-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconstants.py
More file actions
40 lines (29 loc) · 959 Bytes
/
constants.py
File metadata and controls
40 lines (29 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from typing import TypedDict
"""Constants used by API clients"""
DEV_ENVIRONMENT = "dev"
API_CACHE_KEY = "api_client_access_token"
class Constants:
"""Constants used for the API clients"""
RETRYABLE_STATUS_CODES = {429, 500, 502, 503, 504}
DEFAULT_API_CLIENTS_TIMEOUT = 5
API_CLIENTS_MAX_RETRIES = 2
API_CLIENTS_BACKOFF_SECONDS = 0.5
# Fields from the incoming SQS message that forms part of the base schema and filtering attributes for MNS notifications
class FilteringData(TypedDict):
"""MNS notification filtering attributes."""
generalpractitioner: str | None
sourceorganisation: str
sourceapplication: str
subjectage: int
immunisationtype: str
action: str
class MnsNotificationPayload(TypedDict):
"""CloudEvents-compliant MNS notification payload."""
specversion: str
id: str
source: str
type: str
time: str
subject: str
dataref: str
filtering: FilteringData