{
  "lexicon": 1,
  "id": "com.atproto.label.defs",
  "defs": {
    "label": {
      "type": "object",
      "description": "Metadata tag on an atproto resource (eg, repo or record).",
      "required": [
        "src",
        "uri",
        "val",
        "cts"
      ],
      "properties": {
        "cid": {
          "type": "string",
          "description": "Optionally, CID specifying the specific version of 'uri' resource this label applies to.",
          "format": "cid"
        },
        "cts": {
          "type": "string",
          "description": "Timestamp when this label was created.",
          "format": "datetime"
        },
        "exp": {
          "type": "string",
          "description": "Timestamp at which this label expires (no longer applies).",
          "format": "datetime"
        },
        "neg": {
          "type": "boolean",
          "description": "If true, this is a negation label, overwriting a previous label."
        },
        "sig": {
          "type": "bytes",
          "description": "Signature of dag-cbor encoded label."
        },
        "src": {
          "type": "string",
          "description": "DID of the actor who created this label.",
          "format": "did"
        },
        "uri": {
          "type": "string",
          "description": "AT URI of the record, repository (account), or other resource that this label applies to.",
          "format": "uri"
        },
        "val": {
          "type": "string",
          "description": "The short string name of the value or type of this label.",
          "maxLength": 128
        },
        "ver": {
          "type": "integer",
          "description": "The AT Protocol version of the label object."
        }
      }
    },
    "labelValue": {
      "type": "string",
      "knownValues": [
        "!hide",
        "!warn",
        "!no-unauthenticated",
        "porn",
        "sexual",
        "nudity",
        "graphic-media",
        "bot"
      ]
    },
    "labelValueDefinition": {
      "type": "object",
      "description": "Declares a label value and its expected interpretations and behaviors.",
      "required": [
        "identifier",
        "severity",
        "blurs",
        "locales"
      ],
      "properties": {
        "adultOnly": {
          "type": "boolean",
          "description": "Does the user need to have adult content enabled in order to configure this label?"
        },
        "blurs": {
          "type": "string",
          "description": "What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.",
          "knownValues": [
            "content",
            "media",
            "none"
          ]
        },
        "defaultSetting": {
          "type": "string",
          "description": "The default setting for this label.",
          "default": "warn",
          "knownValues": [
            "ignore",
            "warn",
            "hide"
          ]
        },
        "identifier": {
          "type": "string",
          "description": "The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).",
          "maxLength": 100,
          "maxGraphemes": 100
        },
        "locales": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#labelValueDefinitionStrings"
          }
        },
        "severity": {
          "type": "string",
          "description": "How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.",
          "knownValues": [
            "inform",
            "alert",
            "none"
          ]
        }
      }
    },
    "labelValueDefinitionStrings": {
      "type": "object",
      "description": "Strings which describe the label in the UI, localized into a specific language.",
      "required": [
        "lang",
        "name",
        "description"
      ],
      "properties": {
        "description": {
          "type": "string",
          "description": "A longer description of what the label means and why it might be applied.",
          "maxLength": 100000,
          "maxGraphemes": 10000
        },
        "lang": {
          "type": "string",
          "description": "The code of the language these strings are written in.",
          "format": "language"
        },
        "name": {
          "type": "string",
          "description": "A short human-readable name for the label.",
          "maxLength": 640,
          "maxGraphemes": 64
        }
      }
    },
    "selfLabel": {
      "type": "object",
      "description": "Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel.",
      "required": [
        "val"
      ],
      "properties": {
        "val": {
          "type": "string",
          "description": "The short string name of the value or type of this label.",
          "maxLength": 128
        }
      }
    },
    "selfLabels": {
      "type": "object",
      "description": "Metadata tags on an atproto record, published by the author within the record.",
      "required": [
        "values"
      ],
      "properties": {
        "values": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#selfLabel"
          },
          "maxLength": 10
        }
      }
    }
  }
}