Skip to content

get_agreement_cancellation_request async

get_agreement_cancellation_request(
    agreement_cancellation_request_id: AgreementCancellationRequestId,
    agreement_id: AgreementId,
    *,
    config_overrides: Optional[AsyncMarketplaceAgreementClientConfig] = None,
) -> GetAgreementCancellationRequestOutput

Retrieves detailed information about a specific agreement cancellation request. Both sellers (proposers) and buyers (acceptors) can use this operation to view cancellation requests associated with their agreements.

Parameters:

  • agreement_cancellation_request_id (AgreementCancellationRequestId) –

    The unique identifier of the cancellation request.

  • agreement_id (AgreementId) –

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

Raises:

Examples:

Get a cancellation request

>>> await client.get_agreement_cancellation_request(agreement_id='agmt-752jqvg74yo7k', agreement_cancellation_request_id='acr-sgew33rhsds')
Source code in docs_src/capo_marketplace_agreement/_services/async_marketplace_agreement.py
async def get_agreement_cancellation_request(
    self,
    agreement_cancellation_request_id: "capo_marketplace_agreement.types.agreement_cancellation_request_id.AgreementCancellationRequestId",
    agreement_id: "capo_marketplace_agreement.types.agreement_id.AgreementId",
    *,
    config_overrides: Optional[AsyncMarketplaceAgreementClientConfig] = None,
) -> "capo_marketplace_agreement.types.get_agreement_cancellation_request_output.GetAgreementCancellationRequestOutput":
    """<p>Retrieves detailed information about a specific agreement cancellation request. Both sellers (proposers) and buyers (acceptors) can use this operation to view cancellation requests associated with their agreements.</p>

    Args:
        agreement_cancellation_request_id: <p>The unique identifier of the cancellation request.</p>
        agreement_id: <p>The unique identifier of the agreement associated with the cancellation 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.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:
        Get a cancellation request

        >>> await client.get_agreement_cancellation_request(agreement_id='agmt-752jqvg74yo7k', agreement_cancellation_request_id='acr-sgew33rhsds')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_marketplace_agreement.types.get_agreement_cancellation_request_input.GetAgreementCancellationRequestInput]",
    ) -> AsyncOperationResponse[
        "capo_marketplace_agreement.types.get_agreement_cancellation_request_output.GetAgreementCancellationRequestOutput"
    ]:
        if req.options.protocol == "awsJson1_0":
            import capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.aws_json1_0.get_agreement_cancellation_request

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

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

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

        return capo_marketplace_agreement.types.get_agreement_cancellation_request_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "GetAgreementCancellationRequest", redact_output=_redact_output
        ),
    )
    input_: capo_marketplace_agreement.types.get_agreement_cancellation_request_input.GetAgreementCancellationRequestInput = {
        "agreement_cancellation_request_id": agreement_cancellation_request_id,
        "agreement_id": agreement_id,
    }

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