Skip to content

list_sandboxes_for_project async

list_sandboxes_for_project(
    project_name: NonEmptyString,
    *,
    config_overrides: Optional[AsyncCodeBuildClientConfig] = None,
    max_results: Optional[PageSize] = None,
    sort_order: Optional[SortOrderType] = None,
    next_token: Optional[SensitiveString] = None,
) -> ListSandboxesForProjectOutput

Gets a list of sandboxes for a given project.

Parameters:

  • project_name (NonEmptyString) –

    The CodeBuild project name.

  • max_results (Optional[PageSize], default: None ) –

    The maximum number of sandbox records to be retrieved.

  • sort_order (Optional[SortOrderType], default: None ) –

    The order in which sandbox records should be retrieved.

  • next_token (Optional[SensitiveString], default: None ) –

    The next token, if any, to get paginated results. You will get this value from previous execution of list sandboxes.

Raises:

Source code in docs_src/capo_codebuild/_services/async_code_build.py
async def list_sandboxes_for_project(
    self,
    project_name: "capo_codebuild.types.non_empty_string.NonEmptyString",
    *,
    config_overrides: Optional[AsyncCodeBuildClientConfig] = None,
    max_results: Optional["capo_codebuild.types.page_size.PageSize"] = None,
    sort_order: Optional[
        "capo_codebuild.types.sort_order_type.SortOrderType"
    ] = None,
    next_token: Optional[
        "capo_codebuild.types.sensitive_string.SensitiveString"
    ] = None,
) -> "capo_codebuild.types.list_sandboxes_for_project_output.ListSandboxesForProjectOutput":
    """<p>Gets a list of sandboxes for a given project.</p>

    Args:
        project_name: <p>The CodeBuild project name.</p>
        max_results: <p>The maximum number of sandbox records to be retrieved.</p>
        sort_order: <p>The order in which sandbox records should be retrieved.</p>
        next_token: <p>The next token, if any, to get paginated results. You will get this value from previous execution of list sandboxes.</p>

    Raises:
        capo_codebuild.errors.invalid_input_exception.InvalidInputException: <p>The input value that was provided is not valid.</p>
        capo_codebuild.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified Amazon Web Services resource cannot be found.</p>
        capo_codebuild.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codebuild.types.list_sandboxes_for_project_input.ListSandboxesForProjectInput]",
    ) -> AsyncOperationResponse[
        "capo_codebuild.types.list_sandboxes_for_project_output.ListSandboxesForProjectOutput"
    ]:
        import capo_codebuild._operations.code_build_20161006.list_sandboxes_for_project

        (
            output,
            http_response,
        ) = await capo_codebuild._operations.code_build_20161006.list_sandboxes_for_project.async_list_sandboxes_for_project(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_codebuild.types.list_sandboxes_for_project_input.ListSandboxesForProjectInput",
    ) -> dict[str, Any]:
        import capo_codebuild.types.list_sandboxes_for_project_input

        return (
            capo_codebuild.types.list_sandboxes_for_project_input.redact_sensitive(
                input_
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListSandboxesForProject", redact_input=_redact_input),
    )
    input_: capo_codebuild.types.list_sandboxes_for_project_input.ListSandboxesForProjectInput = {
        "project_name": project_name
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if sort_order is not None:
        input_["sort_order"] = sort_order
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output