{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/cics-ts-resource-overrides/_shared/latest--resourceoverrides-1.0.0.json",
  "title": "CICS resource overrides JSON Schema.",
  "description": "Schema that describes the structure of a CICS resource overrides document.",
  "x-lintel": {
    "source": "https://public.dhe.ibm.com/ibmdl/export/pub/software/htp/cics/schemas/json/resourceoverrides/resourceoverrides-1.0.0.json",
    "sourceSha256": "402be189b7072951045f69319f60999603a60ab8034c25fb0776fc2b0dc42a8e"
  },
  "type": "object",
  "properties": {
    "schemaVersion": {
      "description": "Specify the resource overrides schema version.",
      "type": "string",
      "enum": [
        "resourceOverrides/1.0"
      ]
    },
    "resourceOverrides": {
      "description": "Resources to be overridden are list items after the resourceOverrides mapping.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "atomservice": {
            "$ref": "#/$defs/selector-overrides"
          },
          "bundle": {
            "$ref": "#/$defs/selector-overrides"
          },
          "connection": {
            "$ref": "#/$defs/selector-overrides"
          },
          "db2conn": {
            "$ref": "#/$defs/selector-overrides"
          },
          "db2entry": {
            "$ref": "#/$defs/selector-overrides"
          },
          "db2tran": {
            "$ref": "#/$defs/selector-overrides"
          },
          "doctemplate": {
            "$ref": "#/$defs/selector-overrides"
          },
          "dumpcode": {
            "$ref": "#/$defs/selector-overrides"
          },
          "enqmodel": {
            "$ref": "#/$defs/selector-overrides"
          },
          "file": {
            "$ref": "#/$defs/selector-overrides"
          },
          "ipconn": {
            "$ref": "#/$defs/selector-overrides"
          },
          "journalmodel": {
            "$ref": "#/$defs/selector-overrides"
          },
          "jvmserver": {
            "$ref": "#/$defs/selector-overrides"
          },
          "library": {
            "$ref": "#/$defs/selector-overrides"
          },
          "lsrpool": {
            "$ref": "#/$defs/selector-overrides"
          },
          "mapset": {
            "$ref": "#/$defs/selector-overrides"
          },
          "mqconn": {
            "$ref": "#/$defs/selector-overrides"
          },
          "mqmonitor": {
            "$ref": "#/$defs/selector-overrides"
          },
          "partitionset": {
            "$ref": "#/$defs/selector-overrides"
          },
          "partner": {
            "$ref": "#/$defs/selector-overrides"
          },
          "pipeline": {
            "$ref": "#/$defs/selector-overrides"
          },
          "processtype": {
            "$ref": "#/$defs/selector-overrides"
          },
          "profile": {
            "$ref": "#/$defs/selector-overrides"
          },
          "program": {
            "$ref": "#/$defs/selector-overrides"
          },
          "sessions": {
            "$ref": "#/$defs/selector-overrides"
          },
          "tcpipservice": {
            "$ref": "#/$defs/selector-overrides"
          },
          "tdqueue": {
            "$ref": "#/$defs/selector-overrides"
          },
          "terminal": {
            "$ref": "#/$defs/selector-overrides"
          },
          "tranclass": {
            "$ref": "#/$defs/selector-overrides"
          },
          "transaction": {
            "$ref": "#/$defs/selector-overrides"
          },
          "tsmodel": {
            "$ref": "#/$defs/selector-overrides"
          },
          "typeterm": {
            "$ref": "#/$defs/selector-overrides"
          },
          "urimap": {
            "$ref": "#/$defs/selector-overrides"
          },
          "webservice": {
            "$ref": "#/$defs/selector-overrides"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "copyright": [
    "*----------------------------------------------------------------*",
    "*  notice='cics-lm-source-program'                               *",
    "*  pids='5655-Y04'                                               *",
    "*  years='2020'                                                  *",
    "*  crc='3623749863'                                              *",
    "*  Licensed Materials - Property of IBM                          *",
    "*  5655-Y04                                                      *",
    "*  (C) Copyright IBM Corp. 2020 All Rights Reserved.             *",
    "*  US Government Users Restricted Rights - Use, duplication or   *",
    "*  disclosure restricted by GSA ADP Schedule Contract with       *",
    "*  IBM Corp.                                                     *",
    "*  @{[**]copyright.years=2020}                                   *",
    "*----------------------------------------------------------------*"
  ],
  "$defs": {
    "selectorAttrStrPattern": {
      "type": "string",
      "pattern": "^[^\\*]*\\*?[^\\*]*$"
    },
    "selectorAttributes": {
      "type": "array",
      "items": {
        "properties": {
          "not": {
            "description": "Use 'not' to exclude resources that contain the specified value. The value can include a single '*' wildcard character at the start, in the middle or at the end.",
            "oneOf": [
              {
                "$ref": "#/$defs/selectorAttrStrPattern"
              },
              {
                "type": "number"
              }
            ]
          },
          "is": {
            "description": "Use 'is' to include resources that contain the specified value. The value can include a single '*' wildcard character at the start, in the middle or at the end.",
            "oneOf": [
              {
                "$ref": "#/$defs/selectorAttrStrPattern"
              },
              {
                "type": "number"
              }
            ]
          },
          "literal": {
            "description": "Use 'literal' to include resources that contain the specified value. The '*' character is treated as an asterisk character.",
            "type": "string"
          },
          "literalNot": {
            "description": "Use 'literalNot' to exclude resources that contain the specified value. The '*' character is treated as an asterisk character",
            "type": "string"
          }
        },
        "additionalProperties": false,
        "type": "object"
      }
    },
    "selector": {
      "description": "Use 'selector' to specify a resource that can have its attributes overridden.",
      "type": "object",
      "properties": {
        "name": {
          "description": "The resource name can be selected by specifying a string or using the 'is', 'not', 'literal' and 'literalNot' list items.",
          "oneOf": [
            {
              "$ref": "#/$defs/selectorAttrStrPattern"
            },
            {
              "$ref": "#/$defs/selectorAttributes"
            }
          ]
        },
        "group": {
          "description": "The resource group can be selected by specifying a string or using the 'is', 'not', 'literal' and 'literalNot' list items.",
          "oneOf": [
            {
              "$ref": "#/$defs/selectorAttrStrPattern"
            },
            {
              "$ref": "#/$defs/selectorAttributes"
            }
          ]
        }
      },
      "additionalProperties": {
        "description": "Resource attributes can be selected by specifying a string or using the 'is', 'not', 'literal' and 'literalNot' list items.",
        "oneOf": [
          {
            "type": "number"
          },
          {
            "$ref": "#/$defs/selectorAttrStrPattern"
          },
          {
            "$ref": "#/$defs/selectorAttributes"
          }
        ]
      }
    },
    "overrides": {
      "description": "Use 'overrides' to specify how the attributes of a resource are overridden.",
      "type": "object",
      "additionalProperties": false,
      "patternProperties": {
        "^[a-zA-Z][a-zA-Z0-9]{0,11}$": {
          "description": "Attribute to override. This can be overridden by specifying a string or number or using 'prefix', 'set', 'suffix, or 'find' and 'replace' list items.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "array",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "prefix": {
                        "description": "Prefix value.",
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "suffix": {
                        "description": "Suffix value.",
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "set": {
                        "description": "Set value.",
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "find": {
                        "description": "Find a specific value in the resource.",
                        "type": "string"
                      },
                      "replace": {
                        "description": "Replace all instances of the 'find' value with the 'replace' value.",
                        "type": "string"
                      }
                    },
                    "required": [
                      "find",
                      "replace"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            }
          ]
        }
      }
    },
    "selector-overrides": {
      "description": "CICS resource type. Specify 'selector' list items to select resources of this type.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "selector": {
            "$ref": "#/$defs/selector"
          },
          "overrides": {
            "$ref": "#/$defs/overrides"
          }
        },
        "additionalProperties": false
      }
    }
  }
}
