{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://drivr.cloud/import.schema.json",
  "title": "DRIVRDataImportSchema",
  "description": "The schema accepted by DRIVR to model the data model describing all services and characteristics of the data import process. If a specific data type is not set in the file, the data will not be imported as well as not be deleted as it is expected to not be managed by the data model.",
  "type": "object",
  "properties": {
    "applicationConsumers": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/ApplicationConsumer",
        "type": "object"
      }
    },
    "characteristics": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/Characteristic",
        "type": "object"
      }
    },
    "characteristicServiceLinks": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/CharacteristicServiceLink",
        "type": "object"
      }
    },
    "componentModels": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/ComponentModel",
        "type": "object"
      }
    },
    "dataSources": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/DataSource",
        "type": "object"
      }
    },
    "eventModels": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/EventModel",
        "type": "object"
      }
    },
    "machineUsers": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/MachineUser",
        "type": "object"
      }
    },
    "metadataTypes": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/MetadataType",
        "type": "object"
      }
    },
    "services": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/Service",
        "type": "object"
      }
    },
    "serviceComponentModelLinks": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/ServiceComponentModelLink",
        "type": "object"
      }
    },
    "organizations": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/Organization",
        "type": "object"
      }
    },
    "users": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/User",
        "type": "object"
      }
    }
  },
  "definitions": {
    "ApplicationConsumer": {
      "type": "object",
      "required": [
        "name",
        "slug",
        "secret",
        "grantTypes"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the application consumer."
        },
        "slug": {
          "type": "string",
          "description": "The slug of the application consumer."
        },
        "status": {
          "type": "string",
          "enum": [
            "ACTIVATED",
            "DEACTIVATED",
            "ARCHIVED"
          ],
          "description": "The status of the application consumer.",
          "default": "ACTIVATED"
        },
        "defaultRedirectUri": {
          "oneOf": [
            {
              "type": "string",
              "format": "uri",
              "description": "The default redirect URI of the application consumer."
            },
            {
              "type": "null"
            }
          ]
        },
        "redirectUris": {
          "oneOf": [
            {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uri",
                "description": "The redirect URIs of the application consumer."
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "secret": {
          "type": "string",
          "description": "The secret of the application consumer."
        },
        "noExplicitConsentRequired": {
          "type": "boolean",
          "description": "The flag to indicate if the application consumer requires explicit consent."
        },
        "grantTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "AUTHORIZATION_CODE",
              "PASSWORD",
              "REFRESH_TOKEN"
            ],
            "description": "The grant types of the application consumer."
          }
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string",
            "description": "The scopes of the application consumer."
          }
        }
      }
    },
    "Characteristic": {
      "type": "object",
      "required": [
        "name",
        "code",
        "characteristicType",
        "dataType"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "The code of the characteristic."
        },
        "name": {
          "type": "string",
          "description": "The name of the characteristic."
        },
        "description": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The description of the characteristic.",
          "default": null
        },
        "status": {
          "type": "string",
          "enum": [
            "ACTIVATED",
            "DEACTIVATED",
            "ARCHIVED"
          ],
          "description": "The status of the application consumer.",
          "default": "ACTIVATED"
        },
        "characteristicType": {
          "type": "string",
          "enum": [
            "MEASUREMENT",
            "SETTING"
          ],
          "description": "The type of the characteristic (MEASUREMENT or SETTING). MEASUREMENT means that only the device can set the value, while SETTING means that the user can set the value."
        },
        "dataType": {
          "type": "string",
          "enum": [
            "BLOB",
            "BOOLEAN",
            "DATE",
            "FLOAT",
            "INTEGER",
            "JSON",
            "SELECT",
            "STRING",
            "TIME",
            "TIMESPAN",
            "TIMESTAMP"
          ],
          "description": "The data type of the characteristic."
        },
        "symbol": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The symbol of the characteristic. Something like a unit of measurement. Examples are '\u00b0C' for Celsius or 'kg' for kilogram.",
          "default": null
        },
        "metadataKeyValueStore": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "key",
              "value"
            ],
            "properties": {
              "key": {
                "type": "string",
                "description": "The key of the metadata key-value store."
              },
              "value": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "object",
                    "required": [
                      "string"
                    ],
                    "properties": {
                      "string": {
                        "type": "string",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "float"
                    ],
                    "properties": {
                      "float": {
                        "type": "number",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "integer"
                    ],
                    "properties": {
                      "integer": {
                        "type": "integer",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "boolean"
                    ],
                    "properties": {
                      "boolean": {
                        "type": "boolean",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "timestamp"
                    ],
                    "properties": {
                      "timestamp": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "uuid"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The value of the metadata key-value store."
              }
            }
          }
        },
        "multiple": {
          "type": "boolean",
          "description": "The flag to indicate if the characteristic can have multiple values. It is only supported on data type SELECT. Otherwise the value is ignored.",
          "default": false
        },
        "options": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "key",
              "label"
            ],
            "properties": {
              "key": {
                "type": "string",
                "description": "The key of the option."
              },
              "label": {
                "type": "string",
                "description": "The label of the option."
              },
              "meta": {
                "type": "array",
                "default": [],
                "items": {
                  "type": "object",
                  "required": [
                    "key",
                    "value"
                  ],
                  "properties": {
                    "key": {
                      "type": "string",
                      "description": "The key of the metadata key-value store."
                    },
                    "value": {
                      "type": "string",
                      "description": "The value of the metadata key-value store."
                    }
                  }
                }
              }
            }
          }
        },
        "schema": {
          "oneOf": [
            {
              "type": "object"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The json schema of the characteristic. This is only used for the data type JSON. Otherwise it is ignored. It can either be a string representing the schema or an object with the actual schema inside."
        },
        "boundaryMin": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "string",
              "format": "time"
            },
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "string",
              "format": "duration"
            },
            {
              "type": "number"
            },
            {
              "type": "integer"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The minimum boundary of the characteristic. This is only used for the data type DATE, FLOAT, INTEGER, TIME and TIMESTAMP. Otherwise it is ignored."
        },
        "boundaryMax": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "string",
              "format": "time"
            },
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "string",
              "format": "duration"
            },
            {
              "type": "number"
            },
            {
              "type": "integer"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The maximum boundary of the characteristic. This is only used for the data type DATE, FLOAT, INTEGER, TIME and TIMESTAMP. Otherwise it is ignored."
        },
        "boundaryStep": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "The steps which can be set. If on a FLOAT characteristic 0.5 is set 0, 0.5, 1, 1.5 and others in this schema are allowed. This is only used for the data type FLOAT and INTEGER. Otherwise it is ignored."
        },
        "precision": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "The precision of the characteristic. This is only used for the data type FLOAT. Otherwise it is ignored."
        }
      }
    },
    "CharacteristicServiceLink": {
      "type": "object",
      "description": "Links a characteristic to a service. Services which are referenced will have support for the provided characteristic in it.",
      "required": [
        "characteristicCode",
        "serviceCode"
      ],
      "properties": {
        "characteristicCode": {
          "type": "string",
          "description": "The code of the characteristic."
        },
        "serviceCode": {
          "type": "string",
          "description": "The code of the service."
        }
      }
    },
    "ComponentModel": {
      "type": "object",
      "required": [
        "code",
        "name",
        "componentType"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "The code of the component model. Must be unique."
        },
        "name": {
          "type": "string",
          "description": "The name of the component model."
        },
        "description": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The description of the component model.",
          "default": null
        },
        "componentType": {
          "type": "string",
          "enum": [
            "DEVICE",
            "GATEWAY",
            "VIRTUAL"
          ],
          "description": "The type of the component model (DEVICE, GATEWAY or VIRTUAL)."
        },
        "status": {
          "type": "string",
          "enum": [
            "ACTIVATED",
            "DEACTIVATED",
            "ARCHIVED"
          ],
          "description": "The status of the component model.",
          "default": "ACTIVATED"
        },
        "isConnective": {
          "type": "boolean",
          "description": "The flag to indicate if the component model is connective.",
          "default": false
        },
        "metadataKeyValueStore": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "key",
              "value"
            ],
            "properties": {
              "key": {
                "type": "string",
                "description": "The key of the metadata key-value store."
              },
              "value": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "object",
                    "required": [
                      "string"
                    ],
                    "properties": {
                      "string": {
                        "type": "string",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "float"
                    ],
                    "properties": {
                      "float": {
                        "type": "number",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "integer"
                    ],
                    "properties": {
                      "integer": {
                        "type": "integer",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "boolean"
                    ],
                    "properties": {
                      "boolean": {
                        "type": "boolean",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "timestamp"
                    ],
                    "properties": {
                      "timestamp": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "uuid"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The value of the metadata key-value store."
              }
            }
          }
        },
        "services": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "code"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "The code of the service."
              },
              "index": {
                "type": "integer",
                "description": "The index of the service in the component model. If not set the index defaults to 0.",
                "default": 0
              }
            }
          }
        }
      }
    },
    "DataSource": {
      "type": "object",
      "required": [
        "code"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "The code of the data source."
        },
        "name": {
          "type": "string",
          "description": "The name of the data source."
        },
        "description": {
          "type": "string",
          "description": "The description of the data source.",
          "default": null
        },
        "reference": {
          "type": "string",
          "description": "The reference of the data source.",
          "default": null
        }
      }
    },
    "EventModel": {
      "type": "object",
      "required": [
        "code",
        "eventType",
        "entityType"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "The code of the event model. Must be unique."
        },
        "eventType": {
          "type": "string",
          "enum": [
            "RANGED",
            "SINGLE_POINT"
          ],
          "description": "The type of the event model (RANGED or SINGLE_POINT)."
        },
        "entityType": {
          "type": "string",
          "enum": [
            "COMPONENT",
            "SYSTEM"
          ],
          "description": "The type of the entity the event model is related to (COMPONENT or SYSTEM)."
        },
        "eventLevel": {
          "type": "string",
          "enum": [
            "ERROR",
            "INFO",
            "SUCCESS",
            "WARNING"
          ],
          "description": "The level of the event model.",
          "default": "INFO"
        },
        "message": {
          "type": "string",
          "description": "The message of the event model.",
          "default": null
        },
        "metadataKeyValueStore": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "key",
              "value"
            ],
            "properties": {
              "key": {
                "type": "string",
                "description": "The key of the metadata key-value store."
              },
              "value": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "object",
                    "required": [
                      "string"
                    ],
                    "properties": {
                      "string": {
                        "type": "string",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "float"
                    ],
                    "properties": {
                      "float": {
                        "type": "number",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "integer"
                    ],
                    "properties": {
                      "integer": {
                        "type": "integer",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "boolean"
                    ],
                    "properties": {
                      "boolean": {
                        "type": "boolean",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "timestamp"
                    ],
                    "properties": {
                      "timestamp": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "uuid"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The value of the metadata key-value store."
              }
            }
          }
        },
        "status": {
          "type": "string",
          "enum": [
            "ACTIVATED",
            "DEACTIVATED",
            "ARCHIVED"
          ],
          "description": "The status of the event model.",
          "default": "ACTIVATED"
        },
        "limitToPrototypes": {
          "type": "boolean",
          "description": "The flag to indicate if the event model is limited to prototypes.",
          "default": false
        }
      }
    },
    "MachineUser": {
      "type": "object",
      "required": [
        "username",
        "password"
      ],
      "properties": {
        "username": {
          "type": "string",
          "description": "The username of the machine user."
        },
        "password": {
          "type": "string",
          "description": "The password of the machine user."
        },
        "status": {
          "type": "string",
          "enum": [
            "ACTIVATED",
            "DEACTIVATED",
            "ARCHIVED"
          ],
          "description": "The status of the machine user.",
          "default": "ACTIVATED"
        }
      }
    },
    "MetadataType": {
      "type": "object",
      "required": [
        "key",
        "entityType",
        "dataType"
      ],
      "properties": {
        "key": {
          "type": "string",
          "description": "The key of the metadata type."
        },
        "description": {
          "oneOf": [
            {
              "type": "string",
              "description": "The description of the metadata type."
            },
            {
              "type": "null"
            }
          ]
        },
        "entityType": {
          "type": "string",
          "enum": [
            "CHARACTERISTIC",
            "COMPONENT",
            "COMPONENT_MODEL",
            "EVENT",
            "EVENT_MODEL",
            "ORGANIZATION",
            "ORGANIZATION_UNIT",
            "SERVICE",
            "SYSTEM",
            "USER"
          ],
          "description": "The entity type of the metadata type."
        },
        "dataType": {
          "type": "string",
          "enum": [
            "BOOLEAN",
            "FLOAT",
            "INTEGER",
            "STRING",
            "TIMESTAMP",
            "UUID"
          ],
          "description": "The data type of the metadata type."
        },
        "default": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "description": "The default value of the metadata type."
        },
        "unique": {
          "type": "boolean",
          "description": "The flag to indicate if the metadata type is expecting each value in it be unique. This is only supported on data types INTEGER and STRING."
        }
      }
    },
    "Service": {
      "type": "object",
      "required": [
        "code",
        "name"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "The code of the service."
        },
        "name": {
          "type": "string",
          "description": "The name of the service."
        },
        "description": {
          "type": "string",
          "description": "The description of the service."
        },
        "status": {
          "type": "string",
          "enum": [
            "ACTIVATED",
            "DEACTIVATED",
            "ARCHIVED"
          ],
          "description": "The status of the service.",
          "default": "ACTIVATED"
        },
        "metadataKeyValueStore": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "key",
              "value"
            ],
            "properties": {
              "key": {
                "type": "string",
                "description": "The key of the metadata key-value store."
              },
              "value": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "object",
                    "required": [
                      "string"
                    ],
                    "properties": {
                      "string": {
                        "type": "string",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "float"
                    ],
                    "properties": {
                      "float": {
                        "type": "number",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "integer"
                    ],
                    "properties": {
                      "integer": {
                        "type": "integer",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "boolean"
                    ],
                    "properties": {
                      "boolean": {
                        "type": "boolean",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "timestamp"
                    ],
                    "properties": {
                      "timestamp": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "uuid"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The value of the metadata key-value store."
              }
            }
          }
        },
        "characteristics": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "code"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "The code of the characteristic."
              }
            }
          }
        }
      }
    },
    "ServiceComponentModelLink": {
      "type": "object",
      "description": "Links a service to a component model. Component models which are referenced will have support for the provided service in it.",
      "required": [
        "serviceCode",
        "componentModelCode"
      ],
      "properties": {
        "serviceCode": {
          "type": "string",
          "description": "The code of the service."
        },
        "componentModelCode": {
          "type": "string",
          "description": "The code of the component model."
        },
        "index": {
          "type": "integer",
          "description": "The index of the service in the component model. If not set the index defaults to 0.",
          "default": 0
        }
      }
    },
    "Organization": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "alias": {
          "oneOf": [
            {
              "type": "string",
              "description": "The alias of the organization."
            },
            {
              "type": "null"
            }
          ]
        },
        "name": {
          "type": "string",
          "description": "The name of the organization."
        },
        "status": {
          "type": "string",
          "enum": [
            "ACTIVATED",
            "DEACTIVATED",
            "ARCHIVED"
          ],
          "description": "The status of the organization.",
          "default": "ACTIVATED"
        },
        "metadataKeyValueStore": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "key",
              "value"
            ],
            "properties": {
              "key": {
                "type": "string",
                "description": "The key of the metadata key-value store."
              },
              "value": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "object",
                    "required": [
                      "string"
                    ],
                    "properties": {
                      "string": {
                        "type": "string",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "float"
                    ],
                    "properties": {
                      "float": {
                        "type": "number",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "integer"
                    ],
                    "properties": {
                      "integer": {
                        "type": "integer",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "boolean"
                    ],
                    "properties": {
                      "boolean": {
                        "type": "boolean",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "timestamp"
                    ],
                    "properties": {
                      "timestamp": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "uuid"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The value of the metadata key-value store."
              }
            }
          }
        },
        "organizationUnits": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/OrganizationUnit"
          }
        }
      }
    },
    "OrganizationUnit": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "alias": {
          "oneOf": [
            {
              "type": "string",
              "description": "The alias of the organization unit."
            },
            {
              "type": "null"
            }
          ]
        },
        "name": {
          "type": "string",
          "description": "The name of the organization unit."
        },
        "metadataKeyValueStore": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "key",
              "value"
            ],
            "properties": {
              "key": {
                "type": "string",
                "description": "The key of the metadata key-value store."
              },
              "value": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "object",
                    "required": [
                      "string"
                    ],
                    "properties": {
                      "string": {
                        "type": "string",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "float"
                    ],
                    "properties": {
                      "float": {
                        "type": "number",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "integer"
                    ],
                    "properties": {
                      "integer": {
                        "type": "integer",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "boolean"
                    ],
                    "properties": {
                      "boolean": {
                        "type": "boolean",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "timestamp"
                    ],
                    "properties": {
                      "timestamp": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "uuid"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The value of the metadata key-value store."
              }
            }
          }
        },
        "status": {
          "type": "string",
          "enum": [
            "ACTIVATED",
            "DEACTIVATED",
            "ARCHIVED"
          ],
          "description": "The status of the organization unit.",
          "default": "ACTIVATED"
        },
        "directChildren": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/OrganizationUnit"
          }
        }
      }
    },
    "User": {
      "type": "object",
      "required": [
        "email"
      ],
      "properties": {
        "email": {
          "type": "string",
          "format": "email",
          "description": "The email of the user."
        },
        "name": {
          "oneOf": [
            {
              "type": "string",
              "description": "The name of the user."
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "ACTIVATED",
            "DEACTIVATED",
            "ARCHIVED"
          ],
          "description": "The status of the user.",
          "default": "ACTIVATED"
        },
        "metadataKeyValueStore": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "key",
              "value"
            ],
            "properties": {
              "key": {
                "type": "string",
                "description": "The key of the metadata key-value store."
              },
              "value": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "object",
                    "required": [
                      "string"
                    ],
                    "properties": {
                      "string": {
                        "type": "string",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "float"
                    ],
                    "properties": {
                      "float": {
                        "type": "number",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "integer"
                    ],
                    "properties": {
                      "integer": {
                        "type": "integer",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "boolean"
                    ],
                    "properties": {
                      "boolean": {
                        "type": "boolean",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "timestamp"
                    ],
                    "properties": {
                      "timestamp": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "uuid"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The value of the metadata key-value item."
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The value of the metadata key-value store."
              }
            }
          }
        },
        "organization": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "alias": {
                  "oneOf": [
                    {
                      "type": "string",
                      "description": "The alias of the organization."
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          ],
          "default": null
        }
      }
    }
  }
}
