{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--aws-databrew-ruleset.json",
  "title": "AWSDataBrewRulesetProperties",
  "description": "Resource schema for AWS::DataBrew::Ruleset.. Source:- <https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-databrew.git>",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/lalcebo/json-schema/master/serverless/resources/cloudformation-modified/aws-databrew-ruleset.json",
    "sourceSha256": "926a37e0fc0a41506caf3f0b8f7675ff015e9c76700ebed4c7efa5dcad9924f9"
  },
  "type": "object",
  "properties": {
    "Name": {
      "oneOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "Name of the Ruleset"
    },
    "Description": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 1024
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "Description of the Ruleset"
    },
    "TargetArn": {
      "oneOf": [
        {
          "type": "string",
          "minLength": 20,
          "maxLength": 2048
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "Arn of the target resource (dataset) to apply the ruleset to"
    },
    "Rules": {
      "description": "List of the data quality rules in the ruleset",
      "type": "array",
      "insertionOrder": true,
      "items": {
        "$ref": "#/$defs/Rule"
      },
      "minItems": 1
    },
    "Tags": {
      "type": "array",
      "insertionOrder": false,
      "uniqueItems": false,
      "items": {
        "$ref": "#/$defs/Tag"
      }
    }
  },
  "typeName": "AWS::DataBrew::Ruleset",
  "createOnlyProperties": [
    "/properties/Name",
    "/properties/TargetArn"
  ],
  "sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-databrew.git",
  "taggable": true,
  "additionalProperties": false,
  "primaryIdentifier": [
    "/properties/Name"
  ],
  "$defs": {
    "Expression": {
      "oneOf": [
        {
          "type": "string",
          "minLength": 4,
          "maxLength": 1024,
          "pattern": "^[><0-9A-Za-z_.,:)(!= ]+$"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "Expression with rule conditions",
      "title": "AWSDataBrewRulesetExpressionDefinition"
    },
    "SubstitutionValue": {
      "description": "A key-value pair to associate expression's substitution variable names with their values",
      "type": "object",
      "properties": {
        "ValueReference": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 2,
              "maxLength": 128,
              "pattern": "^:[A-Za-z0-9_]+$"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "Variable name"
        },
        "Value": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 0,
              "maxLength": 1024
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "Value or column name"
        }
      },
      "title": "AWSDataBrewRulesetSubstitutionValueDefinition",
      "required": [
        "ValueReference",
        "Value"
      ],
      "additionalProperties": false
    },
    "ValuesMap": {
      "type": "array",
      "insertionOrder": true,
      "items": {
        "$ref": "#/$defs/SubstitutionValue"
      },
      "title": "AWSDataBrewRulesetValuesMapDefinition"
    },
    "ThresholdValue": {
      "description": "Threshold value for a rule",
      "type": "number",
      "title": "AWSDataBrewRulesetThresholdValueDefinition"
    },
    "ThresholdType": {
      "oneOf": [
        {
          "enum": [
            "GREATER_THAN_OR_EQUAL",
            "LESS_THAN_OR_EQUAL",
            "GREATER_THAN",
            "LESS_THAN"
          ],
          "type": "string"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "Threshold type for a rule",
      "title": "AWSDataBrewRulesetThresholdTypeDefinition"
    },
    "ThresholdUnit": {
      "oneOf": [
        {
          "enum": [
            "COUNT",
            "PERCENTAGE"
          ],
          "type": "string"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "Threshold unit for a rule",
      "title": "AWSDataBrewRulesetThresholdUnitDefinition"
    },
    "Threshold": {
      "type": "object",
      "properties": {
        "Value": {
          "$ref": "#/$defs/ThresholdValue"
        },
        "Type": {
          "$ref": "#/$defs/ThresholdType"
        },
        "Unit": {
          "$ref": "#/$defs/ThresholdUnit"
        }
      },
      "required": [
        "Value"
      ],
      "title": "AWSDataBrewRulesetThresholdDefinition",
      "additionalProperties": false
    },
    "ColumnSelector": {
      "description": "Selector of a column from a dataset for profile job configuration. One selector includes either a column name or a regular expression",
      "type": "object",
      "properties": {
        "Regex": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "A regular expression for selecting a column from a dataset"
        },
        "Name": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The name of a column from a dataset"
        }
      },
      "title": "AWSDataBrewRulesetColumnSelectorDefinition",
      "additionalProperties": false
    },
    "Disabled": {
      "description": "Boolean value to disable/enable a rule",
      "type": "boolean",
      "title": "AWSDataBrewRulesetDisabledDefinition"
    },
    "Rule": {
      "description": "Data quality rule for a target resource (dataset)",
      "type": "object",
      "properties": {
        "Name": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "Name of the rule"
        },
        "Disabled": {
          "$ref": "#/$defs/Disabled"
        },
        "CheckExpression": {
          "$ref": "#/$defs/Expression"
        },
        "SubstitutionMap": {
          "$ref": "#/$defs/ValuesMap"
        },
        "Threshold": {
          "$ref": "#/$defs/Threshold"
        },
        "ColumnSelectors": {
          "type": "array",
          "insertionOrder": true,
          "items": {
            "$ref": "#/$defs/ColumnSelector"
          },
          "minItems": 1
        }
      },
      "required": [
        "Name",
        "CheckExpression"
      ],
      "title": "AWSDataBrewRulesetRuleDefinition",
      "additionalProperties": false
    },
    "Tag": {
      "description": "A key-value pair to associate with a resource",
      "type": "object",
      "properties": {
        "Key": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        },
        "Value": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 0,
              "maxLength": 256
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        }
      },
      "title": "AWSDataBrewRulesetTagDefinition",
      "required": [
        "Value",
        "Key"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "Name",
    "TargetArn",
    "Rules"
  ]
}
