Skip to content

list_subscriptions

list_subscriptions(
    app_id: AppId,
    scope: RequestScope,
    *,
    config_overrides: Optional[AppMonetizationClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListSubscriptionsResponse

Returns the subscriptions 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.

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

    The maximum number of items to return in a single page.

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

Raises:

Source code in docs_src/capo_appmonetization/_services/app_monetization.py
def list_subscriptions(
    self,
    app_id: "capo_appmonetization.types.app_id.AppId",
    scope: "capo_appmonetization.types.request_scope.RequestScope",
    *,
    config_overrides: Optional[AppMonetizationClientConfig] = 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_subscriptions_response.ListSubscriptionsResponse":
    """Returns the subscriptions for an app. We recommend using pagination to ensure that the operation returns quickly and successfully.

    Args:
        app_id: The ID of the app.
        max_results: The maximum number of items to return in a single page.
        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.

    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.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_subscriptions_request.ListSubscriptionsRequest]",
    ) -> OperationResponse[
        "capo_appmonetization.types.list_subscriptions_response.ListSubscriptionsResponse"
    ]:
        import capo_appmonetization._operations.aws_monetization_ai_front_end.list_subscriptions

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListSubscriptions")
    )
    input_: capo_appmonetization.types.list_subscriptions_request.ListSubscriptionsRequest = {
        "app_id": app_id,
        "scope": scope,
    }
    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