Skip to content

list_code_repositories

list_code_repositories(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    creation_time_after: Optional[CreationTime] = None,
    creation_time_before: Optional[CreationTime] = None,
    last_modified_time_after: Optional[Timestamp] = None,
    last_modified_time_before: Optional[Timestamp] = None,
    max_results: Optional[MaxResults] = None,
    name_contains: Optional[CodeRepositoryNameContains] = None,
    next_token: Optional[NextToken] = None,
    sort_by: Optional[CodeRepositorySortBy] = None,
    sort_order: Optional[CodeRepositorySortOrder] = None,
) -> ListCodeRepositoriesOutput

Gets a list of the Git repositories in your account.

Parameters:

  • creation_time_after (Optional[CreationTime], default: None ) –

    A filter that returns only Git repositories that were created after the specified time.

  • creation_time_before (Optional[CreationTime], default: None ) –

    A filter that returns only Git repositories that were created before the specified time.

  • last_modified_time_after (Optional[Timestamp], default: None ) –

    A filter that returns only Git repositories that were last modified after the specified time.

  • last_modified_time_before (Optional[Timestamp], default: None ) –

    A filter that returns only Git repositories that were last modified before the specified time.

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

    The maximum number of Git repositories to return in the response.

  • name_contains (Optional[CodeRepositoryNameContains], default: None ) –

    A string in the Git repositories name. This filter returns only repositories whose name contains the specified string.

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

    If the result of a ListCodeRepositoriesOutput request was truncated, the response includes a NextToken. To get the next set of Git repositories, use the token in the next request.

  • sort_by (Optional[CodeRepositorySortBy], default: None ) –

    The field to sort results by. The default is Name.

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

    The sort order for results. The default is Ascending.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def list_code_repositories(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    creation_time_after: Optional[
        "capo_sagemaker.types.creation_time.CreationTime"
    ] = None,
    creation_time_before: Optional[
        "capo_sagemaker.types.creation_time.CreationTime"
    ] = None,
    last_modified_time_after: Optional[
        "capo_sagemaker.types.timestamp.Timestamp"
    ] = None,
    last_modified_time_before: Optional[
        "capo_sagemaker.types.timestamp.Timestamp"
    ] = None,
    max_results: Optional["capo_sagemaker.types.max_results.MaxResults"] = None,
    name_contains: Optional[
        "capo_sagemaker.types.code_repository_name_contains.CodeRepositoryNameContains"
    ] = None,
    next_token: Optional["capo_sagemaker.types.next_token.NextToken"] = None,
    sort_by: Optional[
        "capo_sagemaker.types.code_repository_sort_by.CodeRepositorySortBy"
    ] = None,
    sort_order: Optional[
        "capo_sagemaker.types.code_repository_sort_order.CodeRepositorySortOrder"
    ] = None,
) -> (
    "capo_sagemaker.types.list_code_repositories_output.ListCodeRepositoriesOutput"
):
    """<p>Gets a list of the Git repositories in your account.</p>

    Args:
        creation_time_after: <p>A filter that returns only Git repositories that were created after the specified time.</p>
        creation_time_before: <p>A filter that returns only Git repositories that were created before the specified time.</p>
        last_modified_time_after: <p>A filter that returns only Git repositories that were last modified after the specified time.</p>
        last_modified_time_before: <p>A filter that returns only Git repositories that were last modified before the specified time.</p>
        max_results: <p>The maximum number of Git repositories to return in the response.</p>
        name_contains: <p>A string in the Git repositories name. This filter returns only repositories whose name contains the specified string.</p>
        next_token: <p>If the result of a <code>ListCodeRepositoriesOutput</code> request was truncated, the response includes a <code>NextToken</code>. To get the next set of Git repositories, use the token in the next request.</p>
        sort_by: <p>The field to sort results by. The default is <code>Name</code>.</p>
        sort_order: <p>The sort order for results. The default is <code>Ascending</code>.</p>

    Raises:
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.list_code_repositories_input.ListCodeRepositoriesInput]",
    ) -> OperationResponse[
        "capo_sagemaker.types.list_code_repositories_output.ListCodeRepositoriesOutput"
    ]:
        import capo_sagemaker._operations.sage_maker.list_code_repositories

        output, http_response = (
            capo_sagemaker._operations.sage_maker.list_code_repositories.list_code_repositories(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListCodeRepositories")
    )
    input_: capo_sagemaker.types.list_code_repositories_input.ListCodeRepositoriesInput = {}
    if creation_time_after is not None:
        input_["creation_time_after"] = creation_time_after
    if creation_time_before is not None:
        input_["creation_time_before"] = creation_time_before
    if last_modified_time_after is not None:
        input_["last_modified_time_after"] = last_modified_time_after
    if last_modified_time_before is not None:
        input_["last_modified_time_before"] = last_modified_time_before
    if max_results is not None:
        input_["max_results"] = max_results
    if name_contains is not None:
        input_["name_contains"] = name_contains
    if next_token is not None:
        input_["next_token"] = next_token
    if sort_by is not None:
        input_["sort_by"] = sort_by
    if sort_order is not None:
        input_["sort_order"] = sort_order

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output