{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ovh/json-schema/ovh-domain-configuration-rules-rule-schema.json",
  "title": "domain.configuration.rules.Rule",
  "description": "A configuration rule defines validation to launch when executing an action on a domain (create, trade...). Depending on the extension, the rule may be different",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ovh-v1-domain-openapi.yml#/components/schemas/domain.configuration.rules.Rule",
  "type": "object",
  "properties": {
    "and": {
      "type": [
        "array",
        "null"
      ],
      "description": "An \"and\" operator on multiple rules",
      "items": {
        "$ref": "#/$defs/domain.configuration.rules.Rule"
      },
      "readOnly": true
    },
    "conditions": {
      "allOf": [
        {
          "$ref": "#/$defs/domain.configuration.rules.Rule"
        }
      ],
      "description": "Whether this rule is applied or not",
      "nullable": true,
      "readOnly": true
    },
    "constraints": {
      "type": [
        "array",
        "null"
      ],
      "description": "The constraints of the rule",
      "items": {
        "$ref": "#/$defs/domain.configuration.rules.Constraint"
      },
      "readOnly": true
    },
    "contexts": {
      "type": [
        "array",
        "null"
      ],
      "description": "The context on which the rule applies",
      "items": {
        "$ref": "#/$defs/domain.configuration.rules.ContextEnum"
      },
      "readOnly": true
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "The description of the rule",
      "readOnly": true
    },
    "fields": {
      "allOf": [
        {
          "$ref": "#/$defs/domain.configuration.rules.Rule"
        }
      ],
      "description": "The fields with specific rules",
      "nullable": true,
      "readOnly": true
    },
    "label": {
      "type": [
        "string",
        "null"
      ],
      "description": "The label of the rule",
      "readOnly": true
    },
    "or": {
      "type": [
        "array",
        "null"
      ],
      "description": "An \"or\" operator on multiple rules",
      "items": {
        "$ref": "#/$defs/domain.configuration.rules.Rule"
      },
      "readOnly": true
    },
    "placeholder": {
      "type": [
        "string",
        "null"
      ],
      "description": "The default value used for the rule",
      "readOnly": true
    },
    "type": {
      "allOf": [
        {
          "$ref": "#/$defs/domain.configuration.rules.TypeEnum"
        }
      ],
      "description": "The type of the object the rule applies on",
      "nullable": true,
      "readOnly": true
    }
  },
  "$defs": {
    "domain.configuration.rules.Constraint": {
      "type": "object",
      "description": "A configuration rule defines validation to launch when executing an action on a domain (create, trade...). Depending on the extension, the rule may be different",
      "properties": {
        "conditions": {
          "allOf": [
            {
              "$ref": "#/$defs/domain.configuration.rules.Rule"
            }
          ],
          "description": "Whether this constraint is applied or not",
          "nullable": true,
          "readOnly": true
        },
        "contexts": {
          "type": [
            "array",
            "null"
          ],
          "description": "The context on which the constraint applies",
          "items": {
            "$ref": "#/$defs/domain.configuration.rules.ContextEnum"
          },
          "readOnly": true
        },
        "operator": {
          "allOf": [
            {
              "$ref": "#/$defs/domain.configuration.rules.OperatorEnum"
            }
          ],
          "description": "The operator of the constraint",
          "nullable": true,
          "readOnly": true
        },
        "value": {
          "type": [
            "string",
            "null"
          ],
          "description": "The value to match against",
          "readOnly": true
        },
        "values": {
          "type": [
            "array",
            "null"
          ],
          "description": "The values to match against",
          "items": {
            "type": "string"
          },
          "readOnly": true
        }
      }
    },
    "domain.configuration.rules.ContextEnum": {
      "type": "string",
      "description": "Used in rule to tell if rule (or part of the rule) is applicable for a given context",
      "enum": [
        "accept_conditions",
        "claims",
        "create",
        "order",
        "premium",
        "protected_code",
        "reason",
        "trade",
        "transfer",
        "update"
      ]
    },
    "domain.configuration.rules.OperatorEnum": {
      "type": "string",
      "description": "Operator use in configuration rule to check content of a field",
      "enum": [
        "between",
        "contains",
        "empty",
        "eq",
        "gt",
        "gte",
        "lt",
        "lte",
        "match",
        "maxlength",
        "minlength",
        "ne",
        "notcontains",
        "notempty",
        "readonly",
        "required",
        "shouldbetrue"
      ]
    },
    "domain.configuration.rules.Rule": {
      "type": "object",
      "description": "A configuration rule defines validation to launch when executing an action on a domain (create, trade...). Depending on the extension, the rule may be different",
      "properties": {
        "and": {
          "type": [
            "array",
            "null"
          ],
          "description": "An \"and\" operator on multiple rules",
          "items": {
            "$ref": "#/$defs/domain.configuration.rules.Rule"
          },
          "readOnly": true
        },
        "conditions": {
          "allOf": [
            {
              "$ref": "#/$defs/domain.configuration.rules.Rule"
            }
          ],
          "description": "Whether this rule is applied or not",
          "nullable": true,
          "readOnly": true
        },
        "constraints": {
          "type": [
            "array",
            "null"
          ],
          "description": "The constraints of the rule",
          "items": {
            "$ref": "#/$defs/domain.configuration.rules.Constraint"
          },
          "readOnly": true
        },
        "contexts": {
          "type": [
            "array",
            "null"
          ],
          "description": "The context on which the rule applies",
          "items": {
            "$ref": "#/$defs/domain.configuration.rules.ContextEnum"
          },
          "readOnly": true
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "The description of the rule",
          "readOnly": true
        },
        "fields": {
          "allOf": [
            {
              "$ref": "#/$defs/domain.configuration.rules.Rule"
            }
          ],
          "description": "The fields with specific rules",
          "nullable": true,
          "readOnly": true
        },
        "label": {
          "type": [
            "string",
            "null"
          ],
          "description": "The label of the rule",
          "readOnly": true
        },
        "or": {
          "type": [
            "array",
            "null"
          ],
          "description": "An \"or\" operator on multiple rules",
          "items": {
            "$ref": "#/$defs/domain.configuration.rules.Rule"
          },
          "readOnly": true
        },
        "placeholder": {
          "type": [
            "string",
            "null"
          ],
          "description": "The default value used for the rule",
          "readOnly": true
        },
        "type": {
          "allOf": [
            {
              "$ref": "#/$defs/domain.configuration.rules.TypeEnum"
            }
          ],
          "description": "The type of the object the rule applies on",
          "nullable": true,
          "readOnly": true
        }
      }
    },
    "domain.configuration.rules.TypeEnum": {
      "type": "string",
      "description": "Type of rule configuration",
      "enum": [
        "bool",
        "contact",
        "date_ISO8601",
        "domain",
        "json",
        "number",
        "string",
        "string[]",
        "text"
      ]
    }
  }
}