Протокол¶
Оглавление¶
-
deviceapis/device/v1/deviceapis_device_safe_emergency_file_v1.proto
Схема классов¶
deviceapis/device/v1/deviceapis_device_safe_emergency_file_v1.proto¶
Спецификация АПИ управления сущностью SafeCityEmergencyFile
SafeCityEmergencyFileService¶
Сервис управления файлами оповещением
| Название метода | Описание | Тип запроса | Тип ответа |
|---|---|---|---|
| DeleteSafeCityEmergencyFile | Метод удаления единичной сущности SafeCityEmergencyFile по ключу | deviceapis.device.v1.DeleteSafeCityEmergencyFileRequest | deviceapis.device.v1.DeleteSafeCityEmergencyFileResponse |
| GetSafeCityEmergencyFileList | Метод получения списка файлов оповещения. В ответе только массив file_name, необязательный параметр content не присутствует | deviceapis.device.v1.GetSafeCityEmergencyFileListRequest | deviceapis.device.v1.GetSafeCityEmergencyFileListResponse |
| SaveSafeCityEmergencyFile | Метод загрузки файла на устройство. Syslog: EVENT:000: Upload Emergency File: File size nnn byte: File Duration nnn sec | deviceapis.device.v1.SaveSafeCityEmergencyFileRequest | deviceapis.device.v1.SaveSafeCityEmergencyFileResponse |
DeleteSafeCityEmergencyFileRequest¶
Запрос удаления единичной сущности SafeCityEmergencyFile по ключу
| Поле | Описание | Тип | Признак |
|---|---|---|---|
| file_name | Имя файла | string | REQUIRED |
DeleteSafeCityEmergencyFileResponse¶
Ответ на запрос удаления единичной сущности SafeCityEmergencyFile по ключу
| Поле | Описание | Тип | Признак |
|---|---|---|---|
| error | Ошибка | optional deviceapis.device.v1.DeleteSafeCityEmergencyFileResponse.Error |
DeleteSafeCityEmergencyFileResponse.Error¶
Ошибка запроса
| Поле | Описание | Тип | Признак |
|---|---|---|---|
| validation | Ошибка валидации | optional deviceapis.device.v1.ValidationError |
GetSafeCityEmergencyFileListRequest¶
Запрос получения списка файлов оповещения
GetSafeCityEmergencyFileListResponse¶
Ответ на запрос получения списка файлов оповещения
| Поле | Описание | Тип | Признак |
|---|---|---|---|
| data | Список SafeCityEmergencyFile | repeated deviceapis.device.v1.SafeCityEmergencyFile |
SafeCityEmergencyFile¶
Файл оповещения
| Поле | Описание | Тип | Признак |
|---|---|---|---|
| file_name | Имя файла | string | REQUIRED |
| content | Тело файла, строка в кодировке Base64. Не возвращается с сервера. TODO: в генерации сваггера не показывать INPUT_ONLY поля в ответах | bytes | INPUT_ONLY |
SaveSafeCityEmergencyFileRequest¶
Запрос загрузки файла на устройство
| Поле | Описание | Тип | Признак |
|---|---|---|---|
| data | Файл оповещения | deviceapis.device.v1.SafeCityEmergencyFile | REQUIRED |
SaveSafeCityEmergencyFileResponse¶
Ответ на запрос загрузки файла на устройство
Скалярные типы значений¶
| .proto Type | Примечание | Python | Go | Ruby | C# | C++ | Java | PHP |
|---|---|---|---|---|---|---|---|---|
| double | float | float64 | Float | double | double | double | float | |
| float | float | float32 | Float | float | float | float | float | |
| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int | int32 | Bignum or Fixnum (as required) | int | int32 | int | integer |
| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int/long | int64 | Bignum | long | int64 | long | integer/string |
| uint32 | Uses variable-length encoding. | int/long | uint32 | Bignum or Fixnum (as required) | uint | uint32 | int | integer |
| uint64 | Uses variable-length encoding. | int/long | uint64 | Bignum or Fixnum (as required) | ulong | uint64 | long | integer/string |
| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int | int32 | Bignum or Fixnum (as required) | int | int32 | int | integer |
| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int/long | int64 | Bignum | long | int64 | long | integer/string |
| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | int | uint32 | Bignum or Fixnum (as required) | uint | uint32 | int | integer |
| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | int/long | uint64 | Bignum | ulong | uint64 | long | integer/string |
| sfixed32 | Always four bytes. | int | int32 | Bignum or Fixnum (as required) | int | int32 | int | integer |
| sfixed64 | Always eight bytes. | int/long | int64 | Bignum | long | int64 | long | integer/string |
| bool | boolean | bool | TrueClass/FalseClass | bool | bool | boolean | boolean | |
| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | str/unicode | string | String (UTF-8) | string | string | String | string |
| bytes | May contain any arbitrary sequence of bytes. | str | []byte | String (ASCII-8BIT) | ByteString | string | ByteString | string |