{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/chatinbox-net/json-schema/chatinbox-net-instance-rule-vm-schema.json",
  "title": "InstanceRuleVM",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/chatinbox-net-instance-api-openapi.yml#/components/schemas/InstanceRuleVM",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "format": "int32"
    },
    "instanceRuleTriggerType": {
      "type": "integer",
      "format": "int32"
    },
    "triggerRelationItemID": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "triggerValue": {
      "type": [
        "string",
        "null"
      ]
    },
    "triggerStartTime": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-span"
    },
    "triggerEndTime": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-span"
    },
    "companyInstanceID": {
      "type": "integer",
      "format": "int32"
    },
    "instanceRuleType": {
      "type": "integer",
      "format": "int32"
    },
    "routingAlgorithmType": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "relationItemID": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "routingAlternativeAlgorithmType": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "alternativeRelationItemID": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "relatedWorkGroups": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/WorkGroupVM"
      }
    },
    "relatedWorkGroupUsers": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "integer",
        "format": "int32"
      }
    },
    "relatedChatBots": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "integer",
        "format": "int32"
      }
    },
    "sendWelcomeMessage": {
      "type": "boolean"
    },
    "userSelectionAlgorithmType": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "welcomeMessageContent": {
      "type": [
        "string",
        "null"
      ]
    },
    "alternativeUserSelectionAlgorithmType": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "WorkGroupUserVM": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "iconText": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "WorkGroupVM": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "rgbCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "workGroupUsers": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/WorkGroupUserVM"
          }
        },
        "isSystemGroup": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    }
  }
}