Skip to content

create_agreement_request async

create_agreement_request(
    intent: Intent,
    requested_terms: RequestedTermList,
    *,
    config_overrides: Optional[AsyncMarketplaceAgreementClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    source_agreement_identifier: Optional[ResourceId] = None,
    agreement_proposal_identifier: Optional[AgreementProposalId] = None,
    tax_configuration: Optional[TaxConfiguration] = None,
) -> CreateAgreementRequestOutput

Creates an agreement request that acts as a quote for the terms you want to accept. The agreement request captures the requested terms, calculates charges, and returns a summary. Use AcceptAgreementRequest with the returned agreementRequestId to finalize the agreement.

Parameters:

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

  • intent (Intent) –

    The purpose and desired outcome of the agreement request. This is a required parameter that determines how the agreement request is processed.

    • NEW – Creates a new agreement for terms in the request.

    • AMEND – Modifies an existing agreement with terms that are accepted in the request.

    • REPLACE – Creates a new agreement with accepted terms and replaces the existing agreement.

  • requested_terms (RequestedTermList) –

    A list of terms that define what is being accepted as part of the agreement. Some terms require configuration.

  • source_agreement_identifier (Optional[ResourceId], default: None ) –

    The agreement's identifier that the request acts upon.

    This parameter is required for all non-NEW intents (i.e., AMEND or REPLACE). Don't provide this parameter if the intent is NEW.

  • agreement_proposal_identifier (Optional[AgreementProposalId], default: None ) –

    The agreement proposal signed by the proposer. The proposal includes the requested resources and the terms that outline an agreement outcome.

    This parameter is required if the intent is not AMEND.

  • tax_configuration (Optional[TaxConfiguration], default: None ) –

    Configuration for tax estimation in the agreement request response.

Raises:

Source code in docs_src/capo_marketplace_agreement/_services/async_marketplace_agreement.py
async def create_agreement_request(
    self,
    intent: "capo_marketplace_agreement.types.intent.Intent",
    requested_terms: "capo_marketplace_agreement.types.requested_term_list.RequestedTermList",
    *,
    config_overrides: Optional[AsyncMarketplaceAgreementClientConfig] = None,
    client_token: Optional[
        "capo_marketplace_agreement.types.client_token.ClientToken"
    ] = None,
    source_agreement_identifier: Optional[
        "capo_marketplace_agreement.types.resource_id.ResourceId"
    ] = None,
    agreement_proposal_identifier: Optional[
        "capo_marketplace_agreement.types.agreement_proposal_id.AgreementProposalId"
    ] = None,
    tax_configuration: Optional[
        "capo_marketplace_agreement.types.tax_configuration.TaxConfiguration"
    ] = None,
) -> "capo_marketplace_agreement.types.create_agreement_request_output.CreateAgreementRequestOutput":
    """<p>Creates an agreement request that acts as a quote for the terms you want to accept. The agreement request captures the requested terms, calculates charges, and returns a summary. Use <code>AcceptAgreementRequest</code> with the returned <code>agreementRequestId</code> to finalize the agreement.</p>

    Args:
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
        intent: <p>The purpose and desired outcome of the agreement request. This is a required parameter that determines how the agreement request is processed.</p> <ul> <li> <p> <code>NEW</code> – Creates a new agreement for terms in the request.</p> </li> <li> <p> <code>AMEND</code> – Modifies an existing agreement with terms that are accepted in the request.</p> </li> <li> <p> <code>REPLACE</code> – Creates a new agreement with accepted terms and replaces the existing agreement.</p> </li> </ul>
        requested_terms: <p>A list of terms that define what is being accepted as part of the agreement. Some terms require configuration.</p>
        source_agreement_identifier: <p>The agreement's identifier that the request acts upon.</p> <important> <p> This parameter is required for all non-<code>NEW</code> intents (i.e., <code>AMEND</code> or <code>REPLACE</code>). Don't provide this parameter if the intent is <code>NEW</code>. </p> </important>
        agreement_proposal_identifier: <p>The agreement proposal signed by the proposer. The proposal includes the requested resources and the terms that outline an agreement outcome.</p> <important> <p> This parameter is required if the intent is not <code>AMEND</code>.</p> </important>
        tax_configuration: <p>Configuration for tax estimation in the agreement request response.</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.conflict_exception.ConflictException: <p>Request was denied due to a resource conflict.</p>
        capo_marketplace_agreement.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_marketplace_agreement.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
        capo_marketplace_agreement.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Request exceeded the maximum allowed limit (quota) for a specific resource or API operation.</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.create_agreement_request_input.CreateAgreementRequestInput]",
    ) -> AsyncOperationResponse[
        "capo_marketplace_agreement.types.create_agreement_request_output.CreateAgreementRequestOutput"
    ]:
        import capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.create_agreement_request

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateAgreementRequest")
    )
    input_: capo_marketplace_agreement.types.create_agreement_request_input.CreateAgreementRequestInput = {
        "intent": intent,
        "requested_terms": requested_terms,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if source_agreement_identifier is not None:
        input_["source_agreement_identifier"] = source_agreement_identifier
    if agreement_proposal_identifier is not None:
        input_["agreement_proposal_identifier"] = agreement_proposal_identifier
    if tax_configuration is not None:
        input_["tax_configuration"] = tax_configuration

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