Skip to content

list_plans

list_plans(
    app_id: AppId,
    scope: RequestScope,
    *,
    config_overrides: Optional[AppMonetizationClientConfig] = None,
    stage: Optional[PlanStage] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListPlansResponse

Returns the plans for an app. We recommend using pagination to ensure that the operation returns quickly and successfully.

Parameters:

  • app_id (AppId) –

    The ID of the app.

  • stage (Optional[PlanStage], default: None ) –

    Which offering stage to list plans from: DRAFT (the latest authored draft) or PUBLISHED (the published offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox. A stage with nothing published yet lists as empty.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of items to return in a single page. Valid range is 1 to 100.

  • next_token (Optional[NextToken], default: None ) –

    An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.

  • scope (RequestScope) –

    Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft (what the sandbox runs).

Raises:

Source code in docs_src/capo_appmonetization/_services/app_monetization.py
def list_plans(
    self,
    app_id: "capo_appmonetization.types.app_id.AppId",
    scope: "capo_appmonetization.types.request_scope.RequestScope",
    *,
    config_overrides: Optional[AppMonetizationClientConfig] = None,
    stage: Optional["capo_appmonetization.types.plan_stage.PlanStage"] = None,
    max_results: Optional[
        "capo_appmonetization.types.max_results.MaxResults"
    ] = None,
    next_token: Optional["capo_appmonetization.types.next_token.NextToken"] = None,
) -> "capo_appmonetization.types.list_plans_response.ListPlansResponse":
    """Returns the plans for an app. We recommend using pagination to ensure that the operation returns quickly and successfully.

    Args:
        app_id: The ID of the app.
        stage: Which offering stage to list plans from: DRAFT (the latest authored draft) or PUBLISHED (the published offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox. A stage with nothing published yet lists as empty.
        max_results: The maximum number of items to return in a single page. Valid range is 1 to 100.
        next_token: An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.
        scope: Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft (what the sandbox runs).

    Raises:
        capo_appmonetization.errors.access_denied_exception.AccessDeniedException: The caller does not have sufficient permission to perform this action.
        capo_appmonetization.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
        capo_appmonetization.errors.resource_not_found_exception.ResourceNotFoundException: The referenced resource does not exist.
        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.list_plans_request.ListPlansRequest]",
    ) -> OperationResponse[
        "capo_appmonetization.types.list_plans_response.ListPlansResponse"
    ]:
        import capo_appmonetization._operations.aws_monetization_ai_front_end.list_plans

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListPlans")
    )
    input_: capo_appmonetization.types.list_plans_request.ListPlansRequest = {
        "app_id": app_id,
        "scope": scope,
    }
    if stage is not None:
        input_["stage"] = stage
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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