{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-front-door/json-schema/microsoft-azure-front-door-rules-engine-list-result-schema.json",
  "title": "RulesEngineListResult",
  "description": "Paged collection of RulesEngine items",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-front-door-frontdoors-api-openapi.yml#/components/schemas/RulesEngineListResult",
  "type": "object",
  "properties": {
    "value": {
      "type": "array",
      "description": "The RulesEngine items on this page",
      "items": {
        "$ref": "#/$defs/RulesEngine"
      },
      "readOnly": true
    },
    "nextLink": {
      "type": "string",
      "format": "uri",
      "description": "The link to the next page of items"
    }
  },
  "required": [
    "value"
  ],
  "$defs": {
    "BasicResource": {
      "type": "object",
      "description": "Common resource representation.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Resource ID.",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "description": "Resource name.",
          "readOnly": true
        },
        "type": {
          "type": "string",
          "description": "Resource type.",
          "readOnly": true
        }
      },
      "x-ms-azure-resource": true
    },
    "FrontDoorResourceState": {
      "type": "string",
      "description": "Resource status of the Front Door or Front Door SubResource.",
      "enum": [
        "Creating",
        "Enabling",
        "Enabled",
        "Disabling",
        "Disabled",
        "Deleting",
        "Migrating",
        "Migrated"
      ],
      "x-ms-enum": {
        "name": "FrontDoorResourceState",
        "modelAsString": true,
        "values": [
          {
            "name": "Creating",
            "value": "Creating",
            "description": "Creating"
          },
          {
            "name": "Enabling",
            "value": "Enabling",
            "description": "Enabling"
          },
          {
            "name": "Enabled",
            "value": "Enabled",
            "description": "Enabled"
          },
          {
            "name": "Disabling",
            "value": "Disabling",
            "description": "Disabling"
          },
          {
            "name": "Disabled",
            "value": "Disabled",
            "description": "Disabled"
          },
          {
            "name": "Deleting",
            "value": "Deleting",
            "description": "Deleting"
          },
          {
            "name": "Migrating",
            "value": "Migrating",
            "description": "Migrating"
          },
          {
            "name": "Migrated",
            "value": "Migrated",
            "description": "Migrated"
          }
        ]
      }
    },
    "HeaderAction": {
      "type": "object",
      "description": "An action that can manipulate an http header.",
      "properties": {
        "headerActionType": {
          "$ref": "#/$defs/HeaderActionType",
          "description": "Which type of manipulation to apply to the header."
        },
        "headerName": {
          "type": "string",
          "description": "The name of the header this action will apply to."
        },
        "value": {
          "type": "string",
          "description": "The value to update the given header name with. This value is not used if the actionType is Delete."
        }
      },
      "required": [
        "headerActionType",
        "headerName"
      ]
    },
    "HeaderActionType": {
      "type": "string",
      "description": "Which type of manipulation to apply to the header.",
      "enum": [
        "Append",
        "Delete",
        "Overwrite"
      ],
      "x-ms-enum": {
        "name": "HeaderActionType",
        "modelAsString": true,
        "values": [
          {
            "name": "Append",
            "value": "Append",
            "description": "Append"
          },
          {
            "name": "Delete",
            "value": "Delete",
            "description": "Delete"
          },
          {
            "name": "Overwrite",
            "value": "Overwrite",
            "description": "Overwrite"
          }
        ]
      }
    },
    "MatchProcessingBehavior": {
      "type": "string",
      "description": "If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue.",
      "enum": [
        "Continue",
        "Stop"
      ],
      "x-ms-enum": {
        "name": "MatchProcessingBehavior",
        "modelAsString": true,
        "values": [
          {
            "name": "Continue",
            "value": "Continue",
            "description": "Continue"
          },
          {
            "name": "Stop",
            "value": "Stop",
            "description": "Stop"
          }
        ]
      }
    },
    "RouteConfiguration": {
      "type": "object",
      "description": "Base class for all types of Route.",
      "properties": {
        "@odata.type": {
          "type": "string"
        }
      },
      "required": [
        "@odata.type"
      ]
    },
    "RulesEngine": {
      "type": "object",
      "description": "A rules engine configuration containing a list of rules that will run to modify the runtime behavior of the request and response.",
      "properties": {
        "properties": {
          "$ref": "#/$defs/RulesEngineProperties",
          "description": "Properties of the Rules Engine Configuration.",
          "x-ms-client-flatten": true
        }
      },
      "allOf": [
        {
          "$ref": "#/$defs/BasicResource"
        }
      ]
    },
    "RulesEngineAction": {
      "type": "object",
      "description": "One or more actions that will execute, modifying the request and/or response.",
      "properties": {
        "requestHeaderActions": {
          "type": "array",
          "description": "A list of header actions to apply from the request from AFD to the origin.",
          "items": {
            "$ref": "#/$defs/HeaderAction"
          }
        },
        "responseHeaderActions": {
          "type": "array",
          "description": "A list of header actions to apply from the response from AFD to the client.",
          "items": {
            "$ref": "#/$defs/HeaderAction"
          }
        },
        "routeConfigurationOverride": {
          "$ref": "#/$defs/RouteConfiguration",
          "description": "Override the route configuration."
        }
      }
    },
    "RulesEngineMatchCondition": {
      "type": "object",
      "description": "Define a match condition",
      "properties": {
        "rulesEngineMatchVariable": {
          "$ref": "#/$defs/RulesEngineMatchVariable",
          "description": "Match Variable"
        },
        "selector": {
          "type": "string",
          "description": "Name of selector in RequestHeader or RequestBody to be matched"
        },
        "rulesEngineOperator": {
          "$ref": "#/$defs/RulesEngineOperator",
          "description": "Describes operator to apply to the match condition."
        },
        "negateCondition": {
          "type": "boolean",
          "description": "Describes if this is negate condition or not"
        },
        "rulesEngineMatchValue": {
          "type": "array",
          "description": "Match values to match against. The operator will apply to each value in here with OR semantics. If any of them match the variable with the given operator this match condition is considered a match.",
          "items": {
            "type": "string"
          }
        },
        "transforms": {
          "type": "array",
          "description": "List of transforms",
          "items": {
            "$ref": "#/$defs/Transform"
          }
        }
      },
      "required": [
        "rulesEngineMatchVariable",
        "rulesEngineOperator",
        "rulesEngineMatchValue"
      ]
    },
    "RulesEngineMatchVariable": {
      "type": "string",
      "description": "Match Variable",
      "enum": [
        "IsMobile",
        "RemoteAddr",
        "RequestMethod",
        "QueryString",
        "PostArgs",
        "RequestUri",
        "RequestPath",
        "RequestFilename",
        "RequestFilenameExtension",
        "RequestHeader",
        "RequestBody",
        "RequestScheme"
      ],
      "x-ms-enum": {
        "name": "RulesEngineMatchVariable",
        "modelAsString": true,
        "values": [
          {
            "name": "IsMobile",
            "value": "IsMobile",
            "description": "IsMobile"
          },
          {
            "name": "RemoteAddr",
            "value": "RemoteAddr",
            "description": "RemoteAddr"
          },
          {
            "name": "RequestMethod",
            "value": "RequestMethod",
            "description": "RequestMethod"
          },
          {
            "name": "QueryString",
            "value": "QueryString",
            "description": "QueryString"
          },
          {
            "name": "PostArgs",
            "value": "PostArgs",
            "description": "PostArgs"
          },
          {
            "name": "RequestUri",
            "value": "RequestUri",
            "description": "RequestUri"
          },
          {
            "name": "RequestPath",
            "value": "RequestPath",
            "description": "RequestPath"
          },
          {
            "name": "RequestFilename",
            "value": "RequestFilename",
            "description": "RequestFilename"
          },
          {
            "name": "RequestFilenameExtension",
            "value": "RequestFilenameExtension",
            "description": "RequestFilenameExtension"
          },
          {
            "name": "RequestHeader",
            "value": "RequestHeader",
            "description": "RequestHeader"
          },
          {
            "name": "RequestBody",
            "value": "RequestBody",
            "description": "RequestBody"
          },
          {
            "name": "RequestScheme",
            "value": "RequestScheme",
            "description": "RequestScheme"
          }
        ]
      }
    },
    "RulesEngineOperator": {
      "type": "string",
      "description": "Describes operator to apply to the match condition.",
      "enum": [
        "Any",
        "IPMatch",
        "GeoMatch",
        "Equal",
        "Contains",
        "LessThan",
        "GreaterThan",
        "LessThanOrEqual",
        "GreaterThanOrEqual",
        "BeginsWith",
        "EndsWith"
      ],
      "x-ms-enum": {
        "name": "RulesEngineOperator",
        "modelAsString": true,
        "values": [
          {
            "name": "Any",
            "value": "Any",
            "description": "Any"
          },
          {
            "name": "IPMatch",
            "value": "IPMatch",
            "description": "IPMatch"
          },
          {
            "name": "GeoMatch",
            "value": "GeoMatch",
            "description": "GeoMatch"
          },
          {
            "name": "Equal",
            "value": "Equal",
            "description": "Equal"
          },
          {
            "name": "Contains",
            "value": "Contains",
            "description": "Contains"
          },
          {
            "name": "LessThan",
            "value": "LessThan",
            "description": "LessThan"
          },
          {
            "name": "GreaterThan",
            "value": "GreaterThan",
            "description": "GreaterThan"
          },
          {
            "name": "LessThanOrEqual",
            "value": "LessThanOrEqual",
            "description": "LessThanOrEqual"
          },
          {
            "name": "GreaterThanOrEqual",
            "value": "GreaterThanOrEqual",
            "description": "GreaterThanOrEqual"
          },
          {
            "name": "BeginsWith",
            "value": "BeginsWith",
            "description": "BeginsWith"
          },
          {
            "name": "EndsWith",
            "value": "EndsWith",
            "description": "EndsWith"
          }
        ]
      }
    },
    "RulesEngineProperties": {
      "type": "object",
      "description": "The JSON object that contains the properties required to create a Rules Engine Configuration.",
      "properties": {
        "resourceState": {
          "$ref": "#/$defs/FrontDoorResourceState",
          "title": "Resource status of the Front Door or Front Door SubResource.",
          "description": "Resource status.",
          "readOnly": true
        }
      },
      "allOf": [
        {
          "$ref": "#/$defs/RulesEngineUpdateParameters"
        }
      ]
    },
    "RulesEngineRule": {
      "type": "object",
      "description": "Contains a list of match conditions, and an action on how to modify the request/response. If multiple rules match, the actions from one rule that conflict with a previous rule overwrite for a singular action, or append in the case of headers manipulation.",
      "properties": {
        "name": {
          "type": "string",
          "description": "A name to refer to this specific rule."
        },
        "priority": {
          "type": "integer",
          "format": "int32",
          "description": "A priority assigned to this rule."
        },
        "action": {
          "$ref": "#/$defs/RulesEngineAction",
          "description": "Actions to perform on the request and response if all of the match conditions are met."
        },
        "matchConditions": {
          "type": "array",
          "description": "A list of match conditions that must meet in order for the actions of this rule to run. Having no match conditions means the actions will always run.",
          "items": {
            "$ref": "#/$defs/RulesEngineMatchCondition"
          }
        },
        "matchProcessingBehavior": {
          "$ref": "#/$defs/MatchProcessingBehavior",
          "description": "If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue."
        }
      },
      "required": [
        "name",
        "priority",
        "action"
      ]
    },
    "RulesEngineUpdateParameters": {
      "type": "object",
      "description": "Rules Engine Configuration to apply to a Routing Rule.",
      "properties": {
        "rules": {
          "type": "array",
          "description": "A list of rules that define a particular Rules Engine Configuration.",
          "items": {
            "$ref": "#/$defs/RulesEngineRule"
          }
        }
      }
    },
    "Transform": {
      "type": "string",
      "description": "Describes what transforms are applied before matching",
      "enum": [
        "Lowercase",
        "Uppercase",
        "Trim",
        "UrlDecode",
        "UrlEncode",
        "RemoveNulls"
      ],
      "x-ms-enum": {
        "name": "Transform",
        "modelAsString": true,
        "values": [
          {
            "name": "Lowercase",
            "value": "Lowercase",
            "description": "Lowercase"
          },
          {
            "name": "Uppercase",
            "value": "Uppercase",
            "description": "Uppercase"
          },
          {
            "name": "Trim",
            "value": "Trim",
            "description": "Trim"
          },
          {
            "name": "UrlDecode",
            "value": "UrlDecode",
            "description": "UrlDecode"
          },
          {
            "name": "UrlEncode",
            "value": "UrlEncode",
            "description": "UrlEncode"
          },
          {
            "name": "RemoveNulls",
            "value": "RemoveNulls",
            "description": "RemoveNulls"
          }
        ]
      }
    }
  }
}