{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/meetstream-ai/json-schema/meetstream-ai-calendar-connection-schema.json",
  "title": "CalendarConnection",
  "description": "A connected calendar account. Token material is never returned.",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/meetstream-ai-openapi.yml#/components/schemas/CalendarConnection",
  "type": "object",
  "properties": {
    "connection_id": {
      "type": "string"
    },
    "account_id": {
      "type": "string"
    },
    "provider": {
      "$ref": "#/$defs/CalendarConnectionProvider"
    },
    "email": {
      "type": "string"
    },
    "display_name": {
      "type": "string"
    },
    "status": {
      "$ref": "#/$defs/CalendarConnectionStatus"
    },
    "state": {
      "type": "string",
      "description": "Lowercase form of `status`."
    },
    "version": {
      "type": "integer"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "has_refresh_token": {
      "type": "boolean"
    },
    "calendars_count": {
      "type": "integer"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "description": "Any type"
      }
    },
    "primary_calendar_id": {
      "type": "string",
      "description": "Google only."
    },
    "watch_channels_count": {
      "type": "integer",
      "description": "Google only."
    },
    "default_calendar_id": {
      "type": "string",
      "description": "Outlook only."
    },
    "subscriptions_count": {
      "type": "integer",
      "description": "Outlook only."
    }
  },
  "$defs": {
    "CalendarConnectionProvider": {
      "type": "string",
      "enum": [
        "google",
        "outlook"
      ],
      "title": "CalendarConnectionProvider"
    },
    "CalendarConnectionStatus": {
      "type": "string",
      "enum": [
        "ACTIVE",
        "PENDING",
        "ERROR",
        "DISCONNECTING"
      ],
      "title": "CalendarConnectionStatus"
    }
  }
}