Skip to content

purchase_offering async

purchase_offering(
    offering_arn: str,
    *,
    config_overrides: Optional[AsyncMediaConnectClientConfig] = None,
    reservation_name: Optional[str] = None,
    start: Optional[str] = None,
) -> PurchaseOfferingResponse

Submits a request to purchase an offering. If you already have an active reservation, you can't purchase another offering.

Parameters:

  • offering_arn (str) –

    The Amazon Resource Name (ARN) of the offering.

  • reservation_name (Optional[str], default: None ) –

    The name that you want to use for the reservation.

  • start (Optional[str], default: None ) –

    The date and time that you want the reservation to begin, in Coordinated Universal Time (UTC).

    You can specify any date and time between 12:00am on the first day of the current month to the current time on today's date, inclusive. Specify the start in a 24-hour notation. Use the following format: YYYY-MM-DDTHH:mm:SSZ, where T and Z are literal characters. For example, to specify 11:30pm on March 5, 2020, enter 2020-03-05T23:30:00Z.

Raises:

Source code in docs_src/capo_mediaconnect/_services/async_media_connect.py
async def purchase_offering(
    self,
    offering_arn: str,
    *,
    config_overrides: Optional[AsyncMediaConnectClientConfig] = None,
    reservation_name: Optional[str] = None,
    start: Optional[str] = None,
) -> "capo_mediaconnect.types.purchase_offering_response.PurchaseOfferingResponse":
    """<p> Submits a request to purchase an offering. If you already have an active reservation, you can't purchase another offering.</p>

    Args:
        offering_arn: <p> The Amazon Resource Name (ARN) of the offering.</p>
        reservation_name: <p> The name that you want to use for the reservation.</p>
        start: <p> The date and time that you want the reservation to begin, in Coordinated Universal Time (UTC). </p> <p>You can specify any date and time between 12:00am on the first day of the current month to the current time on today's date, inclusive. Specify the start in a 24-hour notation. Use the following format: <code>YYYY-MM-DDTHH:mm:SSZ</code>, where <code>T</code> and <code>Z</code> are literal characters. For example, to specify 11:30pm on March 5, 2020, enter <code>2020-03-05T23:30:00Z</code>.</p>

    Raises:
        capo_mediaconnect.errors.bad_request_exception.BadRequestException: <p>This exception is thrown if the request contains a semantic error. The precise meaning depends on the API, and is documented in the error message. </p>
        capo_mediaconnect.errors.forbidden_exception.ForbiddenException: <p>You do not have sufficient access to perform this action. </p>
        capo_mediaconnect.errors.internal_server_error_exception.InternalServerErrorException: <p>The server encountered an internal error and is unable to complete the request. </p>
        capo_mediaconnect.errors.not_found_exception.NotFoundException: <p>One or more of the resources in the request does not exist in the system. </p>
        capo_mediaconnect.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable or busy. </p>
        capo_mediaconnect.errors.too_many_requests_exception.TooManyRequestsException: <p>The request was denied due to request throttling. </p>
        capo_mediaconnect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mediaconnect.types.purchase_offering_request.PurchaseOfferingRequest]",
    ) -> AsyncOperationResponse[
        "capo_mediaconnect.types.purchase_offering_response.PurchaseOfferingResponse"
    ]:
        import capo_mediaconnect._operations.media_connect.purchase_offering

        (
            output,
            http_response,
        ) = await capo_mediaconnect._operations.media_connect.purchase_offering.async_purchase_offering(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PurchaseOffering")
    )
    input_: capo_mediaconnect.types.purchase_offering_request.PurchaseOfferingRequest = {
        "offering_arn": offering_arn
    }
    if reservation_name is not None:
        input_["reservation_name"] = reservation_name
    if start is not None:
        input_["start"] = start

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