Skip to content

update_repository

update_repository(
    domain: DomainName,
    repository: RepositoryName,
    *,
    config_overrides: Optional[codeartifactClientConfig] = None,
    domain_owner: Optional[AccountId] = None,
    description: Optional[Description] = None,
    upstreams: Optional[UpstreamRepositoryList] = None,
) -> UpdateRepositoryResult

Update the properties of a repository.

Parameters:

  • domain (DomainName) –

    The name of the domain associated with the repository to update.

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

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

  • repository (RepositoryName) –

    The name of the repository to update.

  • description (Optional[Description], default: None ) –

    An updated repository description.

  • upstreams (Optional[UpstreamRepositoryList], default: None ) –

    A list of upstream repositories to associate with the repository. The order of the upstream repositories in the list determines their priority order when CodeArtifact looks for a requested package version. For more information, see Working with upstream repositories.

Raises:

  • AccessDeniedException –

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

  • ConflictException –

    The operation did not succeed because prerequisites are not met.

  • 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.

  • ServiceQuotaExceededException –

    The operation did not succeed because it would have exceeded a service limit for your account.

  • 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 update_repository(
    self,
    domain: "capo_codeartifact.types.domain_name.DomainName",
    repository: "capo_codeartifact.types.repository_name.RepositoryName",
    *,
    config_overrides: Optional[codeartifactClientConfig] = None,
    domain_owner: Optional["capo_codeartifact.types.account_id.AccountId"] = None,
    description: Optional["capo_codeartifact.types.description.Description"] = None,
    upstreams: Optional[
        "capo_codeartifact.types.upstream_repository_list.UpstreamRepositoryList"
    ] = None,
) -> "capo_codeartifact.types.update_repository_result.UpdateRepositoryResult":
    """<p> Update the properties of a repository. </p>

    Args:
        domain: <p> The name of the domain associated with the repository to update. </p>
        domain_owner: <p> The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces. </p>
        repository: <p> The name of the repository to update. </p>
        description: <p> An updated repository description. </p>
        upstreams: <p> A list of upstream repositories to associate with the repository. The order of the upstream repositories in the list determines their priority order when CodeArtifact looks for a requested package version. For more information, see <a href="https://docs.aws.amazon.com/codeartifact/latest/ug/repos-upstream.html">Working with upstream repositories</a>. </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.conflict_exception.ConflictException: <p> The operation did not succeed because prerequisites are not met. </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.service_quota_exceeded_exception.ServiceQuotaExceededException: <p> The operation did not succeed because it would have exceeded a service limit for your account. </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.update_repository_request.UpdateRepositoryRequest]",
    ) -> OperationResponse[
        "capo_codeartifact.types.update_repository_result.UpdateRepositoryResult"
    ]:
        import capo_codeartifact._operations.code_artifact_control_plane_service.update_repository

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateRepository")
    )
    input_: capo_codeartifact.types.update_repository_request.UpdateRepositoryRequest = {
        "domain": domain,
        "repository": repository,
    }
    if domain_owner is not None:
        input_["domain_owner"] = domain_owner
    if description is not None:
        input_["description"] = description
    if upstreams is not None:
        input_["upstreams"] = upstreams

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