Skip to content

reject_agreement_cancellation_request async

reject_agreement_cancellation_request(
    agreement_id: AgreementId,
    agreement_cancellation_request_id: AgreementCancellationRequestId,
    rejection_reason: AgreementCancellationRequestRejectionReason,
    *,
    config_overrides: Optional[AsyncMarketplaceAgreementClientConfig] = None,
) -> RejectAgreementCancellationRequestOutput

Allows buyers (acceptors) to reject a cancellation request that is in PENDING_APPROVAL status. Once rejected, the cancellation request transitions to REJECTED status and the agreement remains active. Buyers must provide a reason for the rejection.

Only cancellation requests in PENDING_APPROVAL status can be rejected. A ConflictException is thrown if the cancellation request is in any other status.

Parameters:

  • agreement_id (AgreementId) –

    The unique identifier of the agreement associated with the cancellation request.

  • agreement_cancellation_request_id (AgreementCancellationRequestId) –

    The unique identifier of the cancellation request to reject.

  • rejection_reason (AgreementCancellationRequestRejectionReason) –

    The reason for rejecting the cancellation request (1-2000 characters). This message is visible to the seller.

Raises:

Source code in docs_src/capo_marketplace_agreement/_services/async_marketplace_agreement.py
async def reject_agreement_cancellation_request(
    self,
    agreement_id: "capo_marketplace_agreement.types.agreement_id.AgreementId",
    agreement_cancellation_request_id: "capo_marketplace_agreement.types.agreement_cancellation_request_id.AgreementCancellationRequestId",
    rejection_reason: "capo_marketplace_agreement.types.agreement_cancellation_request_rejection_reason.AgreementCancellationRequestRejectionReason",
    *,
    config_overrides: Optional[AsyncMarketplaceAgreementClientConfig] = None,
) -> "capo_marketplace_agreement.types.reject_agreement_cancellation_request_output.RejectAgreementCancellationRequestOutput":
    """<p>Allows buyers (acceptors) to reject a cancellation request that is in <code>PENDING_APPROVAL</code> status. Once rejected, the cancellation request transitions to <code>REJECTED</code> status and the agreement remains active. Buyers must provide a reason for the rejection.</p> <note> <p>Only cancellation requests in <code>PENDING_APPROVAL</code> status can be rejected. A <code>ConflictException</code> is thrown if the cancellation request is in any other status.</p> </note>

    Args:
        agreement_id: <p>The unique identifier of the agreement associated with the cancellation request.</p>
        agreement_cancellation_request_id: <p>The unique identifier of the cancellation request to reject.</p>
        rejection_reason: <p>The reason for rejecting the cancellation request (1-2000 characters). This message is visible to the seller.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_marketplace_agreement.types.reject_agreement_cancellation_request_input.RejectAgreementCancellationRequestInput]",
    ) -> AsyncOperationResponse[
        "capo_marketplace_agreement.types.reject_agreement_cancellation_request_output.RejectAgreementCancellationRequestOutput"
    ]:
        import capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.reject_agreement_cancellation_request

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

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

        return capo_marketplace_agreement.types.reject_agreement_cancellation_request_input.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_marketplace_agreement.types.reject_agreement_cancellation_request_output.RejectAgreementCancellationRequestOutput",
    ) -> dict[str, Any]:
        import capo_marketplace_agreement.types.reject_agreement_cancellation_request_output

        return capo_marketplace_agreement.types.reject_agreement_cancellation_request_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "RejectAgreementCancellationRequest",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_marketplace_agreement.types.reject_agreement_cancellation_request_input.RejectAgreementCancellationRequestInput = {
        "agreement_id": agreement_id,
        "agreement_cancellation_request_id": agreement_cancellation_request_id,
        "rejection_reason": rejection_reason,
    }

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