Skip to content

list_builds_for_project async

list_builds_for_project(
    project_name: NonEmptyString,
    *,
    config_overrides: Optional[AsyncCodeBuildClientConfig] = None,
    sort_order: Optional[SortOrderType] = None,
    next_token: Optional[String] = None,
) -> ListBuildsForProjectOutput

Gets a list of build identifiers for the specified build project, with each build identifier representing a single build.

Parameters:

  • project_name (NonEmptyString) –

    The name of the CodeBuild project.

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

    The order to sort the results in. The results are sorted by build number, not the build identifier. If this is not specified, the results are sorted in descending order.

    Valid values include:

    • ASCENDING: List the build identifiers in ascending order, by build number.

    • DESCENDING: List the build identifiers in descending order, by build number.

    If the project has more than 100 builds, setting the sort order will result in an error.

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

    During a previous call, if there are more than 100 items in the list, only the first 100 items are returned, along with a unique string called a nextToken. To get the next batch of items in the list, call this operation again, adding the next token to the call. To get all of the items in the list, keep calling this operation with each subsequent next token that is returned, until no more next tokens are returned.

Raises:

Source code in docs_src/capo_codebuild/_services/async_code_build.py
async def list_builds_for_project(
    self,
    project_name: "capo_codebuild.types.non_empty_string.NonEmptyString",
    *,
    config_overrides: Optional[AsyncCodeBuildClientConfig] = None,
    sort_order: Optional[
        "capo_codebuild.types.sort_order_type.SortOrderType"
    ] = None,
    next_token: Optional["capo_codebuild.types.string.String"] = None,
) -> (
    "capo_codebuild.types.list_builds_for_project_output.ListBuildsForProjectOutput"
):
    """<p>Gets a list of build identifiers for the specified build project, with each build identifier representing a single build.</p>

    Args:
        project_name: <p>The name of the CodeBuild project.</p>
        sort_order: <p>The order to sort the results in. The results are sorted by build number, not the build identifier. If this is not specified, the results are sorted in descending order.</p> <p>Valid values include:</p> <ul> <li> <p> <code>ASCENDING</code>: List the build identifiers in ascending order, by build number.</p> </li> <li> <p> <code>DESCENDING</code>: List the build identifiers in descending order, by build number.</p> </li> </ul> <p>If the project has more than 100 builds, setting the sort order will result in an error. </p>
        next_token: <p>During a previous call, if there are more than 100 items in the list, only the first 100 items are returned, along with a unique string called a <i>nextToken</i>. To get the next batch of items in the list, call this operation again, adding the next token to the call. To get all of the items in the list, keep calling this operation with each subsequent next token that is returned, until no more next tokens are returned.</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_builds_for_project_input.ListBuildsForProjectInput]",
    ) -> AsyncOperationResponse[
        "capo_codebuild.types.list_builds_for_project_output.ListBuildsForProjectOutput"
    ]:
        import capo_codebuild._operations.code_build_20161006.list_builds_for_project

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListBuildsForProject")
    )
    input_: capo_codebuild.types.list_builds_for_project_input.ListBuildsForProjectInput = {
        "project_name": project_name
    }
    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