Skip to content

update_one_time_price async

update_one_time_price(
    app_id: AppId,
    one_time_price_id: OneTimePriceId,
    definition: OneTimePriceDefinition,
    *,
    config_overrides: Optional[AsyncAppMonetizationClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> UpdateOneTimePriceResponse

Updates the definition of a one-time price. This operation is idempotent.

Parameters:

  • app_id (AppId) –

    The ID of the app the one-time price belongs to.

  • one_time_price_id (OneTimePriceId) –

    The ID of the one-time price to update.

  • definition (OneTimePriceDefinition) –

    The new definition to apply to the one-time price, including its display name, price, metric, and credited capacity.

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.

Raises:

Source code in docs_src/capo_appmonetization/_services/async_app_monetization.py
async def update_one_time_price(
    self,
    app_id: "capo_appmonetization.types.app_id.AppId",
    one_time_price_id: "capo_appmonetization.types.one_time_price_id.OneTimePriceId",
    definition: "capo_appmonetization.types.one_time_price_definition.OneTimePriceDefinition",
    *,
    config_overrides: Optional[AsyncAppMonetizationClientConfig] = None,
    client_token: Optional[
        "capo_appmonetization.types.client_token.ClientToken"
    ] = None,
) -> "capo_appmonetization.types.update_one_time_price_response.UpdateOneTimePriceResponse":
    """Updates the definition of a one-time price. This operation is idempotent.

    Args:
        app_id: The ID of the app the one-time price belongs to.
        one_time_price_id: The ID of the one-time price to update.
        definition: The new definition to apply to the one-time price, including its display name, price, metric, and credited capacity.
        client_token: A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.

    Raises:
        capo_appmonetization.errors.access_denied_exception.AccessDeniedException: The caller does not have sufficient permission to perform this action.
        capo_appmonetization.errors.conflict_exception.ConflictException: The request conflicts with the current state of the resource, such as a duplicate identifier or a version mismatch. Retrieve the current state of the resource and retry the request.
        capo_appmonetization.errors.idempotency_conflict_exception.IdempotencyConflictException: The clientToken was reused with a request that differs from the original request. Retry the operation with a new clientToken.
        capo_appmonetization.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
        capo_appmonetization.errors.invalid_configuration_exception.InvalidConfigurationException: The requested configuration is not valid.
        capo_appmonetization.errors.resource_not_found_exception.ResourceNotFoundException: The referenced resource does not exist.
        capo_appmonetization.errors.revision_conflict_exception.RevisionConflictException: The request's revision does not match the resource's current revision. Retry with the current revision.
        capo_appmonetization.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: The request would cause a service quota to be exceeded.
        capo_appmonetization.errors.throttling_exception.ThrottlingException: The request was denied due to request throttling.
        capo_appmonetization.errors.validation_exception.ValidationException: The request failed input validation.
        capo_appmonetization.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_appmonetization.types.update_one_time_price_request.UpdateOneTimePriceRequest]",
    ) -> AsyncOperationResponse[
        "capo_appmonetization.types.update_one_time_price_response.UpdateOneTimePriceResponse"
    ]:
        import capo_appmonetization._operations.aws_monetization_ai_front_end.update_one_time_price

        (
            output,
            http_response,
        ) = await capo_appmonetization._operations.aws_monetization_ai_front_end.update_one_time_price.async_update_one_time_price(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateOneTimePrice")
    )
    input_: capo_appmonetization.types.update_one_time_price_request.UpdateOneTimePriceRequest = {
        "app_id": app_id,
        "one_time_price_id": one_time_price_id,
        "definition": definition,
    }
    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