getEventOverview method

Future<Overview?> getEventOverview({
  1. String? range,
  2. String? start,
  3. String? end,
})

Overview returns the caller org's analytics KPIs for one time window.

Overview returns the caller org's analytics KPIs for one time window. Three lenses over one warehouse: llm is the live per-org LLM usage ledger (requests, tokens, spend, models, providers, errors) and is always real; web (pageviews, visitors, sessions) and commerce (orders, revenue, AOV) read the product-event table and report available=false rather than fabricating zeros when it holds nothing yet. The org is the validated principal's — never a parameter — so a caller can only ever read its own tenant. 403 without a validated bearer, 400 on an unknown range, 503 when the warehouse is unreachable.

Parameters:

  • String range: Range is a relative window: a count and a unit — 24h, 7d, 90d, any

  • String start: Start is the inclusive lower bound of a custom window, RFC3339. Requires end.

  • String end: End is the exclusive upper bound of a custom window, RFC3339. Requires start.

Implementation

Future<Overview?> getEventOverview({ String? range, String? start, String? end, }) async {
  final response = await getEventOverviewWithHttpInfo( range: range, start: start, end: end, );
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Overview',) as Overview;

  }
  return null;
}