{
  "$defs": {
    "manager": {
      "additionalProperties": false,
      "properties": {
        "auto_arpa": {
          "oneOf": [
            {
              "type": "boolean"
            },
            {
              "additionalProperties": false,
              "properties": {
                "inherit_ttl": {
                  "type": "boolean"
                },
                "max_auto_arpa": {
                  "minimum": 0,
                  "type": "integer"
                },
                "populate_should_replace": {
                  "type": "boolean"
                },
                "ttl": {
                  "minimum": 0,
                  "type": "integer"
                },
                "wildcard_replacement": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "type": "object"
            }
          ]
        },
        "disable_validators": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "type": "object"
        },
        "enable_checksum": {
          "type": "boolean"
        },
        "enabled": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "include_meta": {
          "type": "boolean"
        },
        "max_workers": {
          "minimum": 1,
          "type": "integer"
        },
        "plan_outputs": {
          "additionalProperties": {
            "$ref": "#/$defs/pluggable_plan_output"
          },
          "type": "object"
        },
        "post_processors": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "processors": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "validators": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "type": "object"
        }
      },
      "type": "object"
    },
    "pluggable_map_processor": {
      "additionalProperties": {
        "$ref": "#/$defs/pluggable_processor"
      },
      "type": "object"
    },
    "pluggable_map_provider": {
      "additionalProperties": {
        "$ref": "#/$defs/pluggable_provider"
      },
      "type": "object"
    },
    "pluggable_map_secret_handler": {
      "additionalProperties": {
        "$ref": "#/$defs/pluggable_secret_handler"
      },
      "type": "object"
    },
    "pluggable_map_validator": {
      "additionalProperties": {
        "$ref": "#/$defs/pluggable_validator"
      },
      "type": "object"
    },
    "pluggable_plan_output": {
      "additionalProperties": true,
      "allOf": [
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.provider.plan.PlanLogger"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "level": {
                "enum": [
                  "debug",
                  "info",
                  "warn",
                  "warning",
                  "error"
                ],
                "type": "string"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.provider.plan.PlanJson"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "indent": {
                "oneOf": [
                  {
                    "minimum": 0,
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "output_filename": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "sort_keys": {
                "type": "boolean"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.provider.plan.PlanMarkdown"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "output_filename": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.provider.plan.PlanHtml"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "output_filename": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          }
        }
      ],
      "properties": {
        "class": {
          "type": "string"
        }
      },
      "required": [
        "class"
      ],
      "type": "object"
    },
    "pluggable_processor": {
      "additionalProperties": true,
      "allOf": [
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.acme.AcmeManagingProcessor"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {}
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.arpa.AutoArpa"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "inherit_ttl": {
                "type": "boolean"
              },
              "max_auto_arpa": {
                "minimum": 0,
                "type": "integer"
              },
              "populate_should_replace": {
                "type": "boolean"
              },
              "ttl": {
                "minimum": 0,
                "type": "integer"
              },
              "wildcard_replacement": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.clamp.TtlClampProcessor"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "max_ttl": {
                "minimum": 0,
                "type": "integer"
              },
              "min_ttl": {
                "minimum": 0,
                "type": "integer"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.filter.TypeAllowlistFilter"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "allowlist": {
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              },
              "include_target": {
                "type": "boolean"
              }
            },
            "required": [
              "allowlist"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.filter.TypeRejectlistFilter"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "include_target": {
                "type": "boolean"
              },
              "rejectlist": {
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "rejectlist"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.filter.NameAllowlistFilter"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "allowlist": {
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              },
              "include_target": {
                "type": "boolean"
              }
            },
            "required": [
              "allowlist"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.filter.NameRejectlistFilter"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "include_target": {
                "type": "boolean"
              },
              "rejectlist": {
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "rejectlist"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.filter.ValueAllowlistFilter"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "allowlist": {
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              },
              "include_target": {
                "type": "boolean"
              }
            },
            "required": [
              "allowlist"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.filter.ValueRejectlistFilter"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "include_target": {
                "type": "boolean"
              },
              "rejectlist": {
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "rejectlist"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.filter.NetworkValueAllowlistFilter"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "allowlist": {
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "allowlist"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.filter.NetworkValueRejectlistFilter"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "rejectlist": {
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "rejectlist"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.filter.IgnoreRootNsFilter"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {}
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.filter.ExcludeRootNsChanges"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "error": {
                "type": "boolean"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.filter.ZoneNameFilter"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "error": {
                "type": "boolean"
              },
              "include_target": {
                "type": "boolean"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.meta.MetaProcessor"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "include_extra": {
                "oneOf": [
                  {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "include_provider": {
                "type": "boolean"
              },
              "include_time": {
                "type": "boolean"
              },
              "include_uuid": {
                "type": "boolean"
              },
              "include_version": {
                "type": "boolean"
              },
              "record_name": {
                "type": "string"
              },
              "ttl": {
                "minimum": 0,
                "type": "integer"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.ownership.OwnershipProcessor"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "should_replace": {
                "type": "boolean"
              },
              "txt_name": {
                "type": "string"
              },
              "txt_ttl": {
                "minimum": 0,
                "type": "integer"
              },
              "txt_value": {
                "type": "string"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.restrict.TtlRestrictionFilter"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "allowed_ttls": {
                "items": {
                  "minimum": 0,
                  "type": "integer"
                },
                "minItems": 1,
                "type": "array"
              },
              "max_ttl": {
                "minimum": 0,
                "type": "integer"
              },
              "min_ttl": {
                "minimum": 0,
                "type": "integer"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.spf.SpfDnsLookupProcessor"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {}
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.templating.Templating"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "context": {
                "additionalProperties": true,
                "type": "object"
              },
              "trailing_dots": {
                "type": "boolean"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.processor.trailing_dots.EnsureTrailingDots"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {}
          }
        }
      ],
      "properties": {
        "class": {
          "type": "string"
        },
        "lenient": {
          "type": "boolean"
        }
      },
      "required": [
        "class"
      ],
      "type": "object"
    },
    "pluggable_provider": {
      "additionalProperties": true,
      "allOf": [
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.provider.yaml.YamlProvider"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "default_ttl": {
                "minimum": 0,
                "type": "integer"
              },
              "directory": {
                "type": "string"
              },
              "disable_zonefile": {
                "type": "boolean"
              },
              "enforce_order": {
                "type": "boolean"
              },
              "escaped_semicolons": {
                "type": "boolean"
              },
              "ignore_missing_zones": {
                "type": "boolean"
              },
              "order_mode": {
                "enum": [
                  "simple",
                  "natural"
                ],
                "type": "string"
              },
              "populate_should_replace": {
                "type": "boolean"
              },
              "shared_filename": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              },
              "split_catchall": {
                "type": "boolean"
              },
              "split_extension": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              },
              "supports_root_ns": {
                "type": "boolean"
              }
            },
            "required": [
              "directory"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.source.envvar.EnvVarSource"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "name": {
                "type": "string"
              },
              "ttl": {
                "minimum": 0,
                "type": "integer"
              },
              "variable": {
                "type": "string"
              }
            },
            "required": [
              "variable",
              "name"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.source.tinydns.TinyDnsFileSource"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {
              "default_ttl": {
                "minimum": 0,
                "type": "integer"
              },
              "directory": {
                "type": "string"
              }
            },
            "required": [
              "directory"
            ]
          }
        }
      ],
      "properties": {
        "class": {
          "type": "string"
        }
      },
      "required": [
        "class"
      ],
      "type": "object"
    },
    "pluggable_secret_handler": {
      "additionalProperties": true,
      "allOf": [
        {
          "if": {
            "properties": {
              "class": {
                "const": "octodns.secret.environ.EnvironSecrets"
              }
            },
            "required": [
              "class"
            ]
          },
          "then": {
            "properties": {}
          }
        }
      ],
      "properties": {
        "class": {
          "type": "string"
        }
      },
      "required": [
        "class"
      ],
      "type": "object"
    },
    "pluggable_validator": {
      "additionalProperties": true,
      "properties": {
        "class": {
          "type": "string"
        },
        "types": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          ]
        }
      },
      "required": [
        "class"
      ],
      "type": "object"
    },
    "zone": {
      "oneOf": [
        {
          "additionalProperties": false,
          "properties": {
            "alias": {
              "type": "string"
            }
          },
          "required": [
            "alias"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "properties": {
            "glob": {
              "type": "string"
            },
            "lenient": {
              "type": "boolean"
            },
            "processors": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "regex": {
              "type": "string"
            },
            "sources": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "targets": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          "required": [
            "sources",
            "targets"
          ],
          "type": "object"
        }
      ]
    },
    "zones": {
      "additionalProperties": {
        "$ref": "#/$defs/zone"
      },
      "type": "object"
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Schema for an octoDNS main configuration YAML file: providers, processors, validators, secret_handlers, and zones.",
  "properties": {
    "manager": {
      "$ref": "#/$defs/manager"
    },
    "processors": {
      "$ref": "#/$defs/pluggable_map_processor"
    },
    "providers": {
      "$ref": "#/$defs/pluggable_map_provider"
    },
    "secret_handlers": {
      "$ref": "#/$defs/pluggable_map_secret_handler"
    },
    "validators": {
      "$ref": "#/$defs/pluggable_map_validator"
    },
    "zones": {
      "$ref": "#/$defs/zones"
    }
  },
  "required": [
    "providers",
    "zones"
  ],
  "title": "octoDNS config file",
  "type": "object"
}
