{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-connect/json-schema/amazon-connect-update-case-rule-request-schema.json",
  "title": "UpdateCaseRuleRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-connect-case-rules-api-openapi.yml#/components/schemas/UpdateCaseRuleRequest",
  "type": "object",
  "properties": {
    "domainId": {
      "type": "string",
      "description": "Unique identifier of a Cases domain."
    },
    "caseRuleId": {
      "type": "string",
      "description": "Unique identifier of a case rule."
    },
    "name": {
      "type": "string",
      "description": "Name of the case rule."
    },
    "description": {
      "type": "string",
      "description": "Description of a case rule."
    },
    "rule": {
      "$ref": "#/$defs/CaseRuleDetails"
    }
  },
  "required": [
    "domainId",
    "caseRuleId"
  ],
  "$defs": {
    "BooleanOperands": {
      "type": "object",
      "properties": {
        "operandOne": {
          "$ref": "#/$defs/OperandOne"
        },
        "operandTwo": {
          "$ref": "#/$defs/OperandTwo"
        },
        "result": {
          "type": "boolean",
          "description": "The value of the outer rule if the condition evaluates to true."
        }
      },
      "required": [
        "operandOne",
        "operandTwo",
        "result"
      ]
    },
    "CaseRuleDetails": {
      "type": "object",
      "properties": {
        "required": {
          "$ref": "#/$defs/RequiredCaseRule"
        },
        "fieldOptions": {
          "$ref": "#/$defs/FieldOptionsCaseRule"
        },
        "hidden": {
          "$ref": "#/$defs/HiddenCaseRule"
        }
      },
      "description": "Exactly one member is set."
    },
    "CasesBooleanCondition": {
      "type": "object",
      "properties": {
        "equalTo": {
          "$ref": "#/$defs/BooleanOperands"
        },
        "notEqualTo": {
          "$ref": "#/$defs/BooleanOperands"
        },
        "andAll": {
          "$ref": "#/$defs/CompoundCondition"
        },
        "orAll": {
          "$ref": "#/$defs/CompoundCondition"
        }
      },
      "description": "Exactly one member is set."
    },
    "CompoundCondition": {
      "type": "object",
      "properties": {
        "conditions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CasesBooleanCondition"
          },
          "description": "The list of conditions to combine using the logical operator. For API users: A case rule can have a maximum of 5 conditions, spread across a maximum of 2 levels of nesting."
        }
      },
      "required": [
        "conditions"
      ]
    },
    "EmptyOperandValue": {
      "type": "object",
      "properties": {}
    },
    "FieldOptionsCaseRule": {
      "type": "object",
      "properties": {
        "parentFieldId": {
          "type": "string",
          "description": "The identifier of the parent field that controls options."
        },
        "childFieldId": {
          "type": "string",
          "description": "The identifier of the child field whose options are controlled."
        },
        "parentChildFieldOptionsMappings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ParentChildFieldOptionsMapping"
          },
          "description": "A mapping between a parent field option value and child field option values."
        }
      },
      "required": [
        "parentChildFieldOptionsMappings"
      ]
    },
    "HiddenCaseRule": {
      "type": "object",
      "properties": {
        "defaultValue": {
          "type": "boolean",
          "description": "Whether the field is hidden when no conditions match."
        },
        "conditions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CasesBooleanCondition"
          },
          "description": "A list of conditions that determine field visibility."
        }
      },
      "required": [
        "defaultValue",
        "conditions"
      ]
    },
    "OperandOne": {
      "type": "object",
      "properties": {
        "fieldId": {
          "type": "string",
          "description": "The field ID that this operand should take the value of."
        }
      },
      "description": "Exactly one member is set."
    },
    "OperandTwo": {
      "type": "object",
      "properties": {
        "stringValue": {
          "type": "string",
          "description": "String value type."
        },
        "booleanValue": {
          "type": "boolean",
          "description": "Boolean value type."
        },
        "doubleValue": {
          "type": "number",
          "description": "Double value type."
        },
        "emptyValue": {
          "$ref": "#/$defs/EmptyOperandValue"
        }
      },
      "description": "Exactly one member is set."
    },
    "ParentChildFieldOptionsMapping": {
      "type": "object",
      "properties": {
        "parentFieldOptionValue": {
          "type": "string",
          "description": "The value in the parent field."
        },
        "childFieldOptionValues": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of allowed values in the child field."
        }
      },
      "required": [
        "parentFieldOptionValue",
        "childFieldOptionValues"
      ]
    },
    "RequiredCaseRule": {
      "type": "object",
      "properties": {
        "defaultValue": {
          "type": "boolean",
          "description": "The value of the rule (that is, whether the field is required) should none of the conditions evaluate to true."
        },
        "conditions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CasesBooleanCondition"
          },
          "description": "List of conditions for the required rule; the first condition to evaluate to true dictates the value of the rule."
        }
      },
      "required": [
        "defaultValue",
        "conditions"
      ]
    }
  }
}