Skip to content

disassociate_capacity_reservation_billing_owner

disassociate_capacity_reservation_billing_owner(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    capacity_reservation_id: Optional[CapacityReservationId] = None,
    unused_reservation_billing_owner_id: Optional[AccountID] = None,
) -> DisassociateCapacityReservationBillingOwnerResult

Cancels a pending request to assign billing of the unused capacity of a Capacity Reservation to a consumer account, or revokes a request that has already been accepted. For more information, see Billing assignment for shared Amazon EC2 Capacity Reservations.

Parameters:

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • capacity_reservation_id (Optional[CapacityReservationId], default: None ) –

    The ID of the Capacity Reservation.

  • unused_reservation_billing_owner_id (Optional[AccountID], default: None ) –

    The ID of the consumer account to which the request was sent.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def disassociate_capacity_reservation_billing_owner(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    capacity_reservation_id: Optional[
        "capo_ec2.types.capacity_reservation_id.CapacityReservationId"
    ] = None,
    unused_reservation_billing_owner_id: Optional[
        "capo_ec2.types.account_id.AccountID"
    ] = None,
) -> "capo_ec2.types.disassociate_capacity_reservation_billing_owner_result.DisassociateCapacityReservationBillingOwnerResult":
    """<p>Cancels a pending request to assign billing of the unused capacity of a Capacity Reservation to a consumer account, or revokes a request that has already been accepted. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/assign-billing.html">Billing assignment for shared Amazon EC2 Capacity Reservations</a>.</p>

    Args:
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        capacity_reservation_id: <p>The ID of the Capacity Reservation.</p>
        unused_reservation_billing_owner_id: <p>The ID of the consumer account to which the request was sent.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.disassociate_capacity_reservation_billing_owner_request.DisassociateCapacityReservationBillingOwnerRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.disassociate_capacity_reservation_billing_owner_result.DisassociateCapacityReservationBillingOwnerResult"
    ]:
        import capo_ec2._operations.amazon_ec2.disassociate_capacity_reservation_billing_owner

        output, http_response = (
            capo_ec2._operations.amazon_ec2.disassociate_capacity_reservation_billing_owner.disassociate_capacity_reservation_billing_owner(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DisassociateCapacityReservationBillingOwner"),
    )
    input_: capo_ec2.types.disassociate_capacity_reservation_billing_owner_request.DisassociateCapacityReservationBillingOwnerRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if capacity_reservation_id is not None:
        input_["capacity_reservation_id"] = capacity_reservation_id
    if unused_reservation_billing_owner_id is not None:
        input_["unused_reservation_billing_owner_id"] = (
            unused_reservation_billing_owner_id
        )

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