{"openapi":"3.0.2","info":{"title":"Notification Service","description":"Service for managing notifications.","version":"2.2.13"},"paths":{"/v1/health/":{"get":{"tags":["Health"],"summary":"Healthcheck if database is online.","description":"Return response that represents status of the database.","operationId":"get_db_status_v1_health__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/email/":{"post":{"tags":["Email"],"summary":"Send emails","description":"Compose and send emails based on templates.","operationId":"send_emails_v1_email__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailSchema"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/all/notifications/":{"get":{"tags":["Notifications"],"summary":"List all notifications.","description":"List notifications.","operationId":"list_notifications_v1_all_notifications__get","parameters":[{"required":false,"schema":{"$ref":"#/components/schemas/NotificationType"},"name":"type","in":"query"},{"required":false,"schema":{"title":"Recipient Username","type":"string"},"name":"recipient_username","in":"query"},{"required":false,"schema":{"title":"Project Code Any","type":"string"},"name":"project_code_any","in":"query"},{"required":false,"schema":{"title":"Created At Start","type":"string","format":"date-time"},"name":"created_at_start","in":"query"},{"required":false,"schema":{"title":"Created At End","type":"string","format":"date-time"},"name":"created_at_end","in":"query"},{"required":false,"schema":{"$ref":"#/components/schemas/NotificationSortByFields"},"name":"sort_by","in":"query"},{"required":false,"schema":{"allOf":[{"$ref":"#/components/schemas/SortingOrder"}],"default":"asc"},"name":"sort_order","in":"query"},{"required":false,"schema":{"title":"Page","minimum":1.0,"type":"integer","default":1},"name":"page","in":"query"},{"required":false,"schema":{"title":"Page Size","minimum":0.0,"type":"integer","default":20},"name":"page_size","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationListResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Notifications"],"summary":"Create new notification(s).","description":"Create one or multiple notifications.","operationId":"create_notification_v1_all_notifications__post","requestBody":{"content":{"application/json":{"schema":{"title":"Body","anyOf":[{"oneOf":[{"$ref":"#/components/schemas/PipelineNotificationCreateSchema"},{"$ref":"#/components/schemas/CopyRequestNotificationCreateSchema"},{"$ref":"#/components/schemas/RoleChangeNotificationCreateSchema"},{"$ref":"#/components/schemas/ProjectNotificationCreateSchema"},{"$ref":"#/components/schemas/MaintenanceNotificationCreateSchema"}]},{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/PipelineNotificationCreateSchema"},{"$ref":"#/components/schemas/CopyRequestNotificationCreateSchema"},{"$ref":"#/components/schemas/RoleChangeNotificationCreateSchema"},{"$ref":"#/components/schemas/ProjectNotificationCreateSchema"},{"$ref":"#/components/schemas/MaintenanceNotificationCreateSchema"}],"discriminator":{"propertyName":"type","mapping":{"pipeline":"#/components/schemas/PipelineNotificationCreateSchema","copy-request":"#/components/schemas/CopyRequestNotificationCreateSchema","role-change":"#/components/schemas/RoleChangeNotificationCreateSchema","project":"#/components/schemas/ProjectNotificationCreateSchema","maintenance":"#/components/schemas/MaintenanceNotificationCreateSchema"}}}}]}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/all/notifications/user":{"get":{"tags":["Notifications"],"summary":"List user notifications.","description":"List user notifications.","operationId":"list_user_notifications_v1_all_notifications_user_get","parameters":[{"required":true,"schema":{"title":"Recipient Username","type":"string"},"name":"recipient_username","in":"query"},{"required":false,"schema":{"title":"Project Code Any","type":"string"},"name":"project_code_any","in":"query"},{"required":false,"schema":{"$ref":"#/components/schemas/NotificationSortByFields"},"name":"sort_by","in":"query"},{"required":false,"schema":{"allOf":[{"$ref":"#/components/schemas/SortingOrder"}],"default":"asc"},"name":"sort_order","in":"query"},{"required":false,"schema":{"title":"Page","minimum":1.0,"type":"integer","default":1},"name":"page","in":"query"},{"required":false,"schema":{"title":"Page Size","minimum":0.0,"type":"integer","default":20},"name":"page_size","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationListResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/announcements/":{"get":{"tags":["Announcements"],"summary":"List all announcements.","description":"List all announcements.","operationId":"list_announcements_v2_announcements__get","parameters":[{"required":false,"schema":{"title":"Username","type":"string"},"name":"username","in":"query"},{"required":false,"schema":{"$ref":"#/components/schemas/AnnouncementSortByFields"},"name":"sort_by","in":"query"},{"required":false,"schema":{"allOf":[{"$ref":"#/components/schemas/SortingOrder"}],"default":"asc"},"name":"sort_order","in":"query"},{"required":false,"schema":{"title":"Page","minimum":1.0,"type":"integer","default":1},"name":"page","in":"query"},{"required":false,"schema":{"title":"Page Size","minimum":0.0,"type":"integer","default":20},"name":"page_size","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnouncementListResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Announcements"],"summary":"Create new announcement.","description":"Create new announcement together with maintenance notification.","operationId":"create_announcement_v2_announcements__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnouncementCreateSchema"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnouncementResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/announcements/{announcement_id}":{"get":{"tags":["Announcements"],"summary":"Get announcement by id.","description":"Get announcement by id.","operationId":"get_announcement_v2_announcements__announcement_id__get","parameters":[{"required":true,"schema":{"title":"Announcement Id","type":"string","format":"uuid"},"name":"announcement_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnouncementResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Announcements"],"summary":"Delete announcement.","description":"Delete announcement together with related maintenance notification.","operationId":"delete_announcement_v2_announcements__announcement_id__delete","parameters":[{"required":true,"schema":{"title":"Announcement Id","type":"string","format":"uuid"},"name":"announcement_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Announcements"],"summary":"Update announcement.","description":"Update announcement and recreate related maintenance notification.","operationId":"update_announcement_v2_announcements__announcement_id__patch","parameters":[{"required":true,"schema":{"title":"Announcement Id","type":"string","format":"uuid"},"name":"announcement_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnouncementUpdateSchema"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnouncementResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/announcements/{announcement_id}/unsubscribe":{"post":{"tags":["Announcements"],"summary":"Unsubscribe user from announcement.","description":"Unsubscribe user from announcement.","operationId":"unsubscribe_from_announcement_v2_announcements__announcement_id__unsubscribe_post","parameters":[{"required":true,"schema":{"title":"Announcement Id","type":"string","format":"uuid"},"name":"announcement_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnouncementUnsubscriptionCreateSchema"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"APIResponse":{"title":"APIResponse","type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/EAPIResponseCode"}],"default":200},"error_msg":{"title":"Error Msg","type":"string","default":""},"page":{"title":"Page","type":"integer","default":0},"total":{"title":"Total","type":"integer","default":1},"num_of_pages":{"title":"Num Of Pages","type":"integer","default":1},"result":{"title":"Result","type":"array","items":{},"default":[]}},"description":"Base class for all available schemas."},"AnnouncementCreateSchema":{"title":"AnnouncementCreateSchema","required":["effective_date","duration_minutes","message"],"type":"object","properties":{"effective_date":{"title":"Effective Date","type":"string","format":"date-time"},"duration_minutes":{"title":"Duration Minutes","exclusiveMinimum":0.0,"type":"integer"},"message":{"title":"Message","maxLength":512,"minLength":3,"type":"string"}},"description":"Announcement schema used for creation."},"AnnouncementListResponseSchema":{"title":"AnnouncementListResponseSchema","required":["num_of_pages","page","total","result"],"type":"object","properties":{"num_of_pages":{"title":"Num Of Pages","type":"integer"},"page":{"title":"Page","type":"integer"},"total":{"title":"Total","type":"integer"},"result":{"title":"Result","type":"array","items":{"$ref":"#/components/schemas/AnnouncementResponseSchema"}}},"description":"Default schema for multiple announcements in response."},"AnnouncementResponseSchema":{"title":"AnnouncementResponseSchema","required":["effective_date","duration_minutes","message","id","created_at"],"type":"object","properties":{"effective_date":{"title":"Effective Date","type":"string","format":"date-time"},"duration_minutes":{"title":"Duration Minutes","exclusiveMinimum":0.0,"type":"integer"},"message":{"title":"Message","maxLength":512,"minLength":3,"type":"string"},"id":{"title":"Id","type":"string","format":"uuid"},"created_at":{"title":"Created At","type":"string","format":"date-time"}},"description":"Default schema for single announcement in response."},"AnnouncementSortByFields":{"title":"AnnouncementSortByFields","enum":["effective_date","created_at"],"type":"string","description":"Fields by which announcements can be sorted."},"AnnouncementUnsubscriptionCreateSchema":{"title":"AnnouncementUnsubscriptionCreateSchema","required":["username"],"type":"object","properties":{"username":{"title":"Username","maxLength":256,"minLength":3,"type":"string"}},"description":"Announcement unsubscription schema used for unsubscribing user from announcement."},"AnnouncementUpdateSchema":{"title":"AnnouncementUpdateSchema","type":"object","properties":{"effective_date":{"title":"Effective Date","type":"string","format":"date-time"},"duration_minutes":{"title":"Duration Minutes","exclusiveMinimum":0.0,"type":"integer"},"message":{"title":"Message","maxLength":512,"minLength":3,"type":"string"}},"description":"Announcement schema used for update."},"CopyRequestAction":{"title":"CopyRequestAction","enum":["approval","denial","close"],"type":"string","description":"Available copy request actions."},"CopyRequestNotificationCreateSchema":{"title":"CopyRequestNotificationCreateSchema","required":["recipient_username","action","initiator_username","project_code","copy_request_id"],"type":"object","properties":{"type":{"title":"Type","enum":["copy-request"],"type":"string","default":"copy-request"},"recipient_username":{"title":"Recipient Username","type":"string"},"action":{"$ref":"#/components/schemas/CopyRequestAction"},"initiator_username":{"title":"Initiator Username","type":"string"},"project_code":{"title":"Project Code","type":"string"},"copy_request_id":{"title":"Copy Request Id","type":"string","format":"uuid"},"source":{"$ref":"#/components/schemas/Location"},"destination":{"$ref":"#/components/schemas/Location"},"targets":{"title":"Targets","minItems":1,"type":"array","items":{"$ref":"#/components/schemas/Target"}}},"description":"Schema for copy request notification creation."},"CopyRequestNotificationResponseSchema":{"title":"CopyRequestNotificationResponseSchema","required":["type","id","created_at","recipient_username","action","initiator_username","project_code","copy_request_id"],"type":"object","properties":{"type":{"title":"Type","enum":["copy-request"],"type":"string"},"id":{"title":"Id","type":"string","format":"uuid"},"created_at":{"title":"Created At","type":"string","format":"date-time"},"recipient_username":{"title":"Recipient Username","type":"string"},"action":{"$ref":"#/components/schemas/CopyRequestAction"},"initiator_username":{"title":"Initiator Username","type":"string"},"project_code":{"title":"Project Code","type":"string"},"copy_request_id":{"title":"Copy Request Id","type":"string","format":"uuid"},"source":{"$ref":"#/components/schemas/Location"},"destination":{"$ref":"#/components/schemas/Location"},"targets":{"title":"Targets","type":"array","items":{"$ref":"#/components/schemas/Target"}}},"description":"Schema for single copy request notification in response."},"EAPIResponseCode":{"title":"EAPIResponseCode","enum":[200,500,400,404,403,401,409,413],"description":"An enumeration."},"HTTPValidationError":{"title":"HTTPValidationError","type":"object","properties":{"detail":{"title":"Detail","type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"InvolvementType":{"title":"InvolvementType","enum":["initiator","owner","receiver"],"type":"string","description":"Available involvement types."},"Location":{"title":"Location","required":["id","path","zone"],"type":"object","properties":{"id":{"title":"Id","type":"string","format":"uuid"},"path":{"title":"Path","type":"string"},"zone":{"title":"Zone","type":"integer"}},"description":"Model for source/destination folder object in notification."},"MaintenanceNotificationCreateSchema":{"title":"MaintenanceNotificationCreateSchema","required":["announcement_id","effective_date","duration_minutes","message"],"type":"object","properties":{"type":{"title":"Type","enum":["maintenance"],"type":"string","default":"maintenance"},"announcement_id":{"title":"Announcement Id","type":"string","format":"uuid"},"effective_date":{"title":"Effective Date","type":"string","format":"date-time"},"duration_minutes":{"title":"Duration Minutes","exclusiveMinimum":0.0,"type":"integer"},"message":{"title":"Message","type":"string"}},"description":"Schema for maintenance notification creation."},"MaintenanceNotificationResponseSchema":{"title":"MaintenanceNotificationResponseSchema","required":["type","id","created_at","announcement_id","effective_date","duration_minutes","message"],"type":"object","properties":{"type":{"title":"Type","enum":["maintenance"],"type":"string"},"id":{"title":"Id","type":"string","format":"uuid"},"created_at":{"title":"Created At","type":"string","format":"date-time"},"announcement_id":{"title":"Announcement Id","type":"string","format":"uuid"},"effective_date":{"title":"Effective Date","type":"string","format":"date-time"},"duration_minutes":{"title":"Duration Minutes","type":"integer"},"message":{"title":"Message","type":"string"}},"description":"Schema for single maintenance notification in response."},"NotificationListResponseSchema":{"title":"NotificationListResponseSchema","required":["num_of_pages","page","total","result"],"type":"object","properties":{"num_of_pages":{"title":"Num Of Pages","type":"integer"},"page":{"title":"Page","type":"integer"},"total":{"title":"Total","type":"integer"},"result":{"title":"Result","type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/PipelineNotificationResponseSchema"},{"$ref":"#/components/schemas/CopyRequestNotificationResponseSchema"},{"$ref":"#/components/schemas/RoleChangeNotificationResponseSchema"},{"$ref":"#/components/schemas/ProjectNotificationResponseSchema"},{"$ref":"#/components/schemas/MaintenanceNotificationResponseSchema"}],"discriminator":{"propertyName":"type","mapping":{"pipeline":"#/components/schemas/PipelineNotificationResponseSchema","copy-request":"#/components/schemas/CopyRequestNotificationResponseSchema","role-change":"#/components/schemas/RoleChangeNotificationResponseSchema","project":"#/components/schemas/ProjectNotificationResponseSchema","maintenance":"#/components/schemas/MaintenanceNotificationResponseSchema"}}}}},"description":"Default schema for multiple notifications in response."},"NotificationSortByFields":{"title":"NotificationSortByFields","enum":["created_at"],"type":"string","description":"Fields by which notifications can be sorted."},"NotificationType":{"title":"NotificationType","enum":["pipeline","copy-request","role-change","project","maintenance"],"type":"string","description":"Available notification types."},"PipelineAction":{"title":"PipelineAction","enum":["delete","copy"],"type":"string","description":"Available pipeline actions."},"PipelineNotificationCreateSchema":{"title":"PipelineNotificationCreateSchema","required":["recipient_username","involved_as","action","status","initiator_username","project_code","source","targets"],"type":"object","properties":{"type":{"title":"Type","enum":["pipeline"],"type":"string","default":"pipeline"},"recipient_username":{"title":"Recipient Username","type":"string"},"involved_as":{"$ref":"#/components/schemas/InvolvementType"},"action":{"$ref":"#/components/schemas/PipelineAction"},"status":{"$ref":"#/components/schemas/PipelineStatus"},"initiator_username":{"title":"Initiator Username","type":"string"},"project_code":{"title":"Project Code","type":"string"},"source":{"$ref":"#/components/schemas/Location"},"destination":{"$ref":"#/components/schemas/Location"},"targets":{"title":"Targets","minItems":1,"type":"array","items":{"$ref":"#/components/schemas/Target"}}},"description":"Schema for pipeline notification creation."},"PipelineNotificationResponseSchema":{"title":"PipelineNotificationResponseSchema","required":["type","id","created_at","recipient_username","involved_as","action","status","initiator_username","project_code","source","targets"],"type":"object","properties":{"type":{"title":"Type","enum":["pipeline"],"type":"string"},"id":{"title":"Id","type":"string","format":"uuid"},"created_at":{"title":"Created At","type":"string","format":"date-time"},"recipient_username":{"title":"Recipient Username","type":"string"},"involved_as":{"$ref":"#/components/schemas/InvolvementType"},"action":{"$ref":"#/components/schemas/PipelineAction"},"status":{"$ref":"#/components/schemas/PipelineStatus"},"initiator_username":{"title":"Initiator Username","type":"string"},"project_code":{"title":"Project Code","type":"string"},"source":{"$ref":"#/components/schemas/Location"},"destination":{"$ref":"#/components/schemas/Location"},"targets":{"title":"Targets","type":"array","items":{"$ref":"#/components/schemas/Target"}}},"description":"Schema for single pipeline notification in response."},"PipelineStatus":{"title":"PipelineStatus","enum":["success","failure"],"type":"string","description":"Available pipeline statuses."},"ProjectNotificationCreateSchema":{"title":"ProjectNotificationCreateSchema","required":["project_code","project_name","announcer_username","message"],"type":"object","properties":{"type":{"title":"Type","enum":["project"],"type":"string","default":"project"},"project_code":{"title":"Project Code","type":"string"},"project_name":{"title":"Project Name","type":"string"},"announcer_username":{"title":"Announcer Username","type":"string"},"message":{"title":"Message","type":"string"}},"description":"Schema for project notification creation."},"ProjectNotificationResponseSchema":{"title":"ProjectNotificationResponseSchema","required":["type","id","created_at","project_code","project_name","announcer_username","message"],"type":"object","properties":{"type":{"title":"Type","enum":["project"],"type":"string"},"id":{"title":"Id","type":"string","format":"uuid"},"created_at":{"title":"Created At","type":"string","format":"date-time"},"project_code":{"title":"Project Code","type":"string"},"project_name":{"title":"Project Name","type":"string"},"announcer_username":{"title":"Announcer Username","type":"string"},"message":{"title":"Message","type":"string"}},"description":"Schema for single project notification in response."},"RoleChangeNotificationCreateSchema":{"title":"RoleChangeNotificationCreateSchema","required":["recipient_username","initiator_username","project_code","previous","current"],"type":"object","properties":{"type":{"title":"Type","enum":["role-change"],"type":"string","default":"role-change"},"recipient_username":{"title":"Recipient Username","type":"string"},"initiator_username":{"title":"Initiator Username","type":"string"},"project_code":{"title":"Project Code","type":"string"},"previous":{"title":"Previous","type":"string"},"current":{"title":"Current","type":"string"}},"description":"Schema for role change notification creation."},"RoleChangeNotificationResponseSchema":{"title":"RoleChangeNotificationResponseSchema","required":["type","id","created_at","recipient_username","initiator_username","project_code","previous","current"],"type":"object","properties":{"type":{"title":"Type","enum":["role-change"],"type":"string"},"id":{"title":"Id","type":"string","format":"uuid"},"created_at":{"title":"Created At","type":"string","format":"date-time"},"recipient_username":{"title":"Recipient Username","type":"string"},"initiator_username":{"title":"Initiator Username","type":"string"},"project_code":{"title":"Project Code","type":"string"},"previous":{"title":"Previous","type":"string"},"current":{"title":"Current","type":"string"}},"description":"Schema for single role change notification in response."},"SendEmailAttachmentSchema":{"title":"SendEmailAttachmentSchema","required":["name","data"],"type":"object","properties":{"name":{"title":"Name","type":"string"},"data":{"title":"Data","type":"string"}},"description":"Email attachment schema."},"SendEmailSchema":{"title":"SendEmailSchema","required":["sender","receiver"],"type":"object","properties":{"sender":{"title":"Sender","type":"string","format":"email"},"receiver":{"title":"Receiver","type":"array","items":{"type":"string","format":"email"}},"subject":{"title":"Subject","type":"string","default":""},"message":{"title":"Message","type":"string","default":""},"template":{"title":"Template","type":"string","default":""},"template_kwargs":{"title":"Template Kwargs","type":"object","default":{}},"msg_type":{"title":"Msg Type","enum":["html","plain"],"type":"string","default":"plain"},"attachments":{"title":"Attachments","type":"array","items":{"$ref":"#/components/schemas/SendEmailAttachmentSchema"},"default":[]}},"description":"Schema used for email sending request."},"SortingOrder":{"title":"SortingOrder","enum":["asc","desc"],"type":"string","description":"Available sorting orders."},"Target":{"title":"Target","required":["id","type","name"],"type":"object","properties":{"id":{"title":"Id","type":"string","format":"uuid"},"type":{"$ref":"#/components/schemas/TargetType"},"name":{"title":"Name","type":"string"}},"description":"Model for file/folder object in notification."},"TargetType":{"title":"TargetType","enum":["file","folder"],"type":"string","description":"Available target types."},"ValidationError":{"title":"ValidationError","required":["loc","msg","type"],"type":"object","properties":{"loc":{"title":"Location","type":"array","items":{"anyOf":[{"type":"string"},{"type":"integer"}]}},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}}}}}}