Skip to content

update_package_group_origin_configuration async

update_package_group_origin_configuration(
    domain: DomainName,
    package_group: PackageGroupPattern,
    *,
    config_overrides: Optional[AsynccodeartifactClientConfig] = None,
    domain_owner: Optional[AccountId] = None,
    restrictions: Optional[OriginRestrictions] = None,
    add_allowed_repositories: Optional[PackageGroupAllowedRepositoryList] = None,
    remove_allowed_repositories: Optional[PackageGroupAllowedRepositoryList] = None,
) -> UpdatePackageGroupOriginConfigurationResult

Updates the package origin configuration for a package group.

The package origin configuration determines how new versions of a package can be added to a repository. You can allow or block direct publishing of new package versions, or ingestion and retaining of new package versions from an external connection or upstream source. For more information about package group origin controls and configuration, see Package group origin controls in the CodeArtifact User Guide.

Parameters:

  • domain (DomainName) –

    The name of the domain which contains the package group for which to update the origin configuration.

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

  • package_group (PackageGroupPattern) –

    The pattern of the package group for which to update the origin configuration.

  • restrictions (Optional[OriginRestrictions], default: None ) –

    The origin configuration settings that determine how package versions can enter repositories.

  • add_allowed_repositories (Optional[PackageGroupAllowedRepositoryList], default: None ) –

    The repository name and restrictions to add to the allowed repository list of the specified package group.

  • remove_allowed_repositories (Optional[PackageGroupAllowedRepositoryList], default: None ) –

    The repository name and restrictions to remove from the allowed repository list of the specified package group.

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.

  • 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/async_codeartifact.py
async def update_package_group_origin_configuration(
    self,
    domain: "capo_codeartifact.types.domain_name.DomainName",
    package_group: "capo_codeartifact.types.package_group_pattern.PackageGroupPattern",
    *,
    config_overrides: Optional[AsynccodeartifactClientConfig] = None,
    domain_owner: Optional["capo_codeartifact.types.account_id.AccountId"] = None,
    restrictions: Optional[
        "capo_codeartifact.types.origin_restrictions.OriginRestrictions"
    ] = None,
    add_allowed_repositories: Optional[
        "capo_codeartifact.types.package_group_allowed_repository_list.PackageGroupAllowedRepositoryList"
    ] = None,
    remove_allowed_repositories: Optional[
        "capo_codeartifact.types.package_group_allowed_repository_list.PackageGroupAllowedRepositoryList"
    ] = None,
) -> "capo_codeartifact.types.update_package_group_origin_configuration_result.UpdatePackageGroupOriginConfigurationResult":
    """<p>Updates the package origin configuration for a package group.</p> <p>The package origin configuration determines how new versions of a package can be added to a repository. You can allow or block direct publishing of new package versions, or ingestion and retaining of new package versions from an external connection or upstream source. For more information about package group origin controls and configuration, see <a href="https://docs.aws.amazon.com/codeartifact/latest/ug/package-group-origin-controls.html">Package group origin controls</a> in the <i>CodeArtifact User Guide</i>.</p>

    Args:
        domain: <p> The name of the domain which contains the package group for which to update the origin configuration. </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>
        package_group: <p> The pattern of the package group for which to update the origin configuration. </p>
        restrictions: <p> The origin configuration settings that determine how package versions can enter repositories. </p>
        add_allowed_repositories: <p>The repository name and restrictions to add to the allowed repository list of the specified package group.</p>
        remove_allowed_repositories: <p>The repository name and restrictions to remove from the allowed repository list of the specified package group.</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.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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codeartifact.types.update_package_group_origin_configuration_request.UpdatePackageGroupOriginConfigurationRequest]",
    ) -> AsyncOperationResponse[
        "capo_codeartifact.types.update_package_group_origin_configuration_result.UpdatePackageGroupOriginConfigurationResult"
    ]:
        import capo_codeartifact._operations.code_artifact_control_plane_service.update_package_group_origin_configuration

        (
            output,
            http_response,
        ) = await capo_codeartifact._operations.code_artifact_control_plane_service.update_package_group_origin_configuration.async_update_package_group_origin_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdatePackageGroupOriginConfiguration")
    )
    input_: capo_codeartifact.types.update_package_group_origin_configuration_request.UpdatePackageGroupOriginConfigurationRequest = {
        "domain": domain,
        "package_group": package_group,
    }
    if domain_owner is not None:
        input_["domain_owner"] = domain_owner
    if restrictions is not None:
        input_["restrictions"] = restrictions
    if add_allowed_repositories is not None:
        input_["add_allowed_repositories"] = add_allowed_repositories
    if remove_allowed_repositories is not None:
        input_["remove_allowed_repositories"] = remove_allowed_repositories

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