{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/entur/json-schema/entur-availability-condition-schema.json",
  "title": "AvailabilityCondition",
  "description": "An AvailabilityCondition",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/entur-availability-conditions-api-openapi.yml#/components/schemas/AvailabilityCondition",
  "required": [
    "changed",
    "created",
    "fareFrameRef",
    "fromDate",
    "id",
    "isAvailable",
    "modification",
    "nameOfClass",
    "status",
    "toDate",
    "version"
  ],
  "type": "object",
  "properties": {
    "available": {
      "type": "boolean"
    },
    "changed": {
      "type": "string",
      "description": "Changed datetime",
      "readOnly": true
    },
    "created": {
      "type": "string",
      "description": "Created datetime",
      "readOnly": true
    },
    "dayTypeRefs": {
      "type": "array",
      "description": "Day Type references.",
      "items": {
        "$ref": "#/$defs/VersionOfObjectRef"
      }
    },
    "description": {
      "type": "array",
      "description": "Description represented in different languages. Language codes are ISO-639.",
      "items": {
        "$ref": "#/$defs/TextInLanguage"
      }
    },
    "fareFrameRef": {
      "$ref": "#/$defs/VersionOfObjectRef"
    },
    "fromDate": {
      "type": "string",
      "description": "FromDate datetime."
    },
    "id": {
      "minLength": 1,
      "pattern": "^([A-Z]{3}):([A-Za-z]*):([0-9A-Za-z_\\-]*)$",
      "type": "string",
      "description": "Id."
    },
    "isAvailable": {
      "type": "boolean",
      "description": "Is available"
    },
    "modification": {
      "type": "string",
      "description": "Modification status",
      "readOnly": true,
      "enum": [
        "NEW",
        "REVISE",
        "DELETE"
      ]
    },
    "name": {
      "type": "array",
      "description": "Name represented in different languages. Language codes are ISO-639.",
      "items": {
        "$ref": "#/$defs/TextInLanguage"
      }
    },
    "nameOfClass": {
      "type": "string",
      "description": "Name of class",
      "readOnly": true
    },
    "organisationId": {
      "type": "string",
      "description": "Organisation related to the userProfile"
    },
    "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true,
      "enum": [
        "DRAFT",
        "PROPOSED",
        "VERSIONED",
        "DEPRECATED"
      ]
    },
    "timebandRefs": {
      "type": "array",
      "description": "Time band references.",
      "items": {
        "$ref": "#/$defs/VersionOfObjectRef"
      }
    },
    "toDate": {
      "type": "string",
      "description": "toDate datetime."
    },
    "version": {
      "minLength": 1,
      "pattern": "^([A-Z]{3}):([A-Za-z]*):([0-9A-Za-z_\\-]*)$",
      "type": "string",
      "description": "AvailabilityCondition version."
    }
  },
  "$defs": {
    "TextInLanguage": {
      "required": [
        "lang",
        "value"
      ],
      "type": "object",
      "properties": {
        "lang": {
          "minLength": 1,
          "type": "string",
          "description": "Language code."
        },
        "value": {
          "minLength": 1,
          "type": "string",
          "description": "The text."
        }
      },
      "description": "Text in a specific language."
    },
    "VersionOfObjectRef": {
      "required": [
        "nameOfClass",
        "ref",
        "version"
      ],
      "type": "object",
      "properties": {
        "nameOfClass": {
          "minLength": 1,
          "type": "string",
          "description": "Name of class."
        },
        "ref": {
          "minLength": 1,
          "pattern": "^([A-Z]{3}):([A-Za-z]*):([0-9A-Za-z_\\-]*)$",
          "type": "string",
          "description": "The netex id reference to the object."
        },
        "version": {
          "type": "string",
          "description": "Version."
        }
      },
      "description": "Fare frame ref."
    }
  }
}