{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$ref": "#/definitions/SqlSdkPredefinedProfiles",
  "definitions": {
    "SqlSdkPredefinedProfiles": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/BaseSdkPredefinedProfile<SqlProfileId,SqlBundleType>"
      }
    },
    "BaseSdkPredefinedProfile<SqlProfileId,SqlBundleType>": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Profile name for UI"
        },
        "id": {
          "$ref": "#/definitions/SqlProfileId",
          "description": "Profile id for docs"
        },
        "bundles": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SqlBundleType"
          },
          "description": "Function bundles enabled for this profile"
        },
        "variables": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SdkVariable"
          },
          "description": "Variable describing name, type, and providing description"
        }
      },
      "required": [
        "name",
        "id",
        "bundles",
        "variables"
      ],
      "additionalProperties": false,
      "description": "Describes a profile"
    },
    "SqlProfileId": {
      "type": "string",
      "enum": [
        "field-calculation",
        "where-clause"
      ],
      "description": "The list of supported profiles"
    },
    "SqlBundleType": {
      "type": "string",
      "enum": [
        "date",
        "numeric",
        "string"
      ],
      "description": "Supported function bundles"
    },
    "SdkVariable": {
      "anyOf": [
        {
          "$ref": "#/definitions/SdkDictionaryVariable"
        },
        {
          "$ref": "#/definitions/SdkValueVariable"
        }
      ],
      "description": "Profile variable"
    },
    "SdkDictionaryVariable": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the variable."
        },
        "type": {
          "type": "string",
          "const": "dictionary",
          "description": "Type of the variable."
        },
        "description": {
          "type": "string",
          "description": "Description of the variable."
        },
        "properties": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SdkVariable"
          }
        }
      },
      "required": [
        "name",
        "properties",
        "type"
      ],
      "additionalProperties": false,
      "description": "A dictionary variable"
    },
    "SdkValueVariable": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the variable."
        },
        "type": {
          "type": "string",
          "enum": [
            "array",
            "boolean",
            "dataCatalogDatastore",
            "date",
            "dateOnly",
            "feature",
            "featureSet",
            "featureSetCollection",
            "geometry",
            "knowledgeGraph",
            "number",
            "pixel",
            "text",
            "time",
            "voxel"
          ],
          "description": "Type of the variable."
        },
        "description": {
          "type": "string",
          "description": "Description of the variable."
        }
      },
      "required": [
        "name",
        "type"
      ],
      "additionalProperties": false,
      "description": "A variable that represents a simple type (boolean, number, feature, etc.)"
    }
  }
}