{
  "$id": "https://dpone.dev/schemas/dpone.dbt-publish-intent.v2.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "enabled": {
      "type": "boolean"
    },
    "execution": {
      "additionalProperties": false,
      "properties": {
        "max_parallelism": {
          "anyOf": [
            {
              "maximum": 1024,
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "profile": {
          "anyOf": [
            {
              "maxLength": 256,
              "minLength": 1,
              "pattern": ".*\\S.*",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "profile",
        "max_parallelism"
      ],
      "type": "object"
    },
    "lineage": {
      "additionalProperties": false,
      "properties": {
        "enabled": {
          "type": "boolean"
        }
      },
      "required": [
        "enabled"
      ],
      "type": "object"
    },
    "physical_design": {
      "additionalProperties": false,
      "properties": {
        "engine": {
          "anyOf": [
            {
              "maxLength": 256,
              "minLength": 1,
              "pattern": ".*\\S.*",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "order_by": {
          "items": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
            "type": "string"
          },
          "type": "array",
          "uniqueItems": true
        },
        "partition_by": {
          "anyOf": [
            {
              "maxLength": 256,
              "minLength": 1,
              "pattern": ".*\\S.*",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "profile": {
          "anyOf": [
            {
              "maxLength": 256,
              "minLength": 1,
              "pattern": ".*\\S.*",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "profile",
        "engine",
        "order_by",
        "partition_by"
      ],
      "type": "object"
    },
    "profile": {
      "maxLength": 256,
      "minLength": 1,
      "pattern": ".*\\S.*",
      "type": "string"
    },
    "quality": {
      "additionalProperties": false,
      "properties": {
        "preset": {
          "enum": [
            "standard",
            "strict"
          ]
        }
      },
      "required": [
        "preset"
      ],
      "type": "object"
    },
    "schema": {
      "const": "dpone.dbt-publish-intent.v2"
    },
    "strategy": {
      "additionalProperties": false,
      "properties": {
        "mode": {
          "enum": [
            "auto",
            "full_refresh",
            "incremental_merge",
            "partition_replace"
          ]
        },
        "partition_key": {
          "anyOf": [
            {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "unique_key": {
          "items": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
            "type": "string"
          },
          "type": "array",
          "uniqueItems": true
        },
        "window_days": {
          "anyOf": [
            {
              "maximum": 366,
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "mode",
        "unique_key",
        "partition_key",
        "window_days"
      ],
      "type": "object"
    },
    "target": {
      "additionalProperties": false,
      "properties": {
        "schema": {
          "anyOf": [
            {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "table": {
          "anyOf": [
            {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "schema",
        "table"
      ],
      "type": "object"
    },
    "workflow": {
      "maxLength": 256,
      "minLength": 1,
      "pattern": ".*\\S.*",
      "type": "string"
    }
  },
  "required": [
    "schema",
    "enabled",
    "profile",
    "workflow",
    "target",
    "strategy",
    "physical_design",
    "execution",
    "quality",
    "lineage"
  ],
  "type": "object"
}
