Returns a user's current subscription and any pending change.
Parameters:
-
app_id
(AppId)
–
-
user_id
(UserId)
–
An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
-
scope
(RequestScope)
–
Required. The environment: live or sandbox.
Raises:
Source code in docs_src/capo_appmonetization/_services/app_monetization.py
| def get_subscription(
self,
app_id: "capo_appmonetization.types.app_id.AppId",
user_id: "capo_appmonetization.types.user_id.UserId",
scope: "capo_appmonetization.types.request_scope.RequestScope",
*,
config_overrides: Optional[AppMonetizationClientConfig] = None,
) -> "capo_appmonetization.types.get_subscription_response.GetSubscriptionResponse":
"""Returns a user's current subscription and any pending change.
Args:
app_id: The ID of the app.
user_id: An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
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.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.get_subscription_request.GetSubscriptionRequest]",
) -> OperationResponse[
"capo_appmonetization.types.get_subscription_response.GetSubscriptionResponse"
]:
import capo_appmonetization._operations.aws_monetization_ai_front_end.get_subscription
output, http_response = (
capo_appmonetization._operations.aws_monetization_ai_front_end.get_subscription.get_subscription(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetSubscription")
)
input_: capo_appmonetization.types.get_subscription_request.GetSubscriptionRequest = {
"app_id": app_id,
"user_id": user_id,
"scope": scope,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|