Skip to content

reject_capacity_reservation_billing_ownership

reject_capacity_reservation_billing_ownership(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    capacity_reservation_id: Optional[CapacityReservationId] = None,
) -> RejectCapacityReservationBillingOwnershipResult

Rejects a request to assign billing of the available capacity of a shared Capacity Reservation to your account. 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 for which to reject the request.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def reject_capacity_reservation_billing_ownership(
    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,
) -> "capo_ec2.types.reject_capacity_reservation_billing_ownership_result.RejectCapacityReservationBillingOwnershipResult":
    """<p>Rejects a request to assign billing of the available capacity of a shared Capacity Reservation to your account. 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 for which to reject the request.</p>

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

    def _handler(
        req: "OperationRequest[capo_ec2.types.reject_capacity_reservation_billing_ownership_request.RejectCapacityReservationBillingOwnershipRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.reject_capacity_reservation_billing_ownership_result.RejectCapacityReservationBillingOwnershipResult"
    ]:
        import capo_ec2._operations.amazon_ec2.reject_capacity_reservation_billing_ownership

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

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("RejectCapacityReservationBillingOwnership"),
    )
    input_: capo_ec2.types.reject_capacity_reservation_billing_ownership_request.RejectCapacityReservationBillingOwnershipRequest = {}
    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

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