{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "$id": "https://artifacts.apis.io/folio/json-schema/folio-storage-configuration-schema.json",
  "title": "storageConfiguration",
  "description": "Remote storage configuration",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/folio-configurations-api-openapi.yml#/components/schemas/storageConfiguration",
  "type": "object",
  "properties": {
    "id": {
      "description": "configuration id",
      "$ref": "#/$defs/uuid"
    },
    "name": {
      "description": "configuration name",
      "type": "string"
    },
    "apiKey": {
      "description": "remote storage apiKey",
      "type": "string"
    },
    "providerName": {
      "description": "remote storage provider name",
      "type": "string"
    },
    "url": {
      "description": "remote storage url",
      "type": "string"
    },
    "statusUrl": {
      "description": "remote storage url",
      "type": "string"
    },
    "accessionDelay": {
      "description": "accession schedule delay",
      "type": "integer",
      "minimum": 1
    },
    "accessionTimeUnit": {
      "description": "accession schedule time unit",
      "type": "object",
      "$ref": "#/$defs/timeUnits"
    },
    "accessionWorkflowDetails": {
      "description": "accession workflow details",
      "type": "object",
      "$ref": "#/$defs/accessionWorkflowDetails"
    },
    "returningWorkflowDetails": {
      "description": "return workflow details",
      "type": "object",
      "$ref": "#/$defs/returningWorkflowDetails"
    },
    "metadata": {
      "description": "Entity metadata",
      "type": "object",
      "$ref": "#/$defs/metadata"
    }
  },
  "additionalProperties": false,
  "required": [
    "name",
    "providerName"
  ],
  "$defs": {
    "accessionWorkflowDetails": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "Accession workflow details",
      "type": "string",
      "enum": [
        "Duplicate holdings",
        "Change permanent location"
      ]
    },
    "metadata": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "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)",
          "$ref": "#/$defs/uuid"
        },
        "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)",
          "$ref": "#/$defs/uuid"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    },
    "returningWorkflowDetails": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "Return workflow details",
      "type": "string",
      "enum": [
        "Scanned to folio",
        "Scanned to CaiaSoft"
      ]
    },
    "timeUnits": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "Time units",
      "type": "string",
      "enum": [
        "minutes",
        "hours",
        "days",
        "weeks",
        "months"
      ]
    },
    "uuid": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "Regexp pattern for UUID validation",
      "type": "string",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
    }
  }
}