Skip to content

get_repository_endpoint

get_repository_endpoint(
    domain: DomainName,
    repository: RepositoryName,
    format: PackageFormat,
    *,
    config_overrides: Optional[codeartifactClientConfig] = None,
    domain_owner: Optional[AccountId] = None,
    endpoint_type: Optional[EndpointType] = None,
) -> GetRepositoryEndpointResult

Returns the endpoint of a repository for a specific package format. A repository has one endpoint for each package format:

  • cargo

  • generic

  • maven

  • npm

  • nuget

  • pypi

  • ruby

  • swift

Parameters:

  • domain (DomainName) –

    The name of the domain that contains the repository.

  • domain_owner (Optional[AccountId], default: None ) –

    The 12-digit account number of the Amazon Web Services account that owns the domain that contains the repository. It does not include dashes or spaces.

  • repository (RepositoryName) –

    The name of the repository.

  • format (PackageFormat) –

    Returns which endpoint of a repository to return. A repository has one endpoint for each package format.

  • endpoint_type (Optional[EndpointType], default: None ) –

    A string that specifies the type of endpoint.

Raises:

  • AccessDeniedException –

    The operation did not succeed because of an unauthorized access attempt.

  • InternalServerException –

    The operation did not succeed because of an error that occurred inside CodeArtifact.

  • ResourceNotFoundException –

    The operation did not succeed because the resource requested is not found in the service.

  • ThrottlingException –

    The operation did not succeed because too many requests are sent to the service.

  • ValidationException –

    The operation did not succeed because a parameter in the request was sent with an invalid value.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_codeartifact/_services/codeartifact.py
def get_repository_endpoint(
    self,
    domain: "capo_codeartifact.types.domain_name.DomainName",
    repository: "capo_codeartifact.types.repository_name.RepositoryName",
    format: "capo_codeartifact.types.package_format.PackageFormat",
    *,
    config_overrides: Optional[codeartifactClientConfig] = None,
    domain_owner: Optional["capo_codeartifact.types.account_id.AccountId"] = None,
    endpoint_type: Optional[
        "capo_codeartifact.types.endpoint_type.EndpointType"
    ] = None,
) -> "capo_codeartifact.types.get_repository_endpoint_result.GetRepositoryEndpointResult":
    """<p> Returns the endpoint of a repository for a specific package format. A repository has one endpoint for each package format: </p> <ul> <li> <p> <code>cargo</code> </p> </li> <li> <p> <code>generic</code> </p> </li> <li> <p> <code>maven</code> </p> </li> <li> <p> <code>npm</code> </p> </li> <li> <p> <code>nuget</code> </p> </li> <li> <p> <code>pypi</code> </p> </li> <li> <p> <code>ruby</code> </p> </li> <li> <p> <code>swift</code> </p> </li> </ul>

    Args:
        domain: <p> The name of the domain that contains the repository. </p>
        domain_owner: <p> The 12-digit account number of the Amazon Web Services account that owns the domain that contains the repository. It does not include dashes or spaces. </p>
        repository: <p> The name of the repository. </p>
        format: <p> Returns which endpoint of a repository to return. A repository has one endpoint for each package format. </p>
        endpoint_type: <p>A string that specifies the type of endpoint.</p>

    Raises:
        capo_codeartifact.errors.access_denied_exception.AccessDeniedException: <p> The operation did not succeed because of an unauthorized access attempt. </p>
        capo_codeartifact.errors.internal_server_exception.InternalServerException: <p> The operation did not succeed because of an error that occurred inside CodeArtifact. </p>
        capo_codeartifact.errors.resource_not_found_exception.ResourceNotFoundException: <p> The operation did not succeed because the resource requested is not found in the service. </p>
        capo_codeartifact.errors.throttling_exception.ThrottlingException: <p> The operation did not succeed because too many requests are sent to the service. </p>
        capo_codeartifact.errors.validation_exception.ValidationException: <p> The operation did not succeed because a parameter in the request was sent with an invalid value. </p>
        capo_codeartifact.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_codeartifact.types.get_repository_endpoint_request.GetRepositoryEndpointRequest]",
    ) -> OperationResponse[
        "capo_codeartifact.types.get_repository_endpoint_result.GetRepositoryEndpointResult"
    ]:
        import capo_codeartifact._operations.code_artifact_control_plane_service.get_repository_endpoint

        output, http_response = (
            capo_codeartifact._operations.code_artifact_control_plane_service.get_repository_endpoint.get_repository_endpoint(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetRepositoryEndpoint")
    )
    input_: capo_codeartifact.types.get_repository_endpoint_request.GetRepositoryEndpointRequest = {
        "domain": domain,
        "repository": repository,
        "format": format,
    }
    if domain_owner is not None:
        input_["domain_owner"] = domain_owner
    if endpoint_type is not None:
        input_["endpoint_type"] = endpoint_type

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