Coverage for opt/mealie/lib/python3.12/site-packages/mealie/schema/household/group_events.py: 100%
64 statements
« prev ^ index » next coverage.py v7.10.6, created at 2025-11-25 15:48 +0000
« prev ^ index » next coverage.py v7.10.6, created at 2025-11-25 15:48 +0000
1from pydantic import UUID4, ConfigDict 1a
2from sqlalchemy.orm import joinedload 1a
3from sqlalchemy.orm.interfaces import LoaderOption 1a
5from mealie.db.models.household import GroupEventNotifierModel 1a
6from mealie.schema._mealie import MealieModel 1a
7from mealie.schema.response.pagination import PaginationBase 1a
9# =============================================================================
10# Group Events Notifier Options
13class GroupEventNotifierOptions(MealieModel): 1a
14 """
15 These events are in-sync with the EventTypes found in the EventBusService.
16 If you modify this, make sure to update the EventBusService as well.
17 """
19 test_message: bool = False 1a
20 webhook_task: bool = False 1a
22 recipe_created: bool = False 1a
23 recipe_updated: bool = False 1a
24 recipe_deleted: bool = False 1a
26 user_signup: bool = False 1a
28 data_migrations: bool = False 1a
29 data_export: bool = False 1a
30 data_import: bool = False 1a
32 mealplan_entry_created: bool = False 1a
34 shopping_list_created: bool = False 1a
35 shopping_list_updated: bool = False 1a
36 shopping_list_deleted: bool = False 1a
38 cookbook_created: bool = False 1a
39 cookbook_updated: bool = False 1a
40 cookbook_deleted: bool = False 1a
42 tag_created: bool = False 1a
43 tag_updated: bool = False 1a
44 tag_deleted: bool = False 1a
46 category_created: bool = False 1a
47 category_updated: bool = False 1a
48 category_deleted: bool = False 1a
50 label_created: bool = False 1a
51 label_updated: bool = False 1a
52 label_deleted: bool = False 1a
55class GroupEventNotifierOptionsSave(GroupEventNotifierOptions): 1a
56 notifier_id: UUID4 1a
59class GroupEventNotifierOptionsOut(GroupEventNotifierOptions): 1a
60 id: UUID4 1a
61 model_config = ConfigDict(from_attributes=True) 1a
64# =======================================================================
65# Notifiers
68class GroupEventNotifierCreate(MealieModel): 1a
69 name: str 1a
70 apprise_url: str | None = None 1a
73class GroupEventNotifierSave(GroupEventNotifierCreate): 1a
74 enabled: bool = True 1a
75 group_id: UUID4 1a
76 household_id: UUID4 1a
77 options: GroupEventNotifierOptions = GroupEventNotifierOptions() 1a
80class GroupEventNotifierUpdate(GroupEventNotifierSave): 1a
81 id: UUID4 1a
82 apprise_url: str | None = None 1a
85class GroupEventNotifierOut(MealieModel): 1a
86 id: UUID4 1a
87 name: str 1a
88 enabled: bool 1a
89 group_id: UUID4 1a
90 household_id: UUID4 1a
91 options: GroupEventNotifierOptionsOut 1a
92 model_config = ConfigDict(from_attributes=True) 1a
94 @classmethod 1a
95 def loader_options(cls) -> list[LoaderOption]: 1a
96 return [joinedload(GroupEventNotifierModel.options)] 1bcdefghijklmnopqrs
99class GroupEventPagination(PaginationBase): 1a
100 items: list[GroupEventNotifierOut] 1a
103class GroupEventNotifierPrivate(GroupEventNotifierOut): 1a
104 apprise_url: str 1a
105 model_config = ConfigDict(from_attributes=True) 1a