{
  "openapi": "3.0.0",
  "info": {
    "description": "Api for SKD node",
    "version": "0.0.1",
    "title": "skd-api"
  },
  "servers": [
    {
      "url": "/api/v1",
      "description": "SKD API"
    }
  ],
  "paths": {
    "/staff": {
      "get": {
        "tags": [
          "staff"
        ],
        "description": "Returns staff page",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "description": "Cards page id to load",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "description": "Maximum number of cards in page",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 150
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned staff page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "surname",
                      "name",
                      "dolzhnost",
                      "uuid"
                    ],
                    "properties": {
                      "surname": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "second_name": {
                        "type": "string"
                      },
                      "access_profiles": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "uuid": {
                              "type": "string"
                            },
                            "from": {
                              "type": "integer"
                            },
                            "to": {
                              "type": "integer"
                            }
                          }
                        },
                        "description": "User's access profiles list"
                      },
                      "access_point": {
                        "type": "string",
                        "description": "Personal access point"
                      },
                      "access_user": {
                        "type": "string"
                      },
                      "pin": {
                        "type": "string",
                        "maxLength": 8,
                        "description": "Personal pin code"
                      },
                      "car_number": {
                        "type": "string",
                        "pattern": "^[0-9A-Za-zАВЕКМНОРСТУХавекмнорстух]{3,9}$"
                      },
                      "biometry": {
                        "properties": {
                          "card_code": {
                            "type": "string",
                            "pattern": "^[1-9]\\d*$",
                            "description": "Staff biometry card code"
                          },
                          "models": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Models of biometry readers for which employee has bio data saved in system"
                          }
                        },
                        "description": "Describes staff biometry data"
                      },
                      "comment": {
                        "type": "string"
                      },
                      "dolzhnost": {
                        "type": "string"
                      },
                      "E-mail": {
                        "type": "string"
                      },
                      "tab_nomer": {
                        "type": "integer"
                      },
                      "bio_provider_person_id": {
                        "type": "string"
                      },
                      "bio_provider": {
                        "type": "string"
                      },
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "description": "User UUID"
                      },
                      "cards": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[1-9]\\d*$"
                        },
                        "description": "Employee cards codes list"
                      },
                      "access_profile": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "description": "User's access profile (DEPRECATED)",
                        "deprecated": true
                      },
                      "banned": {
                        "type": "boolean",
                        "description": "User banned for accessing any access point or not"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "staff"
        ],
        "description": "Add new employee to staff",
        "requestBody": {
          "required": true,
          "description": "New employee data in staff database",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "surname",
                  "name",
                  "dolzhnost",
                  "uuid"
                ],
                "properties": {
                  "surname": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "second_name": {
                    "type": "string"
                  },
                  "access_profiles": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": "string"
                        },
                        "from": {
                          "type": "integer"
                        },
                        "to": {
                          "type": "integer"
                        }
                      }
                    },
                    "description": "User's access profiles list"
                  },
                  "access_point": {
                    "type": "string",
                    "description": "Personal access point"
                  },
                  "access_user": {
                    "type": "string"
                  },
                  "pin": {
                    "type": "string",
                    "maxLength": 8,
                    "description": "Personal pin code"
                  },
                  "car_number": {
                    "type": "string",
                    "pattern": "^[0-9A-Za-zАВЕКМНОРСТУХавекмнорстух]{3,9}$"
                  },
                  "biometry": {
                    "properties": {
                      "card_code": {
                        "type": "string",
                        "pattern": "^[1-9]\\d*$",
                        "description": "Staff biometry card code"
                      },
                      "models": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Models of biometry readers for which employee has bio data saved in system"
                      }
                    },
                    "description": "Describes staff biometry data"
                  },
                  "comment": {
                    "type": "string"
                  },
                  "dolzhnost": {
                    "type": "string"
                  },
                  "E-mail": {
                    "type": "string"
                  },
                  "tab_nomer": {
                    "type": "integer"
                  },
                  "bio_provider_person_id": {
                    "type": "string"
                  },
                  "bio_provider": {
                    "type": "string"
                  },
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "description": "User UUID"
                  },
                  "cards": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[1-9]\\d*$"
                    },
                    "description": "Employee cards codes list"
                  },
                  "access_profile": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "description": "User's access profile (DEPRECATED)",
                    "deprecated": true
                  },
                  "banned": {
                    "type": "boolean",
                    "description": "User banned for accessing any access point or not"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successfully added new employee to staff",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "User with specified uuid already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff/sort": {
      "get": {
        "tags": [
          "staff"
        ],
        "description": "Returns sorted by surname staff page",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "description": "Cards page id to load",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "description": "Maximum number of cards in page",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 150
            }
          },
          {
            "in": "query",
            "name": "direction",
            "description": "Direction of sorting ASC or DESC",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ]
            }
          },
          {
            "in": "query",
            "name": "column_name",
            "description": "Поле по которому сортировать",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "column_name",
            "description": "Column name for sorting",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned staff page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "surname",
                      "name",
                      "dolzhnost",
                      "uuid"
                    ],
                    "properties": {
                      "surname": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "second_name": {
                        "type": "string"
                      },
                      "access_profiles": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "uuid": {
                              "type": "string"
                            },
                            "from": {
                              "type": "integer"
                            },
                            "to": {
                              "type": "integer"
                            }
                          }
                        },
                        "description": "User's access profiles list"
                      },
                      "access_point": {
                        "type": "string",
                        "description": "Personal access point"
                      },
                      "access_user": {
                        "type": "string"
                      },
                      "pin": {
                        "type": "string",
                        "maxLength": 8,
                        "description": "Personal pin code"
                      },
                      "car_number": {
                        "type": "string",
                        "pattern": "^[0-9A-Za-zАВЕКМНОРСТУХавекмнорстух]{3,9}$"
                      },
                      "biometry": {
                        "properties": {
                          "card_code": {
                            "type": "string",
                            "pattern": "^[1-9]\\d*$",
                            "description": "Staff biometry card code"
                          },
                          "models": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Models of biometry readers for which employee has bio data saved in system"
                          }
                        },
                        "description": "Describes staff biometry data"
                      },
                      "comment": {
                        "type": "string"
                      },
                      "dolzhnost": {
                        "type": "string"
                      },
                      "E-mail": {
                        "type": "string"
                      },
                      "tab_nomer": {
                        "type": "integer"
                      },
                      "bio_provider_person_id": {
                        "type": "string"
                      },
                      "bio_provider": {
                        "type": "string"
                      },
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "description": "User UUID"
                      },
                      "cards": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[1-9]\\d*$"
                        },
                        "description": "Employee cards codes list"
                      },
                      "access_profile": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "description": "User's access profile (DEPRECATED)",
                        "deprecated": true
                      },
                      "banned": {
                        "type": "boolean",
                        "description": "User banned for accessing any access point or not"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff/biometry": {
      "post": {
        "tags": [
          "staff"
        ],
        "description": "Add new biometry to staff",
        "requestBody": {
          "required": true,
          "description": "New biometry data in staff database",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user_uuid",
                  "biometry_uuid"
                ],
                "properties": {
                  "user_uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "biometry_uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "card_code": {
                    "type": "string",
                    "pattern": "^[1-9]\\d*$|virtual_card"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "READER",
                      "SERVICE"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully added new biometry to staff",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff/biometry/status": {
      "get": {
        "tags": [
          "staff"
        ],
        "description": "Returns biometry statuses",
        "responses": {
          "200": {
            "description": "Successfully returned biometry statuses",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "readers_in_use"
                  ],
                  "properties": {
                    "readers_in_use": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "user_uuid": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                          },
                          "biometry_uuid": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                          },
                          "card_code": {
                            "type": "string",
                            "pattern": "^[1-9]\\d*$"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff/{uuid}/biometry": {
      "delete": {
        "tags": [
          "staff"
        ],
        "description": "Delete all biometry data from staff",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted biometry data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified employee does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff/{uuid}/biometry/{biometry_model}": {
      "delete": {
        "tags": [
          "staff"
        ],
        "description": "Delete biometry data for specified model from staff",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            }
          },
          {
            "in": "path",
            "name": "biometry_model",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "BioSmart 5M",
                "BioSmart Quasar",
                "BioSmart PV-WTC",
                "BioSmart WTC2",
                "BioSmart 4",
                "ZKTeco 3.x",
                "Hikvision ISAPI",
                "dit"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted biometry data for specified models",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified employee does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff/banned": {
      "get": {
        "tags": [
          "staff"
        ],
        "description": "Returns staff page",
        "responses": {
          "200": {
            "description": "Successfully returned staff page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "surname",
                      "name",
                      "dolzhnost",
                      "uuid"
                    ],
                    "properties": {
                      "surname": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "second_name": {
                        "type": "string"
                      },
                      "access_profiles": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "uuid": {
                              "type": "string"
                            },
                            "from": {
                              "type": "integer"
                            },
                            "to": {
                              "type": "integer"
                            }
                          }
                        },
                        "description": "User's access profiles list"
                      },
                      "access_point": {
                        "type": "string",
                        "description": "Personal access point"
                      },
                      "access_user": {
                        "type": "string"
                      },
                      "pin": {
                        "type": "string",
                        "maxLength": 8,
                        "description": "Personal pin code"
                      },
                      "car_number": {
                        "type": "string",
                        "pattern": "^[0-9A-Za-zАВЕКМНОРСТУХавекмнорстух]{3,9}$"
                      },
                      "biometry": {
                        "properties": {
                          "card_code": {
                            "type": "string",
                            "pattern": "^[1-9]\\d*$",
                            "description": "Staff biometry card code"
                          },
                          "models": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Models of biometry readers for which employee has bio data saved in system"
                          }
                        },
                        "description": "Describes staff biometry data"
                      },
                      "comment": {
                        "type": "string"
                      },
                      "dolzhnost": {
                        "type": "string"
                      },
                      "E-mail": {
                        "type": "string"
                      },
                      "tab_nomer": {
                        "type": "integer"
                      },
                      "bio_provider_person_id": {
                        "type": "string"
                      },
                      "bio_provider": {
                        "type": "string"
                      },
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "description": "User UUID"
                      },
                      "cards": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[1-9]\\d*$"
                        },
                        "description": "Employee cards codes list"
                      },
                      "access_profile": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "description": "User's access profile (DEPRECATED)",
                        "deprecated": true
                      },
                      "banned": {
                        "type": "boolean",
                        "description": "User banned for accessing any access point or not"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff/ban/{uuid}": {
      "put": {
        "tags": [
          "staff"
        ],
        "description": "Edit employee data",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully edited employee",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified employee does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff/unban/{uuid}": {
      "put": {
        "tags": [
          "staff"
        ],
        "description": "Edit employee data",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully edited employee",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified employee does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff/count": {
      "get": {
        "tags": [
          "staff"
        ],
        "description": "Returns staff count",
        "parameters": [
          {
            "in": "query",
            "name": "filter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Filter staff by staff property",
                  "required": [
                    "staff_property_name",
                    "staff_property_value"
                  ],
                  "properties": {
                    "staff_property_name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "staff_property_value": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                }
              }
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfull got staff count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff/search": {
      "get": {
        "tags": [
          "staff"
        ],
        "description": "Return a filtered list of staff",
        "parameters": [
          {
            "in": "query",
            "name": "surname",
            "description": "Employee surname search parameter",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "name",
            "description": "Employee name search parameter",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "description": "Maximum number of search results to be returned",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 150
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "description": "Cursor to proceed search from",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "in": "query",
            "name": "filter",
            "description": "JSON filter object for staff search",
            "required": false,
            "schema": {
              "type": "object",
              "description": "Filter staff by staff property",
              "required": [
                "staff_property_name",
                "staff_property_value"
              ],
              "properties": {
                "staff_property_name": {
                  "type": "string",
                  "minLength": 1
                },
                "staff_property_value": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned list of staff",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "staff",
                    "cursor",
                    "count"
                  ],
                  "properties": {
                    "staff": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "surname",
                          "name",
                          "dolzhnost",
                          "uuid"
                        ],
                        "properties": {
                          "surname": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "second_name": {
                            "type": "string"
                          },
                          "access_profiles": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "uuid": {
                                  "type": "string"
                                },
                                "from": {
                                  "type": "integer"
                                },
                                "to": {
                                  "type": "integer"
                                }
                              }
                            },
                            "description": "User's access profiles list"
                          },
                          "access_point": {
                            "type": "string",
                            "description": "Personal access point"
                          },
                          "access_user": {
                            "type": "string"
                          },
                          "pin": {
                            "type": "string",
                            "maxLength": 8,
                            "description": "Personal pin code"
                          },
                          "car_number": {
                            "type": "string",
                            "pattern": "^[0-9A-Za-zАВЕКМНОРСТУХавекмнорстух]{3,9}$"
                          },
                          "biometry": {
                            "properties": {
                              "card_code": {
                                "type": "string",
                                "pattern": "^[1-9]\\d*$",
                                "description": "Staff biometry card code"
                              },
                              "models": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                },
                                "description": "Models of biometry readers for which employee has bio data saved in system"
                              }
                            },
                            "description": "Describes staff biometry data"
                          },
                          "comment": {
                            "type": "string"
                          },
                          "dolzhnost": {
                            "type": "string"
                          },
                          "E-mail": {
                            "type": "string"
                          },
                          "tab_nomer": {
                            "type": "integer"
                          },
                          "bio_provider_person_id": {
                            "type": "string"
                          },
                          "bio_provider": {
                            "type": "string"
                          },
                          "uuid": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "description": "User UUID"
                          },
                          "cards": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[1-9]\\d*$"
                            },
                            "description": "Employee cards codes list"
                          },
                          "access_profile": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "description": "User's access profile (DEPRECATED)",
                            "deprecated": true
                          },
                          "banned": {
                            "type": "boolean",
                            "description": "User banned for accessing any access point or not"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Overall search count"
                    },
                    "cursor": {
                      "type": "integer",
                      "description": "Cursor to proceed with search from"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff/multisearch": {
      "get": {
        "tags": [
          "staff"
        ],
        "description": "Return a filtered and sorted list of staff",
        "parameters": [
          {
            "in": "query",
            "name": "surname",
            "description": "Employee surname search parameter",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "name",
            "description": "Employee name search parameter",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "description": "Maximum number of search results to be returned",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 150
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "description": "Cursor to proceed search from",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "in": "query",
            "name": "filter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Filters staff by staff properties",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              }
            },
            "required": false
          },
          {
            "in": "query",
            "name": "direction",
            "description": "Direction of sorting ASC, DESC or empty string for no sort search",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ],
              "nullable": true
            }
          },
          {
            "in": "query",
            "name": "searchString",
            "description": "Employee search parameter",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned list of staff",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "staff",
                    "cursor",
                    "count"
                  ],
                  "properties": {
                    "staff": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "surname",
                          "name",
                          "dolzhnost",
                          "uuid"
                        ],
                        "properties": {
                          "surname": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "second_name": {
                            "type": "string"
                          },
                          "access_profiles": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "uuid": {
                                  "type": "string"
                                },
                                "from": {
                                  "type": "integer"
                                },
                                "to": {
                                  "type": "integer"
                                }
                              }
                            },
                            "description": "User's access profiles list"
                          },
                          "access_point": {
                            "type": "string",
                            "description": "Personal access point"
                          },
                          "access_user": {
                            "type": "string"
                          },
                          "pin": {
                            "type": "string",
                            "maxLength": 8,
                            "description": "Personal pin code"
                          },
                          "car_number": {
                            "type": "string",
                            "pattern": "^[0-9A-Za-zАВЕКМНОРСТУХавекмнорстух]{3,9}$"
                          },
                          "biometry": {
                            "properties": {
                              "card_code": {
                                "type": "string",
                                "pattern": "^[1-9]\\d*$",
                                "description": "Staff biometry card code"
                              },
                              "models": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                },
                                "description": "Models of biometry readers for which employee has bio data saved in system"
                              }
                            },
                            "description": "Describes staff biometry data"
                          },
                          "comment": {
                            "type": "string"
                          },
                          "dolzhnost": {
                            "type": "string"
                          },
                          "E-mail": {
                            "type": "string"
                          },
                          "tab_nomer": {
                            "type": "integer"
                          },
                          "bio_provider_person_id": {
                            "type": "string"
                          },
                          "bio_provider": {
                            "type": "string"
                          },
                          "uuid": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "description": "User UUID"
                          },
                          "cards": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[1-9]\\d*$"
                            },
                            "description": "Employee cards codes list"
                          },
                          "access_profile": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "description": "User's access profile (DEPRECATED)",
                            "deprecated": true
                          },
                          "banned": {
                            "type": "boolean",
                            "description": "User banned for accessing any access point or not"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Overall search count"
                    },
                    "cursor": {
                      "type": "integer",
                      "description": "Cursor to proceed with search from"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff/full_names": {
      "get": {
        "tags": [
          "staff"
        ],
        "description": "Returns all staff full names",
        "responses": {
          "200": {
            "description": "Successfully got staff full names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "uuid": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "name",
                      "uuid"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff/{uuid}": {
      "get": {
        "tags": [
          "staff"
        ],
        "description": "Returns employee by uuid",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned employee by uuid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "surname",
                    "name",
                    "dolzhnost",
                    "uuid"
                  ],
                  "properties": {
                    "surname": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "second_name": {
                      "type": "string"
                    },
                    "access_profiles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "uuid": {
                            "type": "string"
                          },
                          "from": {
                            "type": "integer"
                          },
                          "to": {
                            "type": "integer"
                          }
                        }
                      },
                      "description": "User's access profiles list"
                    },
                    "access_point": {
                      "type": "string",
                      "description": "Personal access point"
                    },
                    "access_user": {
                      "type": "string"
                    },
                    "pin": {
                      "type": "string",
                      "maxLength": 8,
                      "description": "Personal pin code"
                    },
                    "car_number": {
                      "type": "string",
                      "pattern": "^[0-9A-Za-zАВЕКМНОРСТУХавекмнорстух]{3,9}$"
                    },
                    "biometry": {
                      "properties": {
                        "card_code": {
                          "type": "string",
                          "pattern": "^[1-9]\\d*$",
                          "description": "Staff biometry card code"
                        },
                        "models": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Models of biometry readers for which employee has bio data saved in system"
                        }
                      },
                      "description": "Describes staff biometry data"
                    },
                    "comment": {
                      "type": "string"
                    },
                    "dolzhnost": {
                      "type": "string"
                    },
                    "E-mail": {
                      "type": "string"
                    },
                    "tab_nomer": {
                      "type": "integer"
                    },
                    "bio_provider_person_id": {
                      "type": "string"
                    },
                    "bio_provider": {
                      "type": "string"
                    },
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "description": "User UUID"
                    },
                    "cards": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[1-9]\\d*$"
                      },
                      "description": "Employee cards codes list"
                    },
                    "access_profile": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "description": "User's access profile (DEPRECATED)",
                      "deprecated": true
                    },
                    "banned": {
                      "type": "boolean",
                      "description": "User banned for accessing any access point or not"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified employee was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "staff"
        ],
        "description": "Edit employee data",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "New data for employee",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "surname",
                  "name",
                  "dolzhnost",
                  "uuid"
                ],
                "properties": {
                  "surname": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "second_name": {
                    "type": "string"
                  },
                  "access_profiles": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": "string"
                        },
                        "from": {
                          "type": "integer"
                        },
                        "to": {
                          "type": "integer"
                        }
                      }
                    },
                    "description": "User's access profiles list"
                  },
                  "access_point": {
                    "type": "string",
                    "description": "Personal access point"
                  },
                  "access_user": {
                    "type": "string"
                  },
                  "pin": {
                    "type": "string",
                    "maxLength": 8,
                    "description": "Personal pin code"
                  },
                  "car_number": {
                    "type": "string",
                    "pattern": "^[0-9A-Za-zАВЕКМНОРСТУХавекмнорстух]{3,9}$"
                  },
                  "biometry": {
                    "properties": {
                      "card_code": {
                        "type": "string",
                        "pattern": "^[1-9]\\d*$",
                        "description": "Staff biometry card code"
                      },
                      "models": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Models of biometry readers for which employee has bio data saved in system"
                      }
                    },
                    "description": "Describes staff biometry data"
                  },
                  "comment": {
                    "type": "string"
                  },
                  "dolzhnost": {
                    "type": "string"
                  },
                  "E-mail": {
                    "type": "string"
                  },
                  "tab_nomer": {
                    "type": "integer"
                  },
                  "bio_provider_person_id": {
                    "type": "string"
                  },
                  "bio_provider": {
                    "type": "string"
                  },
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "description": "User UUID"
                  },
                  "cards": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[1-9]\\d*$"
                    },
                    "description": "Employee cards codes list"
                  },
                  "access_profile": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "description": "User's access profile (DEPRECATED)",
                    "deprecated": true
                  },
                  "banned": {
                    "type": "boolean",
                    "description": "User banned for accessing any access point or not"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully edited employee",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified employee does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "staff"
        ],
        "description": "Delete specified employee",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted employee",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified employee does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff/{uuid}/last_access": {
      "get": {
        "tags": [
          "staff"
        ],
        "description": "Returns staff last access",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned staff page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "terra": {
                      "type": "string"
                    },
                    "ts": {
                      "type": "number"
                    },
                    "access_point_uuid": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff/{uuid}/biometry_card": {
      "delete": {
        "tags": [
          "staff"
        ],
        "description": "Unset biometry card from user",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully unset biometry card from user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff/{uuid}/biometry_card/{card_code}": {
      "post": {
        "tags": [
          "staff"
        ],
        "description": "Set user's biometry card",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "card_code",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9]\\d*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully set user's biometry card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff_properties": {
      "get": {
        "tags": [
          "staff"
        ],
        "description": "Returns all registered staff properties",
        "responses": {
          "200": {
            "description": "Successfully returned registered staff properties",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Staff property",
                    "required": [
                      "name",
                      "display_name",
                      "type",
                      "required",
                      "show_in_search"
                    ],
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "pattern": "^(?!(?:uuid|cards|access_point|access_profile|terra|car_number|banned|biometry))[\\s\\S]+"
                      },
                      "display_name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "string",
                          "integer",
                          "directory_entry"
                        ]
                      },
                      "required": {
                        "type": "boolean"
                      },
                      "value_directory": {
                        "description": "Directory name from which property values are taken. Required when property type is directory_entry",
                        "type": "string"
                      },
                      "show_in_search": {
                        "description": "Show property in staff search results",
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "staff"
        ],
        "description": "Register new staff properties",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "description": "Staff property",
                  "required": [
                    "name",
                    "display_name",
                    "type",
                    "required",
                    "show_in_search"
                  ],
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "^(?!(?:uuid|cards|access_point|access_profile|terra|car_number|banned|biometry))[\\s\\S]+"
                    },
                    "display_name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "string",
                        "integer",
                        "directory_entry"
                      ]
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "value_directory": {
                      "description": "Directory name from which property values are taken. Required when property type is directory_entry",
                      "type": "string"
                    },
                    "show_in_search": {
                      "description": "Show property in staff search results",
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully added new staff property"
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff_properties/{name}": {
      "get": {
        "tags": [
          "staff"
        ],
        "description": "Get staff property by name",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully received property",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Staff property",
                  "required": [
                    "name",
                    "display_name",
                    "type",
                    "required",
                    "show_in_search"
                  ],
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "^(?!(?:uuid|cards|access_point|access_profile|terra|car_number|banned|biometry))[\\s\\S]+"
                    },
                    "display_name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "string",
                        "integer",
                        "directory_entry"
                      ]
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "value_directory": {
                      "description": "Directory name from which property values are taken. Required when property type is directory_entry",
                      "type": "string"
                    },
                    "show_in_search": {
                      "description": "Show property in staff search results",
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified property does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on a server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "staff"
        ],
        "description": "Update staff property data",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Staff property",
                "required": [
                  "name",
                  "display_name",
                  "type",
                  "required",
                  "show_in_search"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^(?!(?:uuid|cards|access_point|access_profile|terra|car_number|banned|biometry))[\\s\\S]+"
                  },
                  "display_name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "string",
                      "integer",
                      "directory_entry"
                    ]
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "value_directory": {
                    "description": "Directory name from which property values are taken. Required when property type is directory_entry",
                    "type": "string"
                  },
                  "show_in_search": {
                    "description": "Show property in staff search results",
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully updated property",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified property does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on a server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "staff"
        ],
        "description": "Delete staff property by name",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted property",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Specified property is default property and can't be deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified property does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on a server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/staff/{uuid}/convolution": {
      "post": {
        "tags": [
          "staff"
        ],
        "description": "Добавить сверсток биометрии пользователю (Если требуется создать виртуальную карту, то необходимо задать \"card_code\": \"virtual_card\")",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user_uuid",
                  "model",
                  "card_code",
                  "convolution"
                ],
                "properties": {
                  "user_uuid": {
                    "type": "string",
                    "example": "b5f14fa0-3c7b-11f0-af07-d9c079cb43c4"
                  },
                  "model": {
                    "type": "string",
                    "example": "BioSmart 5M"
                  },
                  "card_code": {
                    "type": "string",
                    "example": "57016322"
                  },
                  "convolution": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Сверсток биометрии был успешно добавлен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ],
                      "example": true
                    },
                    "card_code": {
                      "type": "string",
                      "example": "57016322"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Пользователь не найден",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "staff"
        ],
        "description": "Получить сверсток биометрии пользователя",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно получен сверсток биометрии",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ],
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "rev_id": {
                          "type": "string",
                          "example": "2"
                        },
                        "card_code": {
                          "type": "string",
                          "example": "57016322"
                        },
                        "uuid": {
                          "type": "string",
                          "example": "4bc43860-50ec-11f0-90a4-b1e08f14be91"
                        },
                        "model": {
                          "type": "string",
                          "example": "data"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Пользователь не найден",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/visitors": {
      "get": {
        "tags": [
          "visitors"
        ],
        "description": "Returns visitor page",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "description": "Cards page id to load",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "description": "Maximum number of cards in page",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 150
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned visitors page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "surname",
                      "name",
                      "uuid"
                    ],
                    "properties": {
                      "surname": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "second_name": {
                        "type": "string"
                      },
                      "access_profiles": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "uuid": {
                              "type": "string"
                            },
                            "from": {
                              "type": "integer"
                            },
                            "to": {
                              "type": "integer"
                            }
                          }
                        },
                        "description": "User's access profiles list"
                      },
                      "company": {
                        "type": "string"
                      },
                      "car_number": {
                        "type": "string",
                        "pattern": "^[0-9A-Za-zАВЕКМНОРСТУХавекмнорстух]{3,9}$"
                      },
                      "phone": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string"
                      },
                      "comment": {
                        "type": "string"
                      },
                      "first_access": {
                        "type": "integer",
                        "description": "First visitor access ms"
                      },
                      "last_access": {
                        "type": "integer",
                        "description": "Last visitor access ms"
                      },
                      "identifier_format": {
                        "type": "string",
                        "enum": [
                          "",
                          "qr",
                          "barcode",
                          "card"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "",
                          "WAITING",
                          "ACTIVE:INNER",
                          "ACTIVE:OUTER",
                          "BANNED",
                          "NOT-COME",
                          "ARCHIVE",
                          "VIOLATION"
                        ]
                      },
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "description": "User UUID"
                      },
                      "code": {
                        "type": "string",
                        "pattern": "(^[1-9]\\d*$)|(^$)",
                        "description": "identifier code"
                      },
                      "access_profile": {
                        "type": "string",
                        "description": "User's access profile (DEPRECATED)",
                        "deprecated": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "visitors"
        ],
        "description": "Add new visitor",
        "requestBody": {
          "description": "New visitor data in visitors database",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "surname",
                  "name",
                  "uuid"
                ],
                "properties": {
                  "surname": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "second_name": {
                    "type": "string"
                  },
                  "access_profiles": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": "string"
                        },
                        "from": {
                          "type": "integer"
                        },
                        "to": {
                          "type": "integer"
                        }
                      }
                    },
                    "description": "User's access profiles list"
                  },
                  "company": {
                    "type": "string"
                  },
                  "car_number": {
                    "type": "string",
                    "pattern": "^[0-9A-Za-zАВЕКМНОРСТУХавекмнорстух]{3,9}$"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "comment": {
                    "type": "string"
                  },
                  "first_access": {
                    "type": "integer",
                    "description": "First visitor access ms"
                  },
                  "last_access": {
                    "type": "integer",
                    "description": "Last visitor access ms"
                  },
                  "identifier_format": {
                    "type": "string",
                    "enum": [
                      "",
                      "qr",
                      "barcode",
                      "card"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "",
                      "WAITING",
                      "ACTIVE:INNER",
                      "ACTIVE:OUTER",
                      "BANNED",
                      "NOT-COME",
                      "ARCHIVE",
                      "VIOLATION"
                    ]
                  },
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "description": "User UUID"
                  },
                  "code": {
                    "type": "string",
                    "pattern": "(^[1-9]\\d*$)|(^$)",
                    "description": "identifier code"
                  },
                  "access_profile": {
                    "type": "string",
                    "description": "User's access profile (DEPRECATED)",
                    "deprecated": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successfully added new visitor",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/visitors/count": {
      "get": {
        "tags": [
          "visitors"
        ],
        "description": "Returns visitors count",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ACTIVE:INNER",
                "WAITING"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got staff count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/visitors/count_planned": {
      "get": {
        "tags": [
          "visitors"
        ],
        "summary": "Returns planned visitors",
        "description": "Returns count of visitors that have waiting status, and their access profiles (at least one valid profile per visitor) and identifiers are valid until 'end' parameter",
        "parameters": [
          {
            "in": "query",
            "name": "end",
            "required": true,
            "description": "end of count timestamp",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got planned visitors count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "count"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "count": {
                      "type": "integer",
                      "example": 4,
                      "minimum": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "message"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "message": {
                      "type": "string",
                      "enum": [
                        "Query parameter 'end' must represents valid timestamp"
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/visitors/full_names": {
      "get": {
        "tags": [
          "visitors"
        ],
        "description": "Returns all visitors full names",
        "responses": {
          "200": {
            "description": "Successfully got visitors full names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "name",
                      "uuid"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "uuid": {
                        "type": "string",
                        "format": "uuid"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/visitors/{uuid}": {
      "get": {
        "tags": [
          "visitors"
        ],
        "description": "Returns visitor by uuid",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned visitor by uuid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "surname",
                    "name",
                    "uuid"
                  ],
                  "properties": {
                    "surname": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "second_name": {
                      "type": "string"
                    },
                    "access_profiles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "uuid": {
                            "type": "string"
                          },
                          "from": {
                            "type": "integer"
                          },
                          "to": {
                            "type": "integer"
                          }
                        }
                      },
                      "description": "User's access profiles list"
                    },
                    "company": {
                      "type": "string"
                    },
                    "car_number": {
                      "type": "string",
                      "pattern": "^[0-9A-Za-zАВЕКМНОРСТУХавекмнорстух]{3,9}$"
                    },
                    "phone": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "comment": {
                      "type": "string"
                    },
                    "first_access": {
                      "type": "integer",
                      "description": "First visitor access ms"
                    },
                    "last_access": {
                      "type": "integer",
                      "description": "Last visitor access ms"
                    },
                    "identifier_format": {
                      "type": "string",
                      "enum": [
                        "",
                        "qr",
                        "barcode",
                        "card"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "",
                        "WAITING",
                        "ACTIVE:INNER",
                        "ACTIVE:OUTER",
                        "BANNED",
                        "NOT-COME",
                        "ARCHIVE",
                        "VIOLATION"
                      ]
                    },
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "description": "User UUID"
                    },
                    "code": {
                      "type": "string",
                      "pattern": "(^[1-9]\\d*$)|(^$)",
                      "description": "identifier code"
                    },
                    "access_profile": {
                      "type": "string",
                      "description": "User's access profile (DEPRECATED)",
                      "deprecated": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified visitor was no found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "visitors"
        ],
        "description": "Edit visitor data",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "surname",
                  "name",
                  "uuid"
                ],
                "properties": {
                  "surname": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "second_name": {
                    "type": "string"
                  },
                  "access_profiles": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": "string"
                        },
                        "from": {
                          "type": "integer"
                        },
                        "to": {
                          "type": "integer"
                        }
                      }
                    },
                    "description": "User's access profiles list"
                  },
                  "company": {
                    "type": "string"
                  },
                  "car_number": {
                    "type": "string",
                    "pattern": "^[0-9A-Za-zАВЕКМНОРСТУХавекмнорстух]{3,9}$"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "comment": {
                    "type": "string"
                  },
                  "first_access": {
                    "type": "integer",
                    "description": "First visitor access ms"
                  },
                  "last_access": {
                    "type": "integer",
                    "description": "Last visitor access ms"
                  },
                  "identifier_format": {
                    "type": "string",
                    "enum": [
                      "",
                      "qr",
                      "barcode",
                      "card"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "",
                      "WAITING",
                      "ACTIVE:INNER",
                      "ACTIVE:OUTER",
                      "BANNED",
                      "NOT-COME",
                      "ARCHIVE",
                      "VIOLATION"
                    ]
                  },
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "description": "User UUID"
                  },
                  "code": {
                    "type": "string",
                    "pattern": "(^[1-9]\\d*$)|(^$)",
                    "description": "identifier code"
                  },
                  "access_profile": {
                    "type": "string",
                    "description": "User's access profile (DEPRECATED)",
                    "deprecated": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully edited visitor",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified visitor does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "visitors"
        ],
        "description": "Delete specified visitor",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted visitor",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified visitor does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/visitors/sort": {
      "get": {
        "tags": [
          "visitors"
        ],
        "description": "Returns sorted by column_name visitor page",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "description": "Identifiers page id to load",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "column_name",
            "description": "Sortable column",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "description": "Maximum number of cards in page",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 150
            }
          },
          {
            "in": "query",
            "name": "direction",
            "description": "Direction of sorting ASC or DESC",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned visitor page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "surname",
                      "name",
                      "uuid"
                    ],
                    "properties": {
                      "surname": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "second_name": {
                        "type": "string"
                      },
                      "access_profiles": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "uuid": {
                              "type": "string"
                            },
                            "from": {
                              "type": "integer"
                            },
                            "to": {
                              "type": "integer"
                            }
                          }
                        },
                        "description": "User's access profiles list"
                      },
                      "company": {
                        "type": "string"
                      },
                      "car_number": {
                        "type": "string",
                        "pattern": "^[0-9A-Za-zАВЕКМНОРСТУХавекмнорстух]{3,9}$"
                      },
                      "phone": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string"
                      },
                      "comment": {
                        "type": "string"
                      },
                      "first_access": {
                        "type": "integer",
                        "description": "First visitor access ms"
                      },
                      "last_access": {
                        "type": "integer",
                        "description": "Last visitor access ms"
                      },
                      "identifier_format": {
                        "type": "string",
                        "enum": [
                          "",
                          "qr",
                          "barcode",
                          "card"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "",
                          "WAITING",
                          "ACTIVE:INNER",
                          "ACTIVE:OUTER",
                          "BANNED",
                          "NOT-COME",
                          "ARCHIVE",
                          "VIOLATION"
                        ]
                      },
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "description": "User UUID"
                      },
                      "code": {
                        "type": "string",
                        "pattern": "(^[1-9]\\d*$)|(^$)",
                        "description": "identifier code"
                      },
                      "access_profile": {
                        "type": "string",
                        "description": "User's access profile (DEPRECATED)",
                        "deprecated": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/visitors/multisearch": {
      "get": {
        "tags": [
          "visitors"
        ],
        "description": "Return a filtered and sorted list of visitors",
        "parameters": [
          {
            "in": "query",
            "name": "surname",
            "description": "Visitor surname search parameter",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "name",
            "description": "Visitor name search parameter",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "description": "Maximum number of search results to be returned",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 150
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "description": "Cursor to proceed search from",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "in": "query",
            "name": "filter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Filters staff by staff properties",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              }
            },
            "required": false
          },
          {
            "in": "query",
            "name": "direction",
            "description": "Direction of sorting ASC, DESC or empty string for no sort search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "column_name",
            "description": "Sorted column",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "searchString",
            "description": "Visitor search parameter",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned list of visitor",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "visitors",
                    "cursor"
                  ],
                  "properties": {
                    "visitor": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "surname",
                          "name",
                          "uuid"
                        ],
                        "properties": {
                          "surname": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "second_name": {
                            "type": "string"
                          },
                          "access_profiles": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "uuid": {
                                  "type": "string"
                                },
                                "from": {
                                  "type": "integer"
                                },
                                "to": {
                                  "type": "integer"
                                }
                              }
                            },
                            "description": "User's access profiles list"
                          },
                          "company": {
                            "type": "string"
                          },
                          "car_number": {
                            "type": "string",
                            "pattern": "^[0-9A-Za-zАВЕКМНОРСТУХавекмнорстух]{3,9}$"
                          },
                          "phone": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "comment": {
                            "type": "string"
                          },
                          "first_access": {
                            "type": "integer",
                            "description": "First visitor access ms"
                          },
                          "last_access": {
                            "type": "integer",
                            "description": "Last visitor access ms"
                          },
                          "identifier_format": {
                            "type": "string",
                            "enum": [
                              "",
                              "qr",
                              "barcode",
                              "card"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "",
                              "WAITING",
                              "ACTIVE:INNER",
                              "ACTIVE:OUTER",
                              "BANNED",
                              "NOT-COME",
                              "ARCHIVE",
                              "VIOLATION"
                            ]
                          },
                          "uuid": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "description": "User UUID"
                          },
                          "code": {
                            "type": "string",
                            "pattern": "(^[1-9]\\d*$)|(^$)",
                            "description": "identifier code"
                          },
                          "access_profile": {
                            "type": "string",
                            "description": "User's access profile (DEPRECATED)",
                            "deprecated": true
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Overall search count"
                    },
                    "cursor": {
                      "type": "integer",
                      "description": "Cursor to proceed with search from"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/visitors_properties": {
      "get": {
        "tags": [
          "visitors"
        ],
        "description": "Returns all registered visitors properties",
        "responses": {
          "200": {
            "description": "Successfully returned registered visitors properties",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Visitor property",
                    "required": [
                      "name",
                      "display_name",
                      "type",
                      "required",
                      "show_in_search"
                    ],
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "pattern": "^(?!(?:uuid|surname|name))[\\s\\S]+"
                      },
                      "display_name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "string",
                          "integer",
                          "directory_entry"
                        ]
                      },
                      "required": {
                        "type": "boolean"
                      },
                      "value_directory": {
                        "description": "Directory name from which property values are taken. Required when property type is directory_entry",
                        "type": "string"
                      },
                      "show_in_search": {
                        "description": "Show property in staff search results",
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "visitors"
        ],
        "description": "Register new visitors properties",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "description": "Visitor property",
                  "required": [
                    "name",
                    "display_name",
                    "type",
                    "required",
                    "show_in_search"
                  ],
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "^(?!(?:uuid|surname|name))[\\s\\S]+"
                    },
                    "display_name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "string",
                        "integer",
                        "directory_entry"
                      ]
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "value_directory": {
                      "description": "Directory name from which property values are taken. Required when property type is directory_entry",
                      "type": "string"
                    },
                    "show_in_search": {
                      "description": "Show property in staff search results",
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully added new visitors property"
          }
        }
      }
    },
    "/visitors_properties/{name}": {
      "get": {
        "tags": [
          "visitors"
        ],
        "description": "Get visitors property by name",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully received property",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Visitor property",
                  "required": [
                    "name",
                    "display_name",
                    "type",
                    "required",
                    "show_in_search"
                  ],
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "^(?!(?:uuid|surname|name))[\\s\\S]+"
                    },
                    "display_name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "string",
                        "integer",
                        "directory_entry"
                      ]
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "value_directory": {
                      "description": "Directory name from which property values are taken. Required when property type is directory_entry",
                      "type": "string"
                    },
                    "show_in_search": {
                      "description": "Show property in staff search results",
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified property does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on a server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "visitors"
        ],
        "description": "Update visitors property data",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Visitor property",
                "required": [
                  "name",
                  "display_name",
                  "type",
                  "required",
                  "show_in_search"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^(?!(?:uuid|surname|name))[\\s\\S]+"
                  },
                  "display_name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "string",
                      "integer",
                      "directory_entry"
                    ]
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "value_directory": {
                    "description": "Directory name from which property values are taken. Required when property type is directory_entry",
                    "type": "string"
                  },
                  "show_in_search": {
                    "description": "Show property in staff search results",
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully updated property",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified property does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on a server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "visitors"
        ],
        "description": "Delete visitors property by name",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted property",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Specified property is default property and can't be deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified property does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on a server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/cards": {
      "get": {
        "deprecated": true,
        "tags": [
          "cards"
        ],
        "description": "Returns list of cards",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "description": "Cards page id to load",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "description": "Maximum number of cards in page",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned specified page of registered cards",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "code",
                      "privilege",
                      "disposable",
                      "expire"
                    ],
                    "properties": {
                      "code": {
                        "type": "string",
                        "minLength": 1,
                        "pattern": "^[1-9]\\d*$"
                      },
                      "privilege": {
                        "type": "integer"
                      },
                      "disposable": {
                        "type": "boolean"
                      },
                      "expire": {
                        "type": "integer",
                        "format": "int64",
                        "description": "Card expiration UNIX timestamp in milliseconds"
                      },
                      "user_uuid": {
                        "type": "string"
                      },
                      "comment": {
                        "type": "string"
                      },
                      "ext_privileges": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "SET_AP_STATE",
                            "SET_ON_GUARD",
                            "UNSET_ON_GUARD",
                            "START_AUTOMATION",
                            "CONFIRM_ACCESS",
                            "EASY_ACCESS",
                            "SKIP_ZONES_CONTROL"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "deprecated": true,
        "tags": [
          "cards"
        ],
        "description": "Add new card to system",
        "requestBody": {
          "description": "Creates new card in database",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code",
                  "privilege",
                  "disposable",
                  "expire"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^[1-9]\\d*$"
                  },
                  "privilege": {
                    "type": "integer"
                  },
                  "disposable": {
                    "type": "boolean"
                  },
                  "expire": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Card expiration UNIX timestamp in milliseconds"
                  },
                  "user_uuid": {
                    "type": "string"
                  },
                  "comment": {
                    "type": "string"
                  },
                  "ext_privileges": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "SET_AP_STATE",
                        "SET_ON_GUARD",
                        "UNSET_ON_GUARD",
                        "START_AUTOMATION",
                        "CONFIRM_ACCESS",
                        "EASY_ACCESS",
                        "SKIP_ZONES_CONTROL"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Card has been successfully added",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Card already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/cards/search": {
      "get": {
        "deprecated": true,
        "tags": [
          "cards"
        ],
        "description": "Search for cards by part of code as substring of code string",
        "parameters": [
          {
            "in": "query",
            "name": "search_query",
            "required": true,
            "description": "Card code search query",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "description": "Search results maximum page size",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "description": "Cursor to proceed search from, if skipped, starts search from beginning and calculates all results count",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "description": "Page size of violation events",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned found cards page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "page",
                    "cursor",
                    "cards"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Overall search results count, calculated only when cursor was not specified in requst"
                    },
                    "page": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 50
                    },
                    "cursor": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Next element to search from to get next search page, or 0 if search stopped"
                    },
                    "cards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "code",
                          "privilege",
                          "disposable",
                          "expire"
                        ],
                        "properties": {
                          "code": {
                            "type": "string",
                            "minLength": 1,
                            "pattern": "^[1-9]\\d*$"
                          },
                          "privilege": {
                            "type": "integer"
                          },
                          "disposable": {
                            "type": "boolean"
                          },
                          "expire": {
                            "type": "integer",
                            "format": "int64",
                            "description": "Card expiration UNIX timestamp in milliseconds"
                          },
                          "user_uuid": {
                            "type": "string"
                          },
                          "comment": {
                            "type": "string"
                          },
                          "ext_privileges": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "SET_AP_STATE",
                                "SET_ON_GUARD",
                                "UNSET_ON_GUARD",
                                "START_AUTOMATION",
                                "CONFIRM_ACCESS",
                                "EASY_ACCESS",
                                "SKIP_ZONES_CONTROL"
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/cards/count": {
      "get": {
        "deprecated": true,
        "tags": [
          "cards"
        ],
        "description": "Get cards overall count",
        "responses": {
          "200": {
            "description": "Successfully got cards overall count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/cards/ext_privileges": {
      "get": {
        "deprecated": true,
        "tags": [
          "cards"
        ],
        "description": "Get cards extended privileges description",
        "responses": {
          "200": {
            "description": "Successfully got cards ext privileges description",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "name",
                      "description"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/cards/{code}": {
      "get": {
        "deprecated": true,
        "tags": [
          "cards"
        ],
        "description": "Get specified card data",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got card with specified code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "privilege",
                    "disposable",
                    "expire"
                  ],
                  "properties": {
                    "code": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "^[1-9]\\d*$"
                    },
                    "privilege": {
                      "type": "integer"
                    },
                    "disposable": {
                      "type": "boolean"
                    },
                    "expire": {
                      "type": "integer",
                      "format": "int64",
                      "description": "Card expiration UNIX timestamp in milliseconds"
                    },
                    "user_uuid": {
                      "type": "string"
                    },
                    "comment": {
                      "type": "string"
                    },
                    "ext_privileges": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "SET_AP_STATE",
                          "SET_ON_GUARD",
                          "UNSET_ON_GUARD",
                          "START_AUTOMATION",
                          "CONFIRM_ACCESS",
                          "EASY_ACCESS",
                          "SKIP_ZONES_CONTROL"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request (card code is not valid integer)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified card does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "deprecated": true,
        "tags": [
          "cards"
        ],
        "description": "Modify specified card data",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9]\\d*$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code",
                  "privilege",
                  "disposable",
                  "expire"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^[1-9]\\d*$"
                  },
                  "privilege": {
                    "type": "integer"
                  },
                  "disposable": {
                    "type": "boolean"
                  },
                  "expire": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Card expiration UNIX timestamp in milliseconds"
                  },
                  "user_uuid": {
                    "type": "string"
                  },
                  "comment": {
                    "type": "string"
                  },
                  "ext_privileges": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "SET_AP_STATE",
                        "SET_ON_GUARD",
                        "UNSET_ON_GUARD",
                        "START_AUTOMATION",
                        "CONFIRM_ACCESS",
                        "EASY_ACCESS",
                        "SKIP_ZONES_CONTROL"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully modified card data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified card does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "deprecated": true,
        "tags": [
          "cards"
        ],
        "description": "Delete card",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9]\\d*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid card code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified card does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/identifiers": {
      "get": {
        "tags": [
          "identifiers"
        ],
        "description": "Returns list of identifiers",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "description": "Cards page id to load",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "description": "Maximum number of cards in page",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned specified page of registered cards",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "code",
                      "privilege",
                      "disposable",
                      "active_from",
                      "active_to",
                      "format"
                    ],
                    "properties": {
                      "code": {
                        "type": "string",
                        "minLength": 1,
                        "pattern": "^[1-9]\\d*$"
                      },
                      "privilege": {
                        "type": "integer"
                      },
                      "disposable": {
                        "type": "boolean"
                      },
                      "no_expire_delete": {
                        "type": "boolean"
                      },
                      "active_from": {
                        "type": "integer",
                        "format": "int64",
                        "description": "UNIX timestamp of the start of Identifier in milliseconds, if value equal 0 set timestamp as start of current day"
                      },
                      "active_to": {
                        "type": "integer",
                        "format": "int64",
                        "description": "UNIX timestamp of the end of Identifier in milliseconds, if value equal 0 set timestamp as end of current day"
                      },
                      "user_uuid": {
                        "type": "string"
                      },
                      "comment": {
                        "type": "string"
                      },
                      "format": {
                        "type": "string",
                        "description": "Identifier format",
                        "enum": [
                          "qr",
                          "barcode",
                          "card"
                        ]
                      },
                      "ext_privileges": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "SET_AP_STATE",
                            "SET_ON_GUARD",
                            "UNSET_ON_GUARD",
                            "START_AUTOMATION",
                            "CONFIRM_ACCESS",
                            "EASY_ACCESS",
                            "SKIP_ZONES_CONTROL"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "identifiers"
        ],
        "description": "Add new identifier to system",
        "requestBody": {
          "description": "Creates new identifier in database",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code",
                  "privilege",
                  "disposable",
                  "active_from",
                  "active_to",
                  "format"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^[1-9]\\d*$"
                  },
                  "privilege": {
                    "type": "integer"
                  },
                  "disposable": {
                    "type": "boolean"
                  },
                  "no_expire_delete": {
                    "type": "boolean"
                  },
                  "active_from": {
                    "type": "integer",
                    "format": "int64",
                    "description": "UNIX timestamp of the start of Identifier in milliseconds, if value equal 0 set timestamp as start of current day"
                  },
                  "active_to": {
                    "type": "integer",
                    "format": "int64",
                    "description": "UNIX timestamp of the end of Identifier in milliseconds, if value equal 0 set timestamp as end of current day"
                  },
                  "user_uuid": {
                    "type": "string"
                  },
                  "comment": {
                    "type": "string"
                  },
                  "format": {
                    "type": "string",
                    "description": "Identifier format",
                    "enum": [
                      "qr",
                      "barcode",
                      "card"
                    ]
                  },
                  "ext_privileges": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "SET_AP_STATE",
                        "SET_ON_GUARD",
                        "UNSET_ON_GUARD",
                        "START_AUTOMATION",
                        "CONFIRM_ACCESS",
                        "EASY_ACCESS",
                        "SKIP_ZONES_CONTROL"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Identifier has been successfully added",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Identifier already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/identifiers/search": {
      "get": {
        "tags": [
          "identifiers"
        ],
        "description": "Search for identifiers by part of code as substring of code string",
        "parameters": [
          {
            "in": "query",
            "name": "search_query",
            "required": true,
            "description": "Identifier code search query",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": true,
            "description": "Search results maximum page size",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "description": "Cursor to proceed search from, if skipped, starts search from beginning and calculates all results count",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned found identifiers page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "page",
                    "cursor",
                    "cards"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Overall search results count, calculated only when cursor was not specified in requst"
                    },
                    "page": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 50
                    },
                    "cursor": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Next element to search from to get next search page, or 0 if search stopped"
                    },
                    "cards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "code",
                          "privilege",
                          "disposable",
                          "expire"
                        ],
                        "properties": {
                          "code": {
                            "type": "string",
                            "minLength": 1,
                            "pattern": "^[1-9]\\d*$"
                          },
                          "privilege": {
                            "type": "integer"
                          },
                          "disposable": {
                            "type": "boolean"
                          },
                          "expire": {
                            "type": "integer",
                            "format": "int64",
                            "description": "Card expiration UNIX timestamp in milliseconds"
                          },
                          "user_uuid": {
                            "type": "string"
                          },
                          "comment": {
                            "type": "string"
                          },
                          "ext_privileges": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "SET_AP_STATE",
                                "SET_ON_GUARD",
                                "UNSET_ON_GUARD",
                                "START_AUTOMATION",
                                "CONFIRM_ACCESS",
                                "EASY_ACCESS",
                                "SKIP_ZONES_CONTROL"
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/identifiers/count": {
      "get": {
        "tags": [
          "identifiers"
        ],
        "description": "Get cards overall count",
        "responses": {
          "200": {
            "description": "Successfully got cards overall count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/identifiers/ext_privileges": {
      "get": {
        "tags": [
          "identifiers"
        ],
        "description": "Get identifiers extended privileges description",
        "responses": {
          "200": {
            "description": "Successfully got identifiers ext privileges description",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "name",
                      "description"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/identifiers/generate": {
      "get": {
        "tags": [
          "identifiers"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "format",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "qr",
                "barcode"
              ]
            }
          }
        ],
        "description": "Get random identifier code for given format",
        "responses": {
          "200": {
            "description": "Successfully got identifier random code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/identifiers/{code}": {
      "get": {
        "tags": [
          "identifiers"
        ],
        "description": "Get specified identifier data",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got identifier with specified code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code",
                    "privilege",
                    "disposable",
                    "active_from",
                    "active_to",
                    "format"
                  ],
                  "properties": {
                    "code": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "^[1-9]\\d*$"
                    },
                    "privilege": {
                      "type": "integer"
                    },
                    "disposable": {
                      "type": "boolean"
                    },
                    "no_expire_delete": {
                      "type": "boolean"
                    },
                    "active_from": {
                      "type": "integer",
                      "format": "int64",
                      "description": "UNIX timestamp of the start of Identifier in milliseconds, if value equal 0 set timestamp as start of current day"
                    },
                    "active_to": {
                      "type": "integer",
                      "format": "int64",
                      "description": "UNIX timestamp of the end of Identifier in milliseconds, if value equal 0 set timestamp as end of current day"
                    },
                    "user_uuid": {
                      "type": "string"
                    },
                    "comment": {
                      "type": "string"
                    },
                    "format": {
                      "type": "string",
                      "description": "Identifier format",
                      "enum": [
                        "qr",
                        "barcode",
                        "card"
                      ]
                    },
                    "ext_privileges": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "SET_AP_STATE",
                          "SET_ON_GUARD",
                          "UNSET_ON_GUARD",
                          "START_AUTOMATION",
                          "CONFIRM_ACCESS",
                          "EASY_ACCESS",
                          "SKIP_ZONES_CONTROL"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request (card code is not valid integer)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified identifier does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "identifiers"
        ],
        "description": "Modify specified identifier data",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9]\\d*$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code",
                  "privilege",
                  "disposable",
                  "active_from",
                  "active_to",
                  "format"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^[1-9]\\d*$"
                  },
                  "privilege": {
                    "type": "integer"
                  },
                  "disposable": {
                    "type": "boolean"
                  },
                  "no_expire_delete": {
                    "type": "boolean"
                  },
                  "active_from": {
                    "type": "integer",
                    "format": "int64",
                    "description": "UNIX timestamp of the start of Identifier in milliseconds, if value equal 0 set timestamp as start of current day"
                  },
                  "active_to": {
                    "type": "integer",
                    "format": "int64",
                    "description": "UNIX timestamp of the end of Identifier in milliseconds, if value equal 0 set timestamp as end of current day"
                  },
                  "user_uuid": {
                    "type": "string"
                  },
                  "comment": {
                    "type": "string"
                  },
                  "format": {
                    "type": "string",
                    "description": "Identifier format",
                    "enum": [
                      "qr",
                      "barcode",
                      "card"
                    ]
                  },
                  "ext_privileges": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "SET_AP_STATE",
                        "SET_ON_GUARD",
                        "UNSET_ON_GUARD",
                        "START_AUTOMATION",
                        "CONFIRM_ACCESS",
                        "EASY_ACCESS",
                        "SKIP_ZONES_CONTROL"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully modified card data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified card does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "identifiers"
        ],
        "description": "Delete identifier",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9]\\d*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted identifier",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid identifier code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified identifier does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/identifiers/sort": {
      "get": {
        "tags": [
          "identifiers"
        ],
        "description": "Returns sorted by column_name identifiers page",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "description": "Identifiers page id to load",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "column_name",
            "description": "Sortable column",
            "required": true,
            "schema": {
              "type": "string",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "description": "Maximum number of cards in page",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 150
            }
          },
          {
            "in": "query",
            "name": "direction",
            "description": "Direction of sorting ASC or DESC",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned specified page of registered cards",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "code",
                      "privilege",
                      "disposable",
                      "active_from",
                      "active_to",
                      "format"
                    ],
                    "properties": {
                      "code": {
                        "type": "string",
                        "minLength": 1,
                        "pattern": "^[1-9]\\d*$"
                      },
                      "privilege": {
                        "type": "integer"
                      },
                      "disposable": {
                        "type": "boolean"
                      },
                      "no_expire_delete": {
                        "type": "boolean"
                      },
                      "active_from": {
                        "type": "integer",
                        "format": "int64",
                        "description": "UNIX timestamp of the start of Identifier in milliseconds, if value equal 0 set timestamp as start of current day"
                      },
                      "active_to": {
                        "type": "integer",
                        "format": "int64",
                        "description": "UNIX timestamp of the end of Identifier in milliseconds, if value equal 0 set timestamp as end of current day"
                      },
                      "user_uuid": {
                        "type": "string"
                      },
                      "comment": {
                        "type": "string"
                      },
                      "format": {
                        "type": "string",
                        "description": "Identifier format",
                        "enum": [
                          "qr",
                          "barcode",
                          "card"
                        ]
                      },
                      "ext_privileges": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "SET_AP_STATE",
                            "SET_ON_GUARD",
                            "UNSET_ON_GUARD",
                            "START_AUTOMATION",
                            "CONFIRM_ACCESS",
                            "EASY_ACCESS",
                            "SKIP_ZONES_CONTROL"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/identifiers/filter/{filter}": {
      "get": {
        "tags": [
          "identifiers"
        ],
        "description": "Returns filtered items",
        "parameters": [
          {
            "in": "path",
            "name": "filter",
            "required": true,
            "description": "The filter type (e.g., 'card')",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "description": "Identifiers page id to load",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "description": "Maximum number of cards in page",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 150
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned specified page of registered cards",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "code",
                      "privilege",
                      "disposable",
                      "active_from",
                      "active_to",
                      "format"
                    ],
                    "properties": {
                      "code": {
                        "type": "string",
                        "minLength": 1,
                        "pattern": "^[1-9]\\d*$"
                      },
                      "privilege": {
                        "type": "integer"
                      },
                      "disposable": {
                        "type": "boolean"
                      },
                      "no_expire_delete": {
                        "type": "boolean"
                      },
                      "active_from": {
                        "type": "integer",
                        "format": "int64",
                        "description": "UNIX timestamp of the start of Identifier in milliseconds, if value equal 0 set timestamp as start of current day"
                      },
                      "active_to": {
                        "type": "integer",
                        "format": "int64",
                        "description": "UNIX timestamp of the end of Identifier in milliseconds, if value equal 0 set timestamp as end of current day"
                      },
                      "user_uuid": {
                        "type": "string"
                      },
                      "comment": {
                        "type": "string"
                      },
                      "format": {
                        "type": "string",
                        "description": "Identifier format",
                        "enum": [
                          "qr",
                          "barcode",
                          "card"
                        ]
                      },
                      "ext_privileges": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "SET_AP_STATE",
                            "SET_ON_GUARD",
                            "UNSET_ON_GUARD",
                            "START_AUTOMATION",
                            "CONFIRM_ACCESS",
                            "EASY_ACCESS",
                            "SKIP_ZONES_CONTROL"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/devices": {
      "get": {
        "tags": [
          "devices"
        ],
        "description": "Returns list of devices",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned list of registered devices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "controller",
                      "address",
                      "name",
                      "subdevices"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "controller": {
                        "type": "string",
                        "description": "Controller serial"
                      },
                      "address": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "vendor": {
                        "type": "string",
                        "minLength": 1
                      },
                      "access_point": {
                        "type": "string"
                      },
                      "baudrate": {
                        "type": "integer",
                        "enum": [
                          9600,
                          19200,
                          38400,
                          57600,
                          115200
                        ]
                      },
                      "subdevices": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "type",
                            "address",
                            "name",
                            "access_point"
                          ],
                          "properties": {
                            "control": {
                              "type": "boolean",
                              "description": "Line control notify"
                            },
                            "type": {
                              "type": "string",
                              "description": "Subdevice type",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "address": {
                              "type": "string",
                              "minLength": 1,
                              "description": "Subdevice address inside host device"
                            },
                            "access_point": {
                              "type": "string",
                              "description": "UUID of access point to which this subdevice attached"
                            },
                            "error_status": {
                              "type": "string"
                            },
                            "notification": {
                              "type": "string",
                              "maxLength": 36,
                              "description": "Attached user defined notification UUID"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "",
                                "0",
                                "1"
                              ]
                            },
                            "is_in_use": {
                              "type": "boolean",
                              "description": "Indicates that subdevice is used in system"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/devices/count": {
      "get": {
        "tags": [
          "devices"
        ],
        "description": "Get devices count",
        "responses": {
          "200": {
            "description": "Successfully received devices count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/devices/controllers_list": {
      "get": {
        "tags": [
          "devices"
        ],
        "description": "Returns existing devices controllers list",
        "responses": {
          "200": {
            "description": "Successfully received devices controllers list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/devices/by_controller/{controller}": {
      "get": {
        "tags": [
          "devices"
        ],
        "description": "Returns list of devices on specified controller",
        "parameters": [
          {
            "in": "path",
            "name": "controller",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully received devices on specified controller",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "controller",
                      "address",
                      "name",
                      "subdevices"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "controller": {
                        "type": "string",
                        "description": "Controller serial"
                      },
                      "address": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "vendor": {
                        "type": "string",
                        "minLength": 1
                      },
                      "access_point": {
                        "type": "string"
                      },
                      "baudrate": {
                        "type": "integer",
                        "enum": [
                          9600,
                          19200,
                          38400,
                          57600,
                          115200
                        ]
                      },
                      "subdevices": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "type",
                            "address",
                            "name",
                            "access_point"
                          ],
                          "properties": {
                            "control": {
                              "type": "boolean",
                              "description": "Line control notify"
                            },
                            "type": {
                              "type": "string",
                              "description": "Subdevice type",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "address": {
                              "type": "string",
                              "minLength": 1,
                              "description": "Subdevice address inside host device"
                            },
                            "access_point": {
                              "type": "string",
                              "description": "UUID of access point to which this subdevice attached"
                            },
                            "error_status": {
                              "type": "string"
                            },
                            "notification": {
                              "type": "string",
                              "maxLength": 36,
                              "description": "Attached user defined notification UUID"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "",
                                "0",
                                "1"
                              ]
                            },
                            "is_in_use": {
                              "type": "boolean",
                              "description": "Indicates that subdevice is used in system"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/devices/have_errors": {
      "get": {
        "tags": [
          "devices"
        ],
        "description": "Returns list of devices that have errors",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned list of devices with errors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "controller",
                      "address",
                      "name",
                      "subdevices"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "controller": {
                        "type": "string",
                        "description": "Controller serial"
                      },
                      "address": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "vendor": {
                        "type": "string",
                        "minLength": 1
                      },
                      "access_point": {
                        "type": "string"
                      },
                      "baudrate": {
                        "type": "integer",
                        "enum": [
                          9600,
                          19200,
                          38400,
                          57600,
                          115200
                        ]
                      },
                      "subdevices": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "type",
                            "address",
                            "name",
                            "access_point"
                          ],
                          "properties": {
                            "control": {
                              "type": "boolean",
                              "description": "Line control notify"
                            },
                            "type": {
                              "type": "string",
                              "description": "Subdevice type",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "address": {
                              "type": "string",
                              "minLength": 1,
                              "description": "Subdevice address inside host device"
                            },
                            "access_point": {
                              "type": "string",
                              "description": "UUID of access point to which this subdevice attached"
                            },
                            "error_status": {
                              "type": "string"
                            },
                            "notification": {
                              "type": "string",
                              "maxLength": 36,
                              "description": "Attached user defined notification UUID"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "",
                                "0",
                                "1"
                              ]
                            },
                            "is_in_use": {
                              "type": "boolean",
                              "description": "Indicates that subdevice is used in system"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/devices/have_notifications": {
      "get": {
        "tags": [
          "devices"
        ],
        "description": "Returns list of devices that have active notifications",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned list of devices active notifications",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "controller",
                      "address",
                      "name",
                      "subdevices"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "controller": {
                        "type": "string",
                        "description": "Controller serial"
                      },
                      "address": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "vendor": {
                        "type": "string",
                        "minLength": 1
                      },
                      "access_point": {
                        "type": "string"
                      },
                      "baudrate": {
                        "type": "integer",
                        "enum": [
                          9600,
                          19200,
                          38400,
                          57600,
                          115200
                        ]
                      },
                      "subdevices": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "type",
                            "address",
                            "name",
                            "access_point"
                          ],
                          "properties": {
                            "control": {
                              "type": "boolean",
                              "description": "Line control notify"
                            },
                            "type": {
                              "type": "string",
                              "description": "Subdevice type",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "address": {
                              "type": "string",
                              "minLength": 1,
                              "description": "Subdevice address inside host device"
                            },
                            "access_point": {
                              "type": "string",
                              "description": "UUID of access point to which this subdevice attached"
                            },
                            "error_status": {
                              "type": "string"
                            },
                            "notification": {
                              "type": "string",
                              "maxLength": 36,
                              "description": "Attached user defined notification UUID"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "",
                                "0",
                                "1"
                              ]
                            },
                            "is_in_use": {
                              "type": "boolean",
                              "description": "Indicates that subdevice is used in system"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/devices/find": {
      "get": {
        "tags": [
          "devices"
        ],
        "description": "Returns list of devices",
        "parameters": [
          {
            "in": "query",
            "name": "controller",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "device_address",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully found specified device",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "controller",
                    "address",
                    "name",
                    "subdevices"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "controller": {
                      "type": "string",
                      "description": "Controller serial"
                    },
                    "address": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "vendor": {
                      "type": "string",
                      "minLength": 1
                    },
                    "access_point": {
                      "type": "string"
                    },
                    "baudrate": {
                      "type": "integer",
                      "enum": [
                        9600,
                        19200,
                        38400,
                        57600,
                        115200
                      ]
                    },
                    "subdevices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "type",
                          "address",
                          "name",
                          "access_point"
                        ],
                        "properties": {
                          "control": {
                            "type": "boolean",
                            "description": "Line control notify"
                          },
                          "type": {
                            "type": "string",
                            "description": "Subdevice type",
                            "minLength": 1
                          },
                          "name": {
                            "type": "string",
                            "minLength": 1
                          },
                          "address": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Subdevice address inside host device"
                          },
                          "access_point": {
                            "type": "string",
                            "description": "UUID of access point to which this subdevice attached"
                          },
                          "error_status": {
                            "type": "string"
                          },
                          "notification": {
                            "type": "string",
                            "maxLength": 36,
                            "description": "Attached user defined notification UUID"
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "",
                              "0",
                              "1"
                            ]
                          },
                          "is_in_use": {
                            "type": "boolean",
                            "description": "Indicates that subdevice is used in system"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified device does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/devices/{uuid}": {
      "get": {
        "tags": [
          "devices"
        ],
        "description": "Get device by UUID",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned device data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "controller",
                    "address",
                    "name",
                    "subdevices"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "controller": {
                      "type": "string",
                      "description": "Controller serial"
                    },
                    "address": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "vendor": {
                      "type": "string",
                      "minLength": 1
                    },
                    "access_point": {
                      "type": "string"
                    },
                    "baudrate": {
                      "type": "integer",
                      "enum": [
                        9600,
                        19200,
                        38400,
                        57600,
                        115200
                      ]
                    },
                    "subdevices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "type",
                          "address",
                          "name",
                          "access_point"
                        ],
                        "properties": {
                          "control": {
                            "type": "boolean",
                            "description": "Line control notify"
                          },
                          "type": {
                            "type": "string",
                            "description": "Subdevice type",
                            "minLength": 1
                          },
                          "name": {
                            "type": "string",
                            "minLength": 1
                          },
                          "address": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Subdevice address inside host device"
                          },
                          "access_point": {
                            "type": "string",
                            "description": "UUID of access point to which this subdevice attached"
                          },
                          "error_status": {
                            "type": "string"
                          },
                          "notification": {
                            "type": "string",
                            "maxLength": 36,
                            "description": "Attached user defined notification UUID"
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "",
                              "0",
                              "1"
                            ]
                          },
                          "is_in_use": {
                            "type": "boolean",
                            "description": "Indicates that subdevice is used in system"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified device does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "devices"
        ],
        "description": "Modify device data",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "controller",
                  "address",
                  "name",
                  "subdevices"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "controller": {
                    "type": "string",
                    "description": "Controller serial"
                  },
                  "address": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "vendor": {
                    "type": "string",
                    "minLength": 1
                  },
                  "access_point": {
                    "type": "string"
                  },
                  "baudrate": {
                    "type": "integer",
                    "enum": [
                      9600,
                      19200,
                      38400,
                      57600,
                      115200
                    ]
                  },
                  "subdevices": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "type",
                        "address",
                        "name",
                        "access_point"
                      ],
                      "properties": {
                        "control": {
                          "type": "boolean",
                          "description": "Line control notify"
                        },
                        "type": {
                          "type": "string",
                          "description": "Subdevice type",
                          "minLength": 1
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1
                        },
                        "address": {
                          "type": "string",
                          "minLength": 1,
                          "description": "Subdevice address inside host device"
                        },
                        "access_point": {
                          "type": "string",
                          "description": "UUID of access point to which this subdevice attached"
                        },
                        "error_status": {
                          "type": "string"
                        },
                        "notification": {
                          "type": "string",
                          "maxLength": 36,
                          "description": "Attached user defined notification UUID"
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "",
                            "0",
                            "1"
                          ]
                        },
                        "is_in_use": {
                          "type": "boolean",
                          "description": "Indicates that subdevice is used in system"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully modified device",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified device does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "devices"
        ],
        "description": "Deletes device with specified UUID",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted device",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "UUID is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/devices/action": {
      "post": {
        "tags": [
          "devices"
        ],
        "description": "Simulate hardware events",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "required": [
                      "data",
                      "type"
                    ],
                    "properties": {
                      "binary_data": {
                        "type": "string"
                      },
                      "data": {
                        "type": "string"
                      },
                      "device_addr": {
                        "type": "string"
                      },
                      "subdev_addr": {
                        "type": "string"
                      },
                      "subdev_type": {
                        "type": "string"
                      },
                      "timestamp": {
                        "type": "integer"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "CARD READ",
                          "KEY PRESSED"
                        ]
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "data",
                      "type"
                    ],
                    "properties": {
                      "data": {
                        "type": "object",
                        "required": [
                          "state"
                        ],
                        "properties": {
                          "error": {
                            "type": "string"
                          },
                          "state": {
                            "type": "boolean"
                          }
                        }
                      },
                      "timestamp": {
                        "type": "integer"
                      },
                      "device_addr": {
                        "type": "string"
                      },
                      "subdev_addr": {
                        "type": "string"
                      },
                      "subdev_type": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "DISCRETE INPUT EVENT"
                        ]
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "description",
                      "type"
                    ],
                    "properties": {
                      "description": {
                        "type": "string",
                        "enum": [
                          "Output is active",
                          "Output is inactive"
                        ]
                      },
                      "device_addr": {
                        "type": "string"
                      },
                      "subdev_addr": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "OK"
                        ]
                      },
                      "timestamp": {
                        "type": "integer"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "STATUS"
                        ]
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully simulated hardware event",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/devices/monitor": {
      "get": {
        "tags": [
          "device"
        ],
        "description": "Enable devices state monitoring",
        "parameters": [
          {
            "in": "query",
            "name": "controller",
            "description": "Target controller for gets stat",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned process list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/device_search/status": {
      "get": {
        "tags": [
          "devices"
        ],
        "description": "Get current device search status",
        "responses": {
          "200": {
            "description": "Successfully returned device search status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "STARTED",
                        "STOPPED"
                      ]
                    },
                    "if1": {
                      "type": "object",
                      "required": [
                        "start_addr",
                        "stop_addr",
                        "progress"
                      ],
                      "properties": {
                        "start_addr": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 127,
                          "description": "Current search start address"
                        },
                        "stop_addr": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 127,
                          "description": "Current search stop address"
                        },
                        "progress": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 100,
                          "description": "Current search progress"
                        }
                      }
                    },
                    "if2": {
                      "type": "object",
                      "required": [
                        "start_addr",
                        "stop_addr",
                        "progress"
                      ],
                      "properties": {
                        "start_addr": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 127,
                          "description": "Current search start address"
                        },
                        "stop_addr": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 127,
                          "description": "Current search stop address"
                        },
                        "progress": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 100,
                          "description": "Current search progress"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/device_search/virtual": {
      "post": {
        "tags": [
          "add virtual access module"
        ],
        "description": "Add virtual access module",
        "responses": {
          "200": {
            "description": "Successfully started/stopped search",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Search is already in progress",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/device_search": {
      "get": {
        "tags": [
          "devices"
        ],
        "description": "Get last or current search results",
        "responses": {
          "200": {
            "description": "Successfully returned device search results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "address",
                      "vendor",
                      "subdevices"
                    ],
                    "properties": {
                      "address": {
                        "type": "string",
                        "minLength": 1
                      },
                      "vendor": {
                        "type": "string"
                      },
                      "baudrate": {
                        "type": "integer",
                        "enum": [
                          9600,
                          19200,
                          38400,
                          57600,
                          115200
                        ]
                      },
                      "subdevices": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "address",
                            "type"
                          ],
                          "properties": {
                            "address": {
                              "type": "string",
                              "minLength": 1
                            },
                            "type": {
                              "type": "string",
                              "minLength": 1
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "devices"
        ],
        "description": "Send search command",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "command"
                ],
                "properties": {
                  "command": {
                    "type": "string",
                    "enum": [
                      "START",
                      "STOP"
                    ]
                  },
                  "if1": {
                    "description": "RS485 interface 1",
                    "type": "object",
                    "required": [
                      "start_addr",
                      "stop_addr",
                      "baudrates"
                    ],
                    "properties": {
                      "baudrates": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "type": "integer",
                          "enum": [
                            9600,
                            19200,
                            38400,
                            57600,
                            115200
                          ]
                        }
                      },
                      "start_addr": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 126,
                        "description": "Device RS485 address to start device search from (inclusive)"
                      },
                      "stop_addr": {
                        "description": "Device RS485 address to stop device search at (inclusive)",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 126
                      }
                    }
                  },
                  "if2": {
                    "description": "RS485 interface 1",
                    "type": "object",
                    "required": [
                      "start_addr",
                      "stop_addr",
                      "baudrates"
                    ],
                    "properties": {
                      "baudrates": {
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "enum": [
                            9600,
                            19200,
                            38400,
                            57600,
                            115200
                          ]
                        }
                      },
                      "start_addr": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 126,
                        "description": "Device RS485 address to start device search from (inclusive)"
                      },
                      "stop_addr": {
                        "description": "Device RS485 address to stop device search at (inclusive)",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 126
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Command successfully applied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/device_search/save": {
      "post": {
        "tags": [
          "devices"
        ],
        "description": "Save device from search results to the system",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "address",
                  "uuid",
                  "name",
                  "baudrate",
                  "subdevices"
                ],
                "properties": {
                  "address": {
                    "type": "string",
                    "minLength": 1
                  },
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "baudrate": {
                    "type": "number",
                    "enum": [
                      9600,
                      19200,
                      38400,
                      57600,
                      115200
                    ]
                  },
                  "subdevices": {
                    "description": "Subdevices parameters to save",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "address",
                        "name"
                      ],
                      "properties": {
                        "address": {
                          "type": "string",
                          "minLength": 1
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully added device from search results to the system",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invaid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified device is not in search results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Device has already been added to the system",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points": {
      "get": {
        "tags": [
          "access points"
        ],
        "description": "Returns all access points in system",
        "parameters": [
          {
            "in": "query",
            "name": "alert_state",
            "description": "Returns all access points with alert state",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "failure_state",
            "description": "Returns all access points with any failure devices = failure points",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned list of access points",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "type",
                      "name",
                      "state",
                      "privilege"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "type": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "privilege": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "state": {
                        "type": "string",
                        "description": "Состояние меняется отдельным методом /access_points/{uuid}/state/{state}",
                        "deprecated": true
                      }
                    },
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/self": {
      "get": {
        "deprecated": true,
        "tags": [
          "access points"
        ],
        "description": "Возвращает список точек доступа вэб турникета контроллера на который отправлен запрос.",
        "responses": {
          "200": {
            "description": "Список точек доступа успешно возвращён",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "type",
                      "name",
                      "state",
                      "privilege"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "type": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "privilege": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "state": {
                        "type": "string",
                        "description": "Состояние меняется отдельным методом /access_points/{uuid}/state/{state}",
                        "deprecated": true
                      }
                    },
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Некорректные параметры запроса",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Произошла ошибка. Вероятно, неисправность на сервере",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/single": {
      "post": {
        "tags": [
          "access points"
        ],
        "description": "Add new single-side access point",
        "requestBody": {
          "description": "Creates new single-side access point",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "type",
                  "name",
                  "state",
                  "privilege"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "type": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "privilege": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "state": {
                    "type": "string",
                    "description": "Состояние меняется отдельным методом /access_points/{uuid}/state/{state}",
                    "deprecated": true
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Access point successfully created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Can`t update state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Access point already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/single/{uuid}": {
      "put": {
        "tags": [
          "access points"
        ],
        "description": "Modify single-side access point data",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "type",
                  "name",
                  "state",
                  "privilege"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "type": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "privilege": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "state": {
                    "type": "string",
                    "description": "Состояние меняется отдельным методом /access_points/{uuid}/state/{state}",
                    "deprecated": true
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access point successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Can`t update state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access point does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/lift": {
      "post": {
        "tags": [
          "access points"
        ],
        "description": "Add new single-side access point",
        "requestBody": {
          "description": "Creates new lift access point",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "type",
                  "name",
                  "state",
                  "privilege"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "type": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "privilege": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "state": {
                    "type": "string",
                    "description": "Состояние меняется отдельным методом /access_points/{uuid}/state/{state}",
                    "deprecated": true
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Access point successfully created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Can`t update state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Access point already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/lift/{uuid}": {
      "put": {
        "tags": [
          "access points"
        ],
        "description": "Modify lift access point data",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "type",
                  "name",
                  "state",
                  "privilege"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "type": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "privilege": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "state": {
                    "type": "string",
                    "description": "Состояние меняется отдельным методом /access_points/{uuid}/state/{state}",
                    "deprecated": true
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access point successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Can`t update state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access point does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/double": {
      "post": {
        "tags": [
          "access points"
        ],
        "description": "Add new access point",
        "requestBody": {
          "description": "Creates new double-side access point",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "type",
                  "name",
                  "state",
                  "privilege"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "type": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "privilege": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "state": {
                    "type": "string",
                    "description": "Состояние меняется отдельным методом /access_points/{uuid}/state/{state}",
                    "deprecated": true
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Access point successfully created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Can`t update state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Access point already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/double/{uuid}": {
      "put": {
        "tags": [
          "access points"
        ],
        "description": "Modify double-side access point data",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "type",
                  "name",
                  "state",
                  "privilege"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "type": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "privilege": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "state": {
                    "type": "string",
                    "description": "Состояние меняется отдельным методом /access_points/{uuid}/state/{state}",
                    "deprecated": true
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access point successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Can`t update state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access point does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/mantrap": {
      "post": {
        "tags": [
          "access points"
        ],
        "description": "Add new mantrap access point",
        "requestBody": {
          "description": "Creates new mantrap access point",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "type",
                  "name",
                  "state",
                  "privilege"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "type": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "privilege": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "state": {
                    "type": "string",
                    "description": "Состояние меняется отдельным методом /access_points/{uuid}/state/{state}",
                    "deprecated": true
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Access point successfully created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Can`t update state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Access point already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/mantrap/{uuid}": {
      "put": {
        "tags": [
          "access points"
        ],
        "description": "Modify mantrap access point data",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "type",
                  "name",
                  "state",
                  "privilege"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "type": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "privilege": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "state": {
                    "type": "string",
                    "description": "Состояние меняется отдельным методом /access_points/{uuid}/state/{state}",
                    "deprecated": true
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access point successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Can`t update state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access point does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/turnstile": {
      "post": {
        "tags": [
          "access points"
        ],
        "description": "Add new turnstile access point",
        "requestBody": {
          "description": "Creates new turnstile access point",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "type",
                  "name",
                  "state",
                  "privilege"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "type": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "privilege": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "state": {
                    "type": "string",
                    "description": "Состояние меняется отдельным методом /access_points/{uuid}/state/{state}",
                    "deprecated": true
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Access point successfully created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Can`t update state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Access point already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/turnstile/{uuid}": {
      "put": {
        "tags": [
          "access points"
        ],
        "description": "Modify turnstile access point data",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "type",
                  "name",
                  "state",
                  "privilege"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "type": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "privilege": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "state": {
                    "type": "string",
                    "description": "Состояние меняется отдельным методом /access_points/{uuid}/state/{state}",
                    "deprecated": true
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access point successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Can`t update state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access point does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/turnstile_with_card_box": {
      "post": {
        "tags": [
          "access points"
        ],
        "description": "Add new turnstile with card box access point",
        "requestBody": {
          "description": "Creates new turnstile access point",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "type",
                  "name",
                  "state",
                  "privilege"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "type": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "privilege": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "state": {
                    "type": "string",
                    "description": "Состояние меняется отдельным методом /access_points/{uuid}/state/{state}",
                    "deprecated": true
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Access point successfully created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Can`t update state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Access point already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/turnstile_with_card_box/{uuid}": {
      "put": {
        "tags": [
          "access points"
        ],
        "description": "Modify turnstile with card box access point data",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "type",
                  "name",
                  "state",
                  "privilege"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "type": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "privilege": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "state": {
                    "type": "string",
                    "description": "Состояние меняется отдельным методом /access_points/{uuid}/state/{state}",
                    "deprecated": true
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access point successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Can`t update state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access point does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/barrier": {
      "post": {
        "tags": [
          "access points"
        ],
        "description": "Add new access point",
        "requestBody": {
          "description": "Creates new barrier access point",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "type",
                  "name",
                  "state",
                  "privilege"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "type": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "privilege": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "state": {
                    "type": "string",
                    "description": "Состояние меняется отдельным методом /access_points/{uuid}/state/{state}",
                    "deprecated": true
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Access point successfully created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Can`t update state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Access point already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/barrier/{uuid}": {
      "put": {
        "tags": [
          "access points"
        ],
        "description": "Modify barrier access point data",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "type",
                  "name",
                  "state",
                  "privilege"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "type": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "privilege": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "state": {
                    "type": "string",
                    "description": "Состояние меняется отдельным методом /access_points/{uuid}/state/{state}",
                    "deprecated": true
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access point successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Can`t update state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access point does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/ext_parameters": {
      "get": {
        "deprecated": true,
        "tags": [
          "access points"
        ],
        "description": "Returns access points extended parameters description",
        "responses": {
          "200": {
            "description": "Successfuly return access points extended parameters description",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "close_timeout",
                    "remote_close_timeout",
                    "door_hold_timeout",
                    "unclosed_sound_indication_timeout",
                    "extended_open_sensor",
                    "reader_activation_sound",
                    "reader_activation_light",
                    "minimal_privilage_to_cancel_apb",
                    "out_of_schedule_access_terra",
                    "host_mode",
                    "pin_code",
                    "open_sensor_nc",
                    "barrier_up_lock_impulse",
                    "barrier_down_lock_impulse",
                    "apb_cancel_timeout",
                    "max_forbidden_attempts",
                    "disposable_forbidden_on_side_a",
                    "disposable_forbidden_on_side_b",
                    "offline_exit",
                    "offline_exit_from_side_a",
                    "duress_access_forbidden",
                    "access_multiplicity",
                    "access_multiplicity_timeout_sec",
                    "pin_code_additional_privilege"
                  ],
                  "properties": {
                    "close_timeout": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 30,
                      "description": "Access point locks close timeout in seconds"
                    },
                    "remote_close_timeout": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 30,
                      "description": "Access point locks close timeout after been opened programmatically in seconds"
                    },
                    "door_hold_timeout": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 30,
                      "description": "Access point door hold timeout in seconds"
                    },
                    "unclosed_sound_indication_timeout": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1800,
                      "description": "Timout for sound indication of unclosed door"
                    },
                    "reader_activation_sound": {
                      "type": "boolean",
                      "description": "Reader activation sound on or off"
                    },
                    "reader_activation_light": {
                      "type": "boolean",
                      "description": "Reader activation light on or off"
                    },
                    "minimal_privilage_to_cancel_apb": {
                      "type": "integer",
                      "description": "Minimum card prevelege level to cancel APB check"
                    },
                    "out_of_schedule_access_terra": {
                      "type": "string",
                      "description": "Territory to which out of schedule access allowed"
                    },
                    "host_mode": {
                      "type": "boolean",
                      "description": "Turn on/off host mode"
                    },
                    "pin_code": {
                      "type": "string",
                      "description": "Use access point pin code to verify access"
                    },
                    "open_sensor_nc": {
                      "type": "boolean",
                      "description": "Open sensor normally closed"
                    },
                    "descriptions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "name",
                          "type",
                          "value",
                          "description"
                        ],
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "string",
                              "integer",
                              "boolean"
                            ]
                          },
                          "description": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "barrier_up_lock_impulse": {
                      "type": "boolean",
                      "description": "Barrier up relay is impulse"
                    },
                    "lock_impulse_time_ms": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Lock impulse length in milliseconds"
                    },
                    "apb_cancel_timeout": {
                      "type": "integer",
                      "minimum": 1,
                      "description": "Timeout to ignore zone control rules"
                    },
                    "max_forbidden_attempts": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Maximum number of access forbidden events in a row before door block"
                    },
                    "bruteforce_block_timeout_min": {
                      "type": "integer",
                      "minimum": 1,
                      "description": "Timeout of bruteforce prevention block in minutes"
                    },
                    "disposable_forbidden_on_side_a": {
                      "type": "boolean",
                      "description": "Access with disposable card forbidden on side a"
                    },
                    "disposable_forbidden_on_side_b": {
                      "type": "boolean",
                      "description": "Access with disposable card forbidden on side b"
                    },
                    "offline_exit": {
                      "type": "boolean",
                      "description": "Allow offline exit"
                    },
                    "offline_exit_from_side_a": {
                      "type": "boolean",
                      "description": "Exit side in offline mode is a"
                    },
                    "duress_access_forbidden": {
                      "type": "boolean",
                      "description": "Do not allow access through access point under duress"
                    },
                    "access_multiplicity": {
                      "type": "integer",
                      "description": "How many people needed at one time to get access on this access point"
                    },
                    "access_multiplicity_timeout_sec": {
                      "type": "integer",
                      "description": "Maximum time to wait for next user to accomplish mulitplicity access"
                    },
                    "external_access_confirmation": {
                      "type": "string",
                      "enum": [
                        "ALWAYS",
                        "NEVER",
                        "ENOUGH_PRIVILEGE",
                        "NOT_ENOUGH_PRIVILEGE"
                      ],
                      "description": "Access must be granted by external system"
                    },
                    "external_access_confirmation_timeout_sec": {
                      "type": "integer",
                      "description": "External system access confirmation timeout in seconds"
                    },
                    "low_privilege_access_confirmation": {
                      "type": "string",
                      "enum": [
                        "ALWAYS",
                        "NEVER",
                        "ENOUGH_PRIVILEGE",
                        "NOT_ENOUGH_PRIVILEGE"
                      ],
                      "description": "Allow passage with confirmation when privilege level"
                    },
                    "confirm_access_after_external_timeout": {
                      "type": "boolean",
                      "description": "Auto confirm access after external system response timeout expired"
                    },
                    "pin_code_additional_privilege": {
                      "type": "integer",
                      "description": "Pin code additional privilege level"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/ext_parameters/sections": {
      "get": {
        "deprecated": true,
        "tags": [
          "access points"
        ],
        "description": "Returns access points extended parameters sections description",
        "responses": {
          "200": {
            "description": "Successfuly return access points extended parameters sections description",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "type": "string",
                    "enum": [
                      "Время ожидания",
                      "Считыватели",
                      "Датчики",
                      "Доступ"
                    ]
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/{uuid}/state/{state}": {
      "post": {
        "tags": [
          "access points"
        ],
        "description": "Set access point state",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            }
          },
          {
            "in": "path",
            "name": "state",
            "schema": {
              "type": "string",
              "enum": [
                "NORMAL",
                "BLOCKED",
                "BLOCKED_SIDE_A",
                "BLOCKED_SIDE_B",
                "UNBLOCKED",
                "UNBLOCKED_SIDE_A",
                "UNBLOCKED_SIDE_B",
                "GUARDED"
              ]
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully set access point state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/{uuid}": {
      "get": {
        "tags": [
          "access points"
        ],
        "description": "Get specified access point",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got access point with specified uuid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "type",
                    "name",
                    "state",
                    "privilege"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "type": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "privilege": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "state": {
                      "type": "string",
                      "description": "Состояние меняется отдельным методом /access_points/{uuid}/state/{state}",
                      "deprecated": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Specified access point does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "access points"
        ],
        "description": "Delete access point",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Access point has been successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access point does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/{uuid}/alert_state": {
      "delete": {
        "tags": [
          "access points"
        ],
        "description": "Сбросить тревожное состояние точки прохода",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Тревожное состояние точки прохода было успешно сброшено",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Точка прохода не находится в тревожном состоянии",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Точка прохода не найдена",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points/schema/{type}": {
      "get": {
        "tags": [
          "access points"
        ],
        "summary": "Get schema for access point type",
        "description": "Retrieve the schema for the given access point type.",
        "parameters": [
          {
            "in": "path",
            "name": "type",
            "description": "The type of the access point.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "single",
                "double",
                "turnstile",
                "turnstile_with_card_box",
                "lift",
                "mantrap",
                "barrier"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Returns the schema for the given access point type.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "An error occurred. The reason is in the response body.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points_automations": {
      "get": {
        "tags": [
          "access points"
        ],
        "description": "Get all access points automations",
        "responses": {
          "200": {
            "description": "Successfully received all automations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "name",
                    "access_points",
                    "access_points_state"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "access_points": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "format": "uuid"
                      }
                    },
                    "sensor": {
                      "description": "Sensor to trigger automation",
                      "type": "string"
                    },
                    "code": {
                      "type": "integer",
                      "minimum": 10,
                      "maximum": 99
                    },
                    "sensor_type": {
                      "type": "string",
                      "enum": [
                        "NC",
                        "NO"
                      ]
                    },
                    "sensor_line_control": {
                      "type": "boolean",
                      "description": "Check sensor to work properly"
                    },
                    "access_points_state": {
                      "type": "string",
                      "enum": [
                        "NORMAL",
                        "BLOCKED",
                        "BLOCKED_SIDE_A",
                        "BLOCKED_SIDE_B",
                        "UNBLOCKED_SIDE_A",
                        "UNBLOCKED_SIDE_B",
                        "UNBLOCKED",
                        "GUARDED"
                      ],
                      "description": "State to which access points will be set on automation being triggered"
                    },
                    "return_to_initial_state": {
                      "type": "boolean",
                      "description": "Return access points to initial by sensor back to normal or by timeout (if specified)"
                    },
                    "state_return_timeout_sec": {
                      "type": "integer",
                      "minimum": 5,
                      "description": "Timeout after which to return access points back to initial state"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "access points"
        ],
        "description": "Create new access points automations",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "name",
                  "access_points",
                  "access_points_state"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string"
                  },
                  "access_points": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "format": "uuid"
                    }
                  },
                  "sensor": {
                    "description": "Sensor to trigger automation",
                    "type": "string"
                  },
                  "code": {
                    "type": "integer",
                    "minimum": 10,
                    "maximum": 99
                  },
                  "sensor_type": {
                    "type": "string",
                    "enum": [
                      "NC",
                      "NO"
                    ]
                  },
                  "sensor_line_control": {
                    "type": "boolean",
                    "description": "Check sensor to work properly"
                  },
                  "access_points_state": {
                    "type": "string",
                    "enum": [
                      "NORMAL",
                      "BLOCKED",
                      "BLOCKED_SIDE_A",
                      "BLOCKED_SIDE_B",
                      "UNBLOCKED_SIDE_A",
                      "UNBLOCKED_SIDE_B",
                      "UNBLOCKED",
                      "GUARDED"
                    ],
                    "description": "State to which access points will be set on automation being triggered"
                  },
                  "return_to_initial_state": {
                    "type": "boolean",
                    "description": "Return access points to initial by sensor back to normal or by timeout (if specified)"
                  },
                  "state_return_timeout_sec": {
                    "type": "integer",
                    "minimum": 5,
                    "description": "Timeout after which to return access points back to initial state"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successfully created new automation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Can`t update state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Automation with specified UUID already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_points_automations/{uuid}": {
      "get": {
        "tags": [
          "access points"
        ],
        "description": "Get access points automation points automation by UUID",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully received automation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "name",
                    "access_points",
                    "access_points_state"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "access_points": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "format": "uuid"
                      }
                    },
                    "sensor": {
                      "description": "Sensor to trigger automation",
                      "type": "string"
                    },
                    "code": {
                      "type": "integer",
                      "minimum": 10,
                      "maximum": 99
                    },
                    "sensor_type": {
                      "type": "string",
                      "enum": [
                        "NC",
                        "NO"
                      ]
                    },
                    "sensor_line_control": {
                      "type": "boolean",
                      "description": "Check sensor to work properly"
                    },
                    "access_points_state": {
                      "type": "string",
                      "enum": [
                        "NORMAL",
                        "BLOCKED",
                        "BLOCKED_SIDE_A",
                        "BLOCKED_SIDE_B",
                        "UNBLOCKED_SIDE_A",
                        "UNBLOCKED_SIDE_B",
                        "UNBLOCKED",
                        "GUARDED"
                      ],
                      "description": "State to which access points will be set on automation being triggered"
                    },
                    "return_to_initial_state": {
                      "type": "boolean",
                      "description": "Return access points to initial by sensor back to normal or by timeout (if specified)"
                    },
                    "state_return_timeout_sec": {
                      "type": "integer",
                      "minimum": 5,
                      "description": "Timeout after which to return access points back to initial state"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified automation does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "access points"
        ],
        "description": "Update specified access points automation data",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "name",
                  "access_points",
                  "access_points_state"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string"
                  },
                  "access_points": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "format": "uuid"
                    }
                  },
                  "sensor": {
                    "description": "Sensor to trigger automation",
                    "type": "string"
                  },
                  "code": {
                    "type": "integer",
                    "minimum": 10,
                    "maximum": 99
                  },
                  "sensor_type": {
                    "type": "string",
                    "enum": [
                      "NC",
                      "NO"
                    ]
                  },
                  "sensor_line_control": {
                    "type": "boolean",
                    "description": "Check sensor to work properly"
                  },
                  "access_points_state": {
                    "type": "string",
                    "enum": [
                      "NORMAL",
                      "BLOCKED",
                      "BLOCKED_SIDE_A",
                      "BLOCKED_SIDE_B",
                      "UNBLOCKED_SIDE_A",
                      "UNBLOCKED_SIDE_B",
                      "UNBLOCKED",
                      "GUARDED"
                    ],
                    "description": "State to which access points will be set on automation being triggered"
                  },
                  "return_to_initial_state": {
                    "type": "boolean",
                    "description": "Return access points to initial by sensor back to normal or by timeout (if specified)"
                  },
                  "state_return_timeout_sec": {
                    "type": "integer",
                    "minimum": 5,
                    "description": "Timeout after which to return access points back to initial state"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated automation data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "name",
                    "access_points",
                    "access_points_state"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "access_points": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "format": "uuid"
                      }
                    },
                    "sensor": {
                      "description": "Sensor to trigger automation",
                      "type": "string"
                    },
                    "code": {
                      "type": "integer",
                      "minimum": 10,
                      "maximum": 99
                    },
                    "sensor_type": {
                      "type": "string",
                      "enum": [
                        "NC",
                        "NO"
                      ]
                    },
                    "sensor_line_control": {
                      "type": "boolean",
                      "description": "Check sensor to work properly"
                    },
                    "access_points_state": {
                      "type": "string",
                      "enum": [
                        "NORMAL",
                        "BLOCKED",
                        "BLOCKED_SIDE_A",
                        "BLOCKED_SIDE_B",
                        "UNBLOCKED_SIDE_A",
                        "UNBLOCKED_SIDE_B",
                        "UNBLOCKED",
                        "GUARDED"
                      ],
                      "description": "State to which access points will be set on automation being triggered"
                    },
                    "return_to_initial_state": {
                      "type": "boolean",
                      "description": "Return access points to initial by sensor back to normal or by timeout (if specified)"
                    },
                    "state_return_timeout_sec": {
                      "type": "integer",
                      "minimum": 5,
                      "description": "Timeout after which to return access points back to initial state"
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Can`t update state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified automation does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "access points"
        ],
        "description": "Delete specified access points automation",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted specified automation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "name",
                    "access_points",
                    "access_points_state"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "access_points": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "format": "uuid"
                      }
                    },
                    "sensor": {
                      "description": "Sensor to trigger automation",
                      "type": "string"
                    },
                    "code": {
                      "type": "integer",
                      "minimum": 10,
                      "maximum": 99
                    },
                    "sensor_type": {
                      "type": "string",
                      "enum": [
                        "NC",
                        "NO"
                      ]
                    },
                    "sensor_line_control": {
                      "type": "boolean",
                      "description": "Check sensor to work properly"
                    },
                    "access_points_state": {
                      "type": "string",
                      "enum": [
                        "NORMAL",
                        "BLOCKED",
                        "BLOCKED_SIDE_A",
                        "BLOCKED_SIDE_B",
                        "UNBLOCKED_SIDE_A",
                        "UNBLOCKED_SIDE_B",
                        "UNBLOCKED",
                        "GUARDED"
                      ],
                      "description": "State to which access points will be set on automation being triggered"
                    },
                    "return_to_initial_state": {
                      "type": "boolean",
                      "description": "Return access points to initial by sensor back to normal or by timeout (if specified)"
                    },
                    "state_return_timeout_sec": {
                      "type": "integer",
                      "minimum": 5,
                      "description": "Timeout after which to return access points back to initial state"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified automation does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_profiles": {
      "get": {
        "tags": [
          "access profiles"
        ],
        "description": "Returns all access profiles",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successfully got all access profiles",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "name",
                      "access_points"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "access_points": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "uuid",
                            "schedule_uuid"
                          ],
                          "properties": {
                            "uuid": {
                              "type": "string",
                              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                            },
                            "schedule_uuid": {
                              "type": "string",
                              "pattern": "^(|[Dd][Ii][Ff]{2}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
                              "description": "- \"\" (пустая строка) - круглосуточный доступ\n- \"diff\" - разные стороны\n- UUID - расписание\n"
                            },
                            "floors": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "string"
                              }
                            },
                            "sides": {
                              "type": "object",
                              "additionalProperties": {
                                "oneOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      ""
                                    ],
                                    "description": "Пустая строка для круглосуточного доступа"
                                  },
                                  {
                                    "type": "string",
                                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                                  }
                                ]
                              },
                              "example": {
                                "side_a_terra": "",
                                "side_b_terra": "d16cb3d0-efb0-11f0-9785-31d5a85912ab"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "access profiles"
        ],
        "description": "Add new access profile",
        "requestBody": {
          "description": "New access profile properties",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "name",
                  "access_points"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "access_points": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "uuid",
                        "schedule_uuid"
                      ],
                      "properties": {
                        "uuid": {
                          "type": "string",
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                        },
                        "schedule_uuid": {
                          "type": "string",
                          "pattern": "^(|[Dd][Ii][Ff]{2}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
                          "description": "- \"\" (пустая строка) - круглосуточный доступ\n- \"diff\" - разные стороны\n- UUID - расписание\n"
                        },
                        "floors": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "sides": {
                          "type": "object",
                          "additionalProperties": {
                            "oneOf": [
                              {
                                "type": "string",
                                "enum": [
                                  ""
                                ],
                                "description": "Пустая строка для круглосуточного доступа"
                              },
                              {
                                "type": "string",
                                "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                              }
                            ]
                          },
                          "example": {
                            "side_a_terra": "",
                            "side_b_terra": "d16cb3d0-efb0-11f0-9785-31d5a85912ab"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successfully created new access profile"
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Access profile already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_profiles/{uuid}": {
      "get": {
        "tags": [
          "access profiles"
        ],
        "description": "Get specified access profile",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Got specified access profile",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "name",
                    "access_points"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "access_points": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "uuid",
                          "schedule_uuid"
                        ],
                        "properties": {
                          "uuid": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                          },
                          "schedule_uuid": {
                            "type": "string",
                            "pattern": "^(|[Dd][Ii][Ff]{2}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
                            "description": "- \"\" (пустая строка) - круглосуточный доступ\n- \"diff\" - разные стороны\n- UUID - расписание\n"
                          },
                          "floors": {
                            "type": "object",
                            "additionalProperties": {
                              "type": "string"
                            }
                          },
                          "sides": {
                            "type": "object",
                            "additionalProperties": {
                              "oneOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    ""
                                  ],
                                  "description": "Пустая строка для круглосуточного доступа"
                                },
                                {
                                  "type": "string",
                                  "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                                }
                              ]
                            },
                            "example": {
                              "side_a_terra": "",
                              "side_b_terra": "d16cb3d0-efb0-11f0-9785-31d5a85912ab"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access profile was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "access profiles"
        ],
        "description": "Modify access profile",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "name",
                  "access_points"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "access_points": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "uuid",
                        "schedule_uuid"
                      ],
                      "properties": {
                        "uuid": {
                          "type": "string",
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                        },
                        "schedule_uuid": {
                          "type": "string",
                          "pattern": "^(|[Dd][Ii][Ff]{2}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
                          "description": "- \"\" (пустая строка) - круглосуточный доступ\n- \"diff\" - разные стороны\n- UUID - расписание\n"
                        },
                        "floors": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "sides": {
                          "type": "object",
                          "additionalProperties": {
                            "oneOf": [
                              {
                                "type": "string",
                                "enum": [
                                  ""
                                ],
                                "description": "Пустая строка для круглосуточного доступа"
                              },
                              {
                                "type": "string",
                                "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                              }
                            ]
                          },
                          "example": {
                            "side_a_terra": "",
                            "side_b_terra": "d16cb3d0-efb0-11f0-9785-31d5a85912ab"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access profile successfully modified",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access profile does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "access profiles"
        ],
        "description": "Delete access profile",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Access profile successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access profile does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/schedules": {
      "get": {
        "tags": [
          "schedules"
        ],
        "description": "Returns all existing schedules",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successfully returned all existing schedules",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "name",
                      "calendars",
                      "access_intervals"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "calendars": {
                        "type": "array",
                        "minItems": 3,
                        "maxItems": 3,
                        "items": {
                          "type": "object",
                          "minItems": 3,
                          "maxItems": 3,
                          "required": [
                            "year",
                            "calendar"
                          ],
                          "properties": {
                            "year": {
                              "type": "integer",
                              "minimum": 2016
                            },
                            "calendar": {
                              "type": "object",
                              "minProperties": 365,
                              "maxProperties": 366,
                              "description": "Describes which dates are workdays or holidays in format: { '12.3': '1', '1.11': '0' }"
                            }
                          }
                        }
                      },
                      "access_intervals": {
                        "description": "Access intervals for different day types: 0 - holiday, 1 - workday, 2 - half-holiday, 3 - special day",
                        "type": "object",
                        "required": [
                          "0",
                          "1",
                          "2",
                          "3"
                        ],
                        "properties": {
                          "0": {
                            "description": "holiday",
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "from",
                                "to"
                              ],
                              "properties": {
                                "from": {
                                  "description": "Time from access is available",
                                  "type": "string",
                                  "minLength": 4,
                                  "maxLength": 5
                                },
                                "to": {
                                  "description": "Time till access is available",
                                  "type": "string",
                                  "minLength": 4,
                                  "maxLength": 5
                                }
                              }
                            }
                          },
                          "1": {
                            "description": "workday",
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "from",
                                "to"
                              ],
                              "properties": {
                                "from": {
                                  "description": "Time from access is available",
                                  "type": "string",
                                  "minLength": 4,
                                  "maxLength": 5
                                },
                                "to": {
                                  "description": "Time till access is available",
                                  "type": "string",
                                  "minLength": 4,
                                  "maxLength": 5
                                }
                              }
                            }
                          },
                          "2": {
                            "description": "half-holiday",
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "from",
                                "to"
                              ],
                              "properties": {
                                "from": {
                                  "description": "Time from access is available",
                                  "type": "string",
                                  "minLength": 4,
                                  "maxLength": 5
                                },
                                "to": {
                                  "description": "Time till access is available",
                                  "type": "string",
                                  "minLength": 4,
                                  "maxLength": 5
                                }
                              }
                            }
                          },
                          "3": {
                            "description": "user-defined",
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "from",
                                "to"
                              ],
                              "properties": {
                                "from": {
                                  "description": "Time from access is available",
                                  "type": "string",
                                  "minLength": 4,
                                  "maxLength": 5
                                },
                                "to": {
                                  "description": "Time till access is available",
                                  "type": "string",
                                  "minLength": 4,
                                  "maxLength": 5
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "schedules"
        ],
        "description": "Creates new schedule on server",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "name",
                  "calendars",
                  "access_intervals"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "calendars": {
                    "type": "array",
                    "minItems": 3,
                    "maxItems": 3,
                    "items": {
                      "type": "object",
                      "minItems": 3,
                      "maxItems": 3,
                      "required": [
                        "year",
                        "calendar"
                      ],
                      "properties": {
                        "year": {
                          "type": "integer",
                          "minimum": 2016
                        },
                        "calendar": {
                          "type": "object",
                          "minProperties": 365,
                          "maxProperties": 366,
                          "description": "Describes which dates are workdays or holidays in format: { '12.3': '1', '1.11': '0' }"
                        }
                      }
                    }
                  },
                  "access_intervals": {
                    "description": "Access intervals for different day types: 0 - holiday, 1 - workday, 2 - half-holiday, 3 - special day",
                    "type": "object",
                    "required": [
                      "0",
                      "1",
                      "2",
                      "3"
                    ],
                    "properties": {
                      "0": {
                        "description": "holiday",
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "from",
                            "to"
                          ],
                          "properties": {
                            "from": {
                              "description": "Time from access is available",
                              "type": "string",
                              "minLength": 4,
                              "maxLength": 5
                            },
                            "to": {
                              "description": "Time till access is available",
                              "type": "string",
                              "minLength": 4,
                              "maxLength": 5
                            }
                          }
                        }
                      },
                      "1": {
                        "description": "workday",
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "from",
                            "to"
                          ],
                          "properties": {
                            "from": {
                              "description": "Time from access is available",
                              "type": "string",
                              "minLength": 4,
                              "maxLength": 5
                            },
                            "to": {
                              "description": "Time till access is available",
                              "type": "string",
                              "minLength": 4,
                              "maxLength": 5
                            }
                          }
                        }
                      },
                      "2": {
                        "description": "half-holiday",
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "from",
                            "to"
                          ],
                          "properties": {
                            "from": {
                              "description": "Time from access is available",
                              "type": "string",
                              "minLength": 4,
                              "maxLength": 5
                            },
                            "to": {
                              "description": "Time till access is available",
                              "type": "string",
                              "minLength": 4,
                              "maxLength": 5
                            }
                          }
                        }
                      },
                      "3": {
                        "description": "user-defined",
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "from",
                            "to"
                          ],
                          "properties": {
                            "from": {
                              "description": "Time from access is available",
                              "type": "string",
                              "minLength": 4,
                              "maxLength": 5
                            },
                            "to": {
                              "description": "Time till access is available",
                              "type": "string",
                              "minLength": 4,
                              "maxLength": 5
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully created new schedule",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/schedules/{uuid}": {
      "get": {
        "tags": [
          "schedules"
        ],
        "description": "Returns schedule with specified UUID",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns schedule with specified UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "name",
                    "calendars",
                    "access_intervals"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "calendars": {
                      "type": "array",
                      "minItems": 3,
                      "maxItems": 3,
                      "items": {
                        "type": "object",
                        "minItems": 3,
                        "maxItems": 3,
                        "required": [
                          "year",
                          "calendar"
                        ],
                        "properties": {
                          "year": {
                            "type": "integer",
                            "minimum": 2016
                          },
                          "calendar": {
                            "type": "object",
                            "minProperties": 365,
                            "maxProperties": 366,
                            "description": "Describes which dates are workdays or holidays in format: { '12.3': '1', '1.11': '0' }"
                          }
                        }
                      }
                    },
                    "access_intervals": {
                      "description": "Access intervals for different day types: 0 - holiday, 1 - workday, 2 - half-holiday, 3 - special day",
                      "type": "object",
                      "required": [
                        "0",
                        "1",
                        "2",
                        "3"
                      ],
                      "properties": {
                        "0": {
                          "description": "holiday",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "from",
                              "to"
                            ],
                            "properties": {
                              "from": {
                                "description": "Time from access is available",
                                "type": "string",
                                "minLength": 4,
                                "maxLength": 5
                              },
                              "to": {
                                "description": "Time till access is available",
                                "type": "string",
                                "minLength": 4,
                                "maxLength": 5
                              }
                            }
                          }
                        },
                        "1": {
                          "description": "workday",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "from",
                              "to"
                            ],
                            "properties": {
                              "from": {
                                "description": "Time from access is available",
                                "type": "string",
                                "minLength": 4,
                                "maxLength": 5
                              },
                              "to": {
                                "description": "Time till access is available",
                                "type": "string",
                                "minLength": 4,
                                "maxLength": 5
                              }
                            }
                          }
                        },
                        "2": {
                          "description": "half-holiday",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "from",
                              "to"
                            ],
                            "properties": {
                              "from": {
                                "description": "Time from access is available",
                                "type": "string",
                                "minLength": 4,
                                "maxLength": 5
                              },
                              "to": {
                                "description": "Time till access is available",
                                "type": "string",
                                "minLength": 4,
                                "maxLength": 5
                              }
                            }
                          }
                        },
                        "3": {
                          "description": "user-defined",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "from",
                              "to"
                            ],
                            "properties": {
                              "from": {
                                "description": "Time from access is available",
                                "type": "string",
                                "minLength": 4,
                                "maxLength": 5
                              },
                              "to": {
                                "description": "Time till access is available",
                                "type": "string",
                                "minLength": 4,
                                "maxLength": 5
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Specified UUID is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified schedule does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "schedules"
        ],
        "description": "Updates schedule data",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "name",
                  "calendars",
                  "access_intervals"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "calendars": {
                    "type": "array",
                    "minItems": 3,
                    "maxItems": 3,
                    "items": {
                      "type": "object",
                      "minItems": 3,
                      "maxItems": 3,
                      "required": [
                        "year",
                        "calendar"
                      ],
                      "properties": {
                        "year": {
                          "type": "integer",
                          "minimum": 2016
                        },
                        "calendar": {
                          "type": "object",
                          "minProperties": 365,
                          "maxProperties": 366,
                          "description": "Describes which dates are workdays or holidays in format: { '12.3': '1', '1.11': '0' }"
                        }
                      }
                    }
                  },
                  "access_intervals": {
                    "description": "Access intervals for different day types: 0 - holiday, 1 - workday, 2 - half-holiday, 3 - special day",
                    "type": "object",
                    "required": [
                      "0",
                      "1",
                      "2",
                      "3"
                    ],
                    "properties": {
                      "0": {
                        "description": "holiday",
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "from",
                            "to"
                          ],
                          "properties": {
                            "from": {
                              "description": "Time from access is available",
                              "type": "string",
                              "minLength": 4,
                              "maxLength": 5
                            },
                            "to": {
                              "description": "Time till access is available",
                              "type": "string",
                              "minLength": 4,
                              "maxLength": 5
                            }
                          }
                        }
                      },
                      "1": {
                        "description": "workday",
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "from",
                            "to"
                          ],
                          "properties": {
                            "from": {
                              "description": "Time from access is available",
                              "type": "string",
                              "minLength": 4,
                              "maxLength": 5
                            },
                            "to": {
                              "description": "Time till access is available",
                              "type": "string",
                              "minLength": 4,
                              "maxLength": 5
                            }
                          }
                        }
                      },
                      "2": {
                        "description": "half-holiday",
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "from",
                            "to"
                          ],
                          "properties": {
                            "from": {
                              "description": "Time from access is available",
                              "type": "string",
                              "minLength": 4,
                              "maxLength": 5
                            },
                            "to": {
                              "description": "Time till access is available",
                              "type": "string",
                              "minLength": 4,
                              "maxLength": 5
                            }
                          }
                        }
                      },
                      "3": {
                        "description": "user-defined",
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "from",
                            "to"
                          ],
                          "properties": {
                            "from": {
                              "description": "Time from access is available",
                              "type": "string",
                              "minLength": 4,
                              "maxLength": 5
                            },
                            "to": {
                              "description": "Time till access is available",
                              "type": "string",
                              "minLength": 4,
                              "maxLength": 5
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Specified UUID is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified schedule does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "schedules"
        ],
        "description": "Delete specified schedule",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Delete succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Specified UUID is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified schedule does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/audit_events": {
      "get": {
        "tags": [
          "events"
        ],
        "description": "Return audit events in specified interval sorted by timestamp in reverse order",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": true,
            "description": "UTC UNIX timestamp in milliseconds to get events happened since (inclusive)",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "description": "UTC UNIX timestamp in milliseconds to get events happened before (inclusive)",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": true,
            "description": "Returned events max number",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "description": "Search results cursor",
            "schema": {
              "type": "string",
              "nullable": true,
              "default": ""
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned events happened in specified time period",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "events",
                    "cursor"
                  ],
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "uuid",
                          "type",
                          "reason",
                          "object_type",
                          "object_id",
                          "object_name",
                          "author_id",
                          "author_name"
                        ],
                        "properties": {
                          "uuid": {
                            "type": "string",
                            "description": "Audit event id",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                          },
                          "timestamp": {
                            "type": "integer",
                            "format": "int64",
                            "description": "Event UNIX timestamp in milliseconds"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "DATA",
                              "ACCESS",
                              "EXECUTE_TOKEN",
                              "EXTERNAL"
                            ],
                            "description": "Тип события (полный список типов и причин доступен по get запросу /audit_events/types):\n  *`DATA` - Тип для работы с данными\n  *`ACCESS` - Права доступа объекта\n  *`EXECUTE_TOKEN` - Тип для входа в систему\n"
                          },
                          "reason": {
                            "type": "string",
                            "enum": [
                              "CREATE",
                              "MODIFY_DATA",
                              "MODIFY_TOKEN",
                              "DELETE",
                              "EXECUTE_TOKEN_ACCEPTED",
                              "EXECUTE_TOKEN_REJECTED",
                              "INTERNAL_MODIFY_DATA",
                              "INTERNAL_MODIFY_TOKEN",
                              "GUARDING_REJECTED",
                              "CLEAR_CONFIG",
                              "EXTERNAL_ACCESS"
                            ],
                            "description": "Причина события (полный список типов и причин доступен по get запросу /audit_events/types):\n  *`CREATE` - Объект создан\n  *`DELETE` - Объект удалён\n  *`MODIFY_DATA` - Данные объекта изменены пользователем\n  *`MODIFY_TOKEN` - Права доступа объекта изменены пользователем\n  *`INTERNAL_MODIFY_DATA` - Данные объекта изменены системой\n  *`INTERNAL_MODIFY_TOKEN` - Права доступа объекта изменены системой\n  *`EXECUTE_TOKEN_ACCEPTED` - Пользователь успешно вошёл в систему\n  *`EXECUTE_TOKEN_REJECTED` - Неудачная попытка входа в систему\n"
                          },
                          "object_type": {
                            "type": "string",
                            "minLength": 1
                          },
                          "object_id": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Object on which event was triggered"
                          },
                          "object_name": {
                            "type": "string",
                            "minLength": 1
                          },
                          "author_id": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Author of event"
                          },
                          "author_name": {
                            "type": "string",
                            "minLength": 1
                          }
                        }
                      }
                    },
                    "cursor": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad search parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/audit_events/types": {
      "get": {
        "tags": [
          "events"
        ],
        "description": "Get available events types list",
        "responses": {
          "200": {
            "description": "Successfully got events types",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "type",
                      "reason",
                      "description"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Event type"
                      },
                      "reason": {
                        "type": "string",
                        "description": "Event reason"
                      },
                      "description": {
                        "type": "string",
                        "description": "Event short description"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/audit_events/count": {
      "get": {
        "tags": [
          "events"
        ],
        "description": "Return events count in specified interval",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": true,
            "description": "UTC UNIX timestamp in milliseconds to get events happened since (inclusive)",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "description": "UTC UNIX timestamp in milliseconds to get events happened before (inclusive)",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "user_type",
            "in": "query",
            "required": false,
            "description": "Type of user visitor or staff",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned events count in specified time period",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad search parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/audit_events/{uuid}": {
      "get": {
        "tags": [
          "events"
        ],
        "description": "Returns audit event with specified UUID",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Audit event uuid"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got event with specified UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "type",
                    "reason",
                    "object_type",
                    "object_id",
                    "object_name",
                    "author_id",
                    "author_name"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "description": "Audit event id",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "timestamp": {
                      "type": "integer",
                      "format": "int64",
                      "description": "Event UNIX timestamp in milliseconds"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "DATA",
                        "ACCESS",
                        "EXECUTE_TOKEN",
                        "EXTERNAL"
                      ],
                      "description": "Тип события (полный список типов и причин доступен по get запросу /audit_events/types):\n  *`DATA` - Тип для работы с данными\n  *`ACCESS` - Права доступа объекта\n  *`EXECUTE_TOKEN` - Тип для входа в систему\n"
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "CREATE",
                        "MODIFY_DATA",
                        "MODIFY_TOKEN",
                        "DELETE",
                        "EXECUTE_TOKEN_ACCEPTED",
                        "EXECUTE_TOKEN_REJECTED",
                        "INTERNAL_MODIFY_DATA",
                        "INTERNAL_MODIFY_TOKEN",
                        "GUARDING_REJECTED",
                        "CLEAR_CONFIG",
                        "EXTERNAL_ACCESS"
                      ],
                      "description": "Причина события (полный список типов и причин доступен по get запросу /audit_events/types):\n  *`CREATE` - Объект создан\n  *`DELETE` - Объект удалён\n  *`MODIFY_DATA` - Данные объекта изменены пользователем\n  *`MODIFY_TOKEN` - Права доступа объекта изменены пользователем\n  *`INTERNAL_MODIFY_DATA` - Данные объекта изменены системой\n  *`INTERNAL_MODIFY_TOKEN` - Права доступа объекта изменены системой\n  *`EXECUTE_TOKEN_ACCEPTED` - Пользователь успешно вошёл в систему\n  *`EXECUTE_TOKEN_REJECTED` - Неудачная попытка входа в систему\n"
                    },
                    "object_type": {
                      "type": "string",
                      "minLength": 1
                    },
                    "object_id": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Object on which event was triggered"
                    },
                    "object_name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "author_id": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Author of event"
                    },
                    "author_name": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified event was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/audit_events/user_defined/{uuid}": {
      "put": {
        "tags": [
          "events"
        ],
        "description": "Update specified user defined audit data",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "timestamp",
                  "type",
                  "reason",
                  "object_type",
                  "object_id",
                  "object_name",
                  "author_id",
                  "author_name"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "Audit event id",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "timestamp": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Event UNIX timestamp in milliseconds"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "DATA",
                      "ACCESS",
                      "EXECUTE_TOKEN",
                      "EXTERNAL"
                    ],
                    "description": "Тип события (полный список типов и причин доступен по get запросу /audit_events/types):\n  *`DATA` - Тип для работы с данными\n  *`ACCESS` - Права доступа объекта\n  *`EXECUTE_TOKEN` - Тип для входа в систему\n"
                  },
                  "reason": {
                    "type": "string",
                    "enum": [
                      "CREATE",
                      "MODIFY_DATA",
                      "MODIFY_TOKEN",
                      "DELETE",
                      "EXECUTE_TOKEN_ACCEPTED",
                      "EXECUTE_TOKEN_REJECTED",
                      "INTERNAL_MODIFY_DATA",
                      "INTERNAL_MODIFY_TOKEN",
                      "GUARDING_REJECTED",
                      "CLEAR_CONFIG",
                      "EXTERNAL_ACCESS"
                    ],
                    "description": "Причина события (полный список типов и причин доступен по get запросу /audit_events/types):\n  *`CREATE` - Объект создан\n  *`DELETE` - Объект удалён\n  *`MODIFY_DATA` - Данные объекта изменены пользователем\n  *`MODIFY_TOKEN` - Права доступа объекта изменены пользователем\n  *`INTERNAL_MODIFY_DATA` - Данные объекта изменены системой\n  *`INTERNAL_MODIFY_TOKEN` - Права доступа объекта изменены системой\n  *`EXECUTE_TOKEN_ACCEPTED` - Пользователь успешно вошёл в систему\n  *`EXECUTE_TOKEN_REJECTED` - Неудачная попытка входа в систему\n"
                  },
                  "object_type": {
                    "type": "string",
                    "minLength": 1
                  },
                  "object_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Object on which event was triggered"
                  },
                  "object_name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "author_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Author of event"
                  },
                  "author_name": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully update user defined audit data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified user defined audit does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "events"
        ],
        "description": "Delete specified user defined audit",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted user defined audit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified user defined audit does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/audit_events/user_defined": {
      "post": {
        "tags": [
          "events"
        ],
        "description": "Add new user defined audit",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "timestamp",
                  "type",
                  "reason",
                  "object_type",
                  "object_id",
                  "object_name",
                  "author_id",
                  "author_name"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "Audit event id",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "timestamp": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Event UNIX timestamp in milliseconds"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "DATA",
                      "ACCESS",
                      "EXECUTE_TOKEN",
                      "EXTERNAL"
                    ],
                    "description": "Тип события (полный список типов и причин доступен по get запросу /audit_events/types):\n  *`DATA` - Тип для работы с данными\n  *`ACCESS` - Права доступа объекта\n  *`EXECUTE_TOKEN` - Тип для входа в систему\n"
                  },
                  "reason": {
                    "type": "string",
                    "enum": [
                      "CREATE",
                      "MODIFY_DATA",
                      "MODIFY_TOKEN",
                      "DELETE",
                      "EXECUTE_TOKEN_ACCEPTED",
                      "EXECUTE_TOKEN_REJECTED",
                      "INTERNAL_MODIFY_DATA",
                      "INTERNAL_MODIFY_TOKEN",
                      "GUARDING_REJECTED",
                      "CLEAR_CONFIG",
                      "EXTERNAL_ACCESS"
                    ],
                    "description": "Причина события (полный список типов и причин доступен по get запросу /audit_events/types):\n  *`CREATE` - Объект создан\n  *`DELETE` - Объект удалён\n  *`MODIFY_DATA` - Данные объекта изменены пользователем\n  *`MODIFY_TOKEN` - Права доступа объекта изменены пользователем\n  *`INTERNAL_MODIFY_DATA` - Данные объекта изменены системой\n  *`INTERNAL_MODIFY_TOKEN` - Права доступа объекта изменены системой\n  *`EXECUTE_TOKEN_ACCEPTED` - Пользователь успешно вошёл в систему\n  *`EXECUTE_TOKEN_REJECTED` - Неудачная попытка входа в систему\n"
                  },
                  "object_type": {
                    "type": "string",
                    "minLength": 1
                  },
                  "object_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Object on which event was triggered"
                  },
                  "object_name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "author_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Author of event"
                  },
                  "author_name": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successfully created new user defined audit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "audit with specified UUID already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_events": {
      "get": {
        "tags": [
          "events"
        ],
        "description": "Return access events in specified interval sorted by timestamp in reverse order",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": true,
            "description": "UTC UNIX timestamp in milliseconds to get events happened since (inclusive)",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "description": "UTC UNIX timestamp in milliseconds to get events happened before (inclusive)",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": true,
            "description": "Returned events max number",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "description": "Search results cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned events happened in specified time period",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "events",
                    "cursor"
                  ],
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "uuid",
                          "timestamp",
                          "type",
                          "reason",
                          "user_type",
                          "user_uuid",
                          "user_name",
                          "user_terra",
                          "card_code",
                          "access_point_uuid",
                          "access_point_name",
                          "access_point_privilege",
                          "from",
                          "to",
                          "from_side",
                          "tz_offset"
                        ],
                        "properties": {
                          "uuid": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                          },
                          "timestamp": {
                            "type": "integer",
                            "format": "int64",
                            "description": "Event UNIX timestamp in milliseconds"
                          },
                          "type": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Access event type"
                          },
                          "reason": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Access event type reason"
                          },
                          "user_uuid": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "description": "User UUID - who tried to pass some access point"
                          },
                          "user_name": {
                            "type": "string",
                            "minLength": 3,
                            "description": "User \\<surname>\\<name>\\<second_name>"
                          },
                          "user_terra": {
                            "type": "string",
                            "description": "User zone when event occured"
                          },
                          "card_code": {
                            "type": "string",
                            "description": "User card code"
                          },
                          "access_point_uuid": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                          },
                          "access_point_name": {
                            "type": "string",
                            "minLength": 1
                          },
                          "from": {
                            "type": "string",
                            "description": "Name of the territory from which transition occurred"
                          },
                          "to": {
                            "type": "string",
                            "description": "Name of the territory to which transition occurred"
                          },
                          "from_side": {
                            "type": "string",
                            "enum": [
                              "a",
                              "b"
                            ],
                            "description": "Side from which access occured"
                          },
                          "tz_offset": {
                            "type": "integer",
                            "description": "Event time zone offset in minutes"
                          },
                          "car_number": {
                            "type": "string",
                            "description": "User car number from licence plates recognition analytics from ONVIF device"
                          },
                          "pin": {
                            "type": "string",
                            "enum": [
                              "ACCEPTED",
                              "REJECTED",
                              "DURESS"
                            ],
                            "description": "If present, indicates that pin code was eneterd while access"
                          },
                          "request_ts": {
                            "type": "integer",
                            "format": "int64",
                            "description": "Access request UNIX timestamp in milliseconds"
                          },
                          "response_ts": {
                            "type": "integer",
                            "format": "int64",
                            "description": "Access response UNIX timestamp in milliseconds"
                          },
                          "access_point_privilege": {
                            "type": "number",
                            "description": "Access point privilege"
                          }
                        }
                      }
                    },
                    "cursor": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad search parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_events/types": {
      "get": {
        "tags": [
          "events"
        ],
        "description": "Get available events types list",
        "responses": {
          "200": {
            "description": "Successfully got events types",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "type",
                      "reason",
                      "description"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Event type"
                      },
                      "reason": {
                        "type": "string",
                        "description": "Event reason"
                      },
                      "description": {
                        "type": "string",
                        "description": "Event short description"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_events/count": {
      "get": {
        "tags": [
          "events"
        ],
        "description": "Return events count in specified interval",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": true,
            "description": "UTC UNIX timestamp in milliseconds to get events happened since (inclusive)",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "description": "UTC UNIX timestamp in milliseconds to get events happened before (inclusive)",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "user_type",
            "in": "query",
            "required": false,
            "description": "Type of user visitor or staff",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned events count in specified time period",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad search parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_events/{uuid}": {
      "get": {
        "tags": [
          "events"
        ],
        "description": "Returns access event with specified UUID",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Audit event uuid"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got event with specified UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "timestamp",
                    "type",
                    "reason",
                    "user_type",
                    "user_uuid",
                    "user_name",
                    "user_terra",
                    "card_code",
                    "access_point_uuid",
                    "access_point_name",
                    "access_point_privilege",
                    "from",
                    "to",
                    "from_side",
                    "tz_offset"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "timestamp": {
                      "type": "integer",
                      "format": "int64",
                      "description": "Event UNIX timestamp in milliseconds"
                    },
                    "type": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Access event type"
                    },
                    "reason": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Access event type reason"
                    },
                    "user_uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "description": "User UUID - who tried to pass some access point"
                    },
                    "user_name": {
                      "type": "string",
                      "minLength": 3,
                      "description": "User \\<surname>\\<name>\\<second_name>"
                    },
                    "user_terra": {
                      "type": "string",
                      "description": "User zone when event occured"
                    },
                    "card_code": {
                      "type": "string",
                      "description": "User card code"
                    },
                    "access_point_uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "access_point_name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "from": {
                      "type": "string",
                      "description": "Name of the territory from which transition occurred"
                    },
                    "to": {
                      "type": "string",
                      "description": "Name of the territory to which transition occurred"
                    },
                    "from_side": {
                      "type": "string",
                      "enum": [
                        "a",
                        "b"
                      ],
                      "description": "Side from which access occured"
                    },
                    "tz_offset": {
                      "type": "integer",
                      "description": "Event time zone offset in minutes"
                    },
                    "car_number": {
                      "type": "string",
                      "description": "User car number from licence plates recognition analytics from ONVIF device"
                    },
                    "pin": {
                      "type": "string",
                      "enum": [
                        "ACCEPTED",
                        "REJECTED",
                        "DURESS"
                      ],
                      "description": "If present, indicates that pin code was eneterd while access"
                    },
                    "request_ts": {
                      "type": "integer",
                      "format": "int64",
                      "description": "Access request UNIX timestamp in milliseconds"
                    },
                    "response_ts": {
                      "type": "integer",
                      "format": "int64",
                      "description": "Access response UNIX timestamp in milliseconds"
                    },
                    "access_point_privilege": {
                      "type": "number",
                      "description": "Access point privilege"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified event was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_events/user_defined/{uuid}": {
      "put": {
        "tags": [
          "events"
        ],
        "description": "Update specified user defined access data",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "user_uuid",
                      "user_type",
                      "identifier_format",
                      "user_name",
                      "user_terra",
                      "from",
                      "to",
                      "from_side",
                      "access_point_uuid",
                      "access_point_name",
                      "access_point_privilege",
                      "timestamp",
                      "tz_offset",
                      "type",
                      "reason",
                      "request_ts"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "ALLOWED",
                          "FORBIDDEN"
                        ],
                        "description": "Тип события (полный список типов и причин доступен по get запросу /access_events/types):\n  *`ALLOWED` - Разрешен проход\n  *`FORBIDDEN` - Доступ запрещен (причина в поле reason)\n"
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "ACCESS POINT",
                          "ACCESS PROFILE",
                          "EXTERNAL ACCESS",
                          "PIN CODE",
                          "BUTTON PRESSED",
                          "REMOTE BUTTON PRESSED",
                          "ACCESS POINT UNBLOCKED",
                          "ACCESS POINT SIDE A UNBLOCKED",
                          "ACCESS POINT SIDE B UNBLOCKED",
                          "DURESS PIN CODE",
                          "TEMPORARY ACCESS",
                          "CONFIRM BUTTON PRESSED",
                          "EXTERNAL RESOLUTION",
                          "CARD CONFIRM"
                        ],
                        "description": "Причина события (полный список причин доступен по get запросу /access_events/types)"
                      },
                      "req_id": {
                        "type": "number"
                      },
                      "user_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "user_type": {
                        "type": "string",
                        "enum": [
                          "staff",
                          "visitor"
                        ]
                      },
                      "identifier_format": {
                        "type": "string",
                        "enum": [
                          "card",
                          "qr",
                          "barcode",
                          ""
                        ]
                      },
                      "user_name": {
                        "type": "string"
                      },
                      "user_terra": {
                        "type": "string",
                        "example": "1:1:1:Внешняя"
                      },
                      "from": {
                        "type": "string",
                        "example": "1:1:1"
                      },
                      "to": {
                        "type": "string",
                        "example": "1:1:1:Внешняя"
                      },
                      "from_side": {
                        "type": "string"
                      },
                      "access_point_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "access_point_name": {
                        "type": "string"
                      },
                      "access_point_privilege": {
                        "type": "number"
                      },
                      "timestamp": {
                        "type": "number"
                      },
                      "tz_offset": {
                        "type": "number"
                      },
                      "card_code": {
                        "type": "string"
                      },
                      "card_privilege": {
                        "type": "number"
                      },
                      "request_ts": {
                        "type": "number"
                      },
                      "api_request_from": {
                        "type": "string"
                      },
                      "car_number": {
                        "type": "string"
                      },
                      "pin": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "user_uuid",
                      "user_type",
                      "identifier_format",
                      "user_name",
                      "user_terra",
                      "from",
                      "to",
                      "from_side",
                      "access_point_uuid",
                      "access_point_name",
                      "access_point_privilege",
                      "timestamp",
                      "tz_offset",
                      "type",
                      "reason"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "REQUEST"
                        ],
                        "description": "Тип события (полный список типов и причин доступен по get запросу /access_events/types):\n  *`REQUEST` - Запрос на проход или доступ\n"
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "ACCESS REQUEST",
                          "BUTTON PRESSED",
                          "REMOTE BUTTON PRESSED",
                          "CARD CONFIRM"
                        ],
                        "description": "Причина события (полный список причин доступен по get запросу /access_events/types)"
                      },
                      "req_id": {
                        "type": "number"
                      },
                      "user_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "user_type": {
                        "type": "string",
                        "enum": [
                          "staff",
                          "visitor"
                        ]
                      },
                      "identifier_format": {
                        "type": "string",
                        "enum": [
                          "card",
                          "qr",
                          "barcode",
                          ""
                        ]
                      },
                      "user_name": {
                        "type": "string"
                      },
                      "user_terra": {
                        "type": "string",
                        "example": "1:1:1:Внешняя"
                      },
                      "from": {
                        "type": "string",
                        "example": "1:1:1"
                      },
                      "to": {
                        "type": "string",
                        "example": "1:1:1:Внешняя"
                      },
                      "from_side": {
                        "type": "string"
                      },
                      "access_point_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "access_point_name": {
                        "type": "string"
                      },
                      "access_point_privilege": {
                        "type": "number"
                      },
                      "timestamp": {
                        "type": "number"
                      },
                      "tz_offset": {
                        "type": "number"
                      },
                      "card_code": {
                        "type": "string"
                      },
                      "card_privilege": {
                        "type": "number"
                      },
                      "identification_method": {
                        "type": "string",
                        "enum": [
                          "card_and_pin",
                          "card",
                          "multi_factor",
                          "lpr",
                          "pin",
                          "lpr_and_card",
                          "card_or_pin",
                          "bio",
                          "card_and_bio",
                          "card_and_pin_and_bio"
                        ]
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "user_uuid",
                      "user_type",
                      "identifier_format",
                      "user_name",
                      "user_terra",
                      "from",
                      "to",
                      "from_side",
                      "access_point_uuid",
                      "access_point_name",
                      "access_point_privilege",
                      "timestamp",
                      "tz_offset",
                      "type",
                      "reason",
                      "response_ts",
                      "request_ts"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "EXECUTED",
                          "UNEXECUTED",
                          "PARTIALLY EXECUTED"
                        ],
                        "description": "Тип события (полный список типов и причин доступен по get запросу /access_events/types):\n  *`EXECUTED` - Cовершен проход\n  *`PARTIALLY EXECUTED` - Частично совершен проход\n  *`UNEXECUTED` - Не совершенный проход\n"
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "ACCESS POINT",
                          "ACCESS PROFILE",
                          "EXTERNAL ACCESS",
                          "PIN CODE",
                          "BUTTON PRESSED",
                          "REMOTE BUTTON PRESSED",
                          "ACCESS POINT UNBLOCKED",
                          "ACCESS POINT SIDE A UNBLOCKED",
                          "ACCESS POINT SIDE B UNBLOCKED",
                          "DURESS PIN CODE",
                          "TEMPORARY ACCESS",
                          "EXTERNAL RESOLUTION",
                          "CARD CONFIRM",
                          "CONFIRM BUTTON PRESSED"
                        ],
                        "description": "Причина события (полный список причин доступен по get запросу /access_events/types)"
                      },
                      "req_id": {
                        "type": "number"
                      },
                      "user_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "user_type": {
                        "type": "string",
                        "enum": [
                          "staff",
                          "visitor"
                        ]
                      },
                      "identifier_format": {
                        "type": "string",
                        "enum": [
                          "card",
                          "qr",
                          "barcode",
                          ""
                        ]
                      },
                      "user_name": {
                        "type": "string"
                      },
                      "user_terra": {
                        "type": "string",
                        "example": "1:1:1:Внешняя"
                      },
                      "from": {
                        "type": "string",
                        "example": "1:1:1"
                      },
                      "to": {
                        "type": "string",
                        "example": "1:1:1:Внешняя"
                      },
                      "from_side": {
                        "type": "string"
                      },
                      "access_point_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "access_point_name": {
                        "type": "string"
                      },
                      "access_point_privilege": {
                        "type": "number"
                      },
                      "timestamp": {
                        "type": "number"
                      },
                      "tz_offset": {
                        "type": "number"
                      },
                      "card_code": {
                        "type": "string"
                      },
                      "card_privilege": {
                        "type": "number"
                      },
                      "response_ts": {
                        "type": "number"
                      },
                      "request_ts": {
                        "type": "number"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully update user defined access data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified user defined access does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "events"
        ],
        "description": "Delete specified user defined access",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted user defined access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified user defined access does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_events/user_defined": {
      "post": {
        "tags": [
          "events"
        ],
        "description": "Add new user defined access",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "user_uuid",
                      "user_type",
                      "identifier_format",
                      "user_name",
                      "user_terra",
                      "from",
                      "to",
                      "from_side",
                      "access_point_uuid",
                      "access_point_name",
                      "access_point_privilege",
                      "timestamp",
                      "tz_offset",
                      "type",
                      "reason",
                      "request_ts"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "ALLOWED",
                          "FORBIDDEN"
                        ],
                        "description": "Тип события (полный список типов и причин доступен по get запросу /access_events/types):\n  *`ALLOWED` - Разрешен проход\n  *`FORBIDDEN` - Доступ запрещен (причина в поле reason)\n"
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "ACCESS POINT",
                          "ACCESS PROFILE",
                          "EXTERNAL ACCESS",
                          "PIN CODE",
                          "BUTTON PRESSED",
                          "REMOTE BUTTON PRESSED",
                          "ACCESS POINT UNBLOCKED",
                          "ACCESS POINT SIDE A UNBLOCKED",
                          "ACCESS POINT SIDE B UNBLOCKED",
                          "DURESS PIN CODE",
                          "TEMPORARY ACCESS",
                          "CONFIRM BUTTON PRESSED",
                          "EXTERNAL RESOLUTION",
                          "CARD CONFIRM"
                        ],
                        "description": "Причина события (полный список причин доступен по get запросу /access_events/types)"
                      },
                      "req_id": {
                        "type": "number"
                      },
                      "user_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "user_type": {
                        "type": "string",
                        "enum": [
                          "staff",
                          "visitor"
                        ]
                      },
                      "identifier_format": {
                        "type": "string",
                        "enum": [
                          "card",
                          "qr",
                          "barcode",
                          ""
                        ]
                      },
                      "user_name": {
                        "type": "string"
                      },
                      "user_terra": {
                        "type": "string",
                        "example": "1:1:1:Внешняя"
                      },
                      "from": {
                        "type": "string",
                        "example": "1:1:1"
                      },
                      "to": {
                        "type": "string",
                        "example": "1:1:1:Внешняя"
                      },
                      "from_side": {
                        "type": "string"
                      },
                      "access_point_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "access_point_name": {
                        "type": "string"
                      },
                      "access_point_privilege": {
                        "type": "number"
                      },
                      "timestamp": {
                        "type": "number"
                      },
                      "tz_offset": {
                        "type": "number"
                      },
                      "card_code": {
                        "type": "string"
                      },
                      "card_privilege": {
                        "type": "number"
                      },
                      "request_ts": {
                        "type": "number"
                      },
                      "api_request_from": {
                        "type": "string"
                      },
                      "car_number": {
                        "type": "string"
                      },
                      "pin": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "user_uuid",
                      "user_type",
                      "identifier_format",
                      "user_name",
                      "user_terra",
                      "from",
                      "to",
                      "from_side",
                      "access_point_uuid",
                      "access_point_name",
                      "access_point_privilege",
                      "timestamp",
                      "tz_offset",
                      "type",
                      "reason"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "REQUEST"
                        ],
                        "description": "Тип события (полный список типов и причин доступен по get запросу /access_events/types):\n  *`REQUEST` - Запрос на проход или доступ\n"
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "ACCESS REQUEST",
                          "BUTTON PRESSED",
                          "REMOTE BUTTON PRESSED",
                          "CARD CONFIRM"
                        ],
                        "description": "Причина события (полный список причин доступен по get запросу /access_events/types)"
                      },
                      "req_id": {
                        "type": "number"
                      },
                      "user_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "user_type": {
                        "type": "string",
                        "enum": [
                          "staff",
                          "visitor"
                        ]
                      },
                      "identifier_format": {
                        "type": "string",
                        "enum": [
                          "card",
                          "qr",
                          "barcode",
                          ""
                        ]
                      },
                      "user_name": {
                        "type": "string"
                      },
                      "user_terra": {
                        "type": "string",
                        "example": "1:1:1:Внешняя"
                      },
                      "from": {
                        "type": "string",
                        "example": "1:1:1"
                      },
                      "to": {
                        "type": "string",
                        "example": "1:1:1:Внешняя"
                      },
                      "from_side": {
                        "type": "string"
                      },
                      "access_point_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "access_point_name": {
                        "type": "string"
                      },
                      "access_point_privilege": {
                        "type": "number"
                      },
                      "timestamp": {
                        "type": "number"
                      },
                      "tz_offset": {
                        "type": "number"
                      },
                      "card_code": {
                        "type": "string"
                      },
                      "card_privilege": {
                        "type": "number"
                      },
                      "identification_method": {
                        "type": "string",
                        "enum": [
                          "card_and_pin",
                          "card",
                          "multi_factor",
                          "lpr",
                          "pin",
                          "lpr_and_card",
                          "card_or_pin",
                          "bio",
                          "card_and_bio",
                          "card_and_pin_and_bio"
                        ]
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "user_uuid",
                      "user_type",
                      "identifier_format",
                      "user_name",
                      "user_terra",
                      "from",
                      "to",
                      "from_side",
                      "access_point_uuid",
                      "access_point_name",
                      "access_point_privilege",
                      "timestamp",
                      "tz_offset",
                      "type",
                      "reason",
                      "response_ts",
                      "request_ts"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "EXECUTED",
                          "UNEXECUTED",
                          "PARTIALLY EXECUTED"
                        ],
                        "description": "Тип события (полный список типов и причин доступен по get запросу /access_events/types):\n  *`EXECUTED` - Cовершен проход\n  *`PARTIALLY EXECUTED` - Частично совершен проход\n  *`UNEXECUTED` - Не совершенный проход\n"
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "ACCESS POINT",
                          "ACCESS PROFILE",
                          "EXTERNAL ACCESS",
                          "PIN CODE",
                          "BUTTON PRESSED",
                          "REMOTE BUTTON PRESSED",
                          "ACCESS POINT UNBLOCKED",
                          "ACCESS POINT SIDE A UNBLOCKED",
                          "ACCESS POINT SIDE B UNBLOCKED",
                          "DURESS PIN CODE",
                          "TEMPORARY ACCESS",
                          "EXTERNAL RESOLUTION",
                          "CARD CONFIRM",
                          "CONFIRM BUTTON PRESSED"
                        ],
                        "description": "Причина события (полный список причин доступен по get запросу /access_events/types)"
                      },
                      "req_id": {
                        "type": "number"
                      },
                      "user_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "user_type": {
                        "type": "string",
                        "enum": [
                          "staff",
                          "visitor"
                        ]
                      },
                      "identifier_format": {
                        "type": "string",
                        "enum": [
                          "card",
                          "qr",
                          "barcode",
                          ""
                        ]
                      },
                      "user_name": {
                        "type": "string"
                      },
                      "user_terra": {
                        "type": "string",
                        "example": "1:1:1:Внешняя"
                      },
                      "from": {
                        "type": "string",
                        "example": "1:1:1"
                      },
                      "to": {
                        "type": "string",
                        "example": "1:1:1:Внешняя"
                      },
                      "from_side": {
                        "type": "string"
                      },
                      "access_point_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "access_point_name": {
                        "type": "string"
                      },
                      "access_point_privilege": {
                        "type": "number"
                      },
                      "timestamp": {
                        "type": "number"
                      },
                      "tz_offset": {
                        "type": "number"
                      },
                      "card_code": {
                        "type": "string"
                      },
                      "card_privilege": {
                        "type": "number"
                      },
                      "response_ts": {
                        "type": "number"
                      },
                      "request_ts": {
                        "type": "number"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successfully created new user defined access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Access with specified UUID already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/notification_events": {
      "get": {
        "tags": [
          "events"
        ],
        "description": "Returns notification events by specified query parameters",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": true,
            "description": "UTC UNIX timestamp in milliseconds to get events happened since (inclusive)",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "description": "UTC UNIX timestamp in milliseconds to get events happened before (inclusive)",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": true,
            "description": "Returned events max number",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "description": "Search results cursor",
            "schema": {
              "type": "string",
              "nullable": true,
              "default": ""
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned events happened in specified time period",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "events",
                    "cursor"
                  ],
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "uuid",
                          "timestamp",
                          "type",
                          "reason",
                          "controller",
                          "source_type",
                          "source"
                        ],
                        "properties": {
                          "uuid": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "description": "Event UUID"
                          },
                          "name": {
                            "type": "string",
                            "example": "ACCESS_MODE_CHANGED",
                            "description": "Имя события (полный список имен доступен по get запросу /notification_events/types)"
                          },
                          "timestamp": {
                            "type": "number",
                            "format": "int64",
                            "description": "Event UNIX timestamp in milliseconds"
                          },
                          "type": {
                            "description": "Тип события (полный список типов и причин доступен по get запросу /notification_events/types):\n  *`INFO` - Информационное сообщение\n  *`WARN` - Предупреждение\n  *`ALERT` - Тревога\n",
                            "type": "string",
                            "enum": [
                              "INFO",
                              "WARN",
                              "ALERT",
                              "EVENT"
                            ]
                          },
                          "reason": {
                            "description": "Event description",
                            "type": "string"
                          },
                          "controller": {
                            "description": "Event producer",
                            "type": "string"
                          },
                          "source_type": {
                            "description": "Event source type",
                            "type": "string",
                            "enum": [
                              "HARDWARE",
                              "NETWORK",
                              "SERVICE",
                              "SECURITY",
                              "STAFF"
                            ]
                          },
                          "source": {
                            "type": "string",
                            "description": "Source id"
                          },
                          "error_code": {
                            "type": "integer",
                            "description": "Error code. For ALERT or WARN means which error occured. For INFO means which error corrected"
                          }
                        }
                      }
                    },
                    "cursor": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad search parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/notification_events/error_codes": {
      "get": {
        "tags": [
          "events"
        ],
        "description": "Get notification events error codes descriptions",
        "responses": {
          "200": {
            "description": "Successfully received error codes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "code",
                      "description"
                    ],
                    "properties": {
                      "code": {
                        "type": "integer",
                        "description": "Error code"
                      },
                      "source_type": {
                        "type": "string",
                        "enum": [
                          "HARDWARE",
                          "SERVICE",
                          "NETWORK"
                        ],
                        "description": "Correspoinding notification event source type"
                      },
                      "description": {
                        "type": "string",
                        "description": "Error code description"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/notification_events/user_defined_notifications/{uuid}": {
      "get": {
        "tags": [
          "events"
        ],
        "description": "Get specified user defined notification",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully received user defined notification by UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "sensor_type",
                    "notification_type",
                    "state_description",
                    "signal_input_devices"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "sensor_type": {
                      "type": "string",
                      "enum": [
                        "NC",
                        "NO"
                      ],
                      "description": "Normally closed or normally opened sensor"
                    },
                    "notification_type": {
                      "type": "string",
                      "enum": [
                        "INFO",
                        "WARN",
                        "ALERT"
                      ],
                      "description": "Indicates which notification event type will be generated on sensor response"
                    },
                    "state_description": {
                      "type": "string",
                      "minLength": 1,
                      "description": "State description on sensor triggered"
                    },
                    "guarded_access_point": {
                      "type": "string",
                      "maxLength": 36,
                      "description": "Generate alarm only if specified access point (UUID) guarded"
                    },
                    "error_code": {
                      "type": "integer",
                      "minimum": 4001,
                      "maximum": 4999,
                      "description": "Notification error code"
                    },
                    "signal_input_devices": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 39,
                        "description": "Subdevice of type \"input\" that will trigger events generation in format: <device_uuid>:<subdevice_address>"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified user defined notification does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "events"
        ],
        "description": "Update specified user defined notification data",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "sensor_type",
                  "notification_type",
                  "state_description",
                  "signal_input_devices"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "sensor_type": {
                    "type": "string",
                    "enum": [
                      "NC",
                      "NO"
                    ],
                    "description": "Normally closed or normally opened sensor"
                  },
                  "notification_type": {
                    "type": "string",
                    "enum": [
                      "INFO",
                      "WARN",
                      "ALERT"
                    ],
                    "description": "Indicates which notification event type will be generated on sensor response"
                  },
                  "state_description": {
                    "type": "string",
                    "minLength": 1,
                    "description": "State description on sensor triggered"
                  },
                  "guarded_access_point": {
                    "type": "string",
                    "maxLength": 36,
                    "description": "Generate alarm only if specified access point (UUID) guarded"
                  },
                  "error_code": {
                    "type": "integer",
                    "minimum": 4001,
                    "maximum": 4999,
                    "description": "Notification error code"
                  },
                  "signal_input_devices": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 39,
                      "description": "Subdevice of type \"input\" that will trigger events generation in format: <device_uuid>:<subdevice_address>"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully update user defined notification data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified user defined notification does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "events"
        ],
        "description": "Delete specified user defined notification",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted user defined notification",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified user defined notification does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/notification_events/user_defined_notifications": {
      "get": {
        "tags": [
          "events"
        ],
        "description": "Get all user defined notifications",
        "responses": {
          "200": {
            "description": "Successfully got all user defined notifications",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "sensor_type",
                    "notification_type",
                    "state_description",
                    "signal_input_devices"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "sensor_type": {
                      "type": "string",
                      "enum": [
                        "NC",
                        "NO"
                      ],
                      "description": "Normally closed or normally opened sensor"
                    },
                    "notification_type": {
                      "type": "string",
                      "enum": [
                        "INFO",
                        "WARN",
                        "ALERT"
                      ],
                      "description": "Indicates which notification event type will be generated on sensor response"
                    },
                    "state_description": {
                      "type": "string",
                      "minLength": 1,
                      "description": "State description on sensor triggered"
                    },
                    "guarded_access_point": {
                      "type": "string",
                      "maxLength": 36,
                      "description": "Generate alarm only if specified access point (UUID) guarded"
                    },
                    "error_code": {
                      "type": "integer",
                      "minimum": 4001,
                      "maximum": 4999,
                      "description": "Notification error code"
                    },
                    "signal_input_devices": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 39,
                        "description": "Subdevice of type \"input\" that will trigger events generation in format: <device_uuid>:<subdevice_address>"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "events"
        ],
        "description": "Add new user defined notification",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "sensor_type",
                  "notification_type",
                  "state_description",
                  "signal_input_devices"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "sensor_type": {
                    "type": "string",
                    "enum": [
                      "NC",
                      "NO"
                    ],
                    "description": "Normally closed or normally opened sensor"
                  },
                  "notification_type": {
                    "type": "string",
                    "enum": [
                      "INFO",
                      "WARN",
                      "ALERT"
                    ],
                    "description": "Indicates which notification event type will be generated on sensor response"
                  },
                  "state_description": {
                    "type": "string",
                    "minLength": 1,
                    "description": "State description on sensor triggered"
                  },
                  "guarded_access_point": {
                    "type": "string",
                    "maxLength": 36,
                    "description": "Generate alarm only if specified access point (UUID) guarded"
                  },
                  "error_code": {
                    "type": "integer",
                    "minimum": 4001,
                    "maximum": 4999,
                    "description": "Notification error code"
                  },
                  "signal_input_devices": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 39,
                      "description": "Subdevice of type \"input\" that will trigger events generation in format: <device_uuid>:<subdevice_address>"
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successfully created new user defined notification",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Notification with specified UUID already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/notification_events/count": {
      "get": {
        "tags": [
          "events"
        ],
        "description": "Return events count in specified interval",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": true,
            "description": "UTC UNIX timestamp in milliseconds to get events happened since (inclusive)",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "description": "UTC UNIX timestamp in milliseconds to get events happened before (inclusive)",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "user_type",
            "in": "query",
            "required": false,
            "description": "Type of user visitor or staff",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned events count in specified time period",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad search parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/notification_events/types": {
      "get": {
        "tags": [
          "events"
        ],
        "description": "Get available events types list",
        "responses": {
          "200": {
            "description": "Successfully got events types",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "type",
                      "reason",
                      "description"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Event type"
                      },
                      "reason": {
                        "type": "string",
                        "description": "Event reason"
                      },
                      "description": {
                        "type": "string",
                        "description": "Event short description"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/notification_events/{uuid}": {
      "get": {
        "tags": [
          "events"
        ],
        "description": "Returns notification event with specified UUID",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Audit event uuid"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got event with specified UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "timestamp",
                    "type",
                    "reason",
                    "controller",
                    "source_type",
                    "source"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "description": "Event UUID"
                    },
                    "name": {
                      "type": "string",
                      "example": "ACCESS_MODE_CHANGED",
                      "description": "Имя события (полный список имен доступен по get запросу /notification_events/types)"
                    },
                    "timestamp": {
                      "type": "number",
                      "format": "int64",
                      "description": "Event UNIX timestamp in milliseconds"
                    },
                    "type": {
                      "description": "Тип события (полный список типов и причин доступен по get запросу /notification_events/types):\n  *`INFO` - Информационное сообщение\n  *`WARN` - Предупреждение\n  *`ALERT` - Тревога\n",
                      "type": "string",
                      "enum": [
                        "INFO",
                        "WARN",
                        "ALERT",
                        "EVENT"
                      ]
                    },
                    "reason": {
                      "description": "Event description",
                      "type": "string"
                    },
                    "controller": {
                      "description": "Event producer",
                      "type": "string"
                    },
                    "source_type": {
                      "description": "Event source type",
                      "type": "string",
                      "enum": [
                        "HARDWARE",
                        "NETWORK",
                        "SERVICE",
                        "SECURITY",
                        "STAFF"
                      ]
                    },
                    "source": {
                      "type": "string",
                      "description": "Source id"
                    },
                    "error_code": {
                      "type": "integer",
                      "description": "Error code. For ALERT or WARN means which error occured. For INFO means which error corrected"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified event was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/notification_events/user_defined/{uuid}": {
      "put": {
        "tags": [
          "events"
        ],
        "description": "Update specified user defined notification data",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "controller",
                  "reason"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "description": "Event UUID"
                  },
                  "name": {
                    "type": "string",
                    "example": "ACCESS_MODE_CHANGED",
                    "description": "Имя события (полный список имен доступен по get запросу /notification_events/types)"
                  },
                  "timestamp": {
                    "type": "number",
                    "format": "int64",
                    "description": "Event UNIX timestamp in milliseconds"
                  },
                  "type": {
                    "description": "Тип события (полный список типов и причин доступен по get запросу /notification_events/types):\n  *`INFO` - Информационное сообщение\n  *`WARN` - Предупреждение\n  *`ALERT` - Тревога\n",
                    "type": "string",
                    "enum": [
                      "INFO",
                      "WARN",
                      "ALERT",
                      "EVENT"
                    ]
                  },
                  "reason": {
                    "description": "Event description",
                    "type": "string"
                  },
                  "controller": {
                    "description": "Event producer",
                    "type": "string"
                  },
                  "source_type": {
                    "description": "Event source type",
                    "type": "string",
                    "enum": [
                      "HARDWARE",
                      "NETWORK",
                      "SERVICE",
                      "SECURITY",
                      "STAFF"
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": "Source id"
                  },
                  "error_code": {
                    "type": "integer",
                    "description": "Error code. For ALERT or WARN means which error occured. For INFO means which error corrected"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully update user defined notification data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified user defined notification does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "events"
        ],
        "description": "Delete specified user defined notification",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted user defined notification",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified user defined notification does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/notification_events/user_defined": {
      "post": {
        "tags": [
          "events"
        ],
        "description": "Add new user defined notification",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "controller",
                  "reason"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "description": "Event UUID"
                  },
                  "name": {
                    "type": "string",
                    "example": "ACCESS_MODE_CHANGED",
                    "description": "Имя события (полный список имен доступен по get запросу /notification_events/types)"
                  },
                  "timestamp": {
                    "type": "number",
                    "format": "int64",
                    "description": "Event UNIX timestamp in milliseconds"
                  },
                  "type": {
                    "description": "Тип события (полный список типов и причин доступен по get запросу /notification_events/types):\n  *`INFO` - Информационное сообщение\n  *`WARN` - Предупреждение\n  *`ALERT` - Тревога\n",
                    "type": "string",
                    "enum": [
                      "INFO",
                      "WARN",
                      "ALERT",
                      "EVENT"
                    ]
                  },
                  "reason": {
                    "description": "Event description",
                    "type": "string"
                  },
                  "controller": {
                    "description": "Event producer",
                    "type": "string"
                  },
                  "source_type": {
                    "description": "Event source type",
                    "type": "string",
                    "enum": [
                      "HARDWARE",
                      "NETWORK",
                      "SERVICE",
                      "SECURITY",
                      "STAFF"
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": "Source id"
                  },
                  "error_code": {
                    "type": "integer",
                    "description": "Error code. For ALERT or WARN means which error occured. For INFO means which error corrected"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successfully created new user defined notification",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "notification with specified UUID already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alerts/audit-alert": {
      "get": {
        "tags": [
          "alerts"
        ],
        "description": "Returns alerts",
        "responses": {
          "200": {
            "description": "Successfully returned sorted alerts by access points uuids",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Alerts list"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alerts/notification-alert": {
      "get": {
        "tags": [
          "alerts"
        ],
        "description": "Returns alerts",
        "responses": {
          "200": {
            "description": "Successfully returned sorted alerts by access points uuids",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Alerts list"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alerts/{uuid}": {
      "delete": {
        "tags": [
          "alerts"
        ],
        "description": "Принятие тревоги связанной с точкой прохода",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "description": "Uuid оставлен для обратной совместимости. Не используется.",
            "schema": {
              "type": "string"
            },
            "example": "5c7d61c0-e01d-40d7-b247-0a865bd508f5"
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Alert data",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "alert"
                ],
                "properties": {
                  "alert": {
                    "type": "object",
                    "required": [
                      "access_point_uuid",
                      "type"
                    ],
                    "properties": {
                      "access_point_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "type": {
                        "type": "string"
                      },
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "comment": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "All alert have been successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alerts/sortByAccessPoint": {
      "get": {
        "tags": [
          "alerts"
        ],
        "description": "Returns object with sorted alerts by access point uuids",
        "responses": {
          "200": {
            "description": "Successfully returned sorted alerts by access points uuids",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Alerts list grouped by access point UUID",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": "string",
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                        },
                        "reason": {
                          "type": "string"
                        },
                        "access_point_uuid": {
                          "type": "string",
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                        },
                        "access_point_name": {
                          "type": "string"
                        },
                        "last": {
                          "type": "integer",
                          "description": "Last violation event timestamp"
                        },
                        "first": {
                          "type": "integer",
                          "description": "First violation event timestamp"
                        },
                        "type": {
                          "type": "string"
                        },
                        "count": {
                          "description": "Count of violation events",
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alerts/access_points/{uuid}": {
      "delete": {
        "tags": [
          "alerts"
        ],
        "description": "Delete alerts of access point",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "description": "uuid access point",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "requestBody": {
          "description": "Alert data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "data"
                ],
                "properties": {
                  "data": {
                    "type": "object",
                    "required": [
                      "access_point_uuid"
                    ],
                    "properties": {
                      "access_point_uuid": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "comment": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully deleted alerts of access point",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alerts/access_points/{uuid}/count": {
      "get": {
        "tags": [
          "alerts"
        ],
        "description": "Returns alerts count of access point",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned alerts count of access point",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alerts/violations": {
      "get": {
        "tags": [
          "alerts"
        ],
        "description": "Returns violations",
        "parameters": [
          {
            "in": "query",
            "name": "type",
            "description": "Имя события",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "uuid",
            "description": "Access point uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "description": "Searching cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "description": "Page size of violation events",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned violations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "uuid",
                          "timestamp",
                          "type",
                          "reason",
                          "controller",
                          "source_type",
                          "source"
                        ],
                        "properties": {
                          "uuid": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "description": "Event UUID"
                          },
                          "name": {
                            "type": "string",
                            "example": "ACCESS_MODE_CHANGED",
                            "description": "Имя события (полный список имен доступен по get запросу /notification_events/types)"
                          },
                          "timestamp": {
                            "type": "number",
                            "format": "int64",
                            "description": "Event UNIX timestamp in milliseconds"
                          },
                          "type": {
                            "description": "Тип события (полный список типов и причин доступен по get запросу /notification_events/types):\n  *`INFO` - Информационное сообщение\n  *`WARN` - Предупреждение\n  *`ALERT` - Тревога\n",
                            "type": "string",
                            "enum": [
                              "INFO",
                              "WARN",
                              "ALERT",
                              "EVENT"
                            ]
                          },
                          "reason": {
                            "description": "Event description",
                            "type": "string"
                          },
                          "controller": {
                            "description": "Event producer",
                            "type": "string"
                          },
                          "source_type": {
                            "description": "Event source type",
                            "type": "string",
                            "enum": [
                              "HARDWARE",
                              "NETWORK",
                              "SERVICE",
                              "SECURITY",
                              "STAFF"
                            ]
                          },
                          "source": {
                            "type": "string",
                            "description": "Source id"
                          },
                          "error_code": {
                            "type": "integer",
                            "description": "Error code. For ALERT or WARN means which error occured. For INFO means which error corrected"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alerts/violations/{name}": {
      "get": {
        "tags": [
          "alerts"
        ],
        "description": "Returns violations",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "description": "Searching cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "description": "Page size of violation events",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned violations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "uuid",
                          "timestamp",
                          "type",
                          "reason",
                          "controller",
                          "source_type",
                          "source"
                        ],
                        "properties": {
                          "uuid": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "description": "Event UUID"
                          },
                          "name": {
                            "type": "string",
                            "example": "ACCESS_MODE_CHANGED",
                            "description": "Имя события (полный список имен доступен по get запросу /notification_events/types)"
                          },
                          "timestamp": {
                            "type": "number",
                            "format": "int64",
                            "description": "Event UNIX timestamp in milliseconds"
                          },
                          "type": {
                            "description": "Тип события (полный список типов и причин доступен по get запросу /notification_events/types):\n  *`INFO` - Информационное сообщение\n  *`WARN` - Предупреждение\n  *`ALERT` - Тревога\n",
                            "type": "string",
                            "enum": [
                              "INFO",
                              "WARN",
                              "ALERT",
                              "EVENT"
                            ]
                          },
                          "reason": {
                            "description": "Event description",
                            "type": "string"
                          },
                          "controller": {
                            "description": "Event producer",
                            "type": "string"
                          },
                          "source_type": {
                            "description": "Event source type",
                            "type": "string",
                            "enum": [
                              "HARDWARE",
                              "NETWORK",
                              "SERVICE",
                              "SECURITY",
                              "STAFF"
                            ]
                          },
                          "source": {
                            "type": "string",
                            "description": "Source id"
                          },
                          "error_code": {
                            "type": "integer",
                            "description": "Error code. For ALERT or WARN means which error occured. For INFO means which error corrected"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alerts/violations/by/point": {
      "get": {
        "tags": [
          "alerts"
        ],
        "description": "Новый метод возвращения тревожных событий связанных с тревожными уведомлениями",
        "parameters": [
          {
            "in": "query",
            "name": "type",
            "description": "Имя события",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "uuid",
            "description": "Access point uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "description": "Page size of violation events",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "description": "Searching cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned violations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "uuid",
                          "timestamp",
                          "type",
                          "reason",
                          "controller",
                          "source_type",
                          "source"
                        ],
                        "properties": {
                          "uuid": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                            "description": "Event UUID"
                          },
                          "name": {
                            "type": "string",
                            "example": "ACCESS_MODE_CHANGED",
                            "description": "Имя события (полный список имен доступен по get запросу /notification_events/types)"
                          },
                          "timestamp": {
                            "type": "number",
                            "format": "int64",
                            "description": "Event UNIX timestamp in milliseconds"
                          },
                          "type": {
                            "description": "Тип события (полный список типов и причин доступен по get запросу /notification_events/types):\n  *`INFO` - Информационное сообщение\n  *`WARN` - Предупреждение\n  *`ALERT` - Тревога\n",
                            "type": "string",
                            "enum": [
                              "INFO",
                              "WARN",
                              "ALERT",
                              "EVENT"
                            ]
                          },
                          "reason": {
                            "description": "Event description",
                            "type": "string"
                          },
                          "controller": {
                            "description": "Event producer",
                            "type": "string"
                          },
                          "source_type": {
                            "description": "Event source type",
                            "type": "string",
                            "enum": [
                              "HARDWARE",
                              "NETWORK",
                              "SERVICE",
                              "SECURITY",
                              "STAFF"
                            ]
                          },
                          "source": {
                            "type": "string",
                            "description": "Source id"
                          },
                          "error_code": {
                            "type": "integer",
                            "description": "Error code. For ALERT or WARN means which error occured. For INFO means which error corrected"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alerts/{type}/{name}": {
      "delete": {
        "tags": [
          "alerts"
        ],
        "description": "Delete alert by type and name",
        "parameters": [
          {
            "in": "path",
            "name": "type",
            "description": "Alert event types",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "audit-alert",
                "notification-alert"
              ]
            }
          },
          {
            "in": "path",
            "name": "name",
            "description": "Еvent name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Alert data",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "reason": {
                    "type": "string"
                  },
                  "comment": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "All alert have been successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alert-notification-filters/notification": {
      "get": {
        "tags": [
          "notification",
          "events",
          "filters"
        ],
        "description": "Return notification event filters",
        "responses": {
          "200": {
            "description": "Successfully returned events happened in specified time period",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "uuid",
                          "properties"
                        ],
                        "properties": {
                          "uuid": {
                            "type": "string",
                            "description": "Уникальный идентификатор"
                          },
                          "properties": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "object",
                                "required": [
                                  "type",
                                  "enum"
                                ],
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "string"
                                    ]
                                  },
                                  "enum": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "additionalProperties": false
                              },
                              "access_point_uuid": {
                                "type": "object",
                                "required": [
                                  "type",
                                  "enum"
                                ],
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "string"
                                    ]
                                  },
                                  "enum": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "additionalProperties": false
                          },
                          "actions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "props": {
                                  "type": "object"
                                }
                              }
                            }
                          },
                          "active": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad search parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "notification",
          "events",
          "filters"
        ],
        "description": "Create new filter",
        "requestBody": {
          "description": "Creates new notification event filter in database",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "properties"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "Уникальный идентификатор"
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "object",
                        "required": [
                          "type",
                          "enum"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "string"
                            ]
                          },
                          "enum": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      },
                      "access_point_uuid": {
                        "type": "object",
                        "required": [
                          "type",
                          "enum"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "string"
                            ]
                          },
                          "enum": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  },
                  "actions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "props": {
                          "type": "object"
                        }
                      }
                    }
                  },
                  "active": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "notification event filter has been successfully added",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "notification event filter already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alert-notification-filters/notification/default": {
      "post": {
        "tags": [
          "access",
          "events",
          "filters"
        ],
        "description": "prevent filters to default",
        "responses": {
          "201": {
            "description": "access event filter has been successfully added",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "access event filter already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alert-notification-filters/notification/{uuid}": {
      "get": {
        "tags": [
          "events",
          "filters"
        ],
        "description": "Returns notification event filter with specified UUID",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Notification event filter uuid"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got event with specified UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "properties"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "description": "Уникальный идентификатор"
                    },
                    "properties": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "object",
                          "required": [
                            "type",
                            "enum"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "string"
                              ]
                            },
                            "enum": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "additionalProperties": false
                        },
                        "access_point_uuid": {
                          "type": "object",
                          "required": [
                            "type",
                            "enum"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "string"
                              ]
                            },
                            "enum": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "props": {
                            "type": "object"
                          }
                        }
                      }
                    },
                    "active": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified event was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "events",
          "filters"
        ],
        "description": "Delete notification event filter",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "notification event filter successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified notification event filter does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "notification",
          "events",
          "filters"
        ],
        "description": "Create new filter",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Notification event filter uuid"
          }
        ],
        "requestBody": {
          "description": "Creates new notification event filter in database",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "properties"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "Уникальный идентификатор"
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "object",
                        "required": [
                          "type",
                          "enum"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "string"
                            ]
                          },
                          "enum": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      },
                      "access_point_uuid": {
                        "type": "object",
                        "required": [
                          "type",
                          "enum"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "string"
                            ]
                          },
                          "enum": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  },
                  "actions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "props": {
                          "type": "object"
                        }
                      }
                    }
                  },
                  "active": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "notification event filter has been successfully added",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "notification event filter already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alert-notification-filters/access": {
      "get": {
        "tags": [
          "access",
          "events",
          "filters"
        ],
        "description": "Return access event filters",
        "responses": {
          "200": {
            "description": "Successfully returned filters happened in specified time period",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "uuid",
                          "properties"
                        ],
                        "properties": {
                          "uuid": {
                            "type": "string",
                            "description": "Уникальный идентификатор"
                          },
                          "properties": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "object",
                                "required": [
                                  "type",
                                  "enum"
                                ],
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "string"
                                    ]
                                  },
                                  "enum": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "additionalProperties": false
                              },
                              "access_point_uuid": {
                                "type": "object",
                                "required": [
                                  "type",
                                  "enum"
                                ],
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "string"
                                    ]
                                  },
                                  "enum": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "additionalProperties": false
                              },
                              "user_uuid": {
                                "type": "object",
                                "required": [
                                  "type",
                                  "enum"
                                ],
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "string"
                                    ]
                                  },
                                  "enum": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "additionalProperties": false
                          },
                          "actions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "props": {
                                  "type": "object"
                                }
                              }
                            }
                          },
                          "active": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad search parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "access",
          "events",
          "filters"
        ],
        "description": "Create new filter",
        "requestBody": {
          "description": "Creates new access event filter in database",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "properties"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "Уникальный идентификатор"
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "object",
                        "required": [
                          "type",
                          "enum"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "string"
                            ]
                          },
                          "enum": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      },
                      "access_point_uuid": {
                        "type": "object",
                        "required": [
                          "type",
                          "enum"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "string"
                            ]
                          },
                          "enum": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      },
                      "user_uuid": {
                        "type": "object",
                        "required": [
                          "type",
                          "enum"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "string"
                            ]
                          },
                          "enum": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  },
                  "actions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "props": {
                          "type": "object"
                        }
                      }
                    }
                  },
                  "active": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "access event filter has been successfully added",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "access event filter already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alert-notification-filters/access/default": {
      "post": {
        "tags": [
          "access",
          "events",
          "filters"
        ],
        "description": "prevent filters to default",
        "responses": {
          "201": {
            "description": "access event filter has been successfully added",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "access event filter already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alert-notification-filters/access/{uuid}": {
      "get": {
        "tags": [
          "events",
          "filters"
        ],
        "description": "Returns access event filter with specified UUID",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "access event filter uuid"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got event with specified UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "properties"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "description": "Уникальный идентификатор"
                    },
                    "properties": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "object",
                          "required": [
                            "type",
                            "enum"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "string"
                              ]
                            },
                            "enum": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "additionalProperties": false
                        },
                        "access_point_uuid": {
                          "type": "object",
                          "required": [
                            "type",
                            "enum"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "string"
                              ]
                            },
                            "enum": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "additionalProperties": false
                        },
                        "user_uuid": {
                          "type": "object",
                          "required": [
                            "type",
                            "enum"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "string"
                              ]
                            },
                            "enum": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "props": {
                            "type": "object"
                          }
                        }
                      }
                    },
                    "active": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified event was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "events",
          "filters"
        ],
        "description": "Delete access event filter",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "access event filter successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access event filter does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "access",
          "events",
          "filters"
        ],
        "description": "Create new filter",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "access event filter uuid"
          }
        ],
        "requestBody": {
          "description": "Creates new access event filter in database",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "properties"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "Уникальный идентификатор"
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "object",
                        "required": [
                          "type",
                          "enum"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "string"
                            ]
                          },
                          "enum": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      },
                      "access_point_uuid": {
                        "type": "object",
                        "required": [
                          "type",
                          "enum"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "string"
                            ]
                          },
                          "enum": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      },
                      "user_uuid": {
                        "type": "object",
                        "required": [
                          "type",
                          "enum"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "string"
                            ]
                          },
                          "enum": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  },
                  "actions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "props": {
                          "type": "object"
                        }
                      }
                    }
                  },
                  "active": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "access event filter has been successfully added",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "access event filter already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alert-notification-filters/audit": {
      "get": {
        "tags": [
          "audit",
          "events",
          "filters"
        ],
        "description": "Return audit event filters",
        "responses": {
          "200": {
            "description": "Successfully returned filters happened in specified time period",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "uuid",
                          "properties"
                        ],
                        "properties": {
                          "uuid": {
                            "type": "string",
                            "description": "Уникальный идентификатор"
                          },
                          "properties": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "object",
                                "required": [
                                  "type",
                                  "enum"
                                ],
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "string"
                                    ]
                                  },
                                  "enum": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "additionalProperties": false
                          },
                          "actions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "props": {
                                  "type": "object"
                                }
                              }
                            }
                          },
                          "active": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad search parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "audit",
          "events",
          "filters"
        ],
        "description": "Create new filter",
        "requestBody": {
          "description": "Creates new audit event filter in database",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "properties"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "Уникальный идентификатор"
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "object",
                        "required": [
                          "type",
                          "enum"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "string"
                            ]
                          },
                          "enum": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  },
                  "actions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "props": {
                          "type": "object"
                        }
                      }
                    }
                  },
                  "active": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "audit event filter has been successfully added",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "audit event filter already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alert-notification-filters/audit/default": {
      "post": {
        "tags": [
          "access",
          "events",
          "filters"
        ],
        "description": "prevent filters to default",
        "responses": {
          "201": {
            "description": "access event filter has been successfully added",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "access event filter already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/alert-notification-filters/audit/{uuid}": {
      "get": {
        "tags": [
          "events",
          "filters"
        ],
        "description": "Returns access event filter with specified UUID",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "access event filter uuid"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got event with specified UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "properties"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "description": "Уникальный идентификатор"
                    },
                    "properties": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "object",
                          "required": [
                            "type",
                            "enum"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "string"
                              ]
                            },
                            "enum": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "additionalProperties": false
                        },
                        "access_point_uuid": {
                          "type": "object",
                          "required": [
                            "type",
                            "enum"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "string"
                              ]
                            },
                            "enum": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "additionalProperties": false
                        },
                        "user_uuid": {
                          "type": "object",
                          "required": [
                            "type",
                            "enum"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "string"
                              ]
                            },
                            "enum": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "props": {
                            "type": "object"
                          }
                        }
                      }
                    },
                    "active": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified event was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "events",
          "filters"
        ],
        "description": "Delete access event filter",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "access event filter successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access event filter does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "audit",
          "events",
          "filters"
        ],
        "description": "Create new filter",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "access event filter uuid"
          }
        ],
        "requestBody": {
          "description": "Creates new audit event filter in database",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "properties"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "Уникальный идентификатор"
                  },
                  "properties": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "object",
                        "required": [
                          "type",
                          "enum"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "string"
                            ]
                          },
                          "enum": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  },
                  "actions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "props": {
                          "type": "object"
                        }
                      }
                    }
                  },
                  "active": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "audit event filter has been successfully added",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "audit event filter already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tt_export/configs/{uuid}": {
      "get": {
        "tags": [
          "export"
        ],
        "description": "Get time tracking export configuration by UUID",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully received configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "name",
                    "period",
                    "format",
                    "outer_zones",
                    "inner_zones"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "period": {
                      "type": "string",
                      "enum": [
                        "day",
                        "prev_day",
                        "week",
                        "prev_week",
                        "month",
                        "prev_month"
                      ]
                    },
                    "format": {
                      "type": "string",
                      "enum": [
                        "CSV",
                        "JSON"
                      ]
                    },
                    "delimeter": {
                      "type": "string",
                      "minLength": 1
                    },
                    "outer_zones": {
                      "description": "Zones moving to which is interpreted as exit, from - entrance",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "inner_zones": {
                      "description": "Zones moving to which is interpreted as entrance, from - exit",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "staff_filter": {
                      "description": "Filter staff by some staff properties",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "prop_name",
                          "prop_values"
                        ],
                        "properties": {
                          "prop_name": {
                            "type": "string",
                            "description": "property name"
                          },
                          "prop_values": {
                            "description": "Array of acceptable property values",
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "from": {
                      "type": "integer",
                      "format": "int64",
                      "description": "UNIX timestamp in milliseconds"
                    },
                    "to": {
                      "type": "integer",
                      "format": "int64",
                      "description": "UNIX timestamp in milliseconds"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Wrong UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified configuration does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "export"
        ],
        "description": "Update existing configuration",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "name",
                  "period",
                  "format",
                  "outer_zones",
                  "inner_zones"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string"
                  },
                  "period": {
                    "type": "string",
                    "enum": [
                      "day",
                      "prev_day",
                      "week",
                      "prev_week",
                      "month",
                      "prev_month"
                    ]
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "CSV",
                      "JSON"
                    ]
                  },
                  "delimeter": {
                    "type": "string",
                    "minLength": 1
                  },
                  "outer_zones": {
                    "description": "Zones moving to which is interpreted as exit, from - entrance",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "inner_zones": {
                    "description": "Zones moving to which is interpreted as entrance, from - exit",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "staff_filter": {
                    "description": "Filter staff by some staff properties",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "prop_name",
                        "prop_values"
                      ],
                      "properties": {
                        "prop_name": {
                          "type": "string",
                          "description": "property name"
                        },
                        "prop_values": {
                          "description": "Array of acceptable property values",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "from": {
                    "type": "integer",
                    "format": "int64",
                    "description": "UNIX timestamp in milliseconds"
                  },
                  "to": {
                    "type": "integer",
                    "format": "int64",
                    "description": "UNIX timestamp in milliseconds"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified configuration does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "export"
        ],
        "description": "Delete specified configuration",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted specified configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified configuration does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tt_export/configs": {
      "get": {
        "tags": [
          "export"
        ],
        "description": "Returns all time tracking export configurations",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successfully got all configurations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "name",
                      "period",
                      "format",
                      "outer_zones",
                      "inner_zones"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "name": {
                        "type": "string"
                      },
                      "period": {
                        "type": "string",
                        "enum": [
                          "day",
                          "prev_day",
                          "week",
                          "prev_week",
                          "month",
                          "prev_month"
                        ]
                      },
                      "format": {
                        "type": "string",
                        "enum": [
                          "CSV",
                          "JSON"
                        ]
                      },
                      "delimeter": {
                        "type": "string",
                        "minLength": 1
                      },
                      "outer_zones": {
                        "description": "Zones moving to which is interpreted as exit, from - entrance",
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "inner_zones": {
                        "description": "Zones moving to which is interpreted as entrance, from - exit",
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "staff_filter": {
                        "description": "Filter staff by some staff properties",
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "prop_name",
                            "prop_values"
                          ],
                          "properties": {
                            "prop_name": {
                              "type": "string",
                              "description": "property name"
                            },
                            "prop_values": {
                              "description": "Array of acceptable property values",
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      },
                      "from": {
                        "type": "integer",
                        "format": "int64",
                        "description": "UNIX timestamp in milliseconds"
                      },
                      "to": {
                        "type": "integer",
                        "format": "int64",
                        "description": "UNIX timestamp in milliseconds"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "export"
        ],
        "description": "Create new configuration",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "name",
                  "period",
                  "format",
                  "outer_zones",
                  "inner_zones"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string"
                  },
                  "period": {
                    "type": "string",
                    "enum": [
                      "day",
                      "prev_day",
                      "week",
                      "prev_week",
                      "month",
                      "prev_month"
                    ]
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "CSV",
                      "JSON"
                    ]
                  },
                  "delimeter": {
                    "type": "string",
                    "minLength": 1
                  },
                  "outer_zones": {
                    "description": "Zones moving to which is interpreted as exit, from - entrance",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "inner_zones": {
                    "description": "Zones moving to which is interpreted as entrance, from - exit",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "staff_filter": {
                    "description": "Filter staff by some staff properties",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "prop_name",
                        "prop_values"
                      ],
                      "properties": {
                        "prop_name": {
                          "type": "string",
                          "description": "property name"
                        },
                        "prop_values": {
                          "description": "Array of acceptable property values",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "from": {
                    "type": "integer",
                    "format": "int64",
                    "description": "UNIX timestamp in milliseconds"
                  },
                  "to": {
                    "type": "integer",
                    "format": "int64",
                    "description": "UNIX timestamp in milliseconds"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successfully created new configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Configuration already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tt_export/{uuid}": {
      "get": {
        "tags": [
          "export"
        ],
        "description": "Get time tracking export with specified configuration",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            },
            "description": "Zones export configuration UUID"
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "description": "UNIX timestamp to search events from in milliseconds. This parameter overrides period",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "description": "UNIX timestamp to search events to in milliseconds (ignored if 'from' was not specified). If not specified and 'from' does, assumed as now. This parameter overrides period",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "format",
            "schema": {
              "type": "string",
              "enum": [
                "CSV",
                "JSON"
              ]
            },
            "required": false,
            "description": "Override format parameter from configuration"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully received export file",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Specified configuration was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tt_report/configs/{uuid}": {
      "get": {
        "tags": [
          "export"
        ],
        "description": "Get time tracking reports configuration by UUID",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully received configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "name",
                    "period",
                    "outer_zones",
                    "inner_zones",
                    "work_start_time",
                    "work_end_time",
                    "work_day_length_min"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "period": {
                      "type": "string",
                      "enum": [
                        "day",
                        "prev_day",
                        "week",
                        "prev_week",
                        "month",
                        "prev_month"
                      ]
                    },
                    "delimeter": {
                      "type": "string",
                      "minLength": 1
                    },
                    "outer_zones": {
                      "description": "Zones moving to which is interpreted as exit, from - entrance",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "inner_zones": {
                      "description": "Zones moving to which is interpreted as entrance, from - exit",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "staff_filter": {
                      "description": "Filter staff by some staff properties",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "prop_name",
                          "prop_values"
                        ],
                        "properties": {
                          "prop_name": {
                            "type": "string",
                            "description": "property name"
                          },
                          "prop_values": {
                            "description": "Array of acceptable property values",
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "count_time_mode": {
                      "type": "boolean",
                      "description": "True means: first entry - last exit scheme, false means: enter - exit scheme"
                    },
                    "lunch_break": {
                      "type": "string",
                      "description": "Whether to take into account the lunch break"
                    },
                    "lunch_break_mode": {
                      "type": "boolean",
                      "description": "Lunch break duration in format: HH:mm"
                    },
                    "use_zones": {
                      "type": "boolean",
                      "description": "Whether to consider zones"
                    },
                    "lunch_calc_day_end": {
                      "type": "boolean",
                      "description": "Using a lunch break in end-of-work calculations"
                    },
                    "work_start_time": {
                      "type": "string",
                      "description": "Work start time in format: HH:mm"
                    },
                    "work_end_time": {
                      "type": "string",
                      "description": "Work end time in format: HH:mm"
                    },
                    "work_day_length_min": {
                      "type": "integer",
                      "minimum": 1,
                      "description": "Work day lenght in minutes"
                    },
                    "time_zone_offset": {
                      "type": "integer",
                      "description": "Time zone offset in minutes"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Wrong UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified configuration does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "export"
        ],
        "description": "Update existing configuration",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "name",
                  "period",
                  "outer_zones",
                  "inner_zones",
                  "work_start_time",
                  "work_end_time",
                  "work_day_length_min"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string"
                  },
                  "period": {
                    "type": "string",
                    "enum": [
                      "day",
                      "prev_day",
                      "week",
                      "prev_week",
                      "month",
                      "prev_month"
                    ]
                  },
                  "delimeter": {
                    "type": "string",
                    "minLength": 1
                  },
                  "outer_zones": {
                    "description": "Zones moving to which is interpreted as exit, from - entrance",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "inner_zones": {
                    "description": "Zones moving to which is interpreted as entrance, from - exit",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "staff_filter": {
                    "description": "Filter staff by some staff properties",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "prop_name",
                        "prop_values"
                      ],
                      "properties": {
                        "prop_name": {
                          "type": "string",
                          "description": "property name"
                        },
                        "prop_values": {
                          "description": "Array of acceptable property values",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "count_time_mode": {
                    "type": "boolean",
                    "description": "True means: first entry - last exit scheme, false means: enter - exit scheme"
                  },
                  "lunch_break": {
                    "type": "string",
                    "description": "Whether to take into account the lunch break"
                  },
                  "lunch_break_mode": {
                    "type": "boolean",
                    "description": "Lunch break duration in format: HH:mm"
                  },
                  "use_zones": {
                    "type": "boolean",
                    "description": "Whether to consider zones"
                  },
                  "lunch_calc_day_end": {
                    "type": "boolean",
                    "description": "Using a lunch break in end-of-work calculations"
                  },
                  "work_start_time": {
                    "type": "string",
                    "description": "Work start time in format: HH:mm"
                  },
                  "work_end_time": {
                    "type": "string",
                    "description": "Work end time in format: HH:mm"
                  },
                  "work_day_length_min": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Work day lenght in minutes"
                  },
                  "time_zone_offset": {
                    "type": "integer",
                    "description": "Time zone offset in minutes"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified configuration does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "export"
        ],
        "description": "Delete specified configuration",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted specified configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified configuration does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tt_report/configs": {
      "get": {
        "tags": [
          "export"
        ],
        "description": "Returns all time tracking reports configurations",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successfully got all configurations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "name",
                      "period",
                      "outer_zones",
                      "inner_zones",
                      "work_start_time",
                      "work_end_time",
                      "work_day_length_min"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "name": {
                        "type": "string"
                      },
                      "period": {
                        "type": "string",
                        "enum": [
                          "day",
                          "prev_day",
                          "week",
                          "prev_week",
                          "month",
                          "prev_month"
                        ]
                      },
                      "delimeter": {
                        "type": "string",
                        "minLength": 1
                      },
                      "outer_zones": {
                        "description": "Zones moving to which is interpreted as exit, from - entrance",
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "inner_zones": {
                        "description": "Zones moving to which is interpreted as entrance, from - exit",
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "staff_filter": {
                        "description": "Filter staff by some staff properties",
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "prop_name",
                            "prop_values"
                          ],
                          "properties": {
                            "prop_name": {
                              "type": "string",
                              "description": "property name"
                            },
                            "prop_values": {
                              "description": "Array of acceptable property values",
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      },
                      "count_time_mode": {
                        "type": "boolean",
                        "description": "True means: first entry - last exit scheme, false means: enter - exit scheme"
                      },
                      "lunch_break": {
                        "type": "string",
                        "description": "Whether to take into account the lunch break"
                      },
                      "lunch_break_mode": {
                        "type": "boolean",
                        "description": "Lunch break duration in format: HH:mm"
                      },
                      "use_zones": {
                        "type": "boolean",
                        "description": "Whether to consider zones"
                      },
                      "lunch_calc_day_end": {
                        "type": "boolean",
                        "description": "Using a lunch break in end-of-work calculations"
                      },
                      "work_start_time": {
                        "type": "string",
                        "description": "Work start time in format: HH:mm"
                      },
                      "work_end_time": {
                        "type": "string",
                        "description": "Work end time in format: HH:mm"
                      },
                      "work_day_length_min": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Work day lenght in minutes"
                      },
                      "time_zone_offset": {
                        "type": "integer",
                        "description": "Time zone offset in minutes"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "export"
        ],
        "description": "Create new configuration",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "name",
                  "period",
                  "outer_zones",
                  "inner_zones",
                  "work_start_time",
                  "work_end_time",
                  "work_day_length_min"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string"
                  },
                  "period": {
                    "type": "string",
                    "enum": [
                      "day",
                      "prev_day",
                      "week",
                      "prev_week",
                      "month",
                      "prev_month"
                    ]
                  },
                  "delimeter": {
                    "type": "string",
                    "minLength": 1
                  },
                  "outer_zones": {
                    "description": "Zones moving to which is interpreted as exit, from - entrance",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "inner_zones": {
                    "description": "Zones moving to which is interpreted as entrance, from - exit",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "staff_filter": {
                    "description": "Filter staff by some staff properties",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "prop_name",
                        "prop_values"
                      ],
                      "properties": {
                        "prop_name": {
                          "type": "string",
                          "description": "property name"
                        },
                        "prop_values": {
                          "description": "Array of acceptable property values",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "count_time_mode": {
                    "type": "boolean",
                    "description": "True means: first entry - last exit scheme, false means: enter - exit scheme"
                  },
                  "lunch_break": {
                    "type": "string",
                    "description": "Whether to take into account the lunch break"
                  },
                  "lunch_break_mode": {
                    "type": "boolean",
                    "description": "Lunch break duration in format: HH:mm"
                  },
                  "use_zones": {
                    "type": "boolean",
                    "description": "Whether to consider zones"
                  },
                  "lunch_calc_day_end": {
                    "type": "boolean",
                    "description": "Using a lunch break in end-of-work calculations"
                  },
                  "work_start_time": {
                    "type": "string",
                    "description": "Work start time in format: HH:mm"
                  },
                  "work_end_time": {
                    "type": "string",
                    "description": "Work end time in format: HH:mm"
                  },
                  "work_day_length_min": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Work day lenght in minutes"
                  },
                  "time_zone_offset": {
                    "type": "integer",
                    "description": "Time zone offset in minutes"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successfully created new configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Configuration already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tt_report/{uuid}": {
      "get": {
        "tags": [
          "export"
        ],
        "description": "Get time tracking report export with specified configuration",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            },
            "description": "Zones export configuration UUID"
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "description": "UNIX timestamp to search events from in milliseconds. This parameter overrides period",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "description": "UNIX timestamp to search events to in milliseconds (ignored if 'from' was not specified). If not specified and 'from' does, assumed as now. This parameter overrides period",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully received export file",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Specified configuration was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/share_vpn/status": {
      "get": {
        "tags": [
          "vpn"
        ],
        "description": "Get current VPN connection status",
        "responses": {
          "200": {
            "description": "Successfully received connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "error_status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "DISCONNECTED",
                        "CONNECTING",
                        "CONNECTED",
                        "ERROR"
                      ]
                    },
                    "error_status": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/share_vpn": {
      "get": {
        "tags": [
          "vpn"
        ],
        "description": "Get VPN share string",
        "parameters": [
          {
            "in": "query",
            "name": "serial",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got VPN share string",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "connection_string"
                  ],
                  "properties": {
                    "connection_string": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "vpn"
        ],
        "description": "Share other controller's VPN",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "connection_string"
                ],
                "properties": {
                  "connection_string": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully connected to VPN",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vpn/{serial}": {
      "delete": {
        "tags": [
          "vpn"
        ],
        "description": "Remove controller from cluster",
        "parameters": [
          {
            "in": "path",
            "name": "serial",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully removed controller from cluster",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Controller with specified serial is not in cluster",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Deletion not allowed synchronization",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vpn/members": {
      "get": {
        "tags": [
          "vpn"
        ],
        "description": "Get VPN members list",
        "responses": {
          "200": {
            "description": "Successfully got VPN members serial numbers list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "vpn_members",
                    "self"
                  ],
                  "properties": {
                    "vpn_members": {
                      "description": "Array of vpn members data (serial code and IP address)",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "serial",
                          "address",
                          "online"
                        ],
                        "properties": {
                          "serial": {
                            "type": "string",
                            "description": "Controller serial"
                          },
                          "address": {
                            "type": "string",
                            "description": "Controller current IP address"
                          },
                          "online": {
                            "type": "boolean",
                            "description": "Controller is online in VPN network"
                          }
                        }
                      }
                    },
                    "self": {
                      "type": "string",
                      "description": "This controller serial"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vpn/master/status": {
      "get": {
        "tags": [
          "vpn"
        ],
        "description": "Get synchronization master status",
        "responses": {
          "200": {
            "description": "Successfully got synchronization master status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "stage",
                    "controller",
                    "progress",
                    "error"
                  ],
                  "properties": {
                    "stage": {
                      "type": "string",
                      "enum": [
                        "STOPPED",
                        "HAND_SHAKE",
                        "CLEANUP",
                        "DATA_SYNC",
                        "DATA_SYNC_END",
                        "EVENTS_SYNC",
                        "SYNC_END"
                      ]
                    },
                    "controller": {
                      "type": "string"
                    },
                    "progress": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 100,
                      "description": "Sync progress in percentage"
                    },
                    "error": {
                      "description": "In case of error occured during last sync process, this field will contain error description",
                      "type": "string"
                    },
                    "last_sync_end_timestamp_ms": {
                      "description": "Last remembered synchronization UNIX timestamp in milliseconds",
                      "type": "integer",
                      "format": "int64"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vpn/master/sync/stop": {
      "post": {
        "tags": [
          "vpn"
        ],
        "description": "Stop data synchronization to specified controller",
        "responses": {
          "200": {
            "description": "Successfully stopped data synchronization",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vpn/master/sync/{serial}/{action}": {
      "post": {
        "tags": [
          "vpn"
        ],
        "description": "Start/stop data synchronization to specified controller",
        "parameters": [
          {
            "in": "path",
            "name": "serial",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "action",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "queue",
                "dequeue"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully started/stopped data synchronization",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Synchronization with ourselves does not make scence",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Synchronization already in progress",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vpn/slave/status": {
      "get": {
        "tags": [
          "vpn"
        ],
        "description": "Get synchronization slave status",
        "responses": {
          "200": {
            "description": "Successfully got synchronization slave status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "stage",
                    "progress",
                    "error",
                    "controller"
                  ],
                  "properties": {
                    "stage": {
                      "type": "string",
                      "enum": [
                        "STOPPED",
                        "HAND_SHAKE",
                        "CLEANUP",
                        "DATA_SYNC",
                        "DATA_SYNC_END",
                        "EVENTS_SYNC",
                        "SYNC_END"
                      ]
                    },
                    "progress": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 100,
                      "description": "Synchronization progress in percentage"
                    },
                    "error": {
                      "description": "In case of error occured during last sync process, this field will contain error description",
                      "type": "string"
                    },
                    "controller": {
                      "description": "Sync master controller serial",
                      "type": "string"
                    },
                    "last_sync_end_timestamp_ms": {
                      "description": "Last remembered synchronization UNIX timestamp in milliseconds",
                      "type": "integer",
                      "format": "int64"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vpn/slave/sync/{action}": {
      "post": {
        "tags": [
          "vpn"
        ],
        "description": "Start/stop data synchronization from another controller",
        "parameters": [
          {
            "in": "path",
            "name": "action",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "stop"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully started/stopped data synchronization",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Synchronization already in progress",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vpn/replace_controller": {
      "post": {
        "tags": [
          "vpn"
        ],
        "description": "Replace controller",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "controller_from",
                  "controller_to"
                ],
                "properties": {
                  "controller_from": {
                    "type": "string",
                    "minLength": 1
                  },
                  "controller_to": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully replaced controller",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vpn/set_member_name/{serial_num}": {
      "put": {
        "tags": [
          "vpn"
        ],
        "description": "Изменить пользовательское имя участника vpn",
        "parameters": [
          {
            "in": "path",
            "name": "serial_num",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 50,
                    "description": "Название (максимум 50 символов)"
                  }
                },
                "example": {
                  "name": "Тестовое имя"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Пользовательское имя участника VPN успешно изменено",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Участник VPN с таким серийным номером не найден",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Серверная ошибка добавления пользовательского имени участника VPN",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vpn/date_time": {
      "get": {
        "tags": [
          "vpn"
        ],
        "description": "Получить статус об отклонении во времени контроллеров кластера",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "statuses"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "statuses": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "ok",
                          "error",
                          "unknown"
                        ]
                      },
                      "example": {
                        "00000001": "ok",
                        "00000002": "error",
                        "00000003": "unknown"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/info": {
      "get": {
        "tags": [
          "info"
        ],
        "description": "Get controller info",
        "responses": {
          "200": {
            "description": "Returns controller description",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "serial",
                    "current_time",
                    "memory_usage",
                    "memory_total",
                    "disk_usage",
                    "disk_total",
                    "cpu_load",
                    "uptime",
                    "version",
                    "licence"
                  ],
                  "properties": {
                    "serial": {
                      "type": "string",
                      "description": "Controller serial number"
                    },
                    "current_time": {
                      "type": "integer",
                      "format": "int64",
                      "description": "Controller current time as UTC UNIX timestamp in milliseconds"
                    },
                    "current_date_time_string": {
                      "type": "string"
                    },
                    "memory_usage": {
                      "type": "integer",
                      "description": "Used RAM in percentage"
                    },
                    "memory_total": {
                      "type": "integer",
                      "description": "Total RAM in bytes"
                    },
                    "disk_usage": {
                      "type": "integer",
                      "description": "Current disk usage in percentage"
                    },
                    "disk_total": {
                      "type": "integer",
                      "description": "Disk total size in bytes"
                    },
                    "cpu_load": {
                      "type": "integer"
                    },
                    "uptime": {
                      "type": "integer",
                      "description": "System uptime in seconds"
                    },
                    "version": {
                      "type": "object",
                      "required": [
                        "main"
                      ],
                      "properties": {
                        "main": {
                          "type": "string"
                        }
                      }
                    },
                    "licence": {
                      "type": "string",
                      "enum": [
                        "BASIC",
                        "ENBERPRISE"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/directories": {
      "get": {
        "tags": [
          "directories"
        ],
        "description": "Returns list of directories",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successfully returned list of directories",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "name",
                      "value_type",
                      "values"
                    ],
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "value_type": {
                        "type": "string",
                        "enum": [
                          "string",
                          "integer"
                        ]
                      },
                      "values": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "directories"
        ],
        "description": "Add new directory",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "value_type",
                  "values"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "value_type": {
                    "type": "string",
                    "enum": [
                      "string",
                      "integer"
                    ]
                  },
                  "values": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Derectory has been successfully added"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Directory already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/directories/{name}": {
      "get": {
        "tags": [
          "directories"
        ],
        "description": "Get specified directory by name",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got directory with specified name",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "name",
                    "value_type",
                    "values"
                  ],
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "value_type": {
                      "type": "string",
                      "enum": [
                        "string",
                        "integer"
                      ]
                    },
                    "values": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified directory does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "directories"
        ],
        "description": "Update specified directory data",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "value_type",
                  "values"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "value_type": {
                    "type": "string",
                    "enum": [
                      "string",
                      "integer"
                    ]
                  },
                  "values": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully updated directory with specified name",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "name",
                    "value_type",
                    "values"
                  ],
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "value_type": {
                      "type": "string",
                      "enum": [
                        "string",
                        "integer"
                      ]
                    },
                    "values": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified directory does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "directories"
        ],
        "description": "Delete specified directory data",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted directory",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified directory does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/commands/{command}": {
      "post": {
        "tags": [
          "commands"
        ],
        "description": "Execute command",
        "parameters": [
          {
            "in": "path",
            "name": "command",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "APPLY_STAFF_PROPERTIES",
                "TEST_FLASH",
                "REBOOT",
                "RESTART_REST_API",
                "CLEAR_CONFIG"
              ]
            }
          },
          {
            "in": "query",
            "name": "serial",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Command accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "name",
                    "value_type",
                    "values"
                  ],
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "value_type": {
                      "type": "string",
                      "enum": [
                        "string",
                        "integer"
                      ]
                    },
                    "values": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad command",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/images": {
      "post": {
        "tags": [
          "images"
        ],
        "description": "Save new image",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "image_data"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "image_data": {
                    "type": "string",
                    "format": "byte[]"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Image has been successfully saved"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Image already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/images/{uuid}": {
      "get": {
        "tags": [
          "images"
        ],
        "description": "Get image by UUID",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned image with specified UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "image_data"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "image_data": {
                      "type": "string",
                      "format": "byte[]"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified image does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "images"
        ],
        "description": "Replace image with new",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "image_data"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "image_data": {
                    "type": "string",
                    "format": "byte[]"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Image has been successfully saved"
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified image does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "images"
        ],
        "description": "Replace image with new",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Image has been successfully saved"
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified image does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/network": {
      "get": {
        "tags": [
          "configuration"
        ],
        "description": "Get network configuration",
        "responses": {
          "200": {
            "description": "Successfully sent network configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "dhcp"
                  ],
                  "properties": {
                    "dhcp": {
                      "type": "boolean"
                    },
                    "address": {
                      "type": "string",
                      "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
                    },
                    "netmask": {
                      "type": "string",
                      "pattern": "^(((255\\.){3}(255|254|252|248|240|224|192|128|0+))|((255\\.){2}(255|254|252|248|240|224|192|128|0+)\\.0)|((255\\.)(255|254|252|248|240|224|192|128|0+)(\\.0+){2})|((255|254|252|248|240|224|192|128|0+)(\\.0+){3}))$"
                    },
                    "gateway": {
                      "type": "string",
                      "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
                    },
                    "dns1": {
                      "type": "string",
                      "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
                    },
                    "dns2": {
                      "type": "string",
                      "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
                    },
                    "mac_address": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "configuration"
        ],
        "description": "Set new network configuration",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "dhcp"
                ],
                "properties": {
                  "dhcp": {
                    "type": "boolean"
                  },
                  "address": {
                    "type": "string",
                    "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
                  },
                  "netmask": {
                    "type": "string",
                    "pattern": "^(((255\\.){3}(255|254|252|248|240|224|192|128|0+))|((255\\.){2}(255|254|252|248|240|224|192|128|0+)\\.0)|((255\\.)(255|254|252|248|240|224|192|128|0+)(\\.0+){2})|((255|254|252|248|240|224|192|128|0+)(\\.0+){3}))$"
                  },
                  "gateway": {
                    "type": "string",
                    "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
                  },
                  "dns1": {
                    "type": "string",
                    "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
                  },
                  "dns2": {
                    "type": "string",
                    "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
                  },
                  "mac_address": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully set new network configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/date_time": {
      "get": {
        "tags": [
          "configuration"
        ],
        "description": "Get current date/time and timezone",
        "responses": {
          "200": {
            "description": "Successfully received current date/time",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ntp",
                    "timezone"
                  ],
                  "properties": {
                    "ntp": {
                      "type": "boolean",
                      "description": "Using ntp server"
                    },
                    "ntp_server": {
                      "type": "string",
                      "minLength": 1
                    },
                    "timestamp": {
                      "type": "integer",
                      "format": "int64",
                      "description": "UTC UNIX timestamp in milliseconds"
                    },
                    "timezone": {
                      "type": "string",
                      "description": "One of returned by GET on timezones request"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "configuration"
        ],
        "description": "Set current date/time and timezone",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ntp",
                  "timezone"
                ],
                "properties": {
                  "ntp": {
                    "type": "boolean",
                    "description": "Using ntp server"
                  },
                  "ntp_server": {
                    "type": "string",
                    "minLength": 1
                  },
                  "timestamp": {
                    "type": "integer",
                    "format": "int64",
                    "description": "UTC UNIX timestamp in milliseconds"
                  },
                  "timezone": {
                    "type": "string",
                    "description": "One of returned by GET on timezones request"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully set new date/time",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid date/time parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/date_time/timezones": {
      "get": {
        "tags": [
          "configuration"
        ],
        "description": "Returns available timezones with their offsets",
        "responses": {
          "200": {
            "description": "Successfully received timezones",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "name",
                      "offset",
                      "offset_string"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "offset": {
                        "type": "integer"
                      },
                      "offset_string": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/auth_users": {
      "get": {
        "tags": [
          "authorization"
        ],
        "description": "Get all authorization users",
        "responses": {
          "200": {
            "description": "Successfully returned all auth users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "login",
                      "user",
                      "role",
                      "exp"
                    ],
                    "properties": {
                      "login": {
                        "type": "string",
                        "minLength": 1
                      },
                      "password": {
                        "type": "string",
                        "minLength": 8
                      },
                      "user": {
                        "description": "UUID of user, owninig this login",
                        "type": "string"
                      },
                      "role": {
                        "description": "login privileges",
                        "type": "string",
                        "enum": [
                          "admin",
                          "manager",
                          "user",
                          "installer"
                        ]
                      },
                      "exp": {
                        "type": "integer",
                        "minimum": 5,
                        "description": "token life time"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "authorization"
        ],
        "description": "Add new authorization user",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "login",
                  "user",
                  "role",
                  "exp"
                ],
                "properties": {
                  "login": {
                    "type": "string",
                    "minLength": 1
                  },
                  "password": {
                    "type": "string",
                    "minLength": 8
                  },
                  "user": {
                    "description": "UUID of user, owninig this login",
                    "type": "string"
                  },
                  "role": {
                    "description": "login privileges",
                    "type": "string",
                    "enum": [
                      "admin",
                      "manager",
                      "user",
                      "installer"
                    ]
                  },
                  "exp": {
                    "type": "integer",
                    "minimum": 5,
                    "description": "token life time"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successfully added new auth user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "User with specified login already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/auth_users/{login}": {
      "get": {
        "tags": [
          "authorization"
        ],
        "description": "Get authorization user",
        "parameters": [
          {
            "in": "path",
            "name": "login",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned authorization user with specified login",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "User with specified login was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "authorization"
        ],
        "description": "Udate authorization user data",
        "parameters": [
          {
            "in": "path",
            "name": "login",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "login",
                  "user",
                  "role",
                  "exp"
                ],
                "properties": {
                  "login": {
                    "type": "string",
                    "minLength": 1
                  },
                  "password": {
                    "type": "string",
                    "minLength": 8
                  },
                  "user": {
                    "description": "UUID of user, owninig this login",
                    "type": "string"
                  },
                  "role": {
                    "description": "login privileges",
                    "type": "string",
                    "enum": [
                      "admin",
                      "manager",
                      "user",
                      "installer"
                    ]
                  },
                  "exp": {
                    "type": "integer",
                    "minimum": 5,
                    "description": "token life time"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully updated authorization user data"
          },
          "404": {
            "description": "User with specified login was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "authorization"
        ],
        "description": "Delete authorization user",
        "parameters": [
          {
            "in": "path",
            "name": "login",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully delete authorization user"
          },
          "404": {
            "description": "User with specified login was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/login": {
      "post": {
        "tags": [
          "authorization"
        ],
        "description": "Loggs in and returns auth JWT",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "login",
                  "password"
                ],
                "properties": {
                  "login": {
                    "type": "string",
                    "minLength": 1
                  },
                  "password": {
                    "type": "string",
                    "minLength": 8
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully logged in",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "user",
                    "token"
                  ],
                  "properties": {
                    "user": {
                      "type": "object",
                      "required": [
                        "login",
                        "role"
                      ],
                      "properties": {
                        "login": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "admin",
                            "manager",
                            "user",
                            "installer"
                          ]
                        }
                      }
                    },
                    "token": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Bad login/password pair",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/extend_session": {
      "post": {
        "tags": [
          "authorization"
        ],
        "description": "Extends current user session",
        "responses": {
          "200": {
            "description": "Successfully extended user session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "user",
                    "token"
                  ],
                  "properties": {
                    "user": {
                      "type": "object",
                      "required": [
                        "login",
                        "role"
                      ],
                      "properties": {
                        "login": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "admin",
                            "manager",
                            "user",
                            "installer"
                          ]
                        }
                      }
                    },
                    "token": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/firmware_update": {
      "get": {
        "deprecated": true,
        "tags": [
          "firmware"
        ],
        "description": "Get firmware update status",
        "responses": {
          "200": {
            "description": "Returned firmware update status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "STARTED",
                        "STOPPED",
                        "NEED RESTART"
                      ]
                    },
                    "progress": {
                      "description": "Firmware update progress",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 100
                    },
                    "stage": {
                      "description": "Firmware update stage",
                      "type": "string"
                    },
                    "error_status": {
                      "description": "If error occured during update",
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "deprecated": true,
        "tags": [
          "firmware"
        ],
        "description": "Start firmware update",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "upload_file_size": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Optional size of uploaded file in bytes"
                  },
                  "update_file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Firmware file to upload"
                  }
                },
                "required": [
                  "update_file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Firmware update started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Firmware update already in progress",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/firmware_update/status": {
      "get": {
        "tags": [
          "firmware"
        ],
        "description": "Get firmware update status",
        "responses": {
          "200": {
            "description": "Returned firmware update status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "STARTED",
                        "STOPPED",
                        "NEED RESTART"
                      ]
                    },
                    "progress": {
                      "description": "Firmware update progress",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 100
                    },
                    "stage": {
                      "description": "Firmware update stage",
                      "type": "string"
                    },
                    "error_status": {
                      "description": "If error occured during update",
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/firmware_update/upload": {
      "post": {
        "tags": [
          "firmware"
        ],
        "description": "Start firmware upload",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "upload_file_size": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Optional size of uploaded file in bytes"
                  },
                  "update_file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Firmware file to upload"
                  }
                },
                "required": [
                  "update_file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Firmware upload",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Firmware update already in progress",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/firmware_update/install": {
      "post": {
        "tags": [
          "firmware"
        ],
        "description": "Start firmware install",
        "responses": {
          "200": {
            "description": "Firmware update started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Firmware update already in progress",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/firmware_update/cancel": {
      "post": {
        "tags": [
          "firmware"
        ],
        "description": "Cancel firmware install",
        "responses": {
          "200": {
            "description": "Firmware update started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Firmware update already in progress",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/certificate": {
      "get": {
        "tags": [
          "certificate"
        ],
        "description": "Get CA root or server certificate",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "root",
                "server"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returned CA root or server certificate",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "certificate_file",
                    "type"
                  ],
                  "properties": {
                    "certificate_file": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "root",
                        "server"
                      ]
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/controller_search/status": {
      "get": {
        "tags": [
          "controllers search"
        ],
        "description": "Get controllers search status",
        "responses": {
          "200": {
            "description": "Successfully received search status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/controller_search": {
      "get": {
        "tags": [
          "controllers search"
        ],
        "description": "Get controllers search results",
        "responses": {
          "200": {
            "description": "Successfully returned search results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "address",
                      "udn",
                      "name",
                      "searial",
                      "description",
                      "model"
                    ],
                    "properties": {
                      "address": {
                        "type": "string"
                      },
                      "udn": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "serial": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "model": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "cluster"
        ],
        "description": "Start/stop controllers search",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "command"
                ],
                "properties": {
                  "command": {
                    "type": "string",
                    "enum": [
                      "START",
                      "STOP"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully started/stopped search",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Search is already in progress",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/serial": {
      "get": {
        "tags": [
          "info"
        ],
        "description": "Get controller serial number",
        "responses": {
          "200": {
            "description": "Successfully received controller serial number as string reply",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/onvif": {
      "get": {
        "tags": [
          "onvif"
        ],
        "description": "Get current ONVIF configuration",
        "responses": {
          "200": {
            "description": "Successfully got ONVIF configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "DISCOVERY_MODE",
                    "login"
                  ],
                  "properties": {
                    "DISCOVERY_MODE": {
                      "type": "string",
                      "enum": [
                        "Discoverable",
                        "NonDiscoverable"
                      ]
                    },
                    "login": {
                      "type": "string",
                      "minLength": 3
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "onvif"
        ],
        "description": "Set ONVIF configuration",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "DISCOVERY_MODE"
                ],
                "properties": {
                  "DISCOVERY_MODE": {
                    "type": "string",
                    "enum": [
                      "Discoverable",
                      "NonDiscoverable"
                    ]
                  },
                  "login": {
                    "type": "string",
                    "minLength": 3
                  },
                  "password": {
                    "type": "string",
                    "minLength": 8
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully set new ONVIF configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/licence": {
      "get": {
        "tags": [
          "licence"
        ],
        "description": "Get current licence type",
        "responses": {
          "200": {
            "description": "Returns current licence type",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "licence"
                  ],
                  "properties": {
                    "licence": {
                      "type": "string",
                      "enum": [
                        "BASIC",
                        "ENTERPRISE"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "licence"
        ],
        "description": "Upgrade licence",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "licence"
                ],
                "properties": {
                  "licence": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Licence successfully upgraded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad licence file",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/r3/integration": {
      "get": {
        "tags": [
          "R3"
        ],
        "description": "Get R3 integration configuration",
        "responses": {
          "200": {
            "description": "Successfully received R3 integration configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "state",
                    "connections"
                  ],
                  "properties": {
                    "state": {
                      "type": "string",
                      "enum": [
                        "ACTIVE",
                        "INACTIVE"
                      ]
                    },
                    "connections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "controller",
                          "ms1_address",
                          "ms1_baud_rate",
                          "zones"
                        ],
                        "properties": {
                          "controller": {
                            "type": "string",
                            "description": "Serial of controller connected to R3"
                          },
                          "ms1_address": {
                            "type": "string",
                            "description": "Address of MS-1 module on RS485 buss"
                          },
                          "ms1_baud_rate": {
                            "type": "integer",
                            "enum": [
                              9600,
                              19200,
                              38400,
                              57600,
                              115200
                            ]
                          },
                          "zones": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "id",
                                "access_points"
                              ],
                              "properties": {
                                "id": {
                                  "type": "number",
                                  "minimum": 1,
                                  "description": "Security zone in R3"
                                },
                                "access_points": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "description": "Access points in security zone"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "R3"
        ],
        "description": "Set R3 integration configuration",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "state",
                  "connections"
                ],
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "ACTIVE",
                      "INACTIVE"
                    ]
                  },
                  "connections": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "controller",
                        "ms1_address",
                        "ms1_baud_rate",
                        "zones"
                      ],
                      "properties": {
                        "controller": {
                          "type": "string",
                          "description": "Serial of controller connected to R3"
                        },
                        "ms1_address": {
                          "type": "string",
                          "description": "Address of MS-1 module on RS485 buss"
                        },
                        "ms1_baud_rate": {
                          "type": "integer",
                          "enum": [
                            9600,
                            19200,
                            38400,
                            57600,
                            115200
                          ]
                        },
                        "zones": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "id",
                              "access_points"
                            ],
                            "properties": {
                              "id": {
                                "type": "number",
                                "minimum": 1,
                                "description": "Security zone in R3"
                              },
                              "access_points": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "description": "Access points in security zone"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully set new R3 configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/r3/config": {
      "get": {
        "tags": [
          "R3"
        ],
        "description": "Get R3 native configuration",
        "responses": {
          "200": {
            "description": "Successfully received R3 native configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "controller",
                      "configuration"
                    ],
                    "properties": {
                      "controller": {
                        "type": "string",
                        "description": "Controller serial"
                      },
                      "configuration": {
                        "type": "object",
                        "required": [
                          "devices",
                          "sec_zones"
                        ],
                        "properties": {
                          "devices": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "address",
                                "deviceType"
                              ],
                              "properties": {
                                "address": {
                                  "type": "integer",
                                  "minimum": 0
                                },
                                "deviceType": {
                                  "type": "integer"
                                },
                                "description": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "sec_zones": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "devices",
                                "address",
                                "description"
                              ],
                              "properties": {
                                "devices": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "address",
                                      "zone"
                                    ],
                                    "properties": {
                                      "address": {
                                        "type": "integer",
                                        "minimum": 0
                                      },
                                      "zone": {
                                        "type": "integer"
                                      }
                                    }
                                  }
                                },
                                "address": {
                                  "type": "integer",
                                  "minimum": 0
                                },
                                "description": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "R3"
        ],
        "description": "Set R3 native configuration",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "controller",
                    "configuration"
                  ],
                  "properties": {
                    "controller": {
                      "type": "string",
                      "description": "Controller serial"
                    },
                    "configuration": {
                      "type": "object",
                      "required": [
                        "devices",
                        "sec_zones"
                      ],
                      "properties": {
                        "devices": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "address",
                              "deviceType"
                            ],
                            "properties": {
                              "address": {
                                "type": "integer",
                                "minimum": 0
                              },
                              "deviceType": {
                                "type": "integer"
                              },
                              "description": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "sec_zones": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "devices",
                              "address",
                              "description"
                            ],
                            "properties": {
                              "devices": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "required": [
                                    "address",
                                    "zone"
                                  ],
                                  "properties": {
                                    "address": {
                                      "type": "integer",
                                      "minimum": 0
                                    },
                                    "zone": {
                                      "type": "integer"
                                    }
                                  }
                                }
                              },
                              "address": {
                                "type": "integer",
                                "minimum": 0
                              },
                              "description": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully set new R3 configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/security_integration/r3/integration": {
      "get": {
        "tags": [
          "R3"
        ],
        "description": "Get R3 integration configuration",
        "responses": {
          "200": {
            "description": "Successfully received R3 integration configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "state",
                    "connections"
                  ],
                  "properties": {
                    "state": {
                      "type": "string",
                      "enum": [
                        "ACTIVE",
                        "INACTIVE"
                      ]
                    },
                    "connections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "controller",
                          "ms1_address",
                          "ms1_baud_rate",
                          "zones"
                        ],
                        "properties": {
                          "controller": {
                            "type": "string",
                            "description": "Serial of controller connected to R3"
                          },
                          "ms1_address": {
                            "type": "string",
                            "description": "Address of MS-1 module on RS485 buss"
                          },
                          "ms1_baud_rate": {
                            "type": "integer",
                            "enum": [
                              9600,
                              19200,
                              38400,
                              57600,
                              115200
                            ]
                          },
                          "zones": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "id",
                                "access_points"
                              ],
                              "properties": {
                                "id": {
                                  "type": "number",
                                  "minimum": 1,
                                  "description": "Security zone in R3"
                                },
                                "access_points": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "description": "Access points in security zone"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "R3"
        ],
        "description": "Set R3 integration configuration",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "state",
                  "connections"
                ],
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "ACTIVE",
                      "INACTIVE"
                    ]
                  },
                  "connections": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "controller",
                        "ms1_address",
                        "ms1_baud_rate",
                        "zones"
                      ],
                      "properties": {
                        "controller": {
                          "type": "string",
                          "description": "Serial of controller connected to R3"
                        },
                        "ms1_address": {
                          "type": "string",
                          "description": "Address of MS-1 module on RS485 buss"
                        },
                        "ms1_baud_rate": {
                          "type": "integer",
                          "enum": [
                            9600,
                            19200,
                            38400,
                            57600,
                            115200
                          ]
                        },
                        "zones": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "id",
                              "access_points"
                            ],
                            "properties": {
                              "id": {
                                "type": "number",
                                "minimum": 1,
                                "description": "Security zone in R3"
                              },
                              "access_points": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "description": "Access points in security zone"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully set new R3 configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/security_integration/r3/config": {
      "get": {
        "tags": [
          "R3"
        ],
        "description": "Get R3 native configuration",
        "responses": {
          "200": {
            "description": "Successfully received R3 native configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "controller",
                      "configuration"
                    ],
                    "properties": {
                      "controller": {
                        "type": "string",
                        "description": "Controller serial"
                      },
                      "configuration": {
                        "type": "object",
                        "required": [
                          "devices",
                          "sec_zones"
                        ],
                        "properties": {
                          "devices": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "address",
                                "deviceType"
                              ],
                              "properties": {
                                "address": {
                                  "type": "integer",
                                  "minimum": 0
                                },
                                "deviceType": {
                                  "type": "integer"
                                },
                                "description": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "sec_zones": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "devices",
                                "address",
                                "description"
                              ],
                              "properties": {
                                "devices": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "address",
                                      "zone"
                                    ],
                                    "properties": {
                                      "address": {
                                        "type": "integer",
                                        "minimum": 0
                                      },
                                      "zone": {
                                        "type": "integer"
                                      }
                                    }
                                  }
                                },
                                "address": {
                                  "type": "integer",
                                  "minimum": 0
                                },
                                "description": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "R3"
        ],
        "description": "Set R3 native configuration",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "controller",
                    "configuration"
                  ],
                  "properties": {
                    "controller": {
                      "type": "string",
                      "description": "Controller serial"
                    },
                    "configuration": {
                      "type": "object",
                      "required": [
                        "devices",
                        "sec_zones"
                      ],
                      "properties": {
                        "devices": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "address",
                              "deviceType"
                            ],
                            "properties": {
                              "address": {
                                "type": "integer",
                                "minimum": 0
                              },
                              "deviceType": {
                                "type": "integer"
                              },
                              "description": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "sec_zones": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "devices",
                              "address",
                              "description"
                            ],
                            "properties": {
                              "devices": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "required": [
                                    "address",
                                    "zone"
                                  ],
                                  "properties": {
                                    "address": {
                                      "type": "integer",
                                      "minimum": 0
                                    },
                                    "zone": {
                                      "type": "integer"
                                    }
                                  }
                                }
                              },
                              "address": {
                                "type": "integer",
                                "minimum": 0
                              },
                              "description": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully set new R3 configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/security_integration/r3_link": {
      "get": {
        "tags": [
          "R3 link"
        ],
        "description": "Get R3 link integration configuration",
        "responses": {
          "200": {
            "description": "Successfully received R3 link integration configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "controller",
                      "status",
                      "state",
                      "ip_adr_r3mc",
                      "udp_port",
                      "mask"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      },
                      "controller": {
                        "type": "string",
                        "description": "Серийник контроллера, к которому подключен R3MC"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "ACTIVE",
                          "INACTIVE"
                        ]
                      },
                      "state": {
                        "type": "string",
                        "enum": [
                          "ONLINE",
                          "OFFLINE",
                          "UNKNOWN"
                        ]
                      },
                      "ip_adr_r3mc": {
                        "type": "string",
                        "pattern": "^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$",
                        "description": "IP Адрес R3MC"
                      },
                      "udp_port": {
                        "type": "integer",
                        "description": "Порт"
                      },
                      "mask": {
                        "type": "string",
                        "pattern": "^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$",
                        "description": "Маска подсети"
                      },
                      "ip_adr_strazh": {
                        "type": "string",
                        "pattern": "^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$",
                        "description": "IP Адрес от R3MC"
                      },
                      "config": {
                        "type": "object",
                        "required": [
                          "devices",
                          "sec_zones"
                        ],
                        "properties": {
                          "devices": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "address",
                                "deviceType"
                              ],
                              "properties": {
                                "address": {
                                  "type": "integer",
                                  "minimum": 0
                                },
                                "deviceType": {
                                  "type": "integer"
                                },
                                "description": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "sec_zones": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "devices",
                                "address"
                              ],
                              "properties": {
                                "devices": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "address",
                                      "zone"
                                    ],
                                    "properties": {
                                      "address": {
                                        "type": "integer",
                                        "minimum": 0
                                      },
                                      "zone": {
                                        "type": "integer"
                                      }
                                    }
                                  }
                                },
                                "address": {
                                  "type": "integer",
                                  "minimum": 0
                                },
                                "description": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      },
                      "zones": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "id",
                            "access_points"
                          ],
                          "properties": {
                            "id": {
                              "type": "integer",
                              "minimum": 1,
                              "description": "Security zone in R3 link"
                            },
                            "access_points": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "description": "Access points in security zone",
                                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                              }
                            },
                            "status": {
                              "type": "string",
                              "description": "zone status from integration"
                            }
                          }
                        }
                      },
                      "statistic": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "rx": {
                              "type": "integer",
                              "description": "receive packages"
                            },
                            "tx": {
                              "type": "integer",
                              "description": "outgoing packages"
                            },
                            "link": {
                              "type": "string",
                              "description": "is device online"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "R3 link"
        ],
        "description": "Set R3 link integration configuration",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "controller",
                  "status",
                  "state",
                  "ip_adr_r3mc",
                  "udp_port",
                  "mask"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  },
                  "controller": {
                    "type": "string",
                    "description": "Серийник контроллера, к которому подключен R3MC"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "ACTIVE",
                      "INACTIVE"
                    ]
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "ONLINE",
                      "OFFLINE",
                      "UNKNOWN"
                    ]
                  },
                  "ip_adr_r3mc": {
                    "type": "string",
                    "pattern": "^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$",
                    "description": "IP Адрес R3MC"
                  },
                  "udp_port": {
                    "type": "integer",
                    "description": "Порт"
                  },
                  "mask": {
                    "type": "string",
                    "pattern": "^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$",
                    "description": "Маска подсети"
                  },
                  "ip_adr_strazh": {
                    "type": "string",
                    "pattern": "^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$",
                    "description": "IP Адрес от R3MC"
                  },
                  "config": {
                    "type": "object",
                    "required": [
                      "devices",
                      "sec_zones"
                    ],
                    "properties": {
                      "devices": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "address",
                            "deviceType"
                          ],
                          "properties": {
                            "address": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "deviceType": {
                              "type": "integer"
                            },
                            "description": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "sec_zones": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "devices",
                            "address"
                          ],
                          "properties": {
                            "devices": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "address",
                                  "zone"
                                ],
                                "properties": {
                                  "address": {
                                    "type": "integer",
                                    "minimum": 0
                                  },
                                  "zone": {
                                    "type": "integer"
                                  }
                                }
                              }
                            },
                            "address": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "description": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  },
                  "zones": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "access_points"
                      ],
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1,
                          "description": "Security zone in R3 link"
                        },
                        "access_points": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "description": "Access points in security zone",
                            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                          }
                        },
                        "status": {
                          "type": "string",
                          "description": "zone status from integration"
                        }
                      }
                    }
                  },
                  "statistic": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "rx": {
                          "type": "integer",
                          "description": "receive packages"
                        },
                        "tx": {
                          "type": "integer",
                          "description": "outgoing packages"
                        },
                        "link": {
                          "type": "string",
                          "description": "is device online"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully set new R3 link configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/security_integration/r3_link/{id}": {
      "put": {
        "tags": [
          "R3 link"
        ],
        "description": "Set R3 link integration configuration",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "controller",
                  "status",
                  "state",
                  "ip_adr_r3mc",
                  "udp_port",
                  "mask"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  },
                  "controller": {
                    "type": "string",
                    "description": "Серийник контроллера, к которому подключен R3MC"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "ACTIVE",
                      "INACTIVE"
                    ]
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "ONLINE",
                      "OFFLINE",
                      "UNKNOWN"
                    ]
                  },
                  "ip_adr_r3mc": {
                    "type": "string",
                    "pattern": "^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$",
                    "description": "IP Адрес R3MC"
                  },
                  "udp_port": {
                    "type": "integer",
                    "description": "Порт"
                  },
                  "mask": {
                    "type": "string",
                    "pattern": "^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$",
                    "description": "Маска подсети"
                  },
                  "ip_adr_strazh": {
                    "type": "string",
                    "pattern": "^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$",
                    "description": "IP Адрес от R3MC"
                  },
                  "config": {
                    "type": "object",
                    "required": [
                      "devices",
                      "sec_zones"
                    ],
                    "properties": {
                      "devices": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "address",
                            "deviceType"
                          ],
                          "properties": {
                            "address": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "deviceType": {
                              "type": "integer"
                            },
                            "description": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "sec_zones": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "devices",
                            "address"
                          ],
                          "properties": {
                            "devices": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "address",
                                  "zone"
                                ],
                                "properties": {
                                  "address": {
                                    "type": "integer",
                                    "minimum": 0
                                  },
                                  "zone": {
                                    "type": "integer"
                                  }
                                }
                              }
                            },
                            "address": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "description": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  },
                  "zones": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "access_points"
                      ],
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1,
                          "description": "Security zone in R3 link"
                        },
                        "access_points": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "description": "Access points in security zone",
                            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                          }
                        },
                        "status": {
                          "type": "string",
                          "description": "zone status from integration"
                        }
                      }
                    }
                  },
                  "statistic": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "rx": {
                          "type": "integer",
                          "description": "receive packages"
                        },
                        "tx": {
                          "type": "integer",
                          "description": "outgoing packages"
                        },
                        "link": {
                          "type": "string",
                          "description": "is device online"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully put new R3 link configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "R3 link"
        ],
        "description": "Update parts of the R3 link integration configuration",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  },
                  "controller": {
                    "type": "string",
                    "description": "Серийник контроллера, к которому подключен R3MC"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "ACTIVE",
                      "INACTIVE"
                    ]
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "ONLINE",
                      "OFFLINE",
                      "UNKNOWN"
                    ]
                  },
                  "ip_adr_r3mc": {
                    "type": "string",
                    "pattern": "^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$",
                    "description": "IP Адрес R3MC"
                  },
                  "udp_port": {
                    "type": "integer",
                    "description": "Порт"
                  },
                  "mask": {
                    "type": "string",
                    "pattern": "^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$",
                    "description": "Маска подсети"
                  },
                  "ip_adr_strazh": {
                    "type": "string",
                    "pattern": "^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$",
                    "description": "IP Адрес от R3MC"
                  },
                  "config": {
                    "type": "object",
                    "required": [
                      "devices",
                      "sec_zones"
                    ],
                    "properties": {
                      "devices": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "address",
                            "deviceType"
                          ],
                          "properties": {
                            "address": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "deviceType": {
                              "type": "integer"
                            },
                            "description": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "sec_zones": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "devices",
                            "address"
                          ],
                          "properties": {
                            "devices": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "address",
                                  "zone"
                                ],
                                "properties": {
                                  "address": {
                                    "type": "integer",
                                    "minimum": 0
                                  },
                                  "zone": {
                                    "type": "integer"
                                  }
                                }
                              }
                            },
                            "address": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "description": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  },
                  "zones": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "access_points"
                      ],
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1,
                          "description": "Security zone in R3 link"
                        },
                        "access_points": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "description": "Access points in security zone",
                            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                          }
                        },
                        "status": {
                          "type": "string",
                          "description": "zone status from integration"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully patched R3 link configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "R3 link"
        ],
        "description": "Remove r3 link config",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully removed r3 link config",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/osdp_update": {
      "get": {
        "tags": [
          "OSDP"
        ],
        "description": "Get OSDP device update status",
        "responses": {
          "200": {
            "description": "Returned OSDP device update status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "STARTED",
                        "STOPPED"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "OSDP"
        ],
        "description": "Start OSDP device firmware update",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "devices",
                  "update_file"
                ],
                "properties": {
                  "devices": {
                    "type": "string"
                  },
                  "update_file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update successfully started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "OSDP update already in progress",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/osdp_lines_backup": {
      "get": {
        "tags": [
          "OSDP"
        ],
        "description": "Get OSDP backup configuration",
        "responses": {
          "200": {
            "description": "Successfully got OSD backup configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "backupers"
                  ],
                  "properties": {
                    "backupers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "controller"
                        ],
                        "properties": {
                          "controller": {
                            "type": "string",
                            "description": "Backuping controller serial"
                          },
                          "line_1": {
                            "description": "Line 1 backup configuration",
                            "type": "object",
                            "required": [
                              "controller",
                              "line"
                            ],
                            "properties": {
                              "controller": {
                                "type": "string",
                                "description": "Backuped controller serial"
                              },
                              "line": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 2,
                                "description": "Backuped line number"
                              }
                            }
                          },
                          "line_2": {
                            "description": "Line 2 backup configuration",
                            "type": "object",
                            "required": [
                              "controller",
                              "line"
                            ],
                            "properties": {
                              "controller": {
                                "type": "string",
                                "description": "Backuped controller serial"
                              },
                              "line": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 2,
                                "description": "Backuped line number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "OSDP"
        ],
        "description": "Update OSDP backup configuration",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "backupers"
                ],
                "properties": {
                  "backupers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "controller"
                      ],
                      "properties": {
                        "controller": {
                          "type": "string",
                          "description": "Backuping controller serial"
                        },
                        "line_1": {
                          "description": "Line 1 backup configuration",
                          "type": "object",
                          "required": [
                            "controller",
                            "line"
                          ],
                          "properties": {
                            "controller": {
                              "type": "string",
                              "description": "Backuped controller serial"
                            },
                            "line": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 2,
                              "description": "Backuped line number"
                            }
                          }
                        },
                        "line_2": {
                          "description": "Line 2 backup configuration",
                          "type": "object",
                          "required": [
                            "controller",
                            "line"
                          ],
                          "properties": {
                            "controller": {
                              "type": "string",
                              "description": "Backuped controller serial"
                            },
                            "line": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 2,
                              "description": "Backuped line number"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated OSDP backup configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "OSDP"
        ],
        "description": "Clear OSDP backup configuration",
        "responses": {
          "200": {
            "description": "Successfully deleted OSDP backup configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/osdp/config": {
      "get": {
        "tags": [
          "OSDP"
        ],
        "description": "Get OSDP configuration",
        "responses": {
          "200": {
            "description": "Successfully received OSDP configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "baudrate-line1",
                    "baudrate-line2",
                    "interval-line1",
                    "interval-line2",
                    "err-time-line1",
                    "err-time-line2"
                  ],
                  "properties": {
                    "baudrate-line1": {
                      "type": "integer",
                      "enum": [
                        9600,
                        19200,
                        38400,
                        57600,
                        115200
                      ]
                    },
                    "baudrate-line2": {
                      "type": "integer",
                      "enum": [
                        9600,
                        19200,
                        38400,
                        57600,
                        115200
                      ]
                    },
                    "interval-line1": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "interval-line2": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "err-time-line1": {
                      "type": "integer",
                      "minimum": 10
                    },
                    "err-time-line2": {
                      "type": "integer",
                      "minimum": 10
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "OSDP"
        ],
        "description": "Set new OSDP configuration",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "baudrate-line1",
                  "baudrate-line2",
                  "interval-line1",
                  "interval-line2",
                  "err-time-line1",
                  "err-time-line2"
                ],
                "properties": {
                  "baudrate-line1": {
                    "type": "integer",
                    "enum": [
                      9600,
                      19200,
                      38400,
                      57600,
                      115200
                    ]
                  },
                  "baudrate-line2": {
                    "type": "integer",
                    "enum": [
                      9600,
                      19200,
                      38400,
                      57600,
                      115200
                    ]
                  },
                  "interval-line1": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "interval-line2": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "err-time-line1": {
                    "type": "integer",
                    "minimum": 10
                  },
                  "err-time-line2": {
                    "type": "integer",
                    "minimum": 10
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully set new OSDP configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/osdp/stats": {
      "get": {
        "tags": [
          "OSDP"
        ],
        "description": "Get OSDP communication statistics for devices on this controller",
        "responses": {
          "200": {
            "description": "Successfully received OSDP communication statistics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "device_addr",
                      "rx",
                      "tx"
                    ],
                    "properties": {
                      "device_addr": {
                        "type": "string"
                      },
                      "rx": {
                        "type": "integer",
                        "description": "packets received"
                      },
                      "tx": {
                        "type": "integer",
                        "description": "packets sent"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "OSDP"
        ],
        "description": "Clear osdp communication statistics for devices on this controller",
        "responses": {
          "200": {
            "description": "Successfully cleared OSDP communication statistics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tmp_access": {
      "get": {
        "tags": [
          "temporary access"
        ],
        "description": "Returns all temporary access",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successfully got all temporary access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "user_uuid",
                      "interval_from",
                      "interval_to",
                      "date",
                      "access_points"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "user_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "description": "User to give access to"
                      },
                      "interval_from": {
                        "type": "string",
                        "description": "Interval to give access from in format: \"h:mm\". For example: 9:00",
                        "minLength": 4,
                        "maxLength": 5
                      },
                      "interval_to": {
                        "type": "string",
                        "description": "Interval to give access to in format: \"h:mm\". For example: 17:00",
                        "minLength": 4,
                        "maxLength": 5
                      },
                      "date": {
                        "type": "string",
                        "description": "Access date in format: \"dd.MM.yyyy\"",
                        "minLength": 10,
                        "maxLength": 10
                      },
                      "access_points": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "temporary access"
        ],
        "description": "Add new temporary access",
        "requestBody": {
          "description": "New temporary access properties",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "user_uuid",
                  "interval_from",
                  "interval_to",
                  "date",
                  "access_points"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "user_uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "description": "User to give access to"
                  },
                  "interval_from": {
                    "type": "string",
                    "description": "Interval to give access from in format: \"h:mm\". For example: 9:00",
                    "minLength": 4,
                    "maxLength": 5
                  },
                  "interval_to": {
                    "type": "string",
                    "description": "Interval to give access to in format: \"h:mm\". For example: 17:00",
                    "minLength": 4,
                    "maxLength": 5
                  },
                  "date": {
                    "type": "string",
                    "description": "Access date in format: \"dd.MM.yyyy\"",
                    "minLength": 10,
                    "maxLength": 10
                  },
                  "access_points": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successfully created new temporary access"
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Temporary access already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tmp_access/{uuid}": {
      "get": {
        "tags": [
          "temporary access"
        ],
        "description": "Get specified temporary-access",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Got specified temporary-access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "user_uuid",
                    "interval_from",
                    "interval_to",
                    "date",
                    "access_points"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "user_uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                      "description": "User to give access to"
                    },
                    "interval_from": {
                      "type": "string",
                      "description": "Interval to give access from in format: \"h:mm\". For example: 9:00",
                      "minLength": 4,
                      "maxLength": 5
                    },
                    "interval_to": {
                      "type": "string",
                      "description": "Interval to give access to in format: \"h:mm\". For example: 17:00",
                      "minLength": 4,
                      "maxLength": 5
                    },
                    "date": {
                      "type": "string",
                      "description": "Access date in format: \"dd.MM.yyyy\"",
                      "minLength": 10,
                      "maxLength": 10
                    },
                    "access_points": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified temporary-access was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "temporary access"
        ],
        "description": "Modify temporary-access",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "user_uuid",
                  "interval_from",
                  "interval_to",
                  "date",
                  "access_points"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "user_uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "description": "User to give access to"
                  },
                  "interval_from": {
                    "type": "string",
                    "description": "Interval to give access from in format: \"h:mm\". For example: 9:00",
                    "minLength": 4,
                    "maxLength": 5
                  },
                  "interval_to": {
                    "type": "string",
                    "description": "Interval to give access to in format: \"h:mm\". For example: 17:00",
                    "minLength": 4,
                    "maxLength": 5
                  },
                  "date": {
                    "type": "string",
                    "description": "Access date in format: \"dd.MM.yyyy\"",
                    "minLength": 10,
                    "maxLength": 10
                  },
                  "access_points": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access profile successfully modified",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified temporary-access does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "temporary access"
        ],
        "description": "Delete temporary-access",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Access profile successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified temporary-access does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tmp_access/by_user/{user_uuid}": {
      "get": {
        "tags": [
          "temporary access"
        ],
        "description": "Get specified temporary-access",
        "parameters": [
          {
            "in": "path",
            "name": "user_uuid",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got all temporary access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "user_uuid",
                      "interval_from",
                      "interval_to",
                      "date",
                      "access_points"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "user_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "description": "User to give access to"
                      },
                      "interval_from": {
                        "type": "string",
                        "description": "Interval to give access from in format: \"h:mm\". For example: 9:00",
                        "minLength": 4,
                        "maxLength": 5
                      },
                      "interval_to": {
                        "type": "string",
                        "description": "Interval to give access to in format: \"h:mm\". For example: 17:00",
                        "minLength": 4,
                        "maxLength": 5
                      },
                      "date": {
                        "type": "string",
                        "description": "Access date in format: \"dd.MM.yyyy\"",
                        "minLength": 10,
                        "maxLength": 10
                      },
                      "access_points": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified temporary-access was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tmp_access/by_date/{date}": {
      "get": {
        "tags": [
          "temporary access"
        ],
        "description": "Get specified temporary-access",
        "parameters": [
          {
            "in": "path",
            "name": "date",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got all temporary access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "user_uuid",
                      "interval_from",
                      "interval_to",
                      "date",
                      "access_points"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "user_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "description": "User to give access to"
                      },
                      "interval_from": {
                        "type": "string",
                        "description": "Interval to give access from in format: \"h:mm\". For example: 9:00",
                        "minLength": 4,
                        "maxLength": 5
                      },
                      "interval_to": {
                        "type": "string",
                        "description": "Interval to give access to in format: \"h:mm\". For example: 17:00",
                        "minLength": 4,
                        "maxLength": 5
                      },
                      "date": {
                        "type": "string",
                        "description": "Access date in format: \"dd.MM.yyyy\"",
                        "minLength": 10,
                        "maxLength": 10
                      },
                      "access_points": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified temporary-access was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tmp_access/by_user_and_date/{user_uuid}/{date}": {
      "get": {
        "tags": [
          "temporary access"
        ],
        "description": "Get specified temporary-access",
        "parameters": [
          {
            "in": "path",
            "name": "user_uuid",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "date",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got all temporary access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "user_uuid",
                      "interval_from",
                      "interval_to",
                      "date",
                      "access_points"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "user_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "description": "User to give access to"
                      },
                      "interval_from": {
                        "type": "string",
                        "description": "Interval to give access from in format: \"h:mm\". For example: 9:00",
                        "minLength": 4,
                        "maxLength": 5
                      },
                      "interval_to": {
                        "type": "string",
                        "description": "Interval to give access to in format: \"h:mm\". For example: 17:00",
                        "minLength": 4,
                        "maxLength": 5
                      },
                      "date": {
                        "type": "string",
                        "description": "Access date in format: \"dd.MM.yyyy\"",
                        "minLength": 10,
                        "maxLength": 10
                      },
                      "access_points": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified temporary-access was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_confirmation": {
      "post": {
        "tags": [
          "access confirmation"
        ],
        "description": "Send access confirmation",
        "requestBody": {
          "description": "Access confirmation result",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "request_uuid",
                  "resolution"
                ],
                "properties": {
                  "request_uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "resolution": {
                    "type": "string",
                    "enum": [
                      "ALLOWED",
                      "FORBIDDEN"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully counsumed access confirmation"
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/request_access": {
      "post": {
        "tags": [
          "request access"
        ],
        "description": "Make access request for user through access point",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "access_point_uuid"
                ],
                "properties": {
                  "user_uuid": {
                    "type": "string"
                  },
                  "access_point_uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "from_side": {
                    "type": "string",
                    "enum": [
                      "a",
                      "b"
                    ]
                  },
                  "privilege": {
                    "type": "integer",
                    "description": "Access privilege level"
                  },
                  "card_code": {
                    "type": "string",
                    "pattern": "^[1-9]\\d*$"
                  },
                  "from": {
                    "type": "string"
                  },
                  "to": {
                    "type": "string"
                  },
                  "author_name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully created access request"
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/check_access": {
      "post": {
        "tags": [
          "check access"
        ],
        "description": "Make access request for user through access point",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user_uuid",
                  "access_point_uuid",
                  "from_side"
                ],
                "properties": {
                  "event_uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "user_uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "access_point_uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "from_side": {
                    "type": "string",
                    "enum": [
                      "a",
                      "b"
                    ]
                  },
                  "privilege": {
                    "type": "integer",
                    "description": "Access privilege level"
                  },
                  "card_code": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully created access request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "message",
                    "access"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "access": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external_access": {
      "post": {
        "tags": [
          "external access"
        ],
        "description": "Создаёт запрос для открытия точки прохода внешней системой",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "access_point_uuid",
                  "from_side"
                ],
                "properties": {
                  "access_point_uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "from_side": {
                    "type": "string",
                    "enum": [
                      "a",
                      "b"
                    ]
                  },
                  "timestamp": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully created access request"
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/backup/redis-dump/{dbs}": {
      "get": {
        "tags": [
          "backup"
        ],
        "summary": "Dump Redis data",
        "description": "Создает резервную копию JSON данных Redis.",
        "parameters": [
          {
            "in": "path",
            "name": "dbs",
            "description": "массив номеров БД",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "Content-Type": {
                "description": "The content type of the backup file",
                "schema": {
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "description": "The content disposition of the backup file",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/backup/redis-restore": {
      "post": {
        "tags": [
          "backup"
        ],
        "summary": "Restore Redis data",
        "description": "Restores Redis data from a JSON backup file.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "backup"
                ],
                "properties": {
                  "backup": {
                    "type": "string",
                    "format": "binary",
                    "description": "The JSON backup file"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation"
          },
          "400": {
            "description": "Invalid JSON backup file"
          }
        }
      }
    },
    "/backup/pack": {
      "post": {
        "tags": [
          "backup"
        ],
        "description": "Import backup data",
        "parameters": [
          {
            "in": "query",
            "name": "events",
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "description": "Import events data from backup"
          },
          {
            "in": "query",
            "name": "staff",
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "description": "Import staff data from backup"
          },
          {
            "in": "query",
            "name": "visitors",
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "description": "Import visitor data from backup"
          },
          {
            "in": "query",
            "name": "devices",
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "description": "Import devices data from backup"
          },
          {
            "in": "query",
            "name": "skd_config",
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "description": "Import configuration data from backup"
          },
          {
            "in": "query",
            "name": "replace",
            "schema": {
              "type": "boolean"
            },
            "description": "Replace existing objects with same id from backup"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "staff": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "cards": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "access_points": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "access_profiles": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "auth_users": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "directories": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "access_point_automations": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "staff_properties": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully imported backup data chunk",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/backup/calculation": {
      "get": {
        "tags": [
          "backup"
        ],
        "description": "Calculate overall backup objects and packs count",
        "parameters": [
          {
            "in": "query",
            "name": "events",
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "description": "Get events backup"
          },
          {
            "in": "query",
            "name": "staff",
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "description": "Get staff backup"
          },
          {
            "in": "query",
            "name": "devices",
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "description": "Get devices backup"
          },
          {
            "in": "query",
            "name": "skd_config",
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "description": "Get configuration backup"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully get backup",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "objects_count",
                    "packs_count",
                    "images_count",
                    "images_packs_count",
                    "max_objects_in_pack",
                    "max_images_in_pack"
                  ],
                  "properties": {
                    "objects_count": {
                      "type": "integer",
                      "description": "Overall backup objects count"
                    },
                    "packs_count": {
                      "type": "integer",
                      "description": "Overall backup download chunks count"
                    },
                    "max_objects_in_pack": {
                      "type": "integer",
                      "description": "Maximum objects in one download chunk"
                    },
                    "images_count": {
                      "type": "integer",
                      "description": "Overall images backup download chunks count"
                    },
                    "max_images_in_pack": {
                      "type": "integer",
                      "description": "Maximum images in one download chunk"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/backup/pack_size": {
      "get": {
        "tags": [
          "backup"
        ],
        "description": "Get backup pack size in terms of objects",
        "responses": {
          "200": {
            "description": "Successfully get backup pack size",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "common",
                    "images"
                  ],
                  "properties": {
                    "common": {
                      "type": "integer",
                      "minimum": 200
                    },
                    "images": {
                      "type": "integer",
                      "minimum": 20
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/backup/notify/{type}": {
      "post": {
        "tags": [
          "backup"
        ],
        "description": "Fire backup notification event",
        "parameters": [
          {
            "in": "path",
            "name": "type",
            "description": "Notification type",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 3
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully armed notification",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/backup/pack/{number}": {
      "get": {
        "tags": [
          "backup"
        ],
        "description": "Get backup data chunk",
        "parameters": [
          {
            "in": "query",
            "name": "events",
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "description": "Get events backup"
          },
          {
            "in": "query",
            "name": "staff",
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "description": "Get staff backup"
          },
          {
            "in": "query",
            "name": "devices",
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "description": "Get devices backup"
          },
          {
            "in": "query",
            "name": "skd_config",
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "description": "Get configuration backup"
          },
          {
            "in": "path",
            "name": "number",
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully get backup",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "staff": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "cards": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "access_points": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "access_profiles": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "auth_users": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "directories": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "access_point_automations": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "staff_properties": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/backup/image_pack/{number}": {
      "get": {
        "tags": [
          "backup"
        ],
        "description": "Get staff images backup data chunk",
        "parameters": [
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully received backup data chunk",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "images": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/license_plate_recognition": {
      "get": {
        "tags": [
          "license plate recognition"
        ],
        "description": "got license plate recognition of application",
        "responses": {
          "200": {
            "description": "Successfully got license plate recognition",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "onvif_url",
                      "type"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "name": {
                        "type": "string"
                      },
                      "onvif_url": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "RVI",
                          "ONVIF"
                        ]
                      },
                      "link_to_access_point_uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "login": {
                        "type": "string"
                      },
                      "password": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "license plate recognition"
        ],
        "description": "post license plate recognition",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "onvif_url",
                  "type"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string"
                  },
                  "onvif_url": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "RVI",
                      "ONVIF"
                    ]
                  },
                  "link_to_access_point_uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "login": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully post license plate recognition",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/license_plate_recognition/{id}": {
      "get": {
        "tags": [
          "license plate recognition"
        ],
        "description": "Get license plate recognition by id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got license plate recognition by name",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "onvif_url",
                    "type"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "onvif_url": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "RVI",
                        "ONVIF"
                      ]
                    },
                    "link_to_access_point_uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "login": {
                      "type": "string"
                    },
                    "password": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified license plate recognition does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "license plate recognition"
        ],
        "description": "Update license plate recognition",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "onvif_url",
                  "type"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string"
                  },
                  "onvif_url": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "RVI",
                      "ONVIF"
                    ]
                  },
                  "link_to_access_point_uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "login": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully updated license plate recognition with specified name",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified license plate recognition does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "license plate recognition"
        ],
        "description": "Delete license plate recognition",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted license plate recognition",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "License plate recognition does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/license_plate_recognition/status/{uuid}": {
      "get": {
        "summary": "Get camera status",
        "description": "Get camera status",
        "tags": [
          "license plate recognition"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Camera UUID"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got license plate recognition status"
          },
          "404": {
            "description": "Specified license plate recognition does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/biometry": {
      "get": {
        "tags": [
          "biometry"
        ],
        "description": "got biometry of application",
        "responses": {
          "200": {
            "description": "Successfully got biometry",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "serial",
                      "name",
                      "model",
                      "ip",
                      "identification_method",
                      "subdevice"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "serial": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "model": {
                        "type": "string",
                        "enum": [
                          "BioSmart 5M",
                          "BioSmart Quasar",
                          "BioSmart PV-WTC",
                          "BioSmart WTC2",
                          "BioSmart 4",
                          "ZKTeco 3.x",
                          "Hikvision ISAPI",
                          "dit"
                        ]
                      },
                      "ip": {
                        "type": "string",
                        "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
                      },
                      "identification_method": {
                        "type": "string",
                        "enum": [
                          "bio",
                          "card_and_bio",
                          "card_and_pin_and_bio"
                        ]
                      },
                      "subdevice": {
                        "type": "string",
                        "description": "device_uuid : subdev_addr"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "biometry"
        ],
        "description": "post biometry",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "serial",
                  "name",
                  "model",
                  "ip",
                  "identification_method",
                  "subdevice"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "serial": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "model": {
                    "type": "string",
                    "enum": [
                      "BioSmart 5M",
                      "BioSmart Quasar",
                      "BioSmart PV-WTC",
                      "BioSmart WTC2",
                      "BioSmart 4",
                      "ZKTeco 3.x",
                      "Hikvision ISAPI",
                      "dit"
                    ]
                  },
                  "ip": {
                    "type": "string",
                    "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
                  },
                  "identification_method": {
                    "type": "string",
                    "enum": [
                      "bio",
                      "card_and_bio",
                      "card_and_pin_and_bio"
                    ]
                  },
                  "subdevice": {
                    "type": "string",
                    "description": "device_uuid : subdev_addr"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully post biometry",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/biometry/{id}": {
      "get": {
        "tags": [
          "biometry"
        ],
        "description": "Get biometry by id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got biometry by name",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "serial",
                    "name",
                    "model",
                    "ip",
                    "identification_method",
                    "subdevice"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "serial": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string",
                      "enum": [
                        "BioSmart 5M",
                        "BioSmart Quasar",
                        "BioSmart PV-WTC",
                        "BioSmart WTC2",
                        "BioSmart 4",
                        "ZKTeco 3.x",
                        "Hikvision ISAPI",
                        "dit"
                      ]
                    },
                    "ip": {
                      "type": "string",
                      "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
                    },
                    "identification_method": {
                      "type": "string",
                      "enum": [
                        "bio",
                        "card_and_bio",
                        "card_and_pin_and_bio"
                      ]
                    },
                    "subdevice": {
                      "type": "string",
                      "description": "device_uuid : subdev_addr"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified biometry does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "biometry"
        ],
        "description": "Update biometry",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "serial",
                  "name",
                  "model",
                  "ip",
                  "identification_method",
                  "subdevice"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "serial": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "model": {
                    "type": "string",
                    "enum": [
                      "BioSmart 5M",
                      "BioSmart Quasar",
                      "BioSmart PV-WTC",
                      "BioSmart WTC2",
                      "BioSmart 4",
                      "ZKTeco 3.x",
                      "Hikvision ISAPI",
                      "dit"
                    ]
                  },
                  "ip": {
                    "type": "string",
                    "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
                  },
                  "identification_method": {
                    "type": "string",
                    "enum": [
                      "bio",
                      "card_and_bio",
                      "card_and_pin_and_bio"
                    ]
                  },
                  "subdevice": {
                    "type": "string",
                    "description": "device_uuid : subdev_addr"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully updated biometry with specified name",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified biometry does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "biometry"
        ],
        "description": "Delete biometry",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted biometry",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "biometry does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/biometry/models": {
      "get": {
        "tags": [
          "biometry"
        ],
        "description": "Get biometry models",
        "responses": {
          "200": {
            "description": "Successfully received biometry models",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "model",
                      "description"
                    ],
                    "properties": {
                      "model": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/biometry_update": {
      "get": {
        "tags": [
          "biometry"
        ],
        "description": "Get biometry device update status",
        "responses": {
          "200": {
            "description": "Returned biometry device update status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "devices"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "STARTED",
                        "STOPPED"
                      ]
                    },
                    "devices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "device_uuid",
                          "progress",
                          "stage",
                          "status"
                        ],
                        "properties": {
                          "device_uuid": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                          },
                          "progress": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 100
                          },
                          "stage": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "biometry"
        ],
        "description": "Start biometry device firmware update",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update successfully started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Biometry update already in progress",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/biometry_update/dit": {
      "post": {
        "tags": [
          "biometry"
        ],
        "description": "Start DIT biometry profiles upload",
        "responses": {
          "200": {
            "description": "Upload successfully completed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Biometry update already in progress",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/biometry/generate_convolution": {
      "post": {
        "tags": [
          "biometry"
        ],
        "description": "Сгенерировать сверсток биометрии",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "biometry_uuid"
                ],
                "properties": {
                  "biometry_uuid": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Успешно получен сверсток биометрии",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Устройство биометрии не найдено",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Устройство биометрии занято",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Ошибка на сервере",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/biometry_services/dit": {
      "get": {
        "tags": [
          "Сервис биометрии ДИТ"
        ],
        "description": "Возвращает список сервисов ДИТ",
        "responses": {
          "200": {
            "description": "Указанная страница зарегистрированных карт успешно возвращена",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "host",
                      "clientId",
                      "clientSecret",
                      "username",
                      "password",
                      "kafkaBroker"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "name": {
                        "type": "string",
                        "example": "РС ЕБС (ДИТ г.Москвы)"
                      },
                      "controller": {
                        "type": "string"
                      },
                      "host": {
                        "type": "string",
                        "description": "IP-адрес или хост сервиса с указанием протокола (http:// или https://).",
                        "example": "https://10.23.64.140"
                      },
                      "authHost": {
                        "type": "string",
                        "description": "IP-адрес или хост для авторизации с указанием протокола (http:// или https://).",
                        "example": "https://10.23.64.140"
                      },
                      "clientId": {
                        "type": "string",
                        "description": "Идентификатор клиента.",
                        "example": "rub-test"
                      },
                      "clientSecret": {
                        "type": "string",
                        "description": "Секрет клиента.",
                        "example": "1AAbgZ9zmwIgo3Hwa8BmvyBx3XbZpvQ0"
                      },
                      "username": {
                        "type": "string",
                        "description": "Имя пользователя для доступа к сервису.",
                        "example": "rub-test"
                      },
                      "password": {
                        "type": "string",
                        "description": "Пароль для доступа к сервису.",
                        "example": "xEEXtsRE%7B%5B7bCEy"
                      },
                      "kafkaBroker": {
                        "type": "string",
                        "description": "Адрес и порт Kafka-брокера.",
                        "example": "10.23.64.142:31133"
                      },
                      "kafkaTopic": {
                        "type": "string",
                        "description": "Имя топика Kafka для событий биометрии.",
                        "example": "ebs_event_rub"
                      },
                      "active": {
                        "type": "boolean",
                        "description": "Включен/выключен"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный запрос",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Что-то пошло не так. Похоже, на сервере ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Сервис биометрии ДИТ"
        ],
        "description": "Создает новый сервис ДИТ в базе данных",
        "requestBody": {
          "description": "Настройка нового сервиса ДИТ в базе данных",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "host",
                  "clientId",
                  "clientSecret",
                  "username",
                  "password",
                  "kafkaBroker"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string",
                    "example": "РС ЕБС (ДИТ г.Москвы)"
                  },
                  "controller": {
                    "type": "string"
                  },
                  "host": {
                    "type": "string",
                    "description": "IP-адрес или хост сервиса с указанием протокола (http:// или https://).",
                    "example": "https://10.23.64.140"
                  },
                  "authHost": {
                    "type": "string",
                    "description": "IP-адрес или хост для авторизации с указанием протокола (http:// или https://).",
                    "example": "https://10.23.64.140"
                  },
                  "clientId": {
                    "type": "string",
                    "description": "Идентификатор клиента.",
                    "example": "rub-test"
                  },
                  "clientSecret": {
                    "type": "string",
                    "description": "Секрет клиента.",
                    "example": "1AAbgZ9zmwIgo3Hwa8BmvyBx3XbZpvQ0"
                  },
                  "username": {
                    "type": "string",
                    "description": "Имя пользователя для доступа к сервису.",
                    "example": "rub-test"
                  },
                  "password": {
                    "type": "string",
                    "description": "Пароль для доступа к сервису.",
                    "example": "xEEXtsRE%7B%5B7bCEy"
                  },
                  "kafkaBroker": {
                    "type": "string",
                    "description": "Адрес и порт Kafka-брокера.",
                    "example": "10.23.64.142:31133"
                  },
                  "kafkaTopic": {
                    "type": "string",
                    "description": "Имя топика Kafka для событий биометрии.",
                    "example": "ebs_event_rub"
                  },
                  "active": {
                    "type": "boolean",
                    "description": "Включен/выключен"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Сервис успешно добавлен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный запрос",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Сервис уже существует",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Что-то пошло не так. Похоже, на сервере ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/biometry_services/dit/{id}": {
      "put": {
        "tags": [
          "Сервис биометрии ДИТ"
        ],
        "description": "Обновить сервис ДИТ в базе данных",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Конфигурация сервиса ДИТ в базе данных",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "host",
                  "clientId",
                  "clientSecret",
                  "username",
                  "password",
                  "kafkaBroker"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string",
                    "example": "РС ЕБС (ДИТ г.Москвы)"
                  },
                  "controller": {
                    "type": "string"
                  },
                  "host": {
                    "type": "string",
                    "description": "IP-адрес или хост сервиса с указанием протокола (http:// или https://).",
                    "example": "https://10.23.64.140"
                  },
                  "authHost": {
                    "type": "string",
                    "description": "IP-адрес или хост для авторизации с указанием протокола (http:// или https://).",
                    "example": "https://10.23.64.140"
                  },
                  "clientId": {
                    "type": "string",
                    "description": "Идентификатор клиента.",
                    "example": "rub-test"
                  },
                  "clientSecret": {
                    "type": "string",
                    "description": "Секрет клиента.",
                    "example": "1AAbgZ9zmwIgo3Hwa8BmvyBx3XbZpvQ0"
                  },
                  "username": {
                    "type": "string",
                    "description": "Имя пользователя для доступа к сервису.",
                    "example": "rub-test"
                  },
                  "password": {
                    "type": "string",
                    "description": "Пароль для доступа к сервису.",
                    "example": "xEEXtsRE%7B%5B7bCEy"
                  },
                  "kafkaBroker": {
                    "type": "string",
                    "description": "Адрес и порт Kafka-брокера.",
                    "example": "10.23.64.142:31133"
                  },
                  "kafkaTopic": {
                    "type": "string",
                    "description": "Имя топика Kafka для событий биометрии.",
                    "example": "ebs_event_rub"
                  },
                  "active": {
                    "type": "boolean",
                    "description": "Включен/выключен"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Сервис обновлен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный запрос",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Указанный сервис не существует",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Что-то пошло не так. Похоже, на сервере ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Сервис биометрии ДИТ"
        ],
        "description": "Обновить изменения сервиса ДИТ в базе данных",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Конфигурация сервиса ДИТ в базе данных",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "controller": {
                    "type": "string"
                  },
                  "host": {
                    "type": "string",
                    "description": "IP-адрес или хост сервиса с указанием протокола (http:// или https://).",
                    "example": "https://10.23.64.140"
                  },
                  "authHost": {
                    "type": "string",
                    "description": "IP-адрес или хост для авторизации с указанием протокола (http:// или https://).",
                    "example": "https://10.23.64.140"
                  },
                  "clientId": {
                    "type": "string",
                    "description": "Идентификатор клиента.",
                    "example": "rub-test"
                  },
                  "clientSecret": {
                    "type": "string",
                    "description": "Секрет клиента.",
                    "example": "1AAbgZ9zmwIgo3Hwa8BmvyBx3XbZpvQ0"
                  },
                  "username": {
                    "type": "string",
                    "description": "Имя пользователя для доступа к сервису.",
                    "example": "rub-test"
                  },
                  "password": {
                    "type": "string",
                    "description": "Пароль для доступа к сервису.",
                    "example": "xEEXtsRE%7B%5B7bCEy"
                  },
                  "kafkaBroker": {
                    "type": "string",
                    "description": "Адрес и порт Kafka-брокера.",
                    "example": "10.23.64.142:31133"
                  },
                  "kafkaTopic": {
                    "type": "string",
                    "description": "Имя топика Kafka для событий биометрии.",
                    "example": "ebs_event_rub"
                  },
                  "active": {
                    "type": "boolean",
                    "description": "Включен/выключен"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Сервис обновлен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный запрос",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Указанный сервис не существует",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Что-то пошло не так. Похоже, на сервере ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Сервис биометрии ДИТ"
        ],
        "description": "Удалить сервис биометрии",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Сервис биометрии успешно удален",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный запрос",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Сервис биометрии не существует",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Что-то пошло не так. Похоже, на сервере ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/biometry_services/dit/access_point": {
      "get": {
        "tags": [
          "Сервис биометрии ДИТ"
        ],
        "description": "Возвращает список точек доступа ДИТ",
        "responses": {
          "200": {
            "description": "Список точек доступа успешно возвращен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "access_point_uuid",
                      "cameraConfig",
                      "name",
                      "uuid"
                    ],
                    "properties": {
                      "service_uuid": {
                        "type": "string",
                        "description": "Uuid сервиса биометрии, к которому привязывается точка."
                      },
                      "access_point_uuid": {
                        "type": "string",
                        "description": "Уникальный идентификатор точки прохода."
                      },
                      "cameraConfig": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        },
                        "description": "Конфигурация камер. Ключ - считыватель точки прохода, значение - ID камеры."
                      },
                      "accessLabels": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        },
                        "description": "Метки доступа для камер. Ключ - считыватель точки прохода, значение - метка доступа."
                      },
                      "name": {
                        "type": "string",
                        "description": "Название точки прохода."
                      },
                      "uuid": {
                        "type": "string",
                        "description": "Уникальный идентификатор точки прохода."
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный запрос",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Что-то пошло не так. Похоже, на сервере ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Сервис биометрии ДИТ"
        ],
        "description": "Создает новую точку доступа ДИТ",
        "requestBody": {
          "description": "Настройка нового сервиса ДИТ в базе данных",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "access_point_uuid",
                  "cameraConfig",
                  "name",
                  "uuid"
                ],
                "properties": {
                  "service_uuid": {
                    "type": "string",
                    "description": "Uuid сервиса биометрии, к которому привязывается точка."
                  },
                  "access_point_uuid": {
                    "type": "string",
                    "description": "Уникальный идентификатор точки прохода."
                  },
                  "cameraConfig": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Конфигурация камер. Ключ - считыватель точки прохода, значение - ID камеры."
                  },
                  "accessLabels": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Метки доступа для камер. Ключ - считыватель точки прохода, значение - метка доступа."
                  },
                  "name": {
                    "type": "string",
                    "description": "Название точки прохода."
                  },
                  "uuid": {
                    "type": "string",
                    "description": "Уникальный идентификатор точки прохода."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Конфигурация успешно добавлена",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный запрос",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Конфигурация уже существует",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Что-то пошло не так. Похоже, на сервере ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/biometry_services/dit/access_point/{id}": {
      "put": {
        "tags": [
          "Сервис биометрии ДИТ"
        ],
        "description": "Обновить точку доступа ДИТ",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Обновление сервиса ДИТ в базе данных",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "access_point_uuid",
                  "cameraConfig",
                  "name",
                  "uuid"
                ],
                "properties": {
                  "service_uuid": {
                    "type": "string",
                    "description": "Uuid сервиса биометрии, к которому привязывается точка."
                  },
                  "access_point_uuid": {
                    "type": "string",
                    "description": "Уникальный идентификатор точки прохода."
                  },
                  "cameraConfig": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Конфигурация камер. Ключ - считыватель точки прохода, значение - ID камеры."
                  },
                  "accessLabels": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Метки доступа для камер. Ключ - считыватель точки прохода, значение - метка доступа."
                  },
                  "name": {
                    "type": "string",
                    "description": "Название точки прохода."
                  },
                  "uuid": {
                    "type": "string",
                    "description": "Уникальный идентификатор точки прохода."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Точка доступа ДИТ успешно добавлена",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный запрос",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Точка доступа ДИТ уже существует",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Что-то пошло не так. Похоже, на сервере ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Сервис биометрии ДИТ"
        ],
        "description": "Удалить точку доступа ДИТ",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешно удалено",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный запрос",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Точка доступа не существует",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Что-то пошло не так. Похоже, на сервере ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/puds_service": {
      "get": {
        "tags": [
          "PUDS Service"
        ],
        "summary": "Получить список PUDS сервисов",
        "description": "Возвращает список всех настроенных PUDS сервисов",
        "responses": {
          "200": {
            "description": "Список PUDS сервисов",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "name",
                      "host",
                      "clientId",
                      "clientSecret",
                      "catalogPersonId",
                      "catalogObjectId",
                      "catalogDeviceId",
                      "catalogOrganizationId",
                      "kafkaTopic",
                      "basePath",
                      "authBasePath",
                      "controller",
                      "active"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "description": "Уникальный идентификатор PUDS сервиса"
                      },
                      "name": {
                        "type": "string",
                        "description": "Название PUDS сервиса",
                        "example": "PUDS Сервис"
                      },
                      "host": {
                        "type": "string",
                        "description": "Хост PUDS сервера",
                        "example": "puds-mpl-stage.mos.ru"
                      },
                      "clientId": {
                        "type": "string",
                        "description": "Идентификатор клиента",
                        "example": "client-id"
                      },
                      "clientSecret": {
                        "type": "string",
                        "description": "Секрет клиента",
                        "example": "client-secret"
                      },
                      "catalogPersonId": {
                        "type": "number",
                        "description": "Идентификатор каталога персональных данных",
                        "example": 12345
                      },
                      "catalogObjectId": {
                        "type": "number",
                        "description": "Идентификатор каталога объектов строительства",
                        "example": 12346
                      },
                      "catalogDeviceId": {
                        "type": "number",
                        "description": "Идентификатор каталога оборудования СКУД",
                        "example": 12347
                      },
                      "catalogOrganizationId": {
                        "type": "number",
                        "description": "Идентификатор каталога организаций трудоустройства",
                        "example": 12348
                      },
                      "kafkaTopic": {
                        "type": "string",
                        "description": "Kafka топик для событий",
                        "example": "events-topic"
                      },
                      "basePath": {
                        "type": "string",
                        "description": "Базовый путь для API",
                        "example": "/api/v1"
                      },
                      "authBasePath": {
                        "type": "string",
                        "description": "Базовый путь для аутентификации",
                        "example": "/auth"
                      },
                      "controller": {
                        "type": "string",
                        "description": "Контроллер сервиса"
                      },
                      "namespace": {
                        "type": "string",
                        "description": "Namespace для PUDS API",
                        "example": "puds-rb"
                      },
                      "active": {
                        "type": "boolean",
                        "description": "Активен ли сервис"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PUDS Service"
        ],
        "summary": "Создать PUDS сервис",
        "description": "Создает новый PUDS сервис",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "host",
                  "clientId",
                  "clientSecret",
                  "catalogPersonId",
                  "catalogObjectId",
                  "catalogDeviceId",
                  "catalogOrganizationId",
                  "kafkaTopic",
                  "basePath",
                  "authBasePath",
                  "uuid",
                  "controller",
                  "active"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Название PUDS сервиса",
                    "example": "PUDS Сервис"
                  },
                  "host": {
                    "type": "string",
                    "description": "Хост PUDS сервера",
                    "example": "puds-mpl-stage.mos.ru"
                  },
                  "clientId": {
                    "type": "string",
                    "description": "Идентификатор клиента",
                    "example": "client-id"
                  },
                  "clientSecret": {
                    "type": "string",
                    "description": "Секрет клиента",
                    "example": "client-secret"
                  },
                  "catalogPersonId": {
                    "type": "number",
                    "description": "Идентификатор каталога персональных данных",
                    "example": 12345
                  },
                  "catalogObjectId": {
                    "type": "number",
                    "description": "Идентификатор каталога объектов строительства",
                    "example": 12346
                  },
                  "catalogDeviceId": {
                    "type": "number",
                    "description": "Идентификатор каталога оборудования СКУД",
                    "example": 12347
                  },
                  "catalogOrganizationId": {
                    "type": "number",
                    "description": "Идентификатор каталога организаций трудоустройства",
                    "example": 12348
                  },
                  "kafkaTopic": {
                    "type": "string",
                    "description": "Kafka топик для событий",
                    "example": "events-topic"
                  },
                  "basePath": {
                    "type": "string",
                    "description": "Базовый путь для API",
                    "example": "/api/v1"
                  },
                  "authBasePath": {
                    "type": "string",
                    "description": "Базовый путь для аутентификации",
                    "example": "/auth"
                  },
                  "uuid": {
                    "type": "string",
                    "description": "UUID сервиса",
                    "example": "12345678-1234-1234-1234-123456789012"
                  },
                  "controller": {
                    "type": "string",
                    "description": "Контроллер сервиса"
                  },
                  "namespace": {
                    "type": "string",
                    "description": "Namespace для PUDS API",
                    "example": "puds-rb"
                  },
                  "active": {
                    "type": "boolean",
                    "description": "Активен ли сервис"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "PUDS сервис создан успешно",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/puds_service/{uuid}": {
      "put": {
        "tags": [
          "PUDS Service"
        ],
        "summary": "Обновить PUDS сервис",
        "description": "Обновляет конфигурацию PUDS сервиса",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "description": "UUID PUDS сервиса",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Название PUDS сервиса",
                    "example": "PUDS Сервис"
                  },
                  "host": {
                    "type": "string",
                    "description": "Хост PUDS сервера",
                    "example": "puds-mpl-stage.mos.ru"
                  },
                  "clientId": {
                    "type": "string",
                    "description": "Идентификатор клиента",
                    "example": "client-id"
                  },
                  "clientSecret": {
                    "type": "string",
                    "description": "Секрет клиента",
                    "example": "client-secret"
                  },
                  "catalogPersonId": {
                    "type": "number",
                    "description": "Идентификатор каталога персональных данных",
                    "example": 12345
                  },
                  "catalogObjectId": {
                    "type": "number",
                    "description": "Идентификатор каталога объектов строительства",
                    "example": 12346
                  },
                  "catalogDeviceId": {
                    "type": "number",
                    "description": "Идентификатор каталога оборудования СКУД",
                    "example": 12347
                  },
                  "catalogOrganizationId": {
                    "type": "number",
                    "description": "Идентификатор каталога организаций трудоустройства",
                    "example": 12348
                  },
                  "kafkaTopic": {
                    "type": "string",
                    "description": "Kafka топик для событий",
                    "example": "events-topic"
                  },
                  "basePath": {
                    "type": "string",
                    "description": "Базовый путь для API",
                    "example": "/api/v1"
                  },
                  "authBasePath": {
                    "type": "string",
                    "description": "Базовый путь для аутентификации",
                    "example": "/auth"
                  },
                  "uuid": {
                    "type": "string",
                    "description": "UUID сервиса",
                    "example": "12345678-1234-1234-1234-123456789012"
                  },
                  "controller": {
                    "type": "string",
                    "description": "Контроллер сервиса"
                  },
                  "namespace": {
                    "type": "string",
                    "description": "Namespace для PUDS API",
                    "example": "puds-rb"
                  },
                  "active": {
                    "type": "boolean",
                    "description": "Активен ли сервис"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "PUDS сервис обновлен успешно",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "PUDS Service"
        ],
        "summary": "Частично обновить PUDS сервис",
        "description": "Частично обновляет конфигурацию PUDS сервиса",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "description": "UUID PUDS сервиса",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Название PUDS сервиса",
                    "example": "PUDS Сервис"
                  },
                  "host": {
                    "type": "string",
                    "description": "Хост PUDS сервера",
                    "example": "puds-mpl-stage.mos.ru"
                  },
                  "clientId": {
                    "type": "string",
                    "description": "Идентификатор клиента",
                    "example": "client-id"
                  },
                  "clientSecret": {
                    "type": "string",
                    "description": "Секрет клиента",
                    "example": "client-secret"
                  },
                  "catalogPersonId": {
                    "type": "number",
                    "description": "Идентификатор каталога персональных данных",
                    "example": 12345
                  },
                  "catalogObjectId": {
                    "type": "number",
                    "description": "Идентификатор каталога объектов строительства",
                    "example": 12346
                  },
                  "catalogDeviceId": {
                    "type": "number",
                    "description": "Идентификатор каталога оборудования СКУД",
                    "example": 12347
                  },
                  "catalogOrganizationId": {
                    "type": "number",
                    "description": "Идентификатор каталога организаций трудоустройства",
                    "example": 12348
                  },
                  "kafkaTopic": {
                    "type": "string",
                    "description": "Kafka топик для событий",
                    "example": "events-topic"
                  },
                  "basePath": {
                    "type": "string",
                    "description": "Базовый путь для API",
                    "example": "/api/v1"
                  },
                  "authBasePath": {
                    "type": "string",
                    "description": "Базовый путь для аутентификации",
                    "example": "/auth"
                  },
                  "uuid": {
                    "type": "string",
                    "description": "UUID сервиса",
                    "example": "12345678-1234-1234-1234-123456789012"
                  },
                  "controller": {
                    "type": "string",
                    "description": "Контроллер сервиса"
                  },
                  "namespace": {
                    "type": "string",
                    "description": "Namespace для PUDS API",
                    "example": "puds-rb"
                  },
                  "active": {
                    "type": "boolean",
                    "description": "Активен ли сервис"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "PUDS сервис обновлен успешно",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "PUDS Service"
        ],
        "summary": "Удалить PUDS сервис",
        "description": "Удаляет PUDS сервис",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "description": "UUID PUDS сервиса",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PUDS сервис удален успешно",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/puds_service/access_point": {
      "get": {
        "tags": [
          "PUDS Service"
        ],
        "description": "Возвращает список точек доступа PUDS",
        "responses": {
          "200": {
            "description": "Список точек доступа успешно возвращен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "access_points",
                      "name",
                      "uuid",
                      "service_uuid",
                      "uin",
                      "objName",
                      "ad",
                      "orgInn",
                      "kpp",
                      "date_s",
                      "date_device_start",
                      "controller",
                      "mac_adr"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "description": "Уникальный идентификатор точки прохода."
                      },
                      "name": {
                        "type": "string",
                        "description": "Название точки прохода."
                      },
                      "access_points": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Список UUID точек прохода."
                      },
                      "service_uuid": {
                        "type": "string",
                        "description": "Уникальный идентификатор сервиса PUDS."
                      },
                      "uin": {
                        "type": "string",
                        "description": "Учетный идентификационный номер (УИН) объекта строительства."
                      },
                      "objName": {
                        "type": "string",
                        "description": "Наименование объекта строительства."
                      },
                      "ad": {
                        "type": "string",
                        "description": "Адрес объекта строительства."
                      },
                      "orgInn": {
                        "type": "integer",
                        "description": "ИНН организации."
                      },
                      "kpp": {
                        "type": "integer",
                        "description": "КПП организации."
                      },
                      "date_s": {
                        "type": "integer",
                        "description": "Дата начала строительства (timestamp)."
                      },
                      "date_device_start": {
                        "type": "integer",
                        "description": "Дата начала работы устройства (timestamp)."
                      },
                      "controller": {
                        "type": "string",
                        "description": "Контроллер сервиса."
                      },
                      "mac_adr": {
                        "type": "string",
                        "description": "MAC адрес устройства.",
                        "pattern": "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$|^([0-9A-Fa-f]{4}\\.){2}[0-9A-Fa-f]{4}$|^[0-9A-Fa-f]{12}$"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный запрос",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Что-то пошло не так. Похоже, на сервере ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PUDS Service"
        ],
        "description": "Создает новую точку доступа PUDS",
        "requestBody": {
          "description": "Настройка новой точки доступа PUDS в базе данных",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "access_points",
                  "name",
                  "uuid",
                  "service_uuid",
                  "uin",
                  "objName",
                  "ad",
                  "orgInn",
                  "kpp",
                  "date_s",
                  "date_device_start",
                  "controller",
                  "mac_adr"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "Уникальный идентификатор точки прохода."
                  },
                  "name": {
                    "type": "string",
                    "description": "Название точки прохода."
                  },
                  "access_points": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Список UUID точек прохода."
                  },
                  "service_uuid": {
                    "type": "string",
                    "description": "Уникальный идентификатор сервиса PUDS."
                  },
                  "uin": {
                    "type": "string",
                    "description": "Учетный идентификационный номер (УИН) объекта строительства."
                  },
                  "objName": {
                    "type": "string",
                    "description": "Наименование объекта строительства."
                  },
                  "ad": {
                    "type": "string",
                    "description": "Адрес объекта строительства."
                  },
                  "orgInn": {
                    "type": "integer",
                    "description": "ИНН организации."
                  },
                  "kpp": {
                    "type": "integer",
                    "description": "КПП организации."
                  },
                  "date_s": {
                    "type": "integer",
                    "description": "Дата начала строительства (timestamp)."
                  },
                  "date_device_start": {
                    "type": "integer",
                    "description": "Дата начала работы устройства (timestamp)."
                  },
                  "controller": {
                    "type": "string",
                    "description": "Контроллер сервиса."
                  },
                  "mac_adr": {
                    "type": "string",
                    "description": "MAC адрес устройства.",
                    "pattern": "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$|^([0-9A-Fa-f]{4}\\.){2}[0-9A-Fa-f]{4}$|^[0-9A-Fa-f]{12}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Точка доступа успешно добавлена",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный запрос",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Точка доступа уже существует",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Что-то пошло не так. Похоже, на сервере ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/puds_service/access_point/{uuid}": {
      "put": {
        "tags": [
          "PUDS Service"
        ],
        "description": "Обновить точку доступа PUDS",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Обновление точки доступа PUDS в базе данных",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "access_points",
                  "name",
                  "uuid",
                  "service_uuid",
                  "uin",
                  "objName",
                  "ad",
                  "orgInn",
                  "kpp",
                  "date_s",
                  "date_device_start",
                  "controller",
                  "mac_adr"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "description": "Уникальный идентификатор точки прохода."
                  },
                  "name": {
                    "type": "string",
                    "description": "Название точки прохода."
                  },
                  "access_points": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Список UUID точек прохода."
                  },
                  "service_uuid": {
                    "type": "string",
                    "description": "Уникальный идентификатор сервиса PUDS."
                  },
                  "uin": {
                    "type": "string",
                    "description": "Учетный идентификационный номер (УИН) объекта строительства."
                  },
                  "objName": {
                    "type": "string",
                    "description": "Наименование объекта строительства."
                  },
                  "ad": {
                    "type": "string",
                    "description": "Адрес объекта строительства."
                  },
                  "orgInn": {
                    "type": "integer",
                    "description": "ИНН организации."
                  },
                  "kpp": {
                    "type": "integer",
                    "description": "КПП организации."
                  },
                  "date_s": {
                    "type": "integer",
                    "description": "Дата начала строительства (timestamp)."
                  },
                  "date_device_start": {
                    "type": "integer",
                    "description": "Дата начала работы устройства (timestamp)."
                  },
                  "controller": {
                    "type": "string",
                    "description": "Контроллер сервиса."
                  },
                  "mac_adr": {
                    "type": "string",
                    "description": "MAC адрес устройства.",
                    "pattern": "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$|^([0-9A-Fa-f]{4}\\.){2}[0-9A-Fa-f]{4}$|^[0-9A-Fa-f]{12}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Точка доступа успешно обновлена",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный запрос",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Точка доступа не существует",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Что-то пошло не так. Похоже, на сервере ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "PUDS Service"
        ],
        "description": "Удалить точку доступа PUDS",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Точка доступа успешно удалена",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный запрос",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Точка доступа не существует",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Что-то пошло не так. Похоже, на сервере ошибка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/puds_service/upload-data": {
      "post": {
        "tags": [
          "PUDS Service"
        ],
        "summary": "Загрузить все данные в реестр строителей",
        "description": "Выполняет полную синхронизацию всех справочников реестра строителей:\n- Собирает данные сотрудников, организаций, объектов строительства и оборудования\n- Валидирует данные на соответствие требованиям PUDS API\n- Помечает существующие записи как удаленные\n- Загружает только валидные новые записи\n- Возвращает детальную информацию о процессе валидации и загрузки\n",
        "responses": {
          "200": {
            "description": "Операция синхронизации выполнена успешно",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Статус выполнения операции",
                      "example": true
                    },
                    "synchronized": {
                      "type": "boolean",
                      "description": "Флаг полной синхронизации справочников",
                      "example": true
                    },
                    "deleted": {
                      "type": "object",
                      "description": "Количество записей, помеченных как удаленные",
                      "properties": {
                        "deletedPersonData": {
                          "type": "integer",
                          "description": "Удаленных записей персональных данных",
                          "example": 10
                        },
                        "deletedOrganizationData": {
                          "type": "integer",
                          "description": "Удаленных записей организаций",
                          "example": 2
                        },
                        "deletedConstructionObjectData": {
                          "type": "integer",
                          "description": "Удаленных записей объектов строительства",
                          "example": 3
                        },
                        "deletedEquipmentData": {
                          "type": "integer",
                          "description": "Удаленных записей оборудования",
                          "example": 5
                        }
                      }
                    },
                    "uploaded": {
                      "type": "object",
                      "description": "Количество успешно загруженных записей",
                      "properties": {
                        "uploadedPersonData": {
                          "type": "integer",
                          "description": "Загружено записей персональных данных",
                          "example": 15
                        },
                        "uploadedOrganizationData": {
                          "type": "integer",
                          "description": "Загружено записей организаций",
                          "example": 3
                        },
                        "uploadedConstructionObjectData": {
                          "type": "integer",
                          "description": "Загружено записей объектов строительства",
                          "example": 5
                        },
                        "uploadedEquipmentData": {
                          "type": "integer",
                          "description": "Загружено записей оборудования",
                          "example": 8
                        }
                      }
                    },
                    "validation": {
                      "type": "object",
                      "description": "Детальная информация о валидации данных",
                      "properties": {
                        "totalRecordsProcessed": {
                          "type": "integer",
                          "description": "Общее количество обработанных записей",
                          "example": 35
                        },
                        "totalValidRecords": {
                          "type": "integer",
                          "description": "Общее количество валидных записей",
                          "example": 31
                        },
                        "totalInvalidRecords": {
                          "type": "integer",
                          "description": "Общее количество невалидных записей",
                          "example": 4
                        },
                        "totalStructureErrors": {
                          "type": "integer",
                          "description": "Количество критических ошибок структуры (останавливают загрузку)",
                          "example": 0
                        },
                        "totalValueErrors": {
                          "type": "integer",
                          "description": "Количество ошибок значений (записи пропускаются)",
                          "example": 4
                        },
                        "typeBreakdown": {
                          "type": "object",
                          "description": "Детальная разбивка валидации по типам данных",
                          "properties": {
                            "personData": {
                              "type": "object",
                              "description": "Детали валидации для конкретного типа данных",
                              "properties": {
                                "total": {
                                  "type": "integer",
                                  "description": "Всего записей данного типа",
                                  "example": 20
                                },
                                "valid": {
                                  "type": "integer",
                                  "description": "Валидных записей",
                                  "example": 18
                                },
                                "invalid": {
                                  "type": "integer",
                                  "description": "Невалидных записей",
                                  "example": 2
                                },
                                "structureErrors": {
                                  "type": "integer",
                                  "description": "Ошибок структуры",
                                  "example": 0
                                },
                                "valueErrors": {
                                  "type": "integer",
                                  "description": "Ошибок значений",
                                  "example": 2
                                },
                                "canSend": {
                                  "type": "boolean",
                                  "description": "Можно ли отправлять данные (нет критических ошибок)",
                                  "example": true
                                },
                                "errorDetails": {
                                  "type": "array",
                                  "description": "Детальный список ошибок",
                                  "items": {
                                    "type": "object",
                                    "description": "Информация об ошибке валидации",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "description": "Тип ошибки (structure/value)",
                                        "enum": [
                                          "structure",
                                          "value"
                                        ],
                                        "example": "value"
                                      },
                                      "field": {
                                        "type": "string",
                                        "description": "Название поля с ошибкой",
                                        "example": "uin"
                                      },
                                      "fieldNameRu": {
                                        "type": "string",
                                        "description": "Русское название поля",
                                        "example": "УИН объекта строительства"
                                      },
                                      "message": {
                                        "type": "string",
                                        "description": "Английское сообщение об ошибке",
                                        "example": "Required field 'uin' is empty or invalid"
                                      },
                                      "messageRu": {
                                        "type": "string",
                                        "description": "Русское сообщение об ошибке",
                                        "example": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")"
                                      },
                                      "recordIndex": {
                                        "type": "integer",
                                        "description": "Индекс записи с ошибкой",
                                        "example": 5
                                      },
                                      "uuid": {
                                        "type": "string",
                                        "description": "UUID сотрудника/записи с ошибкой",
                                        "example": "abc-123-def-456"
                                      },
                                      "entityType": {
                                        "type": "string",
                                        "description": "Тип сущности на русском языке",
                                        "example": "Сотрудник"
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "organizationData": {
                              "type": "object",
                              "description": "Детали валидации для конкретного типа данных",
                              "properties": {
                                "total": {
                                  "type": "integer",
                                  "description": "Всего записей данного типа",
                                  "example": 20
                                },
                                "valid": {
                                  "type": "integer",
                                  "description": "Валидных записей",
                                  "example": 18
                                },
                                "invalid": {
                                  "type": "integer",
                                  "description": "Невалидных записей",
                                  "example": 2
                                },
                                "structureErrors": {
                                  "type": "integer",
                                  "description": "Ошибок структуры",
                                  "example": 0
                                },
                                "valueErrors": {
                                  "type": "integer",
                                  "description": "Ошибок значений",
                                  "example": 2
                                },
                                "canSend": {
                                  "type": "boolean",
                                  "description": "Можно ли отправлять данные (нет критических ошибок)",
                                  "example": true
                                },
                                "errorDetails": {
                                  "type": "array",
                                  "description": "Детальный список ошибок",
                                  "items": {
                                    "type": "object",
                                    "description": "Информация об ошибке валидации",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "description": "Тип ошибки (structure/value)",
                                        "enum": [
                                          "structure",
                                          "value"
                                        ],
                                        "example": "value"
                                      },
                                      "field": {
                                        "type": "string",
                                        "description": "Название поля с ошибкой",
                                        "example": "uin"
                                      },
                                      "fieldNameRu": {
                                        "type": "string",
                                        "description": "Русское название поля",
                                        "example": "УИН объекта строительства"
                                      },
                                      "message": {
                                        "type": "string",
                                        "description": "Английское сообщение об ошибке",
                                        "example": "Required field 'uin' is empty or invalid"
                                      },
                                      "messageRu": {
                                        "type": "string",
                                        "description": "Русское сообщение об ошибке",
                                        "example": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")"
                                      },
                                      "recordIndex": {
                                        "type": "integer",
                                        "description": "Индекс записи с ошибкой",
                                        "example": 5
                                      },
                                      "uuid": {
                                        "type": "string",
                                        "description": "UUID сотрудника/записи с ошибкой",
                                        "example": "abc-123-def-456"
                                      },
                                      "entityType": {
                                        "type": "string",
                                        "description": "Тип сущности на русском языке",
                                        "example": "Сотрудник"
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "constructionObjectData": {
                              "type": "object",
                              "description": "Детали валидации для конкретного типа данных",
                              "properties": {
                                "total": {
                                  "type": "integer",
                                  "description": "Всего записей данного типа",
                                  "example": 20
                                },
                                "valid": {
                                  "type": "integer",
                                  "description": "Валидных записей",
                                  "example": 18
                                },
                                "invalid": {
                                  "type": "integer",
                                  "description": "Невалидных записей",
                                  "example": 2
                                },
                                "structureErrors": {
                                  "type": "integer",
                                  "description": "Ошибок структуры",
                                  "example": 0
                                },
                                "valueErrors": {
                                  "type": "integer",
                                  "description": "Ошибок значений",
                                  "example": 2
                                },
                                "canSend": {
                                  "type": "boolean",
                                  "description": "Можно ли отправлять данные (нет критических ошибок)",
                                  "example": true
                                },
                                "errorDetails": {
                                  "type": "array",
                                  "description": "Детальный список ошибок",
                                  "items": {
                                    "type": "object",
                                    "description": "Информация об ошибке валидации",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "description": "Тип ошибки (structure/value)",
                                        "enum": [
                                          "structure",
                                          "value"
                                        ],
                                        "example": "value"
                                      },
                                      "field": {
                                        "type": "string",
                                        "description": "Название поля с ошибкой",
                                        "example": "uin"
                                      },
                                      "fieldNameRu": {
                                        "type": "string",
                                        "description": "Русское название поля",
                                        "example": "УИН объекта строительства"
                                      },
                                      "message": {
                                        "type": "string",
                                        "description": "Английское сообщение об ошибке",
                                        "example": "Required field 'uin' is empty or invalid"
                                      },
                                      "messageRu": {
                                        "type": "string",
                                        "description": "Русское сообщение об ошибке",
                                        "example": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")"
                                      },
                                      "recordIndex": {
                                        "type": "integer",
                                        "description": "Индекс записи с ошибкой",
                                        "example": 5
                                      },
                                      "uuid": {
                                        "type": "string",
                                        "description": "UUID сотрудника/записи с ошибкой",
                                        "example": "abc-123-def-456"
                                      },
                                      "entityType": {
                                        "type": "string",
                                        "description": "Тип сущности на русском языке",
                                        "example": "Сотрудник"
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "equipmentData": {
                              "type": "object",
                              "description": "Детали валидации для конкретного типа данных",
                              "properties": {
                                "total": {
                                  "type": "integer",
                                  "description": "Всего записей данного типа",
                                  "example": 20
                                },
                                "valid": {
                                  "type": "integer",
                                  "description": "Валидных записей",
                                  "example": 18
                                },
                                "invalid": {
                                  "type": "integer",
                                  "description": "Невалидных записей",
                                  "example": 2
                                },
                                "structureErrors": {
                                  "type": "integer",
                                  "description": "Ошибок структуры",
                                  "example": 0
                                },
                                "valueErrors": {
                                  "type": "integer",
                                  "description": "Ошибок значений",
                                  "example": 2
                                },
                                "canSend": {
                                  "type": "boolean",
                                  "description": "Можно ли отправлять данные (нет критических ошибок)",
                                  "example": true
                                },
                                "errorDetails": {
                                  "type": "array",
                                  "description": "Детальный список ошибок",
                                  "items": {
                                    "type": "object",
                                    "description": "Информация об ошибке валидации",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "description": "Тип ошибки (structure/value)",
                                        "enum": [
                                          "structure",
                                          "value"
                                        ],
                                        "example": "value"
                                      },
                                      "field": {
                                        "type": "string",
                                        "description": "Название поля с ошибкой",
                                        "example": "uin"
                                      },
                                      "fieldNameRu": {
                                        "type": "string",
                                        "description": "Русское название поля",
                                        "example": "УИН объекта строительства"
                                      },
                                      "message": {
                                        "type": "string",
                                        "description": "Английское сообщение об ошибке",
                                        "example": "Required field 'uin' is empty or invalid"
                                      },
                                      "messageRu": {
                                        "type": "string",
                                        "description": "Русское сообщение об ошибке",
                                        "example": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")"
                                      },
                                      "recordIndex": {
                                        "type": "integer",
                                        "description": "Индекс записи с ошибкой",
                                        "example": 5
                                      },
                                      "uuid": {
                                        "type": "string",
                                        "description": "UUID сотрудника/записи с ошибкой",
                                        "example": "abc-123-def-456"
                                      },
                                      "entityType": {
                                        "type": "string",
                                        "description": "Тип сущности на русском языке",
                                        "example": "Сотрудник"
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "summary": {
                      "type": "object",
                      "description": "Общая сводка по операции",
                      "properties": {
                        "totalDeleted": {
                          "type": "integer",
                          "description": "Всего удалено записей",
                          "example": 20
                        },
                        "totalUploaded": {
                          "type": "integer",
                          "description": "Всего загружено записей",
                          "example": 31
                        },
                        "validationSuccess": {
                          "type": "boolean",
                          "description": "Успешность валидации (нет критических ошибок)",
                          "example": true
                        },
                        "recordsSkipped": {
                          "type": "integer",
                          "description": "Количество пропущенных записей из-за ошибок",
                          "example": 4
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "PUDS сервис не настроен или неактивен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Ошибка валидации или загрузки данных",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "validation": {
                      "type": "object",
                      "description": "Краткая сводка по валидации",
                      "properties": {
                        "total": {
                          "type": "integer",
                          "description": "Всего записей",
                          "example": 20
                        },
                        "valid": {
                          "type": "integer",
                          "description": "Валидных записей",
                          "example": 15
                        },
                        "invalid": {
                          "type": "integer",
                          "description": "Невалидных записей",
                          "example": 5
                        },
                        "structureErrors": {
                          "type": "integer",
                          "description": "Критических ошибок структуры",
                          "example": 2
                        },
                        "valueErrors": {
                          "type": "integer",
                          "description": "Ошибок значений",
                          "example": 3
                        },
                        "canSend": {
                          "type": "boolean",
                          "description": "Возможность отправки данных",
                          "example": false
                        },
                        "errorDetails": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "description": "Информация об ошибке валидации",
                            "properties": {
                              "type": {
                                "type": "string",
                                "description": "Тип ошибки (structure/value)",
                                "enum": [
                                  "structure",
                                  "value"
                                ],
                                "example": "value"
                              },
                              "field": {
                                "type": "string",
                                "description": "Название поля с ошибкой",
                                "example": "uin"
                              },
                              "fieldNameRu": {
                                "type": "string",
                                "description": "Русское название поля",
                                "example": "УИН объекта строительства"
                              },
                              "message": {
                                "type": "string",
                                "description": "Английское сообщение об ошибке",
                                "example": "Required field 'uin' is empty or invalid"
                              },
                              "messageRu": {
                                "type": "string",
                                "description": "Русское сообщение об ошибке",
                                "example": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")"
                              },
                              "recordIndex": {
                                "type": "integer",
                                "description": "Индекс записи с ошибкой",
                                "example": 5
                              },
                              "uuid": {
                                "type": "string",
                                "description": "UUID сотрудника/записи с ошибкой",
                                "example": "abc-123-def-456"
                              },
                              "entityType": {
                                "type": "string",
                                "description": "Тип сущности на русском языке",
                                "example": "Сотрудник"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/puds_service/queue-stats": {
      "get": {
        "tags": [
          "PUDS Service"
        ],
        "summary": "Получить статистику очереди событий PUDS",
        "description": "Возвращает статистику очереди событий КПП для отправки в реестр строителей",
        "responses": {
          "200": {
            "description": "Статистика очереди событий PUDS",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": ""
                    },
                    "stats": {
                      "type": "object",
                      "properties": {
                        "initialized": {
                          "type": "boolean",
                          "description": "Инициализирован ли обработчик событий",
                          "example": true
                        },
                        "queueLength": {
                          "type": "integer",
                          "description": "Количество событий в очереди",
                          "example": 42
                        },
                        "mappedAccessPoints": {
                          "type": "integer",
                          "description": "Количество точек прохода с PUDS маппингом",
                          "example": 5
                        },
                        "periodicSendingActive": {
                          "type": "boolean",
                          "description": "Активна ли периодическая отправка",
                          "example": true
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/puds_service/send-queue": {
      "post": {
        "tags": [
          "PUDS Service"
        ],
        "summary": "Принудительно отправить события из очереди",
        "description": "Принудительно запускает отправку событий КПП из Redis очереди в реестр строителей (для тестирования)",
        "responses": {
          "200": {
            "description": "Отправка событий запущена успешно",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Events sending triggered successfully"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Обработчик событий не инициализирован",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "example": "PUDS events handler not initialized"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_control_plans": {
      "get": {
        "tags": [
          "access control plans"
        ],
        "description": "got all access control plans",
        "responses": {
          "200": {
            "description": "Successfully got all access control plans",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "building",
                      "floor",
                      "naturalWidth",
                      "naturalHeight",
                      "markers"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "building": {
                        "type": "string"
                      },
                      "floor": {
                        "type": "string"
                      },
                      "naturalWidth": {
                        "type": "number"
                      },
                      "naturalHeight": {
                        "type": "number"
                      },
                      "markers": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "access control plans"
        ],
        "description": "post access_control_plans",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "building",
                  "floor",
                  "naturalWidth",
                  "naturalHeight",
                  "markers"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "building": {
                    "type": "string"
                  },
                  "floor": {
                    "type": "string"
                  },
                  "naturalWidth": {
                    "type": "number"
                  },
                  "naturalHeight": {
                    "type": "number"
                  },
                  "markers": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully post access control plan",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/access_control_plans/{id}": {
      "get": {
        "tags": [
          "access control plans"
        ],
        "description": "Get access control plan by id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got access control plan by name",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "building",
                    "floor",
                    "naturalWidth",
                    "naturalHeight",
                    "markers"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "building": {
                      "type": "string"
                    },
                    "floor": {
                      "type": "string"
                    },
                    "naturalWidth": {
                      "type": "number"
                    },
                    "naturalHeight": {
                      "type": "number"
                    },
                    "markers": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access control plan does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "access control plans"
        ],
        "description": "Update access control plan",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "building",
                  "floor",
                  "naturalWidth",
                  "naturalHeight",
                  "markers"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "building": {
                    "type": "string"
                  },
                  "floor": {
                    "type": "string"
                  },
                  "naturalWidth": {
                    "type": "number"
                  },
                  "naturalHeight": {
                    "type": "number"
                  },
                  "markers": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully updated access control plan with specified name",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access control plan does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "access control plans"
        ],
        "description": "Delete access control plan",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted access control plans",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "access control plan does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/plan_images": {
      "post": {
        "tags": [
          "access control plan images"
        ],
        "description": "Save new access control plan image",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "image_data"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "image_data": {
                    "type": "string",
                    "format": "byte[]"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Access control plan image has been successfully saved"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Access control plan image already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/plan_images/{uuid}": {
      "get": {
        "tags": [
          "access control plan images"
        ],
        "description": "Get access control plan image by UUID",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned access control plan image with specified UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "image_data"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "image_data": {
                      "type": "string",
                      "format": "byte[]"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access control plan image does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "access control plan images"
        ],
        "description": "Replace image with new",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "image_data"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "image_data": {
                    "type": "string",
                    "format": "byte[]"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Access control plan image has been successfully saved"
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access control plan image does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "access control plan images"
        ],
        "description": "Replace image with new",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Access control plan image has been successfully saved"
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified access control plan image does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/device_management/send_event": {
      "post": {
        "tags": [
          "device management events"
        ],
        "description": "custom device management event",
        "requestBody": {
          "description": "Send device event",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "device_addr",
                  "subdev_addr",
                  "subdev_type"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "error": {
                        "type": "string",
                        "default": ""
                      },
                      "state": {
                        "type": "boolean",
                        "default": true
                      },
                      "temporary": {
                        "type": "boolean",
                        "default": true
                      },
                      "time": {
                        "type": "number"
                      }
                    }
                  },
                  "device_addr": {
                    "type": "string"
                  },
                  "subdev_addr": {
                    "type": "string"
                  },
                  "subdev_type": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully post device event",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/device_management/send_pass_event": {
      "post": {
        "tags": [
          "device management events"
        ],
        "description": "device management pass event",
        "requestBody": {
          "description": "Send device pass event",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "device_addr",
                  "subdev_addr",
                  "subdev_type"
                ],
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "error": {
                        "type": "string",
                        "default": ""
                      },
                      "state": {
                        "type": "boolean",
                        "default": true
                      },
                      "temporary": {
                        "type": "boolean",
                        "default": true
                      },
                      "time": {
                        "type": "number"
                      }
                    }
                  },
                  "device_addr": {
                    "type": "string"
                  },
                  "subdev_addr": {
                    "type": "string"
                  },
                  "subdev_type": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully post pass event",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "No access to controller",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/error_logger": {
      "get": {
        "tags": [
          "error_logger"
        ],
        "description": "Get error logs",
        "responses": {
          "200": {
            "description": "Returns system error logs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/skd_modules": {
      "get": {
        "tags": [
          "SKD Modules"
        ],
        "description": "Returns list of SKD Modules",
        "responses": {
          "200": {
            "description": "Successfully returned all installed SKD Modules",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "name",
                      "access_point_type",
                      "version"
                    ],
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 3
                      },
                      "access_point_type": {
                        "type": "string",
                        "enum": [
                          "SINGLE",
                          "DOUBLE",
                          "TURNSTILE",
                          "TURNSTILE_WITH_CARD_BOX",
                          "BARRIER",
                          "MANTRAP"
                        ]
                      },
                      "version": {
                        "type": "string",
                        "minLength": 1
                      },
                      "additional_parameters": {
                        "type": "array",
                        "format": "string",
                        "items": {
                          "type": "string"
                        },
                        "description": "Additional parameters for access point"
                      },
                      "access_points_in_use": {
                        "type": "string",
                        "description": "Access points in use"
                      },
                      "module_description": {
                        "type": "string",
                        "description": "Module description"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "SKD Modules"
        ],
        "summary": "Upload new SDK Module",
        "description": "Upload new SDK Module",
        "requestBody": {
          "description": "JSON containing the new SDK Module",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "module": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation"
          },
          "400": {
            "description": "Invalid JSON file"
          }
        }
      }
    },
    "/skd_modules/{id}": {
      "delete": {
        "tags": [
          "SKD Modules"
        ],
        "summary": "Delete Skd Module",
        "description": "Delete Skd Module",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "Module ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation"
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/notification_channels/{id}": {
      "delete": {
        "tags": [
          "Notification Channels"
        ],
        "description": "Delete channel",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation"
          },
          "400": {
            "description": "Bad request"
          }
        }
      },
      "put": {
        "tags": [
          "Notification Channels"
        ],
        "description": "Update channel",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "JSON containing the new SDK Module",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "type",
                  "name"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "TELEGRAM",
                      "SMS",
                      "EMAIL"
                    ],
                    "description": "Channel type"
                  },
                  "send_to_events_journal": {
                    "type": "boolean",
                    "description": "Send to events journal flag"
                  },
                  "token": {
                    "type": "string",
                    "description": "Telegram channel bot token"
                  },
                  "name": {
                    "type": "string",
                    "description": "Channel name"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation"
          },
          "400": {
            "description": "Bad request"
          }
        }
      },
      "get": {
        "tags": [
          "Notification Channels"
        ],
        "description": "Get channel",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation"
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/notification_channels": {
      "get": {
        "tags": [
          "Notification Channels"
        ],
        "description": "Returns list of Notification Channels",
        "responses": {
          "200": {
            "description": "Successfully returned all installed Notification Channels",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "type",
                      "name"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "TELEGRAM",
                          "SMS",
                          "EMAIL"
                        ],
                        "description": "Channel type"
                      },
                      "send_to_events_journal": {
                        "type": "boolean",
                        "description": "Send to events journal flag"
                      },
                      "token": {
                        "type": "string",
                        "description": "Telegram channel bot token"
                      },
                      "name": {
                        "type": "string",
                        "description": "Channel name"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Notification Channels"
        ],
        "description": "Upload new channel",
        "requestBody": {
          "description": "JSON containing the new new channel",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "type",
                  "name"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "TELEGRAM",
                      "SMS",
                      "EMAIL"
                    ],
                    "description": "Channel type"
                  },
                  "send_to_events_journal": {
                    "type": "boolean",
                    "description": "Send to events journal flag"
                  },
                  "token": {
                    "type": "string",
                    "description": "Telegram channel bot token"
                  },
                  "name": {
                    "type": "string",
                    "description": "Channel name"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation"
          },
          "400": {
            "description": "Invalid JSON file"
          }
        }
      }
    },
    "/notification_settings/{id}": {
      "delete": {
        "tags": [
          "Notification Settings"
        ],
        "description": "Delete settings",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation"
          },
          "400": {
            "description": "Bad request"
          }
        }
      },
      "put": {
        "tags": [
          "Notification Settings"
        ],
        "description": "Update settings",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "JSON containing the new settings",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "name",
                  "source_event_type",
                  "source_events"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string"
                  },
                  "message_text": {
                    "type": "string"
                  },
                  "channel": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "description": "Channel link uuid"
                  },
                  "source_event_type": {
                    "type": "string",
                    "enum": [
                      "access",
                      "alert",
                      "notification"
                    ],
                    "description": "Source filter by event type"
                  },
                  "source_events": {
                    "type": "array",
                    "description": "Source filter by event",
                    "items": {
                      "additionalProperties": true,
                      "properties": {
                        "segr": {
                          "type": "string",
                          "description": "Event code or event type"
                        },
                        "val": {
                          "type": "string",
                          "description": "Event reason"
                        },
                        "title": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "source_access_points": {
                    "description": "Source filter by event",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "val": {
                          "type": "string",
                          "description": "Access point uuid"
                        }
                      }
                    }
                  },
                  "source_zones": {
                    "type": "array",
                    "description": "Source filter by zones",
                    "items": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "val": {
                          "type": "string",
                          "description": "Zone name"
                        }
                      }
                    }
                  },
                  "source_user_type": {
                    "type": "string",
                    "description": "Source filter by user type",
                    "enum": [
                      "staff",
                      "visitor",
                      ""
                    ]
                  },
                  "source_filters": {
                    "type": "array",
                    "description": "Source filters by dictionary",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "description": "Filter name",
                          "type": "string"
                        },
                        "value": {
                          "description": "Filter value",
                          "type": "string"
                        }
                      }
                    }
                  },
                  "source_full_names": {
                    "description": "Source filter by full names",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "val": {
                          "type": "string",
                          "description": "User uuid"
                        }
                      }
                    }
                  },
                  "recipient_filter_type": {
                    "type": "string",
                    "description": "Recipient filter type",
                    "enum": [
                      "TELEGRAM",
                      "DICTIONARY",
                      "TELEGRAM_USERS"
                    ]
                  },
                  "recipient_users_list": {
                    "type": "array",
                    "description": "Recipient user`s usernames list",
                    "items": {
                      "type": "string",
                      "pattern": "^[a-zA-Z][a-zA-Z0-9_]{4,31}$"
                    }
                  },
                  "dict_address": {
                    "type": "string",
                    "description": "Recipient address to send messages"
                  },
                  "recipient_user_type": {
                    "type": "string",
                    "description": "Recipient filter by user type",
                    "enum": [
                      "staff",
                      "visitor"
                    ]
                  },
                  "recipient_full_names": {
                    "description": "Recipient filter by full names",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "val": {
                          "type": "string",
                          "description": "User uuid"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation"
          },
          "400": {
            "description": "Bad request"
          }
        }
      },
      "get": {
        "tags": [
          "Notification Settings"
        ],
        "description": "Delete Skd Module",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation"
          },
          "400": {
            "description": "Bad request"
          }
        }
      }
    },
    "/notification_settings": {
      "get": {
        "tags": [
          "Notification Settings"
        ],
        "description": "Returns list of Notification Settings",
        "responses": {
          "200": {
            "description": "Successfully returned all installed Notification Settings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "name",
                      "source_event_type",
                      "source_events"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "name": {
                        "type": "string"
                      },
                      "message_text": {
                        "type": "string"
                      },
                      "channel": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "description": "Channel link uuid"
                      },
                      "source_event_type": {
                        "type": "string",
                        "enum": [
                          "access",
                          "alert",
                          "notification"
                        ],
                        "description": "Source filter by event type"
                      },
                      "source_events": {
                        "type": "array",
                        "description": "Source filter by event",
                        "items": {
                          "additionalProperties": true,
                          "properties": {
                            "segr": {
                              "type": "string",
                              "description": "Event code or event type"
                            },
                            "val": {
                              "type": "string",
                              "description": "Event reason"
                            },
                            "title": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "source_access_points": {
                        "description": "Source filter by event",
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "title": {
                              "type": "string"
                            },
                            "val": {
                              "type": "string",
                              "description": "Access point uuid"
                            }
                          }
                        }
                      },
                      "source_zones": {
                        "type": "array",
                        "description": "Source filter by zones",
                        "items": {
                          "type": "object",
                          "properties": {
                            "title": {
                              "type": "string"
                            },
                            "val": {
                              "type": "string",
                              "description": "Zone name"
                            }
                          }
                        }
                      },
                      "source_user_type": {
                        "type": "string",
                        "description": "Source filter by user type",
                        "enum": [
                          "staff",
                          "visitor",
                          ""
                        ]
                      },
                      "source_filters": {
                        "type": "array",
                        "description": "Source filters by dictionary",
                        "items": {
                          "type": "object",
                          "properties": {
                            "key": {
                              "description": "Filter name",
                              "type": "string"
                            },
                            "value": {
                              "description": "Filter value",
                              "type": "string"
                            }
                          }
                        }
                      },
                      "source_full_names": {
                        "description": "Source filter by full names",
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "title": {
                              "type": "string"
                            },
                            "val": {
                              "type": "string",
                              "description": "User uuid"
                            }
                          }
                        }
                      },
                      "recipient_filter_type": {
                        "type": "string",
                        "description": "Recipient filter type",
                        "enum": [
                          "TELEGRAM",
                          "DICTIONARY",
                          "TELEGRAM_USERS"
                        ]
                      },
                      "recipient_users_list": {
                        "type": "array",
                        "description": "Recipient user`s usernames list",
                        "items": {
                          "type": "string",
                          "pattern": "^[a-zA-Z][a-zA-Z0-9_]{4,31}$"
                        }
                      },
                      "dict_address": {
                        "type": "string",
                        "description": "Recipient address to send messages"
                      },
                      "recipient_user_type": {
                        "type": "string",
                        "description": "Recipient filter by user type",
                        "enum": [
                          "staff",
                          "visitor"
                        ]
                      },
                      "recipient_full_names": {
                        "description": "Recipient filter by full names",
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "title": {
                              "type": "string"
                            },
                            "val": {
                              "type": "string",
                              "description": "User uuid"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Notification Settings"
        ],
        "description": "Create new notification settings",
        "requestBody": {
          "description": "JSON containing notification settings",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "name",
                  "source_event_type",
                  "source_events"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string"
                  },
                  "message_text": {
                    "type": "string"
                  },
                  "channel": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "description": "Channel link uuid"
                  },
                  "source_event_type": {
                    "type": "string",
                    "enum": [
                      "access",
                      "alert",
                      "notification"
                    ],
                    "description": "Source filter by event type"
                  },
                  "source_events": {
                    "type": "array",
                    "description": "Source filter by event",
                    "items": {
                      "additionalProperties": true,
                      "properties": {
                        "segr": {
                          "type": "string",
                          "description": "Event code or event type"
                        },
                        "val": {
                          "type": "string",
                          "description": "Event reason"
                        },
                        "title": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "source_access_points": {
                    "description": "Source filter by event",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "val": {
                          "type": "string",
                          "description": "Access point uuid"
                        }
                      }
                    }
                  },
                  "source_zones": {
                    "type": "array",
                    "description": "Source filter by zones",
                    "items": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "val": {
                          "type": "string",
                          "description": "Zone name"
                        }
                      }
                    }
                  },
                  "source_user_type": {
                    "type": "string",
                    "description": "Source filter by user type",
                    "enum": [
                      "staff",
                      "visitor",
                      ""
                    ]
                  },
                  "source_filters": {
                    "type": "array",
                    "description": "Source filters by dictionary",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "description": "Filter name",
                          "type": "string"
                        },
                        "value": {
                          "description": "Filter value",
                          "type": "string"
                        }
                      }
                    }
                  },
                  "source_full_names": {
                    "description": "Source filter by full names",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "val": {
                          "type": "string",
                          "description": "User uuid"
                        }
                      }
                    }
                  },
                  "recipient_filter_type": {
                    "type": "string",
                    "description": "Recipient filter type",
                    "enum": [
                      "TELEGRAM",
                      "DICTIONARY",
                      "TELEGRAM_USERS"
                    ]
                  },
                  "recipient_users_list": {
                    "type": "array",
                    "description": "Recipient user`s usernames list",
                    "items": {
                      "type": "string",
                      "pattern": "^[a-zA-Z][a-zA-Z0-9_]{4,31}$"
                    }
                  },
                  "dict_address": {
                    "type": "string",
                    "description": "Recipient address to send messages"
                  },
                  "recipient_user_type": {
                    "type": "string",
                    "description": "Recipient filter by user type",
                    "enum": [
                      "staff",
                      "visitor"
                    ]
                  },
                  "recipient_full_names": {
                    "description": "Recipient filter by full names",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "val": {
                          "type": "string",
                          "description": "User uuid"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation"
          },
          "400": {
            "description": "Invalid JSON file"
          }
        }
      }
    },
    "/notification_settings/events_types": {
      "get": {
        "tags": [
          "Notification Settings"
        ],
        "description": "Get available events types list",
        "responses": {
          "200": {
            "description": "Successfully got events types",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "notification",
                    "alert",
                    "access"
                  ],
                  "properties": {
                    "notification": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "code",
                          "source_type",
                          "description"
                        ],
                        "properties": {
                          "code": {
                            "type": "integer",
                            "description": "Event type"
                          },
                          "source_type": {
                            "type": "string",
                            "description": "Event reason"
                          },
                          "description": {
                            "type": "string",
                            "description": "Event short description"
                          }
                        }
                      }
                    },
                    "alert": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "code",
                          "source_type",
                          "description"
                        ],
                        "properties": {
                          "code": {
                            "type": "integer",
                            "description": "Event type"
                          },
                          "source_type": {
                            "type": "string",
                            "description": "Event reason"
                          },
                          "description": {
                            "type": "string",
                            "description": "Event short description"
                          }
                        }
                      }
                    },
                    "access": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "type",
                          "reason",
                          "description"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "description": "Event type"
                          },
                          "reason": {
                            "type": "string",
                            "description": "Event reason"
                          },
                          "description": {
                            "type": "string",
                            "description": "Event short description"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ap_schedules/{id}": {
      "delete": {
        "tags": [
          "Access point schedules"
        ],
        "description": "Delete point schedule",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "description": "Access point schedule ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Access point schedules"
        ],
        "description": "Update point schedule",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "description": "Access point schedule ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "JSON containing the access point schedule",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "name",
                  "schedules",
                  "access_points",
                  "status"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string",
                    "description": "Schedule name"
                  },
                  "start_ms": {
                    "type": "integer",
                    "description": "Date time in ms when schedule starts"
                  },
                  "status": {
                    "type": "boolean",
                    "description": "Turn on schedule"
                  },
                  "access_points": {
                    "description": "Access points uuids for this schedule",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": "string",
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "schedules": {
                    "type": "object",
                    "required": [
                      "sun",
                      "mon",
                      "tue",
                      "wed",
                      "thu",
                      "fri",
                      "sat"
                    ],
                    "description": "Schedules by weekday",
                    "properties": {
                      "sun": {
                        "type": "array",
                        "description": "Schedules array for given weekday",
                        "items": {
                          "type": "object",
                          "required": [
                            "hour",
                            "minute",
                            "state"
                          ],
                          "properties": {
                            "hour": {
                              "description": "Hour when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 24
                            },
                            "minute": {
                              "description": "Minute when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 60
                            },
                            "state": {
                              "description": "State to set on schedule",
                              "type": "string",
                              "enum": [
                                "NORMAL",
                                "BLOCKED",
                                "BLOCKED_SIDE_A",
                                "BLOCKED_SIDE_B",
                                "UNBLOCKED",
                                "GUARDED"
                              ]
                            }
                          }
                        }
                      },
                      "mon": {
                        "type": "array",
                        "description": "Schedules array for given weekday",
                        "items": {
                          "type": "object",
                          "required": [
                            "hour",
                            "minute",
                            "state"
                          ],
                          "properties": {
                            "hour": {
                              "description": "Hour when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 24
                            },
                            "minute": {
                              "description": "Minute when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 60
                            },
                            "state": {
                              "description": "State to set on schedule",
                              "type": "string",
                              "enum": [
                                "NORMAL",
                                "BLOCKED",
                                "BLOCKED_SIDE_A",
                                "BLOCKED_SIDE_B",
                                "UNBLOCKED",
                                "GUARDED"
                              ]
                            }
                          }
                        }
                      },
                      "tue": {
                        "type": "array",
                        "description": "Schedules array for given weekday",
                        "items": {
                          "type": "object",
                          "required": [
                            "hour",
                            "minute",
                            "state"
                          ],
                          "properties": {
                            "hour": {
                              "description": "Hour when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 24
                            },
                            "minute": {
                              "description": "Minute when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 60
                            },
                            "state": {
                              "description": "State to set on schedule",
                              "type": "string",
                              "enum": [
                                "NORMAL",
                                "BLOCKED",
                                "BLOCKED_SIDE_A",
                                "BLOCKED_SIDE_B",
                                "UNBLOCKED",
                                "GUARDED"
                              ]
                            }
                          }
                        }
                      },
                      "wed": {
                        "type": "array",
                        "description": "Schedules array for given weekday",
                        "items": {
                          "type": "object",
                          "required": [
                            "hour",
                            "minute",
                            "state"
                          ],
                          "properties": {
                            "hour": {
                              "description": "Hour when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 24
                            },
                            "minute": {
                              "description": "Minute when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 60
                            },
                            "state": {
                              "description": "State to set on schedule",
                              "type": "string",
                              "enum": [
                                "NORMAL",
                                "BLOCKED",
                                "BLOCKED_SIDE_A",
                                "BLOCKED_SIDE_B",
                                "UNBLOCKED",
                                "GUARDED"
                              ]
                            }
                          }
                        }
                      },
                      "thu": {
                        "type": "array",
                        "description": "Schedules array for given weekday",
                        "items": {
                          "type": "object",
                          "required": [
                            "hour",
                            "minute",
                            "state"
                          ],
                          "properties": {
                            "hour": {
                              "description": "Hour when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 24
                            },
                            "minute": {
                              "description": "Minute when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 60
                            },
                            "state": {
                              "description": "State to set on schedule",
                              "type": "string",
                              "enum": [
                                "NORMAL",
                                "BLOCKED",
                                "BLOCKED_SIDE_A",
                                "BLOCKED_SIDE_B",
                                "UNBLOCKED",
                                "GUARDED"
                              ]
                            }
                          }
                        }
                      },
                      "fri": {
                        "type": "array",
                        "description": "Schedules array for given weekday",
                        "items": {
                          "type": "object",
                          "required": [
                            "hour",
                            "minute",
                            "state"
                          ],
                          "properties": {
                            "hour": {
                              "description": "Hour when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 24
                            },
                            "minute": {
                              "description": "Minute when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 60
                            },
                            "state": {
                              "description": "State to set on schedule",
                              "type": "string",
                              "enum": [
                                "NORMAL",
                                "BLOCKED",
                                "BLOCKED_SIDE_A",
                                "BLOCKED_SIDE_B",
                                "UNBLOCKED",
                                "GUARDED"
                              ]
                            }
                          }
                        }
                      },
                      "sat": {
                        "type": "array",
                        "description": "Schedules array for given weekday",
                        "items": {
                          "type": "object",
                          "required": [
                            "hour",
                            "minute",
                            "state"
                          ],
                          "properties": {
                            "hour": {
                              "description": "Hour when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 24
                            },
                            "minute": {
                              "description": "Minute when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 60
                            },
                            "state": {
                              "description": "State to set on schedule",
                              "type": "string",
                              "enum": [
                                "NORMAL",
                                "BLOCKED",
                                "BLOCKED_SIDE_A",
                                "BLOCKED_SIDE_B",
                                "UNBLOCKED",
                                "GUARDED"
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Access point schedules"
        ],
        "description": "Get access point schedule",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "description": "Access point schedule ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "name",
                    "schedules",
                    "access_points",
                    "status"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "name": {
                      "type": "string",
                      "description": "Schedule name"
                    },
                    "start_ms": {
                      "type": "integer",
                      "description": "Date time in ms when schedule starts"
                    },
                    "status": {
                      "type": "boolean",
                      "description": "Turn on schedule"
                    },
                    "access_points": {
                      "description": "Access points uuids for this schedule",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "uuid": {
                            "type": "string",
                            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                          },
                          "name": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "schedules": {
                      "type": "object",
                      "required": [
                        "sun",
                        "mon",
                        "tue",
                        "wed",
                        "thu",
                        "fri",
                        "sat"
                      ],
                      "description": "Schedules by weekday",
                      "properties": {
                        "sun": {
                          "type": "array",
                          "description": "Schedules array for given weekday",
                          "items": {
                            "type": "object",
                            "required": [
                              "hour",
                              "minute",
                              "state"
                            ],
                            "properties": {
                              "hour": {
                                "description": "Hour when set access point state",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 24
                              },
                              "minute": {
                                "description": "Minute when set access point state",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 60
                              },
                              "state": {
                                "description": "State to set on schedule",
                                "type": "string",
                                "enum": [
                                  "NORMAL",
                                  "BLOCKED",
                                  "BLOCKED_SIDE_A",
                                  "BLOCKED_SIDE_B",
                                  "UNBLOCKED",
                                  "GUARDED"
                                ]
                              }
                            }
                          }
                        },
                        "mon": {
                          "type": "array",
                          "description": "Schedules array for given weekday",
                          "items": {
                            "type": "object",
                            "required": [
                              "hour",
                              "minute",
                              "state"
                            ],
                            "properties": {
                              "hour": {
                                "description": "Hour when set access point state",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 24
                              },
                              "minute": {
                                "description": "Minute when set access point state",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 60
                              },
                              "state": {
                                "description": "State to set on schedule",
                                "type": "string",
                                "enum": [
                                  "NORMAL",
                                  "BLOCKED",
                                  "BLOCKED_SIDE_A",
                                  "BLOCKED_SIDE_B",
                                  "UNBLOCKED",
                                  "GUARDED"
                                ]
                              }
                            }
                          }
                        },
                        "tue": {
                          "type": "array",
                          "description": "Schedules array for given weekday",
                          "items": {
                            "type": "object",
                            "required": [
                              "hour",
                              "minute",
                              "state"
                            ],
                            "properties": {
                              "hour": {
                                "description": "Hour when set access point state",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 24
                              },
                              "minute": {
                                "description": "Minute when set access point state",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 60
                              },
                              "state": {
                                "description": "State to set on schedule",
                                "type": "string",
                                "enum": [
                                  "NORMAL",
                                  "BLOCKED",
                                  "BLOCKED_SIDE_A",
                                  "BLOCKED_SIDE_B",
                                  "UNBLOCKED",
                                  "GUARDED"
                                ]
                              }
                            }
                          }
                        },
                        "wed": {
                          "type": "array",
                          "description": "Schedules array for given weekday",
                          "items": {
                            "type": "object",
                            "required": [
                              "hour",
                              "minute",
                              "state"
                            ],
                            "properties": {
                              "hour": {
                                "description": "Hour when set access point state",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 24
                              },
                              "minute": {
                                "description": "Minute when set access point state",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 60
                              },
                              "state": {
                                "description": "State to set on schedule",
                                "type": "string",
                                "enum": [
                                  "NORMAL",
                                  "BLOCKED",
                                  "BLOCKED_SIDE_A",
                                  "BLOCKED_SIDE_B",
                                  "UNBLOCKED",
                                  "GUARDED"
                                ]
                              }
                            }
                          }
                        },
                        "thu": {
                          "type": "array",
                          "description": "Schedules array for given weekday",
                          "items": {
                            "type": "object",
                            "required": [
                              "hour",
                              "minute",
                              "state"
                            ],
                            "properties": {
                              "hour": {
                                "description": "Hour when set access point state",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 24
                              },
                              "minute": {
                                "description": "Minute when set access point state",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 60
                              },
                              "state": {
                                "description": "State to set on schedule",
                                "type": "string",
                                "enum": [
                                  "NORMAL",
                                  "BLOCKED",
                                  "BLOCKED_SIDE_A",
                                  "BLOCKED_SIDE_B",
                                  "UNBLOCKED",
                                  "GUARDED"
                                ]
                              }
                            }
                          }
                        },
                        "fri": {
                          "type": "array",
                          "description": "Schedules array for given weekday",
                          "items": {
                            "type": "object",
                            "required": [
                              "hour",
                              "minute",
                              "state"
                            ],
                            "properties": {
                              "hour": {
                                "description": "Hour when set access point state",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 24
                              },
                              "minute": {
                                "description": "Minute when set access point state",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 60
                              },
                              "state": {
                                "description": "State to set on schedule",
                                "type": "string",
                                "enum": [
                                  "NORMAL",
                                  "BLOCKED",
                                  "BLOCKED_SIDE_A",
                                  "BLOCKED_SIDE_B",
                                  "UNBLOCKED",
                                  "GUARDED"
                                ]
                              }
                            }
                          }
                        },
                        "sat": {
                          "type": "array",
                          "description": "Schedules array for given weekday",
                          "items": {
                            "type": "object",
                            "required": [
                              "hour",
                              "minute",
                              "state"
                            ],
                            "properties": {
                              "hour": {
                                "description": "Hour when set access point state",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 24
                              },
                              "minute": {
                                "description": "Minute when set access point state",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 60
                              },
                              "state": {
                                "description": "State to set on schedule",
                                "type": "string",
                                "enum": [
                                  "NORMAL",
                                  "BLOCKED",
                                  "BLOCKED_SIDE_A",
                                  "BLOCKED_SIDE_B",
                                  "UNBLOCKED",
                                  "GUARDED"
                                ]
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ap_schedules": {
      "get": {
        "tags": [
          "Access point schedules"
        ],
        "description": "Returns list of Access point schedules",
        "responses": {
          "200": {
            "description": "Successfully returned all Access point schedules",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "name",
                      "schedules",
                      "access_points",
                      "status"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "name": {
                        "type": "string",
                        "description": "Schedule name"
                      },
                      "start_ms": {
                        "type": "integer",
                        "description": "Date time in ms when schedule starts"
                      },
                      "status": {
                        "type": "boolean",
                        "description": "Turn on schedule"
                      },
                      "access_points": {
                        "description": "Access points uuids for this schedule",
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "uuid": {
                              "type": "string",
                              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                            },
                            "name": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "schedules": {
                        "type": "object",
                        "required": [
                          "sun",
                          "mon",
                          "tue",
                          "wed",
                          "thu",
                          "fri",
                          "sat"
                        ],
                        "description": "Schedules by weekday",
                        "properties": {
                          "sun": {
                            "type": "array",
                            "description": "Schedules array for given weekday",
                            "items": {
                              "type": "object",
                              "required": [
                                "hour",
                                "minute",
                                "state"
                              ],
                              "properties": {
                                "hour": {
                                  "description": "Hour when set access point state",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 24
                                },
                                "minute": {
                                  "description": "Minute when set access point state",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 60
                                },
                                "state": {
                                  "description": "State to set on schedule",
                                  "type": "string",
                                  "enum": [
                                    "NORMAL",
                                    "BLOCKED",
                                    "BLOCKED_SIDE_A",
                                    "BLOCKED_SIDE_B",
                                    "UNBLOCKED",
                                    "GUARDED"
                                  ]
                                }
                              }
                            }
                          },
                          "mon": {
                            "type": "array",
                            "description": "Schedules array for given weekday",
                            "items": {
                              "type": "object",
                              "required": [
                                "hour",
                                "minute",
                                "state"
                              ],
                              "properties": {
                                "hour": {
                                  "description": "Hour when set access point state",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 24
                                },
                                "minute": {
                                  "description": "Minute when set access point state",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 60
                                },
                                "state": {
                                  "description": "State to set on schedule",
                                  "type": "string",
                                  "enum": [
                                    "NORMAL",
                                    "BLOCKED",
                                    "BLOCKED_SIDE_A",
                                    "BLOCKED_SIDE_B",
                                    "UNBLOCKED",
                                    "GUARDED"
                                  ]
                                }
                              }
                            }
                          },
                          "tue": {
                            "type": "array",
                            "description": "Schedules array for given weekday",
                            "items": {
                              "type": "object",
                              "required": [
                                "hour",
                                "minute",
                                "state"
                              ],
                              "properties": {
                                "hour": {
                                  "description": "Hour when set access point state",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 24
                                },
                                "minute": {
                                  "description": "Minute when set access point state",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 60
                                },
                                "state": {
                                  "description": "State to set on schedule",
                                  "type": "string",
                                  "enum": [
                                    "NORMAL",
                                    "BLOCKED",
                                    "BLOCKED_SIDE_A",
                                    "BLOCKED_SIDE_B",
                                    "UNBLOCKED",
                                    "GUARDED"
                                  ]
                                }
                              }
                            }
                          },
                          "wed": {
                            "type": "array",
                            "description": "Schedules array for given weekday",
                            "items": {
                              "type": "object",
                              "required": [
                                "hour",
                                "minute",
                                "state"
                              ],
                              "properties": {
                                "hour": {
                                  "description": "Hour when set access point state",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 24
                                },
                                "minute": {
                                  "description": "Minute when set access point state",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 60
                                },
                                "state": {
                                  "description": "State to set on schedule",
                                  "type": "string",
                                  "enum": [
                                    "NORMAL",
                                    "BLOCKED",
                                    "BLOCKED_SIDE_A",
                                    "BLOCKED_SIDE_B",
                                    "UNBLOCKED",
                                    "GUARDED"
                                  ]
                                }
                              }
                            }
                          },
                          "thu": {
                            "type": "array",
                            "description": "Schedules array for given weekday",
                            "items": {
                              "type": "object",
                              "required": [
                                "hour",
                                "minute",
                                "state"
                              ],
                              "properties": {
                                "hour": {
                                  "description": "Hour when set access point state",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 24
                                },
                                "minute": {
                                  "description": "Minute when set access point state",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 60
                                },
                                "state": {
                                  "description": "State to set on schedule",
                                  "type": "string",
                                  "enum": [
                                    "NORMAL",
                                    "BLOCKED",
                                    "BLOCKED_SIDE_A",
                                    "BLOCKED_SIDE_B",
                                    "UNBLOCKED",
                                    "GUARDED"
                                  ]
                                }
                              }
                            }
                          },
                          "fri": {
                            "type": "array",
                            "description": "Schedules array for given weekday",
                            "items": {
                              "type": "object",
                              "required": [
                                "hour",
                                "minute",
                                "state"
                              ],
                              "properties": {
                                "hour": {
                                  "description": "Hour when set access point state",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 24
                                },
                                "minute": {
                                  "description": "Minute when set access point state",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 60
                                },
                                "state": {
                                  "description": "State to set on schedule",
                                  "type": "string",
                                  "enum": [
                                    "NORMAL",
                                    "BLOCKED",
                                    "BLOCKED_SIDE_A",
                                    "BLOCKED_SIDE_B",
                                    "UNBLOCKED",
                                    "GUARDED"
                                  ]
                                }
                              }
                            }
                          },
                          "sat": {
                            "type": "array",
                            "description": "Schedules array for given weekday",
                            "items": {
                              "type": "object",
                              "required": [
                                "hour",
                                "minute",
                                "state"
                              ],
                              "properties": {
                                "hour": {
                                  "description": "Hour when set access point state",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 24
                                },
                                "minute": {
                                  "description": "Minute when set access point state",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 60
                                },
                                "state": {
                                  "description": "State to set on schedule",
                                  "type": "string",
                                  "enum": [
                                    "NORMAL",
                                    "BLOCKED",
                                    "BLOCKED_SIDE_A",
                                    "BLOCKED_SIDE_B",
                                    "UNBLOCKED",
                                    "GUARDED"
                                  ]
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Access point schedules"
        ],
        "description": "Upload new channel",
        "requestBody": {
          "description": "JSON containing the new access point schedule",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "name",
                  "schedules",
                  "access_points",
                  "status"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string",
                    "description": "Schedule name"
                  },
                  "start_ms": {
                    "type": "integer",
                    "description": "Date time in ms when schedule starts"
                  },
                  "status": {
                    "type": "boolean",
                    "description": "Turn on schedule"
                  },
                  "access_points": {
                    "description": "Access points uuids for this schedule",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "uuid": {
                          "type": "string",
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "schedules": {
                    "type": "object",
                    "required": [
                      "sun",
                      "mon",
                      "tue",
                      "wed",
                      "thu",
                      "fri",
                      "sat"
                    ],
                    "description": "Schedules by weekday",
                    "properties": {
                      "sun": {
                        "type": "array",
                        "description": "Schedules array for given weekday",
                        "items": {
                          "type": "object",
                          "required": [
                            "hour",
                            "minute",
                            "state"
                          ],
                          "properties": {
                            "hour": {
                              "description": "Hour when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 24
                            },
                            "minute": {
                              "description": "Minute when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 60
                            },
                            "state": {
                              "description": "State to set on schedule",
                              "type": "string",
                              "enum": [
                                "NORMAL",
                                "BLOCKED",
                                "BLOCKED_SIDE_A",
                                "BLOCKED_SIDE_B",
                                "UNBLOCKED",
                                "GUARDED"
                              ]
                            }
                          }
                        }
                      },
                      "mon": {
                        "type": "array",
                        "description": "Schedules array for given weekday",
                        "items": {
                          "type": "object",
                          "required": [
                            "hour",
                            "minute",
                            "state"
                          ],
                          "properties": {
                            "hour": {
                              "description": "Hour when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 24
                            },
                            "minute": {
                              "description": "Minute when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 60
                            },
                            "state": {
                              "description": "State to set on schedule",
                              "type": "string",
                              "enum": [
                                "NORMAL",
                                "BLOCKED",
                                "BLOCKED_SIDE_A",
                                "BLOCKED_SIDE_B",
                                "UNBLOCKED",
                                "GUARDED"
                              ]
                            }
                          }
                        }
                      },
                      "tue": {
                        "type": "array",
                        "description": "Schedules array for given weekday",
                        "items": {
                          "type": "object",
                          "required": [
                            "hour",
                            "minute",
                            "state"
                          ],
                          "properties": {
                            "hour": {
                              "description": "Hour when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 24
                            },
                            "minute": {
                              "description": "Minute when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 60
                            },
                            "state": {
                              "description": "State to set on schedule",
                              "type": "string",
                              "enum": [
                                "NORMAL",
                                "BLOCKED",
                                "BLOCKED_SIDE_A",
                                "BLOCKED_SIDE_B",
                                "UNBLOCKED",
                                "GUARDED"
                              ]
                            }
                          }
                        }
                      },
                      "wed": {
                        "type": "array",
                        "description": "Schedules array for given weekday",
                        "items": {
                          "type": "object",
                          "required": [
                            "hour",
                            "minute",
                            "state"
                          ],
                          "properties": {
                            "hour": {
                              "description": "Hour when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 24
                            },
                            "minute": {
                              "description": "Minute when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 60
                            },
                            "state": {
                              "description": "State to set on schedule",
                              "type": "string",
                              "enum": [
                                "NORMAL",
                                "BLOCKED",
                                "BLOCKED_SIDE_A",
                                "BLOCKED_SIDE_B",
                                "UNBLOCKED",
                                "GUARDED"
                              ]
                            }
                          }
                        }
                      },
                      "thu": {
                        "type": "array",
                        "description": "Schedules array for given weekday",
                        "items": {
                          "type": "object",
                          "required": [
                            "hour",
                            "minute",
                            "state"
                          ],
                          "properties": {
                            "hour": {
                              "description": "Hour when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 24
                            },
                            "minute": {
                              "description": "Minute when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 60
                            },
                            "state": {
                              "description": "State to set on schedule",
                              "type": "string",
                              "enum": [
                                "NORMAL",
                                "BLOCKED",
                                "BLOCKED_SIDE_A",
                                "BLOCKED_SIDE_B",
                                "UNBLOCKED",
                                "GUARDED"
                              ]
                            }
                          }
                        }
                      },
                      "fri": {
                        "type": "array",
                        "description": "Schedules array for given weekday",
                        "items": {
                          "type": "object",
                          "required": [
                            "hour",
                            "minute",
                            "state"
                          ],
                          "properties": {
                            "hour": {
                              "description": "Hour when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 24
                            },
                            "minute": {
                              "description": "Minute when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 60
                            },
                            "state": {
                              "description": "State to set on schedule",
                              "type": "string",
                              "enum": [
                                "NORMAL",
                                "BLOCKED",
                                "BLOCKED_SIDE_A",
                                "BLOCKED_SIDE_B",
                                "UNBLOCKED",
                                "GUARDED"
                              ]
                            }
                          }
                        }
                      },
                      "sat": {
                        "type": "array",
                        "description": "Schedules array for given weekday",
                        "items": {
                          "type": "object",
                          "required": [
                            "hour",
                            "minute",
                            "state"
                          ],
                          "properties": {
                            "hour": {
                              "description": "Hour when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 24
                            },
                            "minute": {
                              "description": "Minute when set access point state",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 60
                            },
                            "state": {
                              "description": "State to set on schedule",
                              "type": "string",
                              "enum": [
                                "NORMAL",
                                "BLOCKED",
                                "BLOCKED_SIDE_A",
                                "BLOCKED_SIDE_B",
                                "UNBLOCKED",
                                "GUARDED"
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation"
          },
          "400": {
            "description": "Invalid JSON file"
          }
        }
      }
    },
    "/system/monitor": {
      "get": {
        "tags": [
          "System"
        ],
        "description": "Returns system process list",
        "parameters": [
          {
            "name": "controller",
            "in": "query",
            "description": "Controller to filter the system process list.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned process list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "cpu": {
                      "type": "number",
                      "description": "CPU utilization as a percentage.",
                      "example": 10.6
                    },
                    "memPerc": {
                      "type": "number",
                      "description": "Memory utilization as a percentage.",
                      "example": 1.2
                    },
                    "memAbsMB": {
                      "type": "number",
                      "description": "Absolute memory utilization in megabytes.",
                      "example": 197.50390625
                    },
                    "count": {
                      "type": "integer",
                      "description": "Number of instances of the process.",
                      "example": 1
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/system/call": {
      "post": {
        "tags": [
          "System"
        ],
        "description": "Snap debug method",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "caller": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully returned call response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/card_design_template/{uuid}": {
      "get": {
        "tags": [
          "card design template"
        ],
        "description": "Get specified card design template",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Got specified card design template",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "uuid",
                    "name",
                    "type",
                    "identifierType"
                  ],
                  "properties": {
                    "uuid": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "identifierType": {
                      "type": "string"
                    },
                    "style": {
                      "type": "object"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified card design template was not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "card design template"
        ],
        "description": "Modify card design template",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "name",
                  "type",
                  "identifierType"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "identifierType": {
                    "type": "string"
                  },
                  "style": {
                    "type": "object"
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "card design template successfully modified",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified card design template does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "card design template"
        ],
        "description": "Delete card design template",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "card design template successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid UUID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Specified card design template does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/card_design_template": {
      "get": {
        "tags": [
          "card design template"
        ],
        "description": "Returns list of card design template",
        "responses": {
          "200": {
            "description": "Successfully returned specified page of registered card design template",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "uuid",
                      "name",
                      "type",
                      "identifierType"
                    ],
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                      },
                      "name": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      },
                      "identifierType": {
                        "type": "string"
                      },
                      "style": {
                        "type": "object"
                      },
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "card design template"
        ],
        "description": "Add new card design template to system",
        "requestBody": {
          "description": "Creates new card design template in database",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "uuid",
                  "name",
                  "type",
                  "identifierType"
                ],
                "properties": {
                  "uuid": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                  },
                  "name": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "identifierType": {
                    "type": "string"
                  },
                  "style": {
                    "type": "object"
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "card design template has been successfully added",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "card design template already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/network_tools/ping": {
      "get": {
        "tags": [
          "network-tools"
        ],
        "summary": "Ping device",
        "description": "Returns output of ping command",
        "parameters": [
          {
            "in": "query",
            "name": "host",
            "required": true,
            "description": "ip address of host",
            "schema": {
              "type": "string",
              "pattern": "^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}$"
            }
          },
          {
            "in": "query",
            "name": "c",
            "required": true,
            "description": "replies count",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          },
          {
            "in": "query",
            "name": "s",
            "required": true,
            "description": "number of data bytes to be send",
            "schema": {
              "type": "integer",
              "minimum": 32,
              "maximum": 65507
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got ping output",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/network_tools/ping_stop": {
      "get": {
        "tags": [
          "network-tools"
        ],
        "summary": "Stop ping",
        "description": "Stop ping",
        "responses": {
          "200": {
            "description": "Ping has been stopped",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/network_tools/scan_port": {
      "get": {
        "tags": [
          "network-tools"
        ],
        "summary": "Scan port",
        "description": "Returns output of nc command",
        "parameters": [
          {
            "in": "query",
            "name": "host",
            "required": true,
            "description": "IP address of host",
            "schema": {
              "type": "string",
              "pattern": "^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}$"
            }
          },
          {
            "in": "query",
            "name": "port",
            "required": true,
            "description": "Port number",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 65535
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got nc output",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/group_update/upload": {
      "post": {
        "tags": [
          "upload",
          "firmware"
        ],
        "description": "Загрузка прошивки",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "update_file"
                ],
                "properties": {
                  "update_file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Firmware file"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File uploaded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "filePath": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/group_update": {
      "get": {
        "tags": [
          "group_update"
        ],
        "description": "Получение всех контроллеров и их прошивок",
        "responses": {
          "200": {
            "description": "Successfully returned device search results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^/\\d+$",
                      "example": "00000001"
                    }
                  },
                  "example": {
                    "1.7.0-lpv-dev.250619.519+insecure": [
                      "00000001",
                      "00000002"
                    ],
                    "1.6.5-stable": [
                      "00000003"
                    ]
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/group_update/controller/status": {
      "get": {
        "tags": [
          "group_update"
        ],
        "description": "Получение данных о статусе обновления",
        "parameters": [
          {
            "in": "query",
            "name": "controllers",
            "schema": {
              "type": "string",
              "example": "[\"000000001\",\"000000002\"]"
            },
            "description": "Список контроллеров по которым нужно получить статус обновления"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned device search results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "UNDEFINED",
                          "PREPARATION",
                          "STOPPED",
                          "STARTED",
                          "FILE_TRANSFER"
                        ],
                        "example": "STARTED",
                        "description": "Статус обновления контроллера"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "STATUS"
                        ],
                        "example": "STATUS",
                        "description": "Тип сообщения"
                      },
                      "error_status": {
                        "type": "string",
                        "nullable": true,
                        "example": "Connection timeout",
                        "description": "Описание ошибки если статус ERROR"
                      },
                      "progress": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100,
                        "example": 75.5,
                        "description": "Прогресс обновления в процентах"
                      }
                    }
                  },
                  "example": {
                    "000000001": {
                      "status": "UNDEFINED",
                      "type": "STATUS",
                      "progress": 75.5
                    },
                    "000000002": {
                      "status": "STOPPED",
                      "type": "STATUS",
                      "progress": 100
                    },
                    "000000003": {
                      "status": "STOPPED",
                      "type": "STATUS",
                      "error_status": "Checksum mismatch",
                      "progress": 45
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/group_update/controller/file-version": {
      "get": {
        "tags": [
          "group_update",
          "controllers"
        ],
        "description": "Returns controllers firmware file version",
        "parameters": [
          {
            "in": "query",
            "name": "filePath",
            "description": "update file path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned list of registered devices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "fileVersion"
                  ],
                  "properties": {
                    "fileVersion": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "504": {
            "description": "HAL service not responding",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/group_update/controller/start": {
      "post": {
        "tags": [
          "group_update"
        ],
        "description": "Старт обновления из загруженного файла",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "controllers": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9]{9}$"
                    },
                    "description": "Список серийных номеров контроллеров"
                  },
                  "filePath": {
                    "type": "string",
                    "description": "Путь к файлу прошивки"
                  }
                },
                "required": [
                  "controllers",
                  "filePath"
                ]
              },
              "example": {
                "controllers": [
                  "000000023",
                  "000000033"
                ],
                "filePath": "update.bin"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully returned device search results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/group_update/controller/reset": {
      "post": {
        "tags": [
          "group_update"
        ],
        "description": "Отчистка состояния обновления контроллеров",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "controllers": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9]{9}$"
                    },
                    "description": "Список серийных номеров контроллеров"
                  }
                },
                "required": [
                  "controllers"
                ]
              },
              "example": {
                "controllers": [
                  "000000023",
                  "000000033"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully returned device search results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/group_update/osdp/status/{controller}": {
      "get": {
        "tags": [
          "group_update",
          "osdp"
        ],
        "description": "Returns osdp firmware update status",
        "parameters": [
          {
            "in": "path",
            "name": "controller",
            "description": "серийный номер контроллера",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          },
          {
            "in": "query",
            "name": "devices",
            "description": "массив адресов устройств",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned list of members",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "device_addr": {
                        "type": "string",
                        "pattern": "^/\\d+/\\d+$",
                        "example": "/1/1"
                      },
                      "progress": {
                        "type": "number",
                        "format": "float",
                        "minimum": 0,
                        "maximum": 100,
                        "example": 75.5
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "UNDEFINED",
                          "FILE_TRANSFER",
                          "STOPPED",
                          "STARTED",
                          "PREPARATION"
                        ],
                        "example": "FILE_TRANSFER"
                      },
                      "stage": {
                        "type": "string",
                        "example": "Передача файла на контроллеры"
                      },
                      "error_status": {
                        "type": "string",
                        "nullable": true,
                        "example": ""
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/group_update/osdp/start": {
      "post": {
        "tags": [
          "osdp",
          "firmware_update"
        ],
        "description": "Start group update",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "filePath"
                ],
                "properties": {
                  "devices": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "example": {
                      "1": [
                        "/2/12",
                        "/1/1"
                      ],
                      "23": [
                        "/1/1",
                        "/1/8"
                      ]
                    }
                  },
                  "filePath": {
                    "type": "string",
                    "description": "Путь к файлу прошивки"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Card has been successfully added"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Card already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/group_update/osdp/file-version": {
      "get": {
        "tags": [
          "group_update",
          "osdp"
        ],
        "description": "Returns osdp firmware file version",
        "parameters": [
          {
            "in": "query",
            "name": "filePath",
            "description": "update file path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully returned list of registered devices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "fileVersion"
                  ],
                  "properties": {
                    "fileVersion": {
                      "type": "object",
                      "properties": {
                        "model_number": {
                          "type": "number"
                        },
                        "model_version": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong. It seems there is a bug on server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "504": {
            "description": "HAL service not responding",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/group_auth/get_secret_key": {
      "get": {
        "tags": [
          "Групповая авторизация"
        ],
        "description": "Получение секретного ключа групповой авторизации",
        "responses": {
          "200": {
            "description": "Секретный ключ успешно получен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "secret_key"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "secret_key": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Пользователь не найден",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/group_auth/set_cookie": {
      "post": {
        "tags": [
          "Групповая авторизация"
        ],
        "description": "Установка cookie групповой авторизации",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "login",
                  "secret_key"
                ],
                "properties": {
                  "login": {
                    "type": "string"
                  },
                  "secret_key": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token has been successfully set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "message"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Cookie был успешно установлен"
                }
              }
            }
          },
          "400": {
            "description": "Пользователь не найден",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/migration/status": {
      "get": {
        "tags": [
          "migration"
        ],
        "description": "Получение статуса переноса данных",
        "responses": {
          "200": {
            "description": "Successfully retrieved migration status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "jobInfo": {
                      "type": "object",
                      "properties": {
                        "isRunning": {
                          "type": "boolean"
                        },
                        "lastRun": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "nextRun": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "progress": {
                          "type": "number"
                        },
                        "totalRecords": {
                          "type": "integer"
                        },
                        "processedRecords": {
                          "type": "integer"
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/migration/running": {
      "get": {
        "tags": [
          "migration"
        ],
        "description": "Проверка работает ли перенос данных",
        "responses": {
          "200": {
            "description": "Successfully retrieved migration running status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "isRunning",
                    "status"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "isRunning": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "idle",
                        "running",
                        "completed",
                        "error"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/migration/start": {
      "post": {
        "tags": [
          "migration"
        ],
        "description": "Запуск переноса данных вручную с проверкой подключения накопителя",
        "responses": {
          "200": {
            "description": "Migration successfully started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/migration/stop": {
      "post": {
        "tags": [
          "migration"
        ],
        "description": "Остановка переноса данных",
        "responses": {
          "200": {
            "description": "Migration successfully stopped",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external-storage/controllers": {
      "get": {
        "tags": [
          "External Storage"
        ],
        "summary": "Получение списка контроллеров с внешним накопителем",
        "description": "Возвращает список всех контроллеров с внешним накопителем в кластере",
        "responses": {
          "200": {
            "description": "Список контроллеров",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "controller": {
                        "type": "string",
                        "description": "IP-адрес контроллера",
                        "example": "192.168.0.30"
                      },
                      "description": {
                        "type": "string",
                        "description": "Описание контроллера",
                        "example": "Current external storage controller"
                      },
                      "status": {
                        "type": "string",
                        "description": "Статус внешнего накопителя",
                        "example": "mounted"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external-storage/controllers/status": {
      "get": {
        "tags": [
          "External Storage"
        ],
        "summary": "Получение статуса контроллеров кластера",
        "description": "Возвращает статус внешних накопителей всех контроллеров в кластере",
        "responses": {
          "200": {
            "description": "Статус контроллеров успешно получен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "controller": {
                        "type": "string",
                        "description": "IP-адрес контроллера в локальной сети",
                        "example": "172.16.165.127"
                      },
                      "status": {
                        "type": "string",
                        "description": "Статус внешнего накопителя",
                        "example": "mounted"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external-storage/format": {
      "post": {
        "tags": [
          "External Storage"
        ],
        "summary": "Отправка команды форматирования внешнего накопителя (без ожидания завершения)",
        "description": "Запускает процесс форматирования внешнего накопителя без ожидания завершения операции.\nПроцесс включает:\n- Форматирование накопителя в файловую систему ext4\n- Открытие криптоконтейнера\n- Монтирование файловой системы\n\nКоманда выполняется асинхронно — для получения результата используйте GET /api/v1/external-storage/format/{serial}.\n\nВозможные статусы форматирования (возвращаются через GET /format/{serial}):\n- `idle` — форматирование не запущено\n- `running` — форматирование выполняется\n- `successful` — форматирование завершено успешно\n- `failed` — форматирование завершилось ошибкой\n- `interrupted` — форматирование было прервано (накопитель стал недоступен)\n\n**Проксирование на другие контроллеры:**\nЕсли указан параметр `controller` (в query или body), команда отправляется на указанный контроллер кластера через MQTT.\nВ случае ошибки проксирования возвращается код 400 или 500.\n",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "controller"
                ],
                "properties": {
                  "controller": {
                    "type": "string",
                    "description": "Серийный номер контроллера, для которого выполняется команда",
                    "example": "00000002"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Команда форматирования запущена",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Успешность запуска команды",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание результата",
                      "example": "Команда форматирования внешнего накопителя запущена"
                    },
                    "format_status": {
                      "type": "object",
                      "description": "Статус форматирования",
                      "properties": {
                        "status": {
                          "type": "string",
                          "description": "Статус выполнения форматирования",
                          "enum": [
                            "idle",
                            "running",
                            "successful",
                            "failed",
                            "interrupted"
                          ],
                          "example": "running"
                        },
                        "timestamp": {
                          "type": "integer",
                          "format": "int64",
                          "nullable": true,
                          "description": "Временная метка в миллисекундах",
                          "example": 1672531200000
                        },
                        "data": {
                          "type": "string",
                          "description": "Дополнительные данные",
                          "example": ""
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Ошибка выполнения:\n- Параметр `controller` не указан\n- Накопитель отсутствует или неизвестного вендора\n- Накопитель не готов к операции\n- Форматирование уже запущено\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Успешность операции",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание ошибки",
                      "example": "Внешний накопитель недоступен или не готов к операции"
                    },
                    "format_status": {
                      "type": "object",
                      "description": "Статус форматирования",
                      "properties": {
                        "status": {
                          "type": "string",
                          "description": "Статус выполнения форматирования",
                          "enum": [
                            "idle",
                            "running",
                            "successful",
                            "failed",
                            "interrupted"
                          ],
                          "example": "running"
                        },
                        "timestamp": {
                          "type": "integer",
                          "format": "int64",
                          "nullable": true,
                          "description": "Временная метка в миллисекундах",
                          "example": 1672531200000
                        },
                        "data": {
                          "type": "string",
                          "description": "Дополнительные данные",
                          "example": ""
                        }
                      }
                    },
                    "result": {
                      "type": "string",
                      "description": "Код результата",
                      "example": "missing_controller"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Успешность операции",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание ошибки",
                      "example": "Внутренняя ошибка сервера"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "External Storage"
        ],
        "summary": "Получение статуса форматирования внешнего накопителя",
        "description": "Возвращает текущий статус процесса форматирования внешнего накопителя.\n\nСтатусы форматирования:\n- `idle` — форматирование не запущено\n- `running` — форматирование выполняется\n- `successful` — форматирование завершено успешно\n- `failed` — форматирование завершилось ошибкой\n- `interrupted` — форматирование было прервано (накопитель стал недоступен)\n\n**Проксирование на другие контроллеры:**\nЕсли указан параметр `controller` (в query или body), запрос перенаправляется на указанный контроллер кластера через MQTT.\n",
        "parameters": [
          {
            "name": "serial",
            "in": "path",
            "required": true,
            "description": "Серийный номер контроллера",
            "schema": {
              "type": "string",
              "example": "00000002"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Статус форматирования успешно получен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Успешность операции",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание результата",
                      "example": "Статус форматирования успешно получен"
                    },
                    "storage_available": {
                      "type": "boolean",
                      "description": "Доступен ли накопитель в момент запроса",
                      "example": true
                    },
                    "format_status": {
                      "type": "object",
                      "description": "Статус форматирования",
                      "properties": {
                        "status": {
                          "type": "string",
                          "description": "Статус выполнения форматирования",
                          "enum": [
                            "idle",
                            "running",
                            "successful",
                            "failed",
                            "interrupted"
                          ],
                          "example": "running"
                        },
                        "timestamp": {
                          "type": "integer",
                          "format": "int64",
                          "nullable": true,
                          "description": "Временная метка в миллисекундах",
                          "example": 1672531200000
                        },
                        "data": {
                          "type": "string",
                          "description": "Дополнительные данные",
                          "example": ""
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Ошибка — неверный серийный номер контроллера или контроллер недоступен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Успешность операции",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание ошибки"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Успешность операции",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание ошибки"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external-storage/format/{serial}": {
      "get": {
        "tags": [
          "External Storage"
        ],
        "summary": "Получение статуса форматирования",
        "description": "Возвращает статус процесса форматирования внешнего накопителя",
        "parameters": [
          {
            "name": "serial",
            "in": "path",
            "required": true,
            "description": "Серийный номер контроллера",
            "schema": {
              "type": "string",
              "example": "00000002"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Статус форматирования успешно получен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Успешность операции",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание результата",
                      "example": "Статус форматирования успешно получен"
                    },
                    "storage_available": {
                      "type": "boolean",
                      "description": "Доступен ли накопитель в момент запроса",
                      "example": true
                    },
                    "format_status": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "description": "Статус форматирования",
                          "example": "successful",
                          "enum": [
                            "idle",
                            "running",
                            "successful",
                            "failed",
                            "interrupted"
                          ]
                        },
                        "timestamp": {
                          "type": "integer",
                          "format": "int64",
                          "description": "Временная метка (мс)",
                          "example": 1672531200000
                        },
                        "data": {
                          "type": "string",
                          "description": "Зарезервировано на будущее (всегда пустая строка)",
                          "example": ""
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание ошибки"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external-storage/disconnect": {
      "post": {
        "tags": [
          "External Storage"
        ],
        "description": "Отправка команды отключения внешнего накопителя.\nЕсли указан параметр `controller`, команда отправляется на указанный контроллер кластера через MQTT.\n",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "controller"
                ],
                "properties": {
                  "controller": {
                    "type": "string",
                    "description": "Серийный номер контроллера, для которого выполняется команда",
                    "example": "00000002"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Команда отключения отправлена успешно",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "description": "Сообщение о результате",
                      "example": "Команда отключения внешнего накопителя отправлена успешно"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание ошибки"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external-storage/command": {
      "post": {
        "tags": [
          "External Storage"
        ],
        "description": "Отправка кастомной команды внешнему накопителю.\nЕсли указан параметр `controller`, команда отправляется на указанный контроллер кластера через MQTT.\n",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "controller"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Тип команды",
                    "example": "status"
                  },
                  "controller": {
                    "type": "string",
                    "description": "Серийный номер контроллера, для которого выполняется команда",
                    "example": "00000002"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Команда внешнему накопителю отправлена успешно",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "description": "Сообщение о результате",
                      "example": "Команда внешнему накопителю отправлена успешно"
                    },
                    "command": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "description": "Тип команды",
                          "example": "format"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный запрос (отсутствует type или controller)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание ошибки"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание ошибки"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external-storage/events": {
      "get": {
        "tags": [
          "External Storage"
        ],
        "description": "Получение данных журнала действия с накопителем (без пагинации). Возвращает события всех типов, отсортированные по времени (новые первыми). Если указан параметр controller, запрос перенаправляется на указанный контроллер кластера.",
        "parameters": [
          {
            "name": "controller",
            "in": "query",
            "description": "Серийный номер контроллера кластера, с которого нужно получить события. Если не указан, возвращаются события локального контроллера.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "00000002"
            }
          },
          {
            "name": "memory_increase",
            "in": "query",
            "description": "Если true, возвращается укороченная схема событий (uuid, timestamp, action)",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Данные журнала действия с накопителем",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "uuid": {
                                "type": "string"
                              },
                              "timestamp": {
                                "type": "integer"
                              },
                              "action": {
                                "type": "string",
                                "description": "Текст из поля description события"
                              }
                            },
                            "required": [
                              "uuid",
                              "timestamp",
                              "action"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "uuid": {
                                "type": "string"
                              },
                              "timestamp": {
                                "type": "integer"
                              },
                              "type": {
                                "type": "string"
                              },
                              "event_type": {
                                "type": "string",
                                "description": "Тип события (audit_event, access_event, notification_event)"
                              },
                              "data": {
                                "type": "object"
                              }
                            },
                            "required": [
                              "uuid",
                              "timestamp"
                            ]
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Контроллер недоступен или не найден в VPN",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external-storage/fsck": {
      "post": {
        "tags": [
          "External Storage"
        ],
        "description": "Ручная проверка состояния внешнего накопителя с помощью fsck.\nЕсли указан параметр `controller`, команда отправляется на указанный контроллер кластера через MQTT.\n",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "controller"
                ],
                "properties": {
                  "controller": {
                    "type": "string",
                    "description": "Серийный номер контроллера, для которого выполняется команда",
                    "example": "00000002"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Команда проверки fsck внешнего накопителя отправлена успешно",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "description": "Сообщение о результате",
                      "example": "Команда проверки fsck внешнего накопителя запущена"
                    },
                    "fsck_status": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "description": "Статус проверки fsck",
                          "enum": [
                            "idle",
                            "running",
                            "successful",
                            "failed",
                            "interrupted"
                          ],
                          "example": "running"
                        },
                        "timestamp": {
                          "type": "integer",
                          "format": "int64",
                          "description": "Временная метка (мс)",
                          "example": 1672531200000
                        },
                        "data": {
                          "type": "string",
                          "description": "Вывод утилиты fsck из топика /flash/log",
                          "example": ""
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Ошибка выполнения:\n- Параметр `controller` не указан\n- Проверка fsck уже запущена\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "example": "Команда fsck уже запущена"
                    },
                    "result": {
                      "type": "string",
                      "example": "missing_controller"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание ошибки"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external-storage/fsck/{serial}": {
      "get": {
        "tags": [
          "External Storage"
        ],
        "summary": "Получение статуса проверки fsck",
        "description": "Возвращает статус проверки файловой системы внешнего накопителя",
        "parameters": [
          {
            "name": "serial",
            "in": "path",
            "required": true,
            "description": "Серийный номер контроллера",
            "schema": {
              "type": "string",
              "example": "00000002"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Статус fsck успешно получен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Успешность операции",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание результата",
                      "example": "Статус fsck успешно получен"
                    },
                    "storage_available": {
                      "type": "boolean",
                      "description": "Доступен ли накопитель в момент запроса",
                      "example": true
                    },
                    "fsck_status": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "description": "Статус проверки fsck",
                          "example": "successful",
                          "enum": [
                            "idle",
                            "running",
                            "successful",
                            "failed",
                            "interrupted"
                          ]
                        },
                        "timestamp": {
                          "type": "integer",
                          "format": "int64",
                          "description": "Временная метка (мс)",
                          "example": 1672531200000
                        },
                        "data": {
                          "type": "string",
                          "description": "Вывод утилиты fsck из топика /flash/log",
                          "example": ""
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание ошибки"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external-storage/clean": {
      "post": {
        "tags": [
          "External Storage"
        ],
        "summary": "Очистка файлов БД на внешнем накопителе",
        "description": "Выполняет очистку файлов базы данных на внешнем накопителе.\nВозможные ответы:\n- success: успешная очистка\n- no_event_manager: EventDataManager недоступен\n- clean_failed: ошибка при очистке\n\nЕсли указан параметр `controller`, команда отправляется на указанный контроллер кластера через MQTT.\n",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "controller"
                ],
                "properties": {
                  "controller": {
                    "type": "string",
                    "description": "Серийный номер контроллера, для которого выполняется команда",
                    "example": "00000002"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Команда очистки выполнена успешно",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Успешность операции"
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание результата"
                    },
                    "result": {
                      "type": "string",
                      "description": "Результат операции"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Успешность операции",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание ошибки"
                    },
                    "result": {
                      "type": "string",
                      "description": "Результат операции",
                      "example": "no_event_manager"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external-storage/force-migrate": {
      "post": {
        "tags": [
          "External Storage"
        ],
        "description": "Принудительный перенос ВСЕХ событий из Redis на внешний USB-накопитель.\nПеренос выполняется батчами от новых событий к старым.\nЕсли указан параметр `controller`, команда отправляется на указанный контроллер кластера через MQTT.\n",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "controller"
                ],
                "properties": {
                  "controller": {
                    "type": "string",
                    "description": "Серийный номер контроллера, на котором выполняется перенос",
                    "example": "00000002"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Принудительный перенос событий завершен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Принудительный перенос событий завершен"
                    },
                    "migrated": {
                      "type": "integer",
                      "description": "Количество перенесённых записей",
                      "example": 1250
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Ошибка выполнения:\n- Параметр `controller` не указан\n- Внешний накопитель недоступен или не готов к операции\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "example": "Внешний накопитель недоступен или не готов к операции"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Миграция уже активна",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "example": "Повторите позже. Выполняется перенос событий"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание ошибки"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external-storage/controller/{serial}": {
      "delete": {
        "tags": [
          "External Storage"
        ],
        "summary": "Удаление информации о контроллере по серийному номеру",
        "description": "Удаляет информацию о контроллере с внешним накопителем из Redis с репликацией на другие контроллеры кластера.",
        "parameters": [
          {
            "name": "serial",
            "in": "path",
            "required": true,
            "description": "Серийный номер контроллера",
            "schema": {
              "type": "string",
              "example": "00015454"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Информация о контроллере успешно удалена",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Успешность операции",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание результата",
                      "example": "Информация о контроллере с серийным номером 00015454 успешно удалена"
                    },
                    "deleted_controller": {
                      "type": "object",
                      "properties": {
                        "serial": {
                          "type": "string",
                          "description": "Серийный номер удалённого контроллера",
                          "example": "00015454"
                        },
                        "timestamp": {
                          "type": "integer",
                          "format": "int64",
                          "description": "Временная метка удаления (мс)",
                          "example": 1672531200000
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Серийный номер не указан",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "example": "Серийный номер контроллера обязателен для удаления информации"
                    },
                    "result": {
                      "type": "string",
                      "example": "missing_serial"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Информация о контроллере не найдена",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "example": "Информация о контроллере с серийным номером 00015454 не найдена"
                    },
                    "result": {
                      "type": "string",
                      "example": "controller_not_found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "description": "Описание ошибки"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external-storage/debug/create-test-file": {
      "post": {
        "tags": [
          "External Storage"
        ],
        "summary": "Тестовый маршрут для диагностики создания файлов на внешнем накопителе",
        "description": "Этот маршрут используется для диагностики проблемы с созданием файла базы данных на внешнем накопителе.\nОн проверяет права доступа к директории, возможность создания и удаления файлов, а также доступ к файлу базы данных.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "fileName": {
                    "type": "string",
                    "description": "Имя для тестового файла (по умолчанию 'test_db_creation')",
                    "default": "test_db_creation"
                  },
                  "directory": {
                    "type": "string",
                    "description": "Директория для тестирования (по умолчанию используется директория из конфигурации БД)"
                  },
                  "altPaths": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Один или несколько альтернативных путей для проверки (переопределяют стандартные пути)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Диагностика выполнена успешно",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Указывает на успешность операции"
                    },
                    "message": {
                      "type": "string",
                      "description": "Сообщение о результате операции"
                    },
                    "requestedParams": {
                      "type": "object",
                      "description": "Параметры, переданные в запросе",
                      "properties": {
                        "fileName": {
                          "type": "string",
                          "description": "Имя файла, которое использовалось для теста"
                        },
                        "directory": {
                          "type": "string",
                          "description": "Директория, которая использовалась для теста (если была указана)"
                        },
                        "altPaths": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Альтернативные пути, которые использовались для теста (если были указаны)"
                        }
                      }
                    },
                    "diagnostics": {
                      "type": "object",
                      "description": "Диагностическая информация",
                      "properties": {
                        "dbConfig": {
                          "type": "object",
                          "description": "Конфигурация базы данных"
                        },
                        "dbPath": {
                          "type": "string",
                          "description": "Путь к файлу базы данных"
                        },
                        "dbDir": {
                          "type": "string",
                          "description": "Директория базы данных"
                        },
                        "testFilePath": {
                          "type": "string",
                          "description": "Путь к тестовому файлу"
                        },
                        "fileSystemChecks": {
                          "type": "object",
                          "description": "Результаты проверок файловой системы",
                          "properties": {
                            "directoryExists": {
                              "type": "boolean",
                              "description": "Существует ли директория"
                            },
                            "testFileCreated": {
                              "type": "boolean",
                              "description": "Удалось ли создать тестовый файл"
                            },
                            "testFileContentCorrect": {
                              "type": "boolean",
                              "description": "Правильное ли содержимое у тестового файла"
                            },
                            "testFileDeleted": {
                              "type": "boolean",
                              "description": "Удалось ли удалить тестовый файл"
                            },
                            "directoryError": {
                              "type": "string",
                              "description": "Ошибка при проверке существования директории"
                            },
                            "testFileError": {
                              "type": "string",
                              "description": "Ошибка при создании тестового файла"
                            }
                          }
                        },
                        "accessRights": {
                          "type": "object",
                          "description": "Результаты проверок прав доступа",
                          "properties": {
                            "directoryWriteable": {
                              "type": "boolean",
                              "description": "Можно ли писать в директорию"
                            },
                            "directoryReadable": {
                              "type": "boolean",
                              "description": "Можно ли читать из директории"
                            },
                            "directoryExecutable": {
                              "type": "boolean",
                              "description": "Можно ли выполнять в директории"
                            },
                            "databaseFileAccessible": {
                              "type": "boolean",
                              "description": "Можно ли получить доступ к файлу базы данных"
                            },
                            "directoryWriteError": {
                              "type": "string",
                              "description": "Ошибка при проверке прав на запись"
                            },
                            "directoryReadError": {
                              "type": "string",
                              "description": "Ошибка при проверке прав на чтение"
                            },
                            "directoryExecuteError": {
                              "type": "string",
                              "description": "Ошибка при проверке прав на выполнение"
                            },
                            "databaseFileError": {
                              "type": "string",
                              "description": "Ошибка при доступе к файлу базы данных"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Ошибка при выполнении диагностики",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Указывает на успешность операции"
                    },
                    "message": {
                      "type": "string",
                      "description": "Сообщение о результате операции"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external-storage/debug/migration": {
      "post": {
        "tags": [
          "External Storage"
        ],
        "summary": "Тестовый маршрут для ручного запуска миграции данных",
        "description": "Запускает миграцию данных на внешний накопитель аналогично автоматическому запуску\nпо cron в 0 часов.\n",
        "responses": {
          "200": {
            "description": "Миграция запущена",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Указывает на успешность операции"
                    },
                    "message": {
                      "type": "string",
                      "description": "Сообщение о результате операции"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Внешний накопитель недоступен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external-storage/debug/threshold-migration": {
      "post": {
        "tags": [
          "External Storage"
        ],
        "summary": "Отладочный запуск пороговой миграции",
        "description": "Проверяет общее количество событий и запускает перенос на внешний накопитель,\nесли количество превышает порог (по умолчанию 20000).\nАналог автоматической проверки, выполняемой раз в 30 минут.\n",
        "responses": {
          "200": {
            "description": "Результат проверки порога и миграции",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Указывает на успешность операции"
                    },
                    "message": {
                      "type": "string",
                      "description": "Сообщение о результате операции"
                    },
                    "totalCount": {
                      "type": "integer",
                      "description": "Общее количество событий в Redis"
                    },
                    "threshold": {
                      "type": "integer",
                      "description": "Пороговое значение для миграции"
                    },
                    "migrated": {
                      "type": "integer",
                      "description": "Количество перенесённых событий (0 если миграция не требовалась)"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Внешний накопитель недоступен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
