{"openapi":"3.1.0","info":{"title":"Сервис отправки заданий печати","description":"Серверная часть сервиса отправки заданий на печать и получения файлов для печати с терминала","version":"v2024.12.27"},"servers":[{"url":"/print"}],"paths":{"/is_union_member":{"get":{"tags":["User"],"summary":"Check Union Member","description":"Проверяет наличие пользователя в списке.","operationId":"check_union_member_is_union_member_get","parameters":[{"name":"surname","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Surname"}},{"name":"number","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Number"}},{"name":"v","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"v2024.12.27","title":"V"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"detail":"User not found","description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["User"],"summary":"Update List","description":"Обновляет данные существующего пользователя или добавляет нового, если его нет.","operationId":"update_list_is_union_member_post","security":[{"token":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserList"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/file":{"post":{"tags":["File"],"summary":"Send","description":"Получить пин код для загрузки и скачивания файла.\n\nПолученный пин-код можно использовать в методах POST и GET `/file/{pin}`.","operationId":"send_file_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendOutput"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseModel"}}},"detail":"User error"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseModel"}}},"detail":"PIN generate error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/file/{pin}":{"post":{"tags":["File"],"summary":"Upload File","description":"Загрузить файл на сервер.\n\nТребует пин-код, полученный в методе POST `/file`. Файл для пин-кода можно\nзагрузить лишь один раз. Файл должен быть размером до 5 000 000 байт\n(меняется в настройках сервера).","operationId":"upload_file_file__pin__post","parameters":[{"name":"pin","in":"path","required":true,"schema":{"type":"string","title":"Pin"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_file__pin__post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendOutput"}}}},"400":{"detail":"File is not received","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseModel"}}},"description":"Bad Request"},"404":{"detail":"Pin not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseModel"}}},"description":"Not Found"},"415":{"detail":"File error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseModel"}}},"description":"Unsupported Media Type"},"413":{"detail":"Too large file","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseModel"}}},"description":"Request Entity Too Large"},"416":{"detail":"Invalid page request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseModel"}}},"description":"Requested Range Not Satisfiable"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["File"],"summary":"Update File Options","description":"Обновляет настройки печати.\n\nТребует пин-код, полученный в методе POST `/file`. Обновлять настройки\nможно бесконечное количество раз. Можно изменять настройки по одной.","operationId":"update_file_options_file__pin__patch","parameters":[{"name":"pin","in":"path","required":true,"schema":{"type":"string","title":"Pin"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendInputUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendOutput"}}}},"404":{"detail":"Pin not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseModel"}}},"description":"Not Found"},"413":{"detail":"Too many pages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseModel"}}},"description":"Request Entity Too Large"},"416":{"detail":"Invalid page request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseModel"}}},"description":"Requested Range Not Satisfiable"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["File"],"summary":"Print File","description":"Получить файл для печати.\n\nТребует пин-код, полученный в методе POST `/file`. Файл можно скачать\nбесконечное количество раз в течение 7 дней после загрузки (меняется в\nнастройках сервера).","operationId":"print_file_file__pin__get","parameters":[{"name":"pin","in":"path","required":true,"schema":{"type":"string","title":"Pin"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiveOutput"}}}},"404":{"detail":"Pin not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseModel"}}},"description":"Not Found"},"415":{"detail":"File error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseModel"}}},"description":"Unsupported Media Type"},"416":{"detail":"Invalid page request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseModel"}}},"description":"Requested Range Not Satisfiable"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/qr":{"post":{"tags":["File"],"summary":"Instant Print","operationId":"instant_print_qr_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstantPrintCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/update":{"post":{"tags":["Admin"],"summary":"Manual Update Terminal","operationId":"manual_update_terminal_admin_update_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"token":[]}]}},"/admin/reboot":{"post":{"tags":["Admin"],"summary":"Reboot Terminal","operationId":"reboot_terminal_admin_reboot_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RebootInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"token":[]}]}}},"components":{"schemas":{"Body_upload_file_file__pin__post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_file_file__pin__post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InstantPrintCreate":{"properties":{"qr_token":{"type":"string","title":"Qr Token"},"files":{"items":{"type":"string"},"type":"array","maxItems":10,"minItems":1,"uniqueItems":true,"title":"Files"}},"type":"object","required":["qr_token","files"],"title":"InstantPrintCreate"},"PrintOptions":{"properties":{"pages":{"type":"string","title":"Pages","description":"Страницы для печати","default":"","example":"2-4,6"},"copies":{"type":"integer","title":"Copies","description":"Количество копий для печати","default":1},"two_sided":{"type":"boolean","title":"Two Sided","description":"Включить печать с двух сторон листа","default":false}},"type":"object","title":"PrintOptions"},"RebootInput":{"properties":{"terminal_token":{"type":"string","title":"Terminal Token"}},"type":"object","required":["terminal_token"],"title":"RebootInput"},"ReceiveOutput":{"properties":{"filename":{"type":"string","title":"Filename","description":"Название файла, который можно запросить по адресу https://app.profcomff.com/print/static/{filename}","example":"2021-11-02-ZMNF5V...9.pdf"},"options":{"$ref":"#/components/schemas/PrintOptions"}},"type":"object","required":["filename","options"],"title":"ReceiveOutput"},"SendInput":{"properties":{"surname":{"type":"string","title":"Surname","description":"Фамилия","example":"Иванов"},"number":{"type":"string","title":"Number","description":"Номер профсоюзного или студенческого билетов","example":"1015000"},"filename":{"type":"string","title":"Filename","description":"Название файла","example":"filename.pdf"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"options":{"$ref":"#/components/schemas/PrintOptions","default":{"pages":"","copies":1,"two_sided":false}}},"type":"object","required":["surname","number","filename"],"title":"SendInput"},"SendInputUpdate":{"properties":{"options":{"anyOf":[{"$ref":"#/components/schemas/PrintOptions"},{"type":"null"}]}},"type":"object","title":"SendInputUpdate"},"SendOutput":{"properties":{"pin":{"type":"string","title":"Pin","description":"Пин-код, который используется для манипуляции файлами","example":"OF72I1"},"options":{"$ref":"#/components/schemas/PrintOptions"}},"type":"object","required":["pin","options"],"title":"SendOutput"},"StatusResponseModel":{"properties":{"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"},"ru":{"type":"string","title":"Ru"}},"type":"object","required":["status","message","ru"],"title":"StatusResponseModel"},"UpdateInput":{"properties":{"terminal_token":{"type":"string","title":"Terminal Token"}},"type":"object","required":["terminal_token"],"title":"UpdateInput"},"UpdateUserList":{"properties":{"users":{"items":{"$ref":"#/components/schemas/UserCreate"},"type":"array","title":"Users"}},"type":"object","required":["users"],"title":"UpdateUserList"},"UserCreate":{"properties":{"username":{"type":"string","minLength":1,"title":"Username"},"union_number":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Union Number"},"student_number":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Student Number"}},"type":"object","required":["username","union_number","student_number"],"title":"UserCreate"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"token":{"type":"apiKey","in":"header","name":"Authorization"}}}}