File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 1+ import chalicelib .util .type_util as type_util
12import pydantic
23
3- ReceiverType = str
4- AllowedBasicValueTypes = str | int | float | bool | None
5- AllowedValueTypes = AllowedBasicValueTypes | list [AllowedBasicValueTypes ] | dict [str , AllowedBasicValueTypes ] | None
6- ContextType = dict [str , AllowedValueTypes ]
7-
84
95class NotificationSendRequestSharedContext (pydantic .BaseModel ):
106 from_ : str
117
128
139class NotificationSendRequest (pydantic .BaseModel ):
1410 template_code : str
15- shared_context : ContextType
16- personalized_context : dict [ReceiverType , ContextType ]
11+ shared_context : type_util . ContextType
12+ personalized_context : dict [str , type_util . ContextType ]
Original file line number Diff line number Diff line change 33import botocore .exceptions
44import chalicelib .aws_resource
55import chalicelib .sender .__interface__ as sender_interface
6+ import chalicelib .util .type_util as type_util
67import jinja2
78import pydantic
89
@@ -53,7 +54,7 @@ class AWSSESSendRequest(sender_interface.NotificationSendRequest):
5354
5455 @pydantic .field_validator ("shared_context" , mode = "before" )
5556 @classmethod
56- def validate_shared_context (cls , v : sender_interface .ContextType ) -> sender_interface .ContextType :
57+ def validate_shared_context (cls , v : type_util .ContextType ) -> type_util .ContextType :
5758 if all (k not in v for k in cls .REQUIRED_SHARED_FIELDS ):
5859 raise ValueError ("shared_context missing required fields" )
5960 return v
Original file line number Diff line number Diff line change 66RouteInfoType = tuple [str , list [HttpMethodType ], typing .Callable ]
77RouteCollectionType = list [RouteInfoType ]
88
9+ AllowedBasicValueTypes = str | int | float | bool | None
10+ AllowedValueTypes = AllowedBasicValueTypes | list [AllowedBasicValueTypes ] | dict [str , AllowedBasicValueTypes ] | None
11+ ContextType = dict [str , AllowedValueTypes ]
12+ TemplateType = dict [str , AllowedValueTypes ]
13+
914
1015class NotiCoSQSMessage (pydantic .BaseModel ):
1116 worker_action : str
You can’t perform that action at this time.
0 commit comments