Skip to content

cancel_contractual_investment_attestation

cancel_contractual_investment_attestation(
    attestation_id: IdentifierString,
    contract_arn: ArnString,
    reason: CancellationReason,
    *,
    config_overrides: Optional[BillingClientConfig] = None,
) -> CancelContractualInvestmentAttestationResponse

Cancels a contractual investment attestation. This operation is idempotent, so retrying is safe. You can cancel an attestation only while it is still pending (its isCancellable value is true).

Parameters:

  • attestation_id (IdentifierString) –

    The identifier of the investment attestation to cancel.

  • contract_arn (ArnString) –

    The Amazon Resource Name (ARN) of the contract that contains the attested investment.

  • reason (CancellationReason) –

    The reason for the cancellation. This value can be 1 to 80 characters.

Raises:

  • AccessDeniedException –

    You don't have sufficient access to perform this action.

  • ConflictException –

    The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.

  • InternalServerException –

    The request processing failed because of an unknown error, exception, or failure.

  • ResourceNotFoundException –

    The specified ARN in the request doesn't exist.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The input fails to satisfy the constraints specified by an Amazon Web Services service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Invoke CancelContractualInvestmentAttestation

>>> client.cancel_contractual_investment_attestation(attestation_id='a1b2c3d4-5678-90ab-cdef-111122223333', contract_arn='arn:aws:billing::123456789012:contract/1a2b3c4d-5e6f-7a8b-9c0d-111122223333', reason='Example cancellation reason')
Source code in docs_src/capo_billing/_services/billing.py
def cancel_contractual_investment_attestation(
    self,
    attestation_id: "capo_billing.types.identifier_string.IdentifierString",
    contract_arn: "capo_billing.types.arn_string.ArnString",
    reason: "capo_billing.types.cancellation_reason.CancellationReason",
    *,
    config_overrides: Optional[BillingClientConfig] = None,
) -> "capo_billing.types.cancel_contractual_investment_attestation_response.CancelContractualInvestmentAttestationResponse":
    """<p>Cancels a contractual investment attestation. This operation is idempotent, so retrying is safe. You can cancel an attestation only while it is still pending (its <code>isCancellable</code> value is <code>true</code>).</p>

    Args:
        attestation_id: <p>The identifier of the investment attestation to cancel.</p>
        contract_arn: <p>The Amazon Resource Name (ARN) of the contract that contains the attested investment.</p>
        reason: <p>The reason for the cancellation. This value can be 1 to 80 characters.</p>

    Raises:
        capo_billing.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this action.</p>
        capo_billing.errors.conflict_exception.ConflictException: <p> The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
        capo_billing.errors.internal_server_exception.InternalServerException: <p>The request processing failed because of an unknown error, exception, or failure. </p>
        capo_billing.errors.resource_not_found_exception.ResourceNotFoundException: <p> The specified ARN in the request doesn't exist. </p>
        capo_billing.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. </p>
        capo_billing.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service. </p>
        capo_billing.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Invoke CancelContractualInvestmentAttestation

        >>> client.cancel_contractual_investment_attestation(attestation_id='a1b2c3d4-5678-90ab-cdef-111122223333', contract_arn='arn:aws:billing::123456789012:contract/1a2b3c4d-5e6f-7a8b-9c0d-111122223333', reason='Example cancellation reason')
    """

    def _handler(
        req: "OperationRequest[capo_billing.types.cancel_contractual_investment_attestation_request.CancelContractualInvestmentAttestationRequest]",
    ) -> OperationResponse[
        "capo_billing.types.cancel_contractual_investment_attestation_response.CancelContractualInvestmentAttestationResponse"
    ]:
        import capo_billing._operations.aws_billing.cancel_contractual_investment_attestation

        output, http_response = (
            capo_billing._operations.aws_billing.cancel_contractual_investment_attestation.cancel_contractual_investment_attestation(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CancelContractualInvestmentAttestation")
    )
    input_: capo_billing.types.cancel_contractual_investment_attestation_request.CancelContractualInvestmentAttestationRequest = {
        "attestation_id": attestation_id,
        "contract_arn": contract_arn,
        "reason": reason,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output