{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/dwp-exchange-meta/latest.json",
  "title": "Meta",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/dwp/schemas/main/exchange/publishing-tools/meta-schema.json",
    "sourceSha256": "07b1a9f7b8b608e16ac79c53069d61fac67517e4423b349c6929a4b698db361f",
    "fileMatch": [
      "**/exchange-config/meta.yaml",
      "**/exchange-config/meta.yml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "workspace": {
      "pattern": "^(?!-)[a-zA-Z0-9./_-]*$",
      "title": "Workspace",
      "type": "string",
      "minLength": 2,
      "maxLength": 60,
      "examples": [
        "integration"
      ]
    },
    "product_name": {
      "pattern": "^(?!-\\s)[a-zA-Z0-9\\s._-]+$",
      "title": "Product name",
      "type": "string",
      "minLength": 2,
      "maxLength": 60,
      "examples": [
        "NHS Charge Exemption"
      ]
    },
    "product_id": {
      "format": "uuid",
      "title": "Product ID",
      "type": "string"
    },
    "authentication_proxy": {
      "examples": [
        "true"
      ],
      "title": "Authentication proxy",
      "type": "boolean"
    },
    "workspace_gitlab_groups": {
      "items": {
        "type": "string",
        "pattern": "^@dwp/(?:\\w+|-\\w+|/\\w+)+$",
        "examples": [
          "@dwp/team-name"
        ]
      },
      "title": "GitLab groups for workspace",
      "description": "This field is deprecated and will be removed in a future version",
      "x-deprecated": true,
      "type": "array"
    },
    "product_gitlab_groups": {
      "items": {
        "type": "string",
        "examples": [
          "@dwp/team-name"
        ]
      },
      "title": "GitLab groups for product name",
      "type": "array",
      "pattern": "^@dwp/(?:\\w+|-\\w+|/\\w+)+$"
    },
    "onboarding": {
      "properties": {
        "ifdp": {
          "type": "string",
          "pattern": "^IFDP-\\d+$",
          "examples": [
            "IFDP-1234"
          ]
        },
        "hcs": {
          "type": "boolean"
        },
        "hosts": {
          "type": "object",
          "properties": {
            "non-prod": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^(?:(\\*\\.)?[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*)?$",
                "examples": [
                  "api.example.dwp.gov.uk"
                ]
              }
            },
            "prod": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^(?:(\\*\\.)?[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*)?$",
                "examples": [
                  "api.example.dwp.gov.uk"
                ]
              }
            }
          }
        },
        "ip_ranges": {
          "type": "object",
          "properties": {
            "non-prod": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^\\d+(?:\\.\\d+)+/\\d+$",
                "examples": [
                  "10.82.108.0/22"
                ]
              }
            },
            "prod": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^\\d+(?:\\.\\d+)+/\\d+$",
                "examples": [
                  "10.82.108.0/22"
                ]
              }
            }
          }
        }
      },
      "title": "Additional information required for onboarding",
      "type": "object",
      "additionalProperties": false
    }
  },
  "required": [
    "workspace"
  ],
  "additionalProperties": false,
  "anyOf": [
    {
      "required": [
        "product_name"
      ]
    },
    {
      "required": [
        "workspace_gitlab_groups"
      ]
    }
  ],
  "dependentRequired": {
    "product_gitlab_groups": [
      "product_name"
    ],
    "product_name": [
      "product_id"
    ]
  }
}
