2022-03-15 15:01:56 -08:00
|
|
|
from pydantic import UUID4, NoneStr
|
2022-01-09 21:04:24 -09:00
|
|
|
|
2022-03-25 10:56:49 -08:00
|
|
|
from mealie.schema._mealie import MealieModel
|
2022-06-25 14:39:38 -05:00
|
|
|
from mealie.schema.response.pagination import PaginationBase
|
2022-03-25 10:56:49 -08:00
|
|
|
|
2022-01-09 21:04:24 -09:00
|
|
|
# =============================================================================
|
|
|
|
|
# Group Events Notifier Options
|
|
|
|
|
|
|
|
|
|
|
2022-03-25 10:56:49 -08:00
|
|
|
class GroupEventNotifierOptions(MealieModel):
|
2022-01-09 21:04:24 -09:00
|
|
|
"""
|
|
|
|
|
These events are in-sync with the EventTypes found in the EventBusService.
|
|
|
|
|
If you modify this, make sure to update the EventBusService as well.
|
|
|
|
|
"""
|
|
|
|
|
|
2022-09-27 21:55:20 -05:00
|
|
|
test_message: bool = False
|
|
|
|
|
webhook_task: bool = False
|
|
|
|
|
|
2022-01-09 21:04:24 -09:00
|
|
|
recipe_created: bool = False
|
|
|
|
|
recipe_updated: bool = False
|
|
|
|
|
recipe_deleted: bool = False
|
|
|
|
|
|
|
|
|
|
user_signup: bool = False
|
|
|
|
|
|
|
|
|
|
data_migrations: bool = False
|
|
|
|
|
data_export: bool = False
|
|
|
|
|
data_import: bool = False
|
|
|
|
|
|
|
|
|
|
mealplan_entry_created: bool = False
|
|
|
|
|
|
|
|
|
|
shopping_list_created: bool = False
|
|
|
|
|
shopping_list_updated: bool = False
|
|
|
|
|
shopping_list_deleted: bool = False
|
|
|
|
|
|
|
|
|
|
cookbook_created: bool = False
|
|
|
|
|
cookbook_updated: bool = False
|
|
|
|
|
cookbook_deleted: bool = False
|
|
|
|
|
|
|
|
|
|
tag_created: bool = False
|
|
|
|
|
tag_updated: bool = False
|
|
|
|
|
tag_deleted: bool = False
|
|
|
|
|
|
|
|
|
|
category_created: bool = False
|
|
|
|
|
category_updated: bool = False
|
|
|
|
|
category_deleted: bool = False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class GroupEventNotifierOptionsSave(GroupEventNotifierOptions):
|
|
|
|
|
notifier_id: UUID4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class GroupEventNotifierOptionsOut(GroupEventNotifierOptions):
|
|
|
|
|
id: UUID4
|
|
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
|
orm_mode = True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# =======================================================================
|
|
|
|
|
# Notifiers
|
|
|
|
|
|
|
|
|
|
|
2022-03-25 10:56:49 -08:00
|
|
|
class GroupEventNotifierCreate(MealieModel):
|
2022-01-09 21:04:24 -09:00
|
|
|
name: str
|
|
|
|
|
apprise_url: str
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class GroupEventNotifierSave(GroupEventNotifierCreate):
|
|
|
|
|
enabled: bool = True
|
|
|
|
|
group_id: UUID4
|
|
|
|
|
options: GroupEventNotifierOptions = GroupEventNotifierOptions()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class GroupEventNotifierUpdate(GroupEventNotifierSave):
|
|
|
|
|
id: UUID4
|
2022-03-15 15:01:56 -08:00
|
|
|
apprise_url: NoneStr = None
|
2022-01-09 21:04:24 -09:00
|
|
|
|
|
|
|
|
|
2022-03-25 10:56:49 -08:00
|
|
|
class GroupEventNotifierOut(MealieModel):
|
2022-01-09 21:04:24 -09:00
|
|
|
id: UUID4
|
|
|
|
|
name: str
|
|
|
|
|
enabled: bool
|
|
|
|
|
group_id: UUID4
|
|
|
|
|
options: GroupEventNotifierOptionsOut
|
|
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
|
orm_mode = True
|
|
|
|
|
|
|
|
|
|
|
2022-06-25 14:39:38 -05:00
|
|
|
class GroupEventPagination(PaginationBase):
|
|
|
|
|
items: list[GroupEventNotifierOut]
|
|
|
|
|
|
|
|
|
|
|
2022-01-09 21:04:24 -09:00
|
|
|
class GroupEventNotifierPrivate(GroupEventNotifierOut):
|
|
|
|
|
apprise_url: str
|
|
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
|
orm_mode = True
|