Skip to content

get_plan async

get_plan(
    app_id: AppId,
    plan_id: PlanId,
    scope: RequestScope,
    *,
    config_overrides: Optional[AsyncAppMonetizationClientConfig] = None,
    stage: Optional[PlanStage] = None,
) -> GetPlanResponse

Returns the details of a 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.

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

    The offering stage to read the plan from: DRAFT (the latest draft) or PUBLISHED (the offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.

  • 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/async_app_monetization.py
async def get_plan(
    self,
    app_id: "capo_appmonetization.types.app_id.AppId",
    plan_id: "capo_appmonetization.types.plan_id.PlanId",
    scope: "capo_appmonetization.types.request_scope.RequestScope",
    *,
    config_overrides: Optional[AsyncAppMonetizationClientConfig] = None,
    stage: Optional["capo_appmonetization.types.plan_stage.PlanStage"] = None,
) -> "capo_appmonetization.types.get_plan_response.GetPlanResponse":
    """Returns the details of a 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.
        stage: The offering stage to read the plan from: DRAFT (the latest draft) or PUBLISHED (the offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.
        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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_appmonetization.types.get_plan_request.GetPlanRequest]",
    ) -> AsyncOperationResponse[
        "capo_appmonetization.types.get_plan_response.GetPlanResponse"
    ]:
        import capo_appmonetization._operations.aws_monetization_ai_front_end.get_plan

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetPlan")
    )
    input_: capo_appmonetization.types.get_plan_request.GetPlanRequest = {
        "app_id": app_id,
        "plan_id": plan_id,
        "scope": scope,
    }
    if stage is not None:
        input_["stage"] = stage

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output