Skip to content

start_agreement_approvals async

start_agreement_approvals(
    agreement_request_id: AgreementRequestId,
    plan_inputs: AgreementApprovalPlanInputs,
    *,
    config_overrides: Optional[AsyncMarketplaceAgreementClientConfig] = None,
    purchase_orders: Optional[AgreementApprovalPurchaseOrders] = None,
) -> StartAgreementApprovalsOutput

Allows buyers (acceptors) to start the approvals that their organization requires for an agreement request. You start one agreement approval for each approval plan that you specify. Use GetAgreementRequestApprovalPlans to retrieve the approval plans of the agreement request. Once the agreement approvals start, the agreement request transitions to PENDING_APPROVAL status.

Parameters:

Raises:

Examples:

Start agreement approvals

>>> await client.start_agreement_approvals(agreement_request_id='ar-EXAMPLE4a539b123d4EXAMPLE78', plan_inputs=[{'buyerAgreementApprovalPlanInput': {'planReference': 'aplan-EXAMPLE7g8h9i0j1k2l', 'requesterNote': 'Annual subscription for the data platform team.'}}], purchase_orders=[{'chargeId': 'ch-EXAMPLE4b4296145c3EXAMPLE56', 'purchaseOrderReference': 'PO-123'}])
Source code in docs_src/capo_marketplace_agreement/_services/async_marketplace_agreement.py
async def start_agreement_approvals(
    self,
    agreement_request_id: "capo_marketplace_agreement.types.agreement_request_id.AgreementRequestId",
    plan_inputs: "capo_marketplace_agreement.types.agreement_approval_plan_inputs.AgreementApprovalPlanInputs",
    *,
    config_overrides: Optional[AsyncMarketplaceAgreementClientConfig] = None,
    purchase_orders: Optional[
        "capo_marketplace_agreement.types.agreement_approval_purchase_orders.AgreementApprovalPurchaseOrders"
    ] = None,
) -> "capo_marketplace_agreement.types.start_agreement_approvals_output.StartAgreementApprovalsOutput":
    """<p>Allows buyers (acceptors) to start the approvals that their organization requires for an agreement request. You start one agreement approval for each approval plan that you specify. Use <code>GetAgreementRequestApprovalPlans</code> to retrieve the approval plans of the agreement request. Once the agreement approvals start, the agreement request transitions to <code>PENDING_APPROVAL</code> status.</p>

    Args:
        agreement_request_id: <p>The unique identifier of the agreement request to start approvals for.</p>
        plan_inputs: <p>The approval plans to start agreement approvals for.</p>
        purchase_orders: <p>An optional list of purchase order references to associate with charges on the 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.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.

    Examples:
        Start agreement approvals

        >>> await client.start_agreement_approvals(agreement_request_id='ar-EXAMPLE4a539b123d4EXAMPLE78', plan_inputs=[{'buyerAgreementApprovalPlanInput': {'planReference': 'aplan-EXAMPLE7g8h9i0j1k2l', 'requesterNote': 'Annual subscription for the data platform team.'}}], purchase_orders=[{'chargeId': 'ch-EXAMPLE4b4296145c3EXAMPLE56', 'purchaseOrderReference': 'PO-123'}])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_marketplace_agreement.types.start_agreement_approvals_input.StartAgreementApprovalsInput]",
    ) -> AsyncOperationResponse[
        "capo_marketplace_agreement.types.start_agreement_approvals_output.StartAgreementApprovalsOutput"
    ]:
        if req.options.protocol == "awsJson1_0":
            import capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.aws_json1_0.start_agreement_approvals

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

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

    def _redact_input(
        input_: "capo_marketplace_agreement.types.start_agreement_approvals_input.StartAgreementApprovalsInput",
    ) -> dict[str, Any]:
        import capo_marketplace_agreement.types.start_agreement_approvals_input

        return capo_marketplace_agreement.types.start_agreement_approvals_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("StartAgreementApprovals", redact_input=_redact_input),
    )
    input_: capo_marketplace_agreement.types.start_agreement_approvals_input.StartAgreementApprovalsInput = {
        "agreement_request_id": agreement_request_id,
        "plan_inputs": plan_inputs,
    }
    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