Skip to content

get_app_usage_summary

get_app_usage_summary(
    app_id: AppId,
    started_at: Timestamp,
    ended_at: Timestamp,
    scope: RequestScope,
    *,
    config_overrides: Optional[AppMonetizationClientConfig] = None,
    group_by: Optional[UsageSummaryDimension] = None,
    filter_by: Optional[UsageSummaryFilterBy] = None,
) -> GetAppUsageSummaryResponse

Returns usage for an app, grouped by metric (the default), user, or time.

Parameters:

  • app_id (AppId) –

    The ID of the app.

  • started_at (Timestamp) –

    Start of the reporting window.

  • ended_at (Timestamp) –

    End of the reporting window. Must be after startedAt, at most 720 hours after it, and not in the future.

  • group_by (Optional[UsageSummaryDimension], default: None ) –

    The breakdown dimension. Defaults to METRIC when omitted.

  • filter_by (Optional[UsageSummaryFilterBy], default: None ) –

    Filter constraints keyed by dimension. A filter dimension may differ from groupBy.

  • scope (RequestScope) –

    Required. The environment: live or sandbox.

Raises:

Source code in docs_src/capo_appmonetization/_services/app_monetization.py
def get_app_usage_summary(
    self,
    app_id: "capo_appmonetization.types.app_id.AppId",
    started_at: "capo_appmonetization.types.timestamp.Timestamp",
    ended_at: "capo_appmonetization.types.timestamp.Timestamp",
    scope: "capo_appmonetization.types.request_scope.RequestScope",
    *,
    config_overrides: Optional[AppMonetizationClientConfig] = None,
    group_by: Optional[
        "capo_appmonetization.types.usage_summary_dimension.UsageSummaryDimension"
    ] = None,
    filter_by: Optional[
        "capo_appmonetization.types.usage_summary_filter_by.UsageSummaryFilterBy"
    ] = None,
) -> "capo_appmonetization.types.get_app_usage_summary_response.GetAppUsageSummaryResponse":
    """Returns usage for an app, grouped by metric (the default), user, or time.

    Args:
        app_id: The ID of the app.
        started_at: Start of the reporting window.
        ended_at: End of the reporting window. Must be after startedAt, at most 720 hours after it, and not in the future.
        group_by: The breakdown dimension. Defaults to METRIC when omitted.
        filter_by: Filter constraints keyed by dimension. A filter dimension may differ from groupBy.
        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_app_usage_summary_request.GetAppUsageSummaryRequest]",
    ) -> OperationResponse[
        "capo_appmonetization.types.get_app_usage_summary_response.GetAppUsageSummaryResponse"
    ]:
        import capo_appmonetization._operations.aws_monetization_ai_front_end.get_app_usage_summary

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetAppUsageSummary")
    )
    input_: capo_appmonetization.types.get_app_usage_summary_request.GetAppUsageSummaryRequest = {
        "app_id": app_id,
        "started_at": started_at,
        "ended_at": ended_at,
        "scope": scope,
    }
    if group_by is not None:
        input_["group_by"] = group_by
    if filter_by is not None:
        input_["filter_by"] = filter_by

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