async def accept_capacity_reservation_billing_ownership(
self,
*,
config_overrides: Optional[AsyncEC2ClientConfig] = 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.accept_capacity_reservation_billing_ownership_result.AcceptCapacityReservationBillingOwnershipResult":
"""<p>Accepts 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 accept the request.</p>
Raises:
capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_ec2.types.accept_capacity_reservation_billing_ownership_request.AcceptCapacityReservationBillingOwnershipRequest]",
) -> AsyncOperationResponse[
"capo_ec2.types.accept_capacity_reservation_billing_ownership_result.AcceptCapacityReservationBillingOwnershipResult"
]:
import capo_ec2._operations.amazon_ec2.accept_capacity_reservation_billing_ownership
(
output,
http_response,
) = await capo_ec2._operations.amazon_ec2.accept_capacity_reservation_billing_ownership.async_accept_capacity_reservation_billing_ownership(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("AcceptCapacityReservationBillingOwnership"),
)
input_: capo_ec2.types.accept_capacity_reservation_billing_ownership_request.AcceptCapacityReservationBillingOwnershipRequest = {}
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 = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output