Skip to content

accept_agreement_request async

accept_agreement_request(
    agreement_request_id: AgreementRequestId,
    *,
    config_overrides: Optional[AsyncMarketplaceAgreementClientConfig] = None,
    purchase_orders: Optional[PurchaseOrders] = None,
) -> AcceptAgreementRequestOutput

Accepts an agreement request to finalize the agreement. The acceptor can optionally provide purchase orders to associate with the agreement charges.

Parameters:

  • agreement_request_id (AgreementRequestId) –

    The unique identifier of the agreement request.

  • purchase_orders (Optional[PurchaseOrders], default: None ) –

    A list of purchase orders associated with accepting a marketplace agreement request.

Raises:

Source code in docs_src/capo_marketplace_agreement/_services/async_marketplace_agreement.py
async def accept_agreement_request(
    self,
    agreement_request_id: "capo_marketplace_agreement.types.agreement_request_id.AgreementRequestId",
    *,
    config_overrides: Optional[AsyncMarketplaceAgreementClientConfig] = None,
    purchase_orders: Optional[
        "capo_marketplace_agreement.types.purchase_orders.PurchaseOrders"
    ] = None,
) -> "capo_marketplace_agreement.types.accept_agreement_request_output.AcceptAgreementRequestOutput":
    """<p>Accepts an agreement request to finalize the agreement. The acceptor can optionally provide purchase orders to associate with the agreement charges.</p>

    Args:
        agreement_request_id: <p>The unique identifier of the agreement request.</p>
        purchase_orders: <p>A list of purchase orders associated with accepting a marketplace agreement request.</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.accept_agreement_request_input.AcceptAgreementRequestInput]",
    ) -> AsyncOperationResponse[
        "capo_marketplace_agreement.types.accept_agreement_request_output.AcceptAgreementRequestOutput"
    ]:
        if req.options.protocol == "awsJson1_0":
            import capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.aws_json1_0.accept_agreement_request

            (
                output,
                http_response,
            ) = await capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.aws_json1_0.accept_agreement_request.async_accept_agreement_request(
                req.options, req.input
            )
        elif req.options.protocol == "rpcv2Cbor":
            import capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.rpcv2_cbor.accept_agreement_request

            (
                output,
                http_response,
            ) = await capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.rpcv2_cbor.accept_agreement_request.async_accept_agreement_request(
                req.options, req.input
            )
        else:
            raise ValueError(f"unknown protocol {req.options.protocol!r}")
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AcceptAgreementRequest")
    )
    input_: capo_marketplace_agreement.types.accept_agreement_request_input.AcceptAgreementRequestInput = {
        "agreement_request_id": agreement_request_id
    }
    if purchase_orders is not None:
        input_["purchase_orders"] = purchase_orders

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