listCalendarEventsWithHttpInfo method
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.
Note: This method returns the HTTP Response.
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<Response> listCalendarEventsWithHttpInfo({ List<String>? accountIds, List<String>? providers, String? xWorkspaceID, DateTime? timeMin, DateTime? timeMax, int? limit, }) async {
// ignore: prefer_const_declarations
final path = r'/v1/calendar/events';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (accountIds != null) {
queryParams.addAll(_queryParams('multi', 'account_ids', accountIds));
}
if (providers != null) {
queryParams.addAll(_queryParams('multi', 'providers', providers));
}
if (timeMin != null) {
queryParams.addAll(_queryParams('', 'timeMin', timeMin));
}
if (timeMax != null) {
queryParams.addAll(_queryParams('', 'timeMax', timeMax));
}
if (limit != null) {
queryParams.addAll(_queryParams('', 'limit', limit));
}
if (xWorkspaceID != null) {
headerParams[r'X-Workspace-ID'] = parameterToString(xWorkspaceID);
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}