Skip to content

create_renewal async

create_renewal(
    payment_option: PaymentOption,
    payment_term: PaymentTerm,
    outpost_identifier: OutpostIdentifier,
    *,
    config_overrides: Optional[AsyncOutpostsClientConfig] = None,
    client_token: Optional[AutoFillIdempotencyToken] = None,
) -> CreateRenewalOutput

Creates a renewal contract for the specified Outpost.

Parameters:

Raises:

Source code in docs_src/capo_outposts/_services/async_outposts.py
async def create_renewal(
    self,
    payment_option: "capo_outposts.types.payment_option.PaymentOption",
    payment_term: "capo_outposts.types.payment_term.PaymentTerm",
    outpost_identifier: "capo_outposts.types.outpost_identifier.OutpostIdentifier",
    *,
    config_overrides: Optional[AsyncOutpostsClientConfig] = None,
    client_token: Optional[
        "capo_outposts.types.auto_fill_idempotency_token.AutoFillIdempotencyToken"
    ] = None,
) -> "capo_outposts.types.create_renewal_output.CreateRenewalOutput":
    """<p>Creates a renewal contract for the specified Outpost.</p>

    Args:
        payment_option: <p>The payment option.</p>
        payment_term: <p>The payment term.</p>
        outpost_identifier: <p>The ID or ARN of the Outpost.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>

    Raises:
        capo_outposts.errors.access_denied_exception.AccessDeniedException: <p>You do not have permission to perform this operation.</p>
        capo_outposts.errors.internal_server_exception.InternalServerException: <p>An internal error has occurred.</p>
        capo_outposts.errors.not_found_exception.NotFoundException: <p>The specified request is not valid.</p>
        capo_outposts.errors.validation_exception.ValidationException: <p>A parameter is not valid.</p>
        capo_outposts.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_outposts.types.create_renewal_input.CreateRenewalInput]",
    ) -> AsyncOperationResponse[
        "capo_outposts.types.create_renewal_output.CreateRenewalOutput"
    ]:
        import capo_outposts._operations.outposts_olaf_service.create_renewal

        (
            output,
            http_response,
        ) = await capo_outposts._operations.outposts_olaf_service.create_renewal.async_create_renewal(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateRenewal")
    )
    input_: capo_outposts.types.create_renewal_input.CreateRenewalInput = {
        "payment_option": payment_option,
        "payment_term": payment_term,
        "outpost_identifier": outpost_identifier,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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