{
  "$id": "sevone_device_component_group",
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "ph_request_type": {
      "type": "string",
      "description": "type of request (internal to adapter)",
      "default": "getComponentGroups",
      "enum": [
        "getComponentGroups",
        "createComponentGroup",
        "updateComponentGroup",
        "deleteComponentGroup",
        "addDeviceComponentToGroup",
        "removeDeviceComponentFromGroup"
      ],
      "external_name": "ph_request_type"
    },
    "id": {
      "type": "integer",
      "description": "id of the device",
      "parse": false,
      "encode": false,
      "encrypt": {
        "type": "AES",
        "key": ""
      },
      "minimum": 0,
      "maximum": 999999999999,
      "external_name": "id"
    },
    "name": {
      "type": "string",
      "description": "name of the device",
      "parse": false,
      "encode": false,
      "encrypt": {
        "type": "AES",
        "key": ""
      },
      "external_name": "name"
    },
    "parentId": {
      "type": "integer",
      "description": "id of the parent of this device group",
      "parse": false,
      "encode": false,
      "encrypt": {
        "type": "AES",
        "key": ""
      },
      "minimum": 0,
      "maximum": 999999999999,
      "external_name": "parentId"
    },
    "readOnly": {
      "type": "boolean",
      "description": "whether the component group is read only",
      "parse": false,
      "encode": false,
      "encrypt": {
        "type": "AES",
        "key": ""
      },
      "external_name": "readOnly"
    },
    "members": {
      "type": "array",
      "description": "",
      "parse": false,
      "encode": false,
      "encrypt": {
        "type": "AES",
        "key": ""
      },
      "external_name": "members"
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "ph_request_type": {
            "enum": [
              "createComponentGroup"
            ]
          }
        }
      },
      "then": {
        "required": [
          "name",
          "parentId"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "ph_request_type": {
            "enum": [
              "updateComponentGroup"
            ]
          }
        }
      },
      "then": {
        "required": [
          "name",
          "parentId"
        ]
      }
    }
  ],
  "definitions": {}
}