Skip to content

create_package_group async

create_package_group(
    domain: DomainName,
    package_group: PackageGroupPattern,
    *,
    config_overrides: Optional[AsynccodeartifactClientConfig] = None,
    domain_owner: Optional[AccountId] = None,
    contact_info: Optional[PackageGroupContactInfo] = None,
    description: Optional[Description] = None,
    tags: Optional[TagList] = None,
) -> CreatePackageGroupResult

Creates a package group. For more information about creating package groups, including example CLI commands, see Create a package group in the CodeArtifact User Guide.

Parameters:

  • domain (DomainName) –

    The name of the domain in which you want to create a package group.

  • 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 to create. The pattern is also the identifier of the package group.

  • contact_info (Optional[PackageGroupContactInfo], default: None ) –

    The contact information for the created package group.

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

    A description of the package group.

  • tags (Optional[TagList], default: None ) –

    One or more tag key-value pairs for the package group.

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/async_codeartifact.py
async def create_package_group(
    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,
    contact_info: Optional[
        "capo_codeartifact.types.package_group_contact_info.PackageGroupContactInfo"
    ] = None,
    description: Optional["capo_codeartifact.types.description.Description"] = None,
    tags: Optional["capo_codeartifact.types.tag_list.TagList"] = None,
) -> "capo_codeartifact.types.create_package_group_result.CreatePackageGroupResult":
    """<p> Creates a package group. For more information about creating package groups, including example CLI commands, see <a href="https://docs.aws.amazon.com/codeartifact/latest/ug/create-package-group.html">Create a package group</a> in the <i>CodeArtifact User Guide</i>. </p>

    Args:
        domain: <p> The name of the domain in which you want to create a package group. </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 to create. The pattern is also the identifier of the package group. </p>
        contact_info: <p> The contact information for the created package group. </p>
        description: <p> A description of the package group. </p>
        tags: <p>One or more tag key-value pairs for the 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.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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codeartifact.types.create_package_group_request.CreatePackageGroupRequest]",
    ) -> AsyncOperationResponse[
        "capo_codeartifact.types.create_package_group_result.CreatePackageGroupResult"
    ]:
        import capo_codeartifact._operations.code_artifact_control_plane_service.create_package_group

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreatePackageGroup")
    )
    input_: capo_codeartifact.types.create_package_group_request.CreatePackageGroupRequest = {
        "domain": domain,
        "package_group": package_group,
    }
    if domain_owner is not None:
        input_["domain_owner"] = domain_owner
    if contact_info is not None:
        input_["contact_info"] = contact_info
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags

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