{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "pattern": "^[a-zA-Z0-9_-]+$"
    },
    "name": {
      "type": "string"
    },
    "avatar": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "const": "upload"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "seed": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "required": ["source", "url", "seed"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "const": "account"
            },
            "provider": {
              "type": "string",
              "enum": ["x", "discord", "google"]
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "seed": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "required": ["source", "provider", "url", "seed"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "const": "generated"
            },
            "seed": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "required": ["source", "seed"],
          "additionalProperties": false
        }
      ]
    },
    "displayName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "avatarChoice": {
      "type": "string",
      "enum": ["default", "upload", "account", "generated"]
    },
    "avatarProvider": {
      "anyOf": [
        {
          "type": "string",
          "enum": ["x", "discord", "google"]
        },
        {
          "type": "null"
        }
      ]
    },
    "hidden": {
      "type": "boolean"
    },
    "locked": {
      "type": "boolean"
    },
    "visibility": {
      "type": "string",
      "enum": ["private", "participants", "public"]
    },
    "member": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "pattern": "^[a-zA-Z0-9_-]+$"
    },
    "lockedAt": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "lockedBy": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "lockedReason": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "updatedAt": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "id",
    "name",
    "avatar",
    "displayName",
    "avatarChoice",
    "avatarProvider",
    "hidden",
    "locked",
    "visibility",
    "member",
    "lockedAt",
    "lockedBy",
    "lockedReason",
    "updatedAt"
  ]
}
