Skip to content

update_plan

update_plan(
    app_id: AppId,
    plan_id: PlanId,
    definition: PlanDefinition,
    *,
    config_overrides: Optional[AppMonetizationClientConfig] = None,
) -> UpdatePlanResponse

Updates an existing plan. Only a draft plan, one that has never been published, can be modified. After a plan is published, all of its fields are frozen and any update is rejected with a ConflictException. To change the terms of a published plan, archive it and create a new plan.

Parameters:

  • app_id (AppId) –

    The ID of the app.

  • plan_id (PlanId) –

    The identifier of the plan. AWS App Monetization generates this value when you create the plan. It is unique within the app and is never reused. Treat it as opaque.

  • definition (PlanDefinition) –

    The plan's updated pricing and packaging definition.

Raises:

Source code in docs_src/capo_appmonetization/_services/app_monetization.py
def update_plan(
    self,
    app_id: "capo_appmonetization.types.app_id.AppId",
    plan_id: "capo_appmonetization.types.plan_id.PlanId",
    definition: "capo_appmonetization.types.plan_definition.PlanDefinition",
    *,
    config_overrides: Optional[AppMonetizationClientConfig] = None,
) -> "capo_appmonetization.types.update_plan_response.UpdatePlanResponse":
    """Updates an existing plan. Only a draft plan, one that has never been published, can be modified. After a plan is published, all of its fields are frozen and any update is rejected with a ConflictException. To change the terms of a published plan, archive it and create a new plan.

    Args:
        app_id: The ID of the app.
        plan_id: The identifier of the plan. AWS App Monetization generates this value when you create the plan. It is unique within the app and is never reused. Treat it as opaque.
        definition: The plan's updated pricing and packaging definition.

    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.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.
    """

    def _handler(
        req: "OperationRequest[capo_appmonetization.types.update_plan_request.UpdatePlanRequest]",
    ) -> OperationResponse[
        "capo_appmonetization.types.update_plan_response.UpdatePlanResponse"
    ]:
        import capo_appmonetization._operations.aws_monetization_ai_front_end.update_plan

        output, http_response = (
            capo_appmonetization._operations.aws_monetization_ai_front_end.update_plan.update_plan(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdatePlan")
    )
    input_: capo_appmonetization.types.update_plan_request.UpdatePlanRequest = {
        "app_id": app_id,
        "plan_id": plan_id,
        "definition": definition,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output