Skip to content

update_long_term_pricing async

update_long_term_pricing(
    long_term_pricing_id: LongTermPricingId,
    *,
    config_overrides: Optional[AsyncSnowballClientConfig] = None,
    replacement_job: Optional[JobId] = None,
    is_long_term_pricing_auto_renew: Optional[JavaBoolean] = None,
) -> UpdateLongTermPricingResult

Updates the long-term pricing type.

Parameters:

  • long_term_pricing_id (LongTermPricingId) –

    The ID of the long-term pricing type for the device.

  • replacement_job (Optional[JobId], default: None ) –

    Specifies that a device that is ordered with long-term pricing should be replaced with a new device.

  • is_long_term_pricing_auto_renew (Optional[JavaBoolean], default: None ) –

    If set to true, specifies that the current long-term pricing type for the device should be automatically renewed before the long-term pricing contract expires.

Raises:

  • InvalidResourceException –

    The specified resource can't be found. Check the information you provided in your last request, and try again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_snowball/_services/async_snowball.py
async def update_long_term_pricing(
    self,
    long_term_pricing_id: "capo_snowball.types.long_term_pricing_id.LongTermPricingId",
    *,
    config_overrides: Optional[AsyncSnowballClientConfig] = None,
    replacement_job: Optional["capo_snowball.types.job_id.JobId"] = None,
    is_long_term_pricing_auto_renew: Optional[
        "capo_snowball.types.java_boolean.JavaBoolean"
    ] = None,
) -> "capo_snowball.types.update_long_term_pricing_result.UpdateLongTermPricingResult":
    """<p>Updates the long-term pricing type.</p>

    Args:
        long_term_pricing_id: <p>The ID of the long-term pricing type for the device.</p>
        replacement_job: <p>Specifies that a device that is ordered with long-term pricing should be replaced with a new device.</p>
        is_long_term_pricing_auto_renew: <p>If set to <code>true</code>, specifies that the current long-term pricing type for the device should be automatically renewed before the long-term pricing contract expires.</p>

    Raises:
        capo_snowball.errors.invalid_resource_exception.InvalidResourceException: <p>The specified resource can't be found. Check the information you provided in your last request, and try again.</p>
        capo_snowball.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_snowball.types.update_long_term_pricing_request.UpdateLongTermPricingRequest]",
    ) -> AsyncOperationResponse[
        "capo_snowball.types.update_long_term_pricing_result.UpdateLongTermPricingResult"
    ]:
        import capo_snowball._operations.awsie_snowball_job_management_service.update_long_term_pricing

        (
            output,
            http_response,
        ) = await capo_snowball._operations.awsie_snowball_job_management_service.update_long_term_pricing.async_update_long_term_pricing(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateLongTermPricing")
    )
    input_: capo_snowball.types.update_long_term_pricing_request.UpdateLongTermPricingRequest = {
        "long_term_pricing_id": long_term_pricing_id
    }
    if replacement_job is not None:
        input_["replacement_job"] = replacement_job
    if is_long_term_pricing_auto_renew is not None:
        input_["is_long_term_pricing_auto_renew"] = is_long_term_pricing_auto_renew

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