{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "appealEvent": {
      "description": "An appeal was filed.",
      "properties": {
        "note": {
          "maxGraphemes": 2000,
          "maxLength": 20000,
          "type": "string"
        }
      },
      "type": "object"
    },
    "ejectEvent": {
      "description": "The subject was ejected from the group.",
      "properties": {},
      "type": "object"
    },
    "eventView": {
      "description": "An event in a subject's moderation history.",
      "properties": {
        "cid": {
          "description": "If set, a specific version of the record.",
          "format": "cid",
          "type": "string"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "createdBy": {
          "description": "May be withheld to protect reporters and moderators.",
          "format": "did",
          "type": "string"
        },
        "event": {
          "refs": [
            "#reportEvent",
            "#appealEvent",
            "#statusEvent",
            "#tagEvent",
            "#labelEvent",
            "#ejectEvent"
          ],
          "type": "union"
        },
        "eventId": {
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        },
        "subject": {
          "description": "An account DID or record URI.",
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "eventId",
        "createdAt",
        "subject",
        "event"
      ],
      "type": "object"
    },
    "labelEvent": {
      "description": "A label record was written or deleted.",
      "properties": {
        "deleted": {
          "default": false,
          "type": "boolean"
        },
        "uri": {
          "description": "The label record.",
          "format": "at-uri",
          "type": "string"
        },
        "val": {
          "maxLength": 128,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "uri",
        "val"
      ],
      "type": "object"
    },
    "reasonMisleading": {
      "description": "Misleading content, impersonation, or scams.",
      "type": "token"
    },
    "reasonNsfw": {
      "description": "Unwanted or unlabeled NSFW content.",
      "type": "token"
    },
    "reasonOther": {
      "description": "Anything else.",
      "type": "token"
    },
    "reasonRude": {
      "description": "Rude, harassing, or hateful content.",
      "type": "token"
    },
    "reasonSpam": {
      "description": "Spam or unwanted promotion.",
      "type": "token"
    },
    "reasonType": {
      "knownValues": [
        "org.atgrp.mod.defs#reasonSpam",
        "org.atgrp.mod.defs#reasonViolation",
        "org.atgrp.mod.defs#reasonMisleading",
        "org.atgrp.mod.defs#reasonNsfw",
        "org.atgrp.mod.defs#reasonRude",
        "org.atgrp.mod.defs#reasonOther"
      ],
      "type": "string"
    },
    "reasonViolation": {
      "description": "Breaks a group rule.",
      "type": "token"
    },
    "reportEvent": {
      "description": "A report was filed.",
      "properties": {
        "reason": {
          "maxGraphemes": 2000,
          "maxLength": 20000,
          "type": "string"
        },
        "reasonType": {
          "ref": "#reasonType",
          "type": "ref"
        },
        "rule": {
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "reasonType"
      ],
      "type": "object"
    },
    "statusEvent": {
      "description": "A moderator changed the subject's status or added a note.",
      "properties": {
        "note": {
          "description": "Only visible to moderators.",
          "maxGraphemes": 2000,
          "maxLength": 20000,
          "type": "string"
        },
        "status": {
          "description": "The status after this event.",
          "enum": [
            "open",
            "resolved"
          ],
          "type": "string"
        }
      },
      "required": [
        "status"
      ],
      "type": "object"
    },
    "subjectView": {
      "description": "A subject in the moderation queue.",
      "properties": {
        "cid": {
          "description": "If set, a specific version of the record.",
          "format": "cid",
          "type": "string"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "reportCount": {
          "minimum": 0,
          "type": "integer"
        },
        "status": {
          "enum": [
            "open",
            "resolved"
          ],
          "type": "string"
        },
        "subject": {
          "description": "An account DID or record URI.",
          "format": "uri",
          "type": "string"
        },
        "tags": {
          "description": "Free-form moderator tags in label value syntax ([a-z-]+).",
          "items": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "type": "array"
        },
        "updatedAt": {
          "format": "datetime",
          "type": "string"
        }
      },
      "required": [
        "subject",
        "status",
        "createdAt",
        "updatedAt"
      ],
      "type": "object"
    },
    "tagEvent": {
      "description": "A moderator added or removed tags.",
      "properties": {
        "add": {
          "items": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "type": "array"
        },
        "remove": {
          "items": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": "object"
    }
  },
  "id": "org.atgrp.mod.defs",
  "lexicon": 1
}
