{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "thread": {
      "type": "object",
      "properties": {
        "account_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "thread_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "provider": {
          "type": "string",
          "enum": ["gmail", "outlook", "instantly"]
        }
      },
      "required": ["account_id", "thread_id", "provider"],
      "additionalProperties": false
    },
    "messageId": {
      "type": "string"
    },
    "attachment": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "mimeType": {
          "type": "string"
        },
        "size": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": ["id", "name", "mimeType", "size"],
      "additionalProperties": false
    },
    "content": {
      "type": "string",
      "enum": ["text", "image"]
    },
    "text": {
      "type": "string"
    },
    "textIncomplete": {
      "type": "boolean"
    },
    "pages": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    }
  },
  "required": ["thread", "messageId", "attachment", "content"],
  "additionalProperties": false
}
