{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://objectsgrid.com/.well-known/objects-catalog/Permit/v1/schema.json",
  "title": "Permit",
  "description": "Objects Grid Permit Object. A permit, licence or certificate a Service issues, such as a parking permit or an inspection certificate. A private record: it has no JSON-LD document. Modeled in compliance with https://schema.org/Permit.",
  "x-objectsgrid-jsonLd": false,
  "type": "object",
  "properties": {
    "at_context": {
      "description": "Schema context",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "https://schema.org"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "at_type": {
      "description": "The object type",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "Permit"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "at_id": {
      "description": "This Permit's ObjectsGrid URL, https://apis.objectsgrid.com/<path>/<id>: its JSON-LD @id, which References point to. Set by the service.",
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "readOnly": true
    },
    "id": {
      "description": "The unique identifier for Permit. Assigned by the server.",
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 50,
      "readOnly": true
    },
    "identifier": {
      "description": "The unique identifier for Permit. Assigned by the server.",
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 50,
      "readOnly": true
    },
    "name": {
      "description": "The Permit name",
      "type": "array",
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/LanguageTaggedString/v1/schema.json"
      },
      "minItems": 1
    },
    "description": {
      "description": "The Permit description",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/LanguageTaggedString/v1/schema.json"
      }
    },
    "url": {
      "description": "This Permit URL. Assigned by the server.",
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "minLength": 1,
      "readOnly": true
    },
    "validFrom": {
      "description": "When the permit starts to be valid",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "validUntil": {
      "description": "When the permit stops being valid",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "validFor": {
      "description": "How long it is valid, an ISO 8601 duration, e.g. P1Y",
      "type": [
        "string",
        "null"
      ],
      "minLength": 3,
      "pattern": "^P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(T(\\d+H)?(\\d+M)?(\\d+(\\.\\d+)?S)?)?$"
    },
    "validIn": {
      "description": "Where it is valid, e.g. a city or a zone",
      "type": [
        "string",
        "null"
      ]
    },
    "permitAudience": {
      "description": "Who the permit is for",
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Audience/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "issuedBy": {
      "description": "The Organization issuing the permit",
      "x-objectsgrid-rangeIncludes": [
        "Organization"
      ],
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Reference/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "issuedThrough": {
      "description": "The Service the permit was issued through",
      "x-objectsgrid-rangeIncludes": [
        "Service"
      ],
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Reference/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "tags": {
      "description": "Tags an ABAC policy can decide on. A name may repeat; the same name and value appear once. Every stored object has them: created empty when not sent, kept by a replacement (PUT) that does not mention them, unchanged by a patch that does not mention them, cleared by null or [].",
      "type": "array",
      "default": [],
      "uniqueItems": true,
      "maxItems": 50,
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Tag/v1/schema.json"
      }
    },
    "meta": {
      "description": "System-managed metadata for the object (version, audit fields). Assigned by the server.",
      "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ObjectMeta/v1/schema.json",
      "readOnly": true
    }
  },
  "required": [
    "name"
  ],
  "unevaluatedProperties": false
}
