{
  "$id": "https://intentschema.org/intents/productivity/calendar/invite/list/v1.json",
  "fqdn": "org.intentschema.productivity.calendar.invite.list.v1",
  "title": "List calendar invites",
  "description": "List incoming invites awaiting a response (PARTSTAT NEEDS-ACTION).",
  "payload": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "required": [
      "target"
    ],
    "properties": {
      "target": {
        "$ref": "https://intentschema.org/common/target/v1.json"
      },
      "object": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Optional provider-specific search string."
          },
          "filter": {
            "type": "object",
            "properties": {
              "after": {
                "type": "string",
                "format": "date-time"
              },
              "before": {
                "type": "string",
                "format": "date-time"
              },
              "status": {
                "enum": [
                  "needs_action",
                  "tentative",
                  "accepted",
                  "declined"
                ]
              }
            }
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 500,
            "default": 50
          },
          "cursor": {
            "type": "string"
          }
        }
      }
    }
  },
  "result": {
    "type": "object",
    "required": [
      "items"
    ],
    "properties": {
      "items": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "external_id": {
              "type": "string"
            },
            "summary": {
              "type": "string"
            },
            "organizer": {
              "type": "string",
              "format": "email",
              "description": "RFC 5321 mailbox. Plain address (jane@example.com) or with display name (\"Jane Doe\" <jane@example.com>)."
            },
            "start": {
              "type": "string",
              "format": "date-time"
            },
            "end": {
              "type": "string",
              "format": "date-time"
            },
            "status": {
              "type": "string"
            }
          }
        }
      },
      "next_cursor": {
        "type": "string",
        "description": "Present when more results are available."
      },
      "estimated_total": {
        "type": "integer"
      }
    }
  },
  "examples": [
    {
      "name": "pending invites",
      "value": {
        "target": {
          "system": "google_calendar"
        },
        "object": {
          "filter": {
            "status": "needs_action"
          }
        }
      }
    }
  ]
}
