Skip to content

get_entitlements async

get_entitlements(
    product_code: ProductCode,
    *,
    config_overrides: Optional[AsyncMarketplaceEntitlementServiceClientConfig] = None,
    filter: Optional[GetEntitlementFilters] = None,
    next_token: Optional[NonEmptyString] = None,
    max_results: Optional[PageSizeInteger] = None,
) -> GetEntitlementsResult

GetEntitlements retrieves entitlement values for a given product. The results can be filtered based on customer identifier, AWS account ID, license ARN, or product dimensions.

Parameters:

  • product_code (ProductCode) –

    Product code is used to uniquely identify a product in AWS Marketplace. The product code will be provided by AWS Marketplace when the product listing is created.

  • filter (Optional[GetEntitlementFilters], default: None ) –

    Filter is used to return entitlements for a specific customer or for a specific dimension. Filters are described as keys mapped to a lists of values. Filtered requests are unioned for each value in the value list, and then intersected for each filter key.

    CustomerIdentifier and CustomerAWSAccountId are mutually exclusive parameters. You must use one or the other, but not both in the same request.

    If you're migrating an existing integration, use Account Feeds to map CustomerIdentifier to CustomerAWSAccountId, and Agreements Feeds to map CustomerAWSAccountId and LicenseArn.

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

    For paginated calls to GetEntitlements, pass the NextToken from the previous GetEntitlementsResult.

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

    The maximum number of items to retrieve from the GetEntitlements operation. For pagination, use the NextToken field in subsequent calls to GetEntitlements.

Raises:

Source code in docs_src/capo_marketplace_entitlement_service/_services/async_marketplace_entitlement_service.py
async def get_entitlements(
    self,
    product_code: "capo_marketplace_entitlement_service.types.product_code.ProductCode",
    *,
    config_overrides: Optional[
        AsyncMarketplaceEntitlementServiceClientConfig
    ] = None,
    filter: Optional[
        "capo_marketplace_entitlement_service.types.get_entitlement_filters.GetEntitlementFilters"
    ] = None,
    next_token: Optional[
        "capo_marketplace_entitlement_service.types.non_empty_string.NonEmptyString"
    ] = None,
    max_results: Optional[
        "capo_marketplace_entitlement_service.types.page_size_integer.PageSizeInteger"
    ] = None,
) -> "capo_marketplace_entitlement_service.types.get_entitlements_result.GetEntitlementsResult":
    """<p>GetEntitlements retrieves entitlement values for a given product. The results can be filtered based on customer identifier, AWS account ID, license ARN, or product dimensions.</p>

    Args:
        product_code: <p>Product code is used to uniquely identify a product in AWS Marketplace. The product code will be provided by AWS Marketplace when the product listing is created.</p>
        filter: <p>Filter is used to return entitlements for a specific customer or for a specific dimension. Filters are described as keys mapped to a lists of values. Filtered requests are <i>unioned</i> for each value in the value list, and then <i>intersected</i> for each filter key.</p> <p> <code>CustomerIdentifier</code> and <code>CustomerAWSAccountId</code> are mutually exclusive parameters. You must use one or the other, but not both in the same request. </p> <note> <p>If you're migrating an existing integration, use <a href="https://docs.aws.amazon.com/marketplace/latest/userguide/data-feed-account.html">Account Feeds</a> to map <code>CustomerIdentifier</code> to <code>CustomerAWSAccountId</code>, and <a href="https://docs.aws.amazon.com/marketplace/latest/userguide/data-feed-agreements.html">Agreements Feeds</a> to map <code>CustomerAWSAccountId</code> and <code>LicenseArn</code>.</p> </note>
        next_token: <p>For paginated calls to GetEntitlements, pass the NextToken from the previous GetEntitlementsResult.</p>
        max_results: <p>The maximum number of items to retrieve from the GetEntitlements operation. For pagination, use the NextToken field in subsequent calls to GetEntitlements.</p>

    Raises:
        capo_marketplace_entitlement_service.errors.internal_service_error_exception.InternalServiceErrorException: <p>An internal error has occurred. Retry your request. If the problem persists, post a message with details on the AWS forums.</p>
        capo_marketplace_entitlement_service.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters in your request was invalid.</p>
        capo_marketplace_entitlement_service.errors.throttling_exception.ThrottlingException: <p>The calls to the GetEntitlements API are throttled.</p>
        capo_marketplace_entitlement_service.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_marketplace_entitlement_service.types.get_entitlements_request.GetEntitlementsRequest]",
    ) -> AsyncOperationResponse[
        "capo_marketplace_entitlement_service.types.get_entitlements_result.GetEntitlementsResult"
    ]:
        import capo_marketplace_entitlement_service._operations.awsmp_entitlement_service.get_entitlements

        (
            output,
            http_response,
        ) = await capo_marketplace_entitlement_service._operations.awsmp_entitlement_service.get_entitlements.async_get_entitlements(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetEntitlements")
    )
    input_: capo_marketplace_entitlement_service.types.get_entitlements_request.GetEntitlementsRequest = {
        "product_code": product_code
    }
    if filter is not None:
        input_["filter"] = filter
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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