~kf5jwc/sms-printer

ref: 72a9603961d1c8932a452cbf59e7e5cc6eb073e3 sms-printer/sms_broker_parsers/parsers/json/bandwidth_v1.py -rw-r--r-- 1.1 KiB View raw
72a96039 — Kyle Jones A __main__ for this isn't *really* useful. 1 year, 9 months ago
                                                                                
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from typing import Dict
from ...types import Parser_Base, sms


class Parser(Parser_Base):
    def __init__(self, sms_input: Dict) -> None:
        super().__init__()
        msg = sms(sms_input["from"], sms_input["text"])
        self.messages.append(msg)


SCHEMA = """
{
   "type" : "object",
   "properties" : {
      "direction" : {
         "type" : "string"
      },
      "from" : {
         "type" : "string"
      },
      "state" : {
         "type" : "string"
      },
      "messageUri" : {
         "type" : "string"
      },
      "applicationId" : {
         "type" : "string"
      },
      "text" : {
         "type" : "string"
      },
      "time" : {
         "type" : "string"
      },
      "messageId" : {
         "type" : "string"
      },
      "to" : {
         "type" : "string"
      },
      "eventType" : {
         "type" : "string"
      }
   },
   "required" : [
      "applicationId",
      "direction",
      "eventType",
      "from",
      "messageId",
      "messageUri",
      "state",
      "text",
      "time",
      "to"
   ],
   "$schema" : "http://json-schema.org/schema#"
}
"""