listCalendarEvents method

Future<ListCalendarEvents200Response?> listCalendarEvents({
  1. List<String>? accountIds,
  2. List<String>? providers,
  3. String? xWorkspaceID,
  4. DateTime? timeMin,
  5. DateTime? timeMax,
  6. int? limit,
})

List calendar events across connected accounts.

Fan-out list. Returns events across every connected calendar provider unless filtered by account_ids[] or providers[]. Supports the cross-platform repeated-or-comma-separated filter syntax (?account_ids=a&account_ids=b or ?account_ids=a,b). Time bounds (timeMin / timeMax) accept both RFC3339 and RFC3339Nano. The handler also accepts the snake_case time_min / time_max for direct curl callers; the spec models the camelCase form because that's what the renderer and SDKs use.

Parameters:

  • List<String> accountIds: Repeatable. Restrict to specific connected accounts.

  • List<String> providers: Repeatable. Restrict to provider ids (google-calendar, etc.).

  • String xWorkspaceID: Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

  • DateTime timeMin: Inclusive lower-bound time. RFC3339 or RFC3339Nano.

  • DateTime timeMax: Inclusive upper-bound time.

  • int limit: Max events to return per page (default 50).

Implementation

Future<ListCalendarEvents200Response?> listCalendarEvents({ List<String>? accountIds, List<String>? providers, String? xWorkspaceID, DateTime? timeMin, DateTime? timeMax, int? limit, }) async {
  final response = await listCalendarEventsWithHttpInfo( accountIds: accountIds, providers: providers, xWorkspaceID: xWorkspaceID, timeMin: timeMin, timeMax: timeMax, limit: limit, );
  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), 'ListCalendarEvents200Response',) as ListCalendarEvents200Response;

  }
  return null;
}