Spatio.Api.Calendar (spatio_sdk v0.0.2)

API calls for all endpoints tagged Calendar.

Summary

Functions

Create a calendar event. Single-account create. account_id is required (no auto-resolve for write operations). Reminder array is mirrored into native tasks under the hood; conference data is auto-attached when conference_type is supplied.

Delete an event. Hard delete (no soft-delete / trash). Cascades to any reminder tasks the platform created from this event.

Per-account capability flags. Returns the capabilities the provider declares for the given connected account. The renderer uses these to enable/disable form fields (recurrence picker, attendee inputs, etc.).

Fetch one event. Requires ?account_id= to identify the source account. Response is the bare Event (not wrapped in CalendarOperationResult — distinct from the list/create/update shapes).

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.

List supported calendar providers. Static list of provider ids the Calendar platform can connect to. Returned regardless of which providers the caller has actually authorized.

Trigger a sync across connected calendar accounts. Enqueues sync jobs (one per connected calendar account) and returns immediately with the job ids. Pass ?wait=true to block until all jobs complete (10-second polling budget); the response is then 200 with waited: true and a timed_out flag if any job didn't finish in time.

Update an event (sparse). Partial update. account_id may be supplied in the body (preferred) or as ?account_id= query param — the renderer's update path puts it in the URL while create puts it in the body. updates is a free-form map; the platform's capability gate rejects fields the provider doesn't support.

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

Workspace-scoped list-events (RBAC-protected).

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • id (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

Functions

create_calendar_event(connection, create_event_request, opts \\ [])

Create a calendar event. Single-account create. account_id is required (no auto-resolve for write operations). Reminder array is mirrored into native tasks under the hood; conference data is auto-attached when conference_type is supplied.

Parameters

  • connection (Spatio.Connection): Connection to server
  • create_event_request (CreateEventRequest):
  • opts (keyword): Optional parameters
    • :"X-Workspace-ID" (String.t): 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.

Returns

  • {:ok, Spatio.Model.CreateCalendarEvent201Response.t} on success
  • {:error, Tesla.Env.t} on failure

delete_calendar_event(connection, id, account_id, opts \\ [])

@spec delete_calendar_event(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, Spatio.Model.CalendarOperationResult.t()}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Delete an event. Hard delete (no soft-delete / trash). Cascades to any reminder tasks the platform created from this event.

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t): Event id.
  • account_id (String.t): Connected-account id (snake_case in this platform — the rest of the SpatioAPI uses accountId). Required for single-event operations.
  • opts (keyword): Optional parameters
    • :"X-Workspace-ID" (String.t): 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.

Returns

  • {:ok, Spatio.Model.CalendarOperationResult.t} on success
  • {:error, Tesla.Env.t} on failure

get_calendar_capabilities(connection, account_id, opts \\ [])

@spec get_calendar_capabilities(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, Spatio.Model.CalendarCapabilitiesResponse.t()}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Per-account capability flags. Returns the capabilities the provider declares for the given connected account. The renderer uses these to enable/disable form fields (recurrence picker, attendee inputs, etc.).

Parameters

  • connection (Spatio.Connection): Connection to server
  • account_id (String.t): Connected-account id (snake_case in this platform — the rest of the SpatioAPI uses accountId). Required for single-event operations.
  • opts (keyword): Optional parameters

Returns

  • {:ok, Spatio.Model.CalendarCapabilitiesResponse.t} on success
  • {:error, Tesla.Env.t} on failure

get_calendar_event(connection, id, account_id, opts \\ [])

@spec get_calendar_event(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, Spatio.Model.SpatioEvent.t()}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Fetch one event. Requires ?account_id= to identify the source account. Response is the bare Event (not wrapped in CalendarOperationResult — distinct from the list/create/update shapes).

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t): Event id.
  • account_id (String.t): Connected-account id (snake_case in this platform — the rest of the SpatioAPI uses accountId). Required for single-event operations.
  • opts (keyword): Optional parameters
    • :"X-Workspace-ID" (String.t): 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.

Returns

  • {:ok, Spatio.Model.SpatioEvent.t} on success
  • {:error, Tesla.Env.t} on failure

list_calendar_events(connection, opts \\ [])

@spec list_calendar_events(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, Spatio.Model.ListCalendarEvents200Response.t()}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

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

  • connection (Spatio.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :account_ids ([String.t]): Repeatable. Restrict to specific connected accounts.
    • :providers ([String.t]): Repeatable. Restrict to provider ids (google-calendar, etc.).
    • :"X-Workspace-ID" (String.t): 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.
    • :timeMin (DateTime.t): Inclusive lower-bound time. RFC3339 or RFC3339Nano.
    • :timeMax (DateTime.t): Inclusive upper-bound time.
    • :limit (integer()): Max events to return per page (default 50).

Returns

  • {:ok, Spatio.Model.ListCalendarEvents200Response.t} on success
  • {:error, Tesla.Env.t} on failure

list_calendar_providers(connection, opts \\ [])

@spec list_calendar_providers(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, Spatio.Model.CalendarProvidersInfo.t()}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

List supported calendar providers. Static list of provider ids the Calendar platform can connect to. Returned regardless of which providers the caller has actually authorized.

Parameters

  • connection (Spatio.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, Spatio.Model.CalendarProvidersInfo.t} on success
  • {:error, Tesla.Env.t} on failure

sync_calendar(connection, opts \\ [])

@spec sync_calendar(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, Spatio.Model.CalendarSyncResponse.t()}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Trigger a sync across connected calendar accounts. Enqueues sync jobs (one per connected calendar account) and returns immediately with the job ids. Pass ?wait=true to block until all jobs complete (10-second polling budget); the response is then 200 with waited: true and a timed_out flag if any job didn't finish in time.

Parameters

  • connection (Spatio.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :wait (boolean()): Block until all sync jobs finish (10s timeout).

Returns

  • {:ok, Spatio.Model.CalendarSyncResponse.t} on success
  • {:error, Tesla.Env.t} on failure

update_calendar_event(connection, id, update_event_request, opts \\ [])

Update an event (sparse). Partial update. account_id may be supplied in the body (preferred) or as ?account_id= query param — the renderer's update path puts it in the URL while create puts it in the body. updates is a free-form map; the platform's capability gate rejects fields the provider doesn't support.

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t): Event id.
  • update_event_request (UpdateEventRequest):
  • opts (keyword): Optional parameters
    • :"X-Workspace-ID" (String.t): 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.
    • :account_id (String.t): Optional account-id filter (snake_case).

Returns

  • {:ok, Spatio.Model.CreateCalendarEvent201Response.t} on success
  • {:error, Tesla.Env.t} on failure

workspace_create_calendar_event(connection, org, workspace, request_body, opts \\ [])

@spec workspace_create_calendar_event(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Workspace-scoped create-event (RBAC-protected).

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

workspace_delete_calendar_event(connection, org, workspace, id, opts \\ [])

@spec workspace_delete_calendar_event(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

workspace_get_calendar_event(connection, org, workspace, id, opts \\ [])

@spec workspace_get_calendar_event(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

workspace_list_calendar_events(connection, org, workspace, opts \\ [])

@spec workspace_list_calendar_events(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Workspace-scoped list-events (RBAC-protected).

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

workspace_list_calendar_providers(connection, org, workspace, opts \\ [])

@spec workspace_list_calendar_providers(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Workspace-scoped calendar providers.

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

workspace_update_calendar_event(connection, org, workspace, id, request_body, opts \\ [])

@spec workspace_update_calendar_event(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  String.t(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • id (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure