|
15 | 15 | """Functionality for preparing order details for use in creating an order""" |
16 | 16 | from __future__ import annotations # https://stackoverflow.com/a/33533514 |
17 | 17 | import logging |
18 | | -from typing import Optional, Any, Dict, List |
| 18 | +from typing import Optional, Any, Dict, List, Union |
19 | 19 |
|
20 | 20 | from . import geojson, specs |
21 | 21 | from .exceptions import ClientError |
@@ -143,19 +143,21 @@ def notifications(email: Optional[bool] = None, |
143 | 143 | webhook_per_order: Request a single webhook call per order instead |
144 | 144 | of one call per each delivered item. |
145 | 145 | ''' |
146 | | - notifications_dict = {} |
| 146 | + notifications_dict: Dict[str, Union[dict, bool]] = {} |
147 | 147 |
|
148 | 148 | if webhook_url: |
149 | | - webhook_dict = { |
150 | | - 'url': webhook_url |
151 | | - } |
| 149 | + webhook_dict: Dict[str, Union[str, bool]] = { |
| 150 | + 'url': webhook_url, |
| 151 | + } |
152 | 152 | if webhook_per_order is not None: |
153 | | - webhook_dict['per_order'] = webhook_per_order |
| 153 | + wpo: bool = webhook_per_order |
| 154 | + webhook_dict['per_order'] = wpo |
154 | 155 |
|
155 | 156 | notifications_dict['webhook'] = webhook_dict |
156 | 157 |
|
157 | 158 | if email is not None: |
158 | | - notifications_dict['email'] = email |
| 159 | + val: bool = email |
| 160 | + notifications_dict['email'] = val |
159 | 161 |
|
160 | 162 | return notifications_dict |
161 | 163 |
|
|
0 commit comments