{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://objectsgrid.com/.well-known/objects-catalog/ServiceChannel/v1/schema.json",
  "title": "ServiceChannel",
  "description": "Objects Grid ServiceChannel Object. A means for accessing a service, e.g. a government office location, web site, or phone number. A ServiceChannel can be shared by multiple Services. Modeled in compliance with https://schema.org/ServiceChannel.",
  "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": [
            "ServiceChannel"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "at_id": {
      "description": "This ServiceChannel'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 ServiceChannel. Assigned by the server.",
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 50,
      "readOnly": true
    },
    "identifier": {
      "description": "The unique identifier for ServiceChannel. Assigned by the server.",
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 50,
      "readOnly": true
    },
    "name": {
      "description": "The ServiceChannel name, e.g. 'Online portal', 'Customer hotline'",
      "type": "array",
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/LanguageTaggedString/v1/schema.json"
      },
      "minItems": 1
    },
    "description": {
      "description": "The ServiceChannel description",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/LanguageTaggedString/v1/schema.json"
      }
    },
    "url": {
      "description": "This ServiceChannel URL. Assigned by the server.",
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "minLength": 1,
      "readOnly": true
    },
    "availableLanguage": {
      "description": "Languages that may be used with this ServiceChannel, as IETF BCP 47 language codes, e.g. 'en', 'de-AT'",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "minLength": 2,
        "maxLength": 35,
        "pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{1,8})*$"
      }
    },
    "processingTime": {
      "description": "Estimated processing time for the Service using this ServiceChannel, as an ISO 8601 duration, e.g. 'P3D', 'PT2H'",
      "type": [
        "string",
        "null"
      ],
      "minLength": 3,
      "pattern": "^P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(T(\\d+H)?(\\d+M)?(\\d+(\\.\\d+)?S)?)?$"
    },
    "providesService": {
      "description": "URL of the Service provided by this ServiceChannel",
      "x-objectsgrid-rangeIncludes": [
        "Service"
      ],
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Reference/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "serviceLocation": {
      "description": "URL of the Place (e.g. civic structure, local business, etc.) where a person can go to access the Service",
      "x-objectsgrid-rangeIncludes": [
        "Place"
      ],
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Reference/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "servicePhone": {
      "description": "The phone number to use to access the Service",
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ContactPoint/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "servicePostalAddress": {
      "description": "The address for accessing the Service by mail",
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/PostalAddress/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "serviceSmsNumber": {
      "description": "The number to access the Service by text message",
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ContactPoint/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "serviceUrl": {
      "description": "The website to access the Service",
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "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"
  ],
  "anyOf": [
    {
      "required": [
        "serviceUrl"
      ],
      "properties": {
        "serviceUrl": {
          "type": "string"
        }
      }
    },
    {
      "required": [
        "servicePhone"
      ],
      "properties": {
        "servicePhone": {
          "type": "object"
        }
      }
    },
    {
      "required": [
        "serviceSmsNumber"
      ],
      "properties": {
        "serviceSmsNumber": {
          "type": "object"
        }
      }
    },
    {
      "required": [
        "servicePostalAddress"
      ],
      "properties": {
        "servicePostalAddress": {
          "type": "object"
        }
      }
    },
    {
      "required": [
        "serviceLocation"
      ],
      "properties": {
        "serviceLocation": {
          "type": "string"
        }
      }
    }
  ],
  "unevaluatedProperties": false
}
