Skip to content

search_agreements async

search_agreements(
    *,
    config_overrides: Optional[AsyncMarketplaceAgreementClientConfig] = None,
    catalog: Optional[Catalog] = None,
    filters: Optional[FilterList] = None,
    sort: Optional[Sort] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> SearchAgreementsOutput

Searches across all agreements that a proposer or an acceptor has in AWS Marketplace. The search returns a list of agreements with basic agreement information.

Parameters:

  • catalog (Optional[Catalog], default: None ) –

    The catalog in which the agreement was created.

  • filters (Optional[FilterList], default: None ) –

    The filter name and value pair used to return a specific list of results.

    The following filters are supported:

    • ResourceIdentifier – The unique identifier of the resource.

    • ResourceType – Type of the resource, which is the product (AmiProduct, ContainerProduct, SaaSProduct, ProfessionalServicesProduct, or MachineLearningProduct).

    • PartyType – The party type of the caller. Use Proposer or Acceptor.

    • AcceptorAccountId – The AWS account ID of the party accepting the agreement terms.

    • OfferId – The unique identifier of the offer in which the terms are registered in the agreement token.

    • Status – The current status of the agreement. Values include ACTIVE, CANCELLED, EXPIRED, RENEWED, REPLACED, and TERMINATED.

    • BeforeEndTime – A date used to filter agreements with a date before the endTime of an agreement.

    • AfterEndTime – A date used to filter agreements with a date after the endTime of an agreement.

    • BeforeStartTime – A date used to filter agreements with a date before the startTime of an agreement.

    • AfterStartTime – A date used to filter agreements with a date after the startTime of an agreement.

    • BeforeLastUpdateTime – A date used to filter agreements with a date before the lastUpdateTime of an agreement.

    • AfterLastUpdateTime – A date used to filter agreements with a date after the lastUpdateTime of an agreement.

    • AgreementType – The type of agreement. Supported value includes PurchaseAgreement.

    • OfferSetId – A unique identifier for the offer set containing this offer. All agreements created from offers in this set include this identifier as context.

    • EndTimeBehaviorType – What happens to the agreement when it reaches its end date. Values include RENEW, REPLACE, and EXPIRE.

    • EndTimeBehaviorReasonCode – The reason why the agreement doesn't renew at its end date. Values include PROPOSER_RENEW_OPTED_OUT, ACCEPTOR_RENEW_OPTED_OUT, NO_RENEWAL_TERM, and RENEWAL_LIMIT_EXHAUSTED.

    • InitialAgreementId – The unique identifier of the very first agreement in a chain of related agreements. Use this filter to return every agreement in the same chain.

    • LicenseArn – The Amazon Resource Name (ARN) of the AWS License Manager license associated with an entitlement granted by the agreement.

    A proposer can use any combination of the preceding filters along with AgreementType, which is required.

    The following filter combinations are supported when the PartyType is Acceptor:

    • AgreementType

    • AgreementType + Status

    • AgreementType + EndTime

    • AgreementType + Status + EndTime

    • AgreementType + ResourceIdentifier

    • AgreementType + ResourceIdentifier + EndTime

    • AgreementType + ResourceIdentifier + Status

    • AgreementType + ResourceIdentifier + Status + EndTime

    • AgreementType + ResourceType

    • AgreementType + ResourceType + EndTime

    • AgreementType + OfferId

    • AgreementType + OfferId + EndTime

    • AgreementType + OfferId + Status

    • AgreementType + OfferId + Status + EndTime

    • AgreementType + OfferSetId

    • AgreementType + OfferSetId + EndTime

    • AgreementType + OfferSetId + Status

    • AgreementType + OfferSetId + Status + EndTime

    To filter by EndTime, you can use BeforeEndTime, AfterEndTime, or both.

  • sort (Optional[Sort], default: None ) –

    An object that contains the SortBy and SortOrder attributes. For SearchAgreements, SortBy supports EndTime for both party types, and StartTime and LastUpdateTime only when PartyType is Proposer. The default SortBy value is EndTime.

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

    The maximum number of agreements to return in the response.

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

    A token to specify where to start pagination.

Raises:

Source code in docs_src/capo_marketplace_agreement/_services/async_marketplace_agreement.py
async def search_agreements(
    self,
    *,
    config_overrides: Optional[AsyncMarketplaceAgreementClientConfig] = None,
    catalog: Optional["capo_marketplace_agreement.types.catalog.Catalog"] = None,
    filters: Optional[
        "capo_marketplace_agreement.types.filter_list.FilterList"
    ] = None,
    sort: Optional["capo_marketplace_agreement.types.sort.Sort"] = None,
    max_results: Optional[
        "capo_marketplace_agreement.types.max_results.MaxResults"
    ] = None,
    next_token: Optional[
        "capo_marketplace_agreement.types.next_token.NextToken"
    ] = None,
) -> "capo_marketplace_agreement.types.search_agreements_output.SearchAgreementsOutput":
    """<p>Searches across all agreements that a proposer or an acceptor has in AWS Marketplace. The search returns a list of agreements with basic agreement information.</p>

    Args:
        catalog: <p>The catalog in which the agreement was created.</p>
        filters: <p>The filter name and value pair used to return a specific list of results.</p> <p>The following filters are supported:</p> <ul> <li> <p> <code>ResourceIdentifier</code> – The unique identifier of the resource.</p> </li> <li> <p> <code>ResourceType</code> – Type of the resource, which is the product (<code>AmiProduct</code>, <code>ContainerProduct</code>, <code>SaaSProduct</code>, <code>ProfessionalServicesProduct</code>, or <code>MachineLearningProduct</code>).</p> </li> <li> <p> <code>PartyType</code> – The party type of the caller. Use <code>Proposer</code> or <code>Acceptor</code>.</p> </li> <li> <p> <code>AcceptorAccountId</code> – The AWS account ID of the party accepting the agreement terms.</p> </li> <li> <p> <code>OfferId</code> – The unique identifier of the offer in which the terms are registered in the agreement token.</p> </li> <li> <p> <code>Status</code> – The current status of the agreement. Values include <code>ACTIVE</code>, <code>CANCELLED</code>, <code>EXPIRED</code>, <code>RENEWED</code>, <code>REPLACED</code>, and <code>TERMINATED</code>.</p> </li> <li> <p> <code>BeforeEndTime</code> – A date used to filter agreements with a date before the <code>endTime</code> of an agreement.</p> </li> <li> <p> <code>AfterEndTime</code> – A date used to filter agreements with a date after the <code>endTime</code> of an agreement.</p> </li> <li> <p> <code>BeforeStartTime</code> – A date used to filter agreements with a date before the <code>startTime</code> of an agreement.</p> </li> <li> <p> <code>AfterStartTime</code> – A date used to filter agreements with a date after the <code>startTime</code> of an agreement.</p> </li> <li> <p> <code>BeforeLastUpdateTime</code> – A date used to filter agreements with a date before the <code>lastUpdateTime</code> of an agreement.</p> </li> <li> <p> <code>AfterLastUpdateTime</code> – A date used to filter agreements with a date after the <code>lastUpdateTime</code> of an agreement.</p> </li> <li> <p> <code>AgreementType</code> – The type of agreement. Supported value includes <code>PurchaseAgreement</code>.</p> </li> <li> <p> <code>OfferSetId</code> – A unique identifier for the offer set containing this offer. All agreements created from offers in this set include this identifier as context.</p> </li> <li> <p> <code>EndTimeBehaviorType</code> – What happens to the agreement when it reaches its end date. Values include <code>RENEW</code>, <code>REPLACE</code>, and <code>EXPIRE</code>.</p> </li> <li> <p> <code>EndTimeBehaviorReasonCode</code> – The reason why the agreement doesn't renew at its end date. Values include <code>PROPOSER_RENEW_OPTED_OUT</code>, <code>ACCEPTOR_RENEW_OPTED_OUT</code>, <code>NO_RENEWAL_TERM</code>, and <code>RENEWAL_LIMIT_EXHAUSTED</code>.</p> </li> <li> <p> <code>InitialAgreementId</code> – The unique identifier of the very first agreement in a chain of related agreements. Use this filter to return every agreement in the same chain.</p> </li> <li> <p> <code>LicenseArn</code> – The Amazon Resource Name (ARN) of the AWS License Manager license associated with an entitlement granted by the agreement.</p> </li> </ul> <p>A proposer can use any combination of the preceding filters along with <code>AgreementType</code>, which is required.</p> <p>The following filter combinations are supported when the <code>PartyType</code> is <code>Acceptor</code>:</p> <ul> <li> <p> <code>AgreementType</code> </p> </li> <li> <p> <code>AgreementType</code> + <code>Status</code> </p> </li> <li> <p> <code>AgreementType</code> + <code>EndTime</code> </p> </li> <li> <p> <code>AgreementType</code> + <code>Status</code> + <code>EndTime</code> </p> </li> <li> <p> <code>AgreementType</code> + <code>ResourceIdentifier</code> </p> </li> <li> <p> <code>AgreementType</code> + <code>ResourceIdentifier</code> + <code>EndTime</code> </p> </li> <li> <p> <code>AgreementType</code> + <code>ResourceIdentifier</code> + <code>Status</code> </p> </li> <li> <p> <code>AgreementType</code> + <code>ResourceIdentifier</code> + <code>Status</code> + <code>EndTime</code> </p> </li> <li> <p> <code>AgreementType</code> + <code>ResourceType</code> </p> </li> <li> <p> <code>AgreementType</code> + <code>ResourceType</code> + <code>EndTime</code> </p> </li> <li> <p> <code>AgreementType</code> + <code>OfferId</code> </p> </li> <li> <p> <code>AgreementType</code> + <code>OfferId</code> + <code>EndTime</code> </p> </li> <li> <p> <code>AgreementType</code> + <code>OfferId</code> + <code>Status</code> </p> </li> <li> <p> <code>AgreementType</code> + <code>OfferId</code> + <code>Status</code> + <code>EndTime</code> </p> </li> <li> <p> <code>AgreementType</code> + <code>OfferSetId</code> </p> </li> <li> <p> <code>AgreementType</code> + <code>OfferSetId</code> + <code>EndTime</code> </p> </li> <li> <p> <code>AgreementType</code> + <code>OfferSetId</code> + <code>Status</code> </p> </li> <li> <p> <code>AgreementType</code> + <code>OfferSetId</code> + <code>Status</code> + <code>EndTime</code> </p> </li> </ul> <note> <p>To filter by <code>EndTime</code>, you can use <code>BeforeEndTime</code>, <code>AfterEndTime</code>, or both.</p> </note>
        sort: <p>An object that contains the <code>SortBy</code> and <code>SortOrder</code> attributes. For <code>SearchAgreements</code>, <code>SortBy</code> supports <code>EndTime</code> for both party types, and <code>StartTime</code> and <code>LastUpdateTime</code> only when <code>PartyType</code> is <code>Proposer</code>. The default <code>SortBy</code> value is <code>EndTime</code>.</p>
        max_results: <p>The maximum number of agreements to return in the response.</p>
        next_token: <p>A token to specify where to start pagination.</p>

    Raises:
        capo_marketplace_agreement.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
        capo_marketplace_agreement.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_marketplace_agreement.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
        capo_marketplace_agreement.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service.</p>
        capo_marketplace_agreement.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_marketplace_agreement.types.search_agreements_input.SearchAgreementsInput]",
    ) -> AsyncOperationResponse[
        "capo_marketplace_agreement.types.search_agreements_output.SearchAgreementsOutput"
    ]:
        import capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.search_agreements

        (
            output,
            http_response,
        ) = await capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.search_agreements.async_search_agreements(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SearchAgreements")
    )
    input_: capo_marketplace_agreement.types.search_agreements_input.SearchAgreementsInput = {}
    if catalog is not None:
        input_["catalog"] = catalog
    if filters is not None:
        input_["filters"] = filters
    if sort is not None:
        input_["sort"] = sort
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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