Skip to content

disassociate_contract async

disassociate_contract(
    contract_arn: ArnString,
    *,
    config_overrides: Optional[AsyncBillingClientConfig] = None,
) -> DisassociateContractResponse

Removes the association between a private pricing contract and your Amazon Web Services account. The account must have been associated with the contract previously. This operation is idempotent, so retrying is safe.

Parameters:

  • contract_arn (ArnString) –

    The Amazon Resource Name (ARN) of the contract to disassociate from your account.

Raises:

Examples:

Invoke DisassociateContract

>>> await client.disassociate_contract(contract_arn='arn:aws:billing::123456789012:contract/1a2b3c4d-5e6f-7a8b-9c0d-111122223333')
Source code in docs_src/capo_billing/_services/async_billing.py
async def disassociate_contract(
    self,
    contract_arn: "capo_billing.types.arn_string.ArnString",
    *,
    config_overrides: Optional[AsyncBillingClientConfig] = None,
) -> (
    "capo_billing.types.disassociate_contract_response.DisassociateContractResponse"
):
    """<p>Removes the association between a private pricing contract and your Amazon Web Services account. The account must have been associated with the contract previously. This operation is idempotent, so retrying is safe.</p>

    Args:
        contract_arn: <p>The Amazon Resource Name (ARN) of the contract to disassociate from your account.</p>

    Raises:
        capo_billing.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this action.</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 DisassociateContract

        >>> await client.disassociate_contract(contract_arn='arn:aws:billing::123456789012:contract/1a2b3c4d-5e6f-7a8b-9c0d-111122223333')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_billing.types.disassociate_contract_request.DisassociateContractRequest]",
    ) -> AsyncOperationResponse[
        "capo_billing.types.disassociate_contract_response.DisassociateContractResponse"
    ]:
        import capo_billing._operations.aws_billing.disassociate_contract

        (
            output,
            http_response,
        ) = await capo_billing._operations.aws_billing.disassociate_contract.async_disassociate_contract(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DisassociateContract")
    )
    input_: capo_billing.types.disassociate_contract_request.DisassociateContractRequest = {
        "contract_arn": contract_arn
    }

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