{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/folio/json-schema/folio-central-servers-dto-schema.json",
  "title": "centralServersDTO",
  "description": "Central servers collection",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/folio-central-servers-api-openapi.yml#/components/schemas/centralServersDTO",
  "type": "object",
  "properties": {
    "totalRecords": {
      "description": "Total records",
      "type": "integer"
    },
    "centralServers": {
      "description": "List of INN-Reach Central servers",
      "type": "array",
      "items": {
        "$ref": "#/$defs/centralServerDTO"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "centralServers"
  ],
  "$defs": {
    "centralServerDTO": {
      "description": "Central server",
      "type": "object",
      "properties": {
        "id": {
          "description": "Central server id",
          "type": "string",
          "format": "UUID"
        },
        "name": {
          "description": "Central server name",
          "type": "string"
        },
        "description": {
          "description": "Central server description",
          "type": "string"
        },
        "localServerCode": {
          "description": "Server code",
          "type": "string",
          "maxLength": 5
        },
        "centralServerCode": {
          "description": "Central server code",
          "type": "string",
          "maxLength": 5
        },
        "centralServerAddress": {
          "description": "Central server http address",
          "type": "string"
        },
        "loanTypeId": {
          "description": "Loan type id",
          "type": "string",
          "format": "UUID"
        },
        "localAgencies": {
          "description": "Local agencies",
          "type": "array",
          "items": {
            "$ref": "#/$defs/localAgencyDTO"
          }
        },
        "centralServerKey": {
          "description": "Central server key",
          "type": "string"
        },
        "centralServerSecret": {
          "description": "Central server secret",
          "type": "string"
        },
        "localServerKey": {
          "description": "Local server key",
          "type": "string",
          "format": "UUID"
        },
        "localServerSecret": {
          "description": "Local server secret; UUID on write, then it will be hashed and salted",
          "type": "string"
        },
        "checkPickupLocation": {
          "description": "Indicates whether to look up pickup locations for INN-Reach item hold requests based on transaction pickupLocation",
          "type": "boolean",
          "default": false
        },
        "metadata": {
          "description": "Entity metadata",
          "type": "object",
          "$ref": "#/$defs/metadata"
        }
      },
      "additionalProperties": false,
      "required": [
        "name",
        "localServerCode",
        "centralServerCode",
        "centralServerAddress",
        "loanTypeId",
        "localAgencies",
        "centralServerKey",
        "centralServerSecret"
      ]
    },
    "localAgencyDTO": {
      "description": "Local agency",
      "type": "object",
      "properties": {
        "id": {
          "description": "Local agency id",
          "type": "string",
          "format": "UUID"
        },
        "code": {
          "description": "Local agency code",
          "type": "string",
          "maxLength": 5
        },
        "folioLibraryIds": {
          "description": "Folio libraries ids",
          "type": "array",
          "items": {
            "type": "string",
            "format": "UUID"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "code",
        "folioLibraryIds"
      ]
    },
    "metadata": {
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "type": "object",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  }
}