Skip to content

list_associated_packages async

list_associated_packages(
    domain: DomainName,
    package_group: PackageGroupPattern,
    *,
    config_overrides: Optional[AsynccodeartifactClientConfig] = None,
    domain_owner: Optional[AccountId] = None,
    max_results: Optional[ListPackagesMaxResults] = None,
    next_token: Optional[PaginationToken] = None,
    preview: Optional[BooleanOptional] = None,
) -> ListAssociatedPackagesResult

Returns a list of packages associated with the requested package group. For information package group association and matching, see Package group definition syntax and matching behavior in the CodeArtifact User Guide.

Parameters:

  • domain (DomainName) –

    The name of the domain that contains the package group from which to list associated packages.

  • 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 from which to list associated packages.

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

    The maximum number of results to return per page.

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

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

  • preview (Optional[BooleanOptional], default: None ) –

    When this flag is included, ListAssociatedPackages will return a list of packages that would be associated with a package group, even if it does not exist.

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.

  • 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 list_associated_packages(
    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,
    max_results: Optional[
        "capo_codeartifact.types.list_packages_max_results.ListPackagesMaxResults"
    ] = None,
    next_token: Optional[
        "capo_codeartifact.types.pagination_token.PaginationToken"
    ] = None,
    preview: Optional[
        "capo_codeartifact.types.boolean_optional.BooleanOptional"
    ] = None,
) -> "capo_codeartifact.types.list_associated_packages_result.ListAssociatedPackagesResult":
    """<p>Returns a list of packages associated with the requested package group. For information package group association and matching, see <a href="https://docs.aws.amazon.com/codeartifact/latest/ug/package-group-definition-syntax-matching-behavior.html">Package group definition syntax and matching behavior</a> in the <i>CodeArtifact User Guide</i>.</p>

    Args:
        domain: <p> The name of the domain that contains the package group from which to list associated packages. </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 from which to list associated packages. </p>
        max_results: <p> The maximum number of results to return per page. </p>
        next_token: <p> The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results. </p>
        preview: <p> When this flag is included, <code>ListAssociatedPackages</code> will return a list of packages that would be associated with a package group, even if it does not exist. </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.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.list_associated_packages_request.ListAssociatedPackagesRequest]",
    ) -> AsyncOperationResponse[
        "capo_codeartifact.types.list_associated_packages_result.ListAssociatedPackagesResult"
    ]:
        import capo_codeartifact._operations.code_artifact_control_plane_service.list_associated_packages

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAssociatedPackages")
    )
    input_: capo_codeartifact.types.list_associated_packages_request.ListAssociatedPackagesRequest = {
        "domain": domain,
        "package_group": package_group,
    }
    if domain_owner is not None:
        input_["domain_owner"] = domain_owner
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if preview is not None:
        input_["preview"] = preview

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