-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMessage.py
More file actions
74 lines (58 loc) · 2.21 KB
/
Message.py
File metadata and controls
74 lines (58 loc) · 2.21 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
# -*- coding: utf-8 -*-
"""
FlowrouteMessagingLib.Models.Message
This file was automatically generated for flowroute
by APIMATIC BETA v2.0 on 02/08/2016
"""
from FlowrouteMessagingLib.APIHelper import APIHelper
class Message(object):
"""
Implementation of the 'Message' model.
A simple message.
Attributes:
to (string): Phone number in E.164 format to send a message to.
mfrom (string): Phone number in E.164 format where the message is sent
from.
content (string): The content of the message.
"""
def __init__(self, **kwargs):
# Set all of the parameters to their default values
self.to = None
self.mfrom = None
self.content = None
self.is_mms = False
self.media_urls = []
# Create a mapping from API property names to Model property names
replace_names = {
"to": "to",
"from_": "mfrom",
"content": "content",
"is_mms": "is_mms",
"media_urls": "media_urls"
}
# Parse all of the Key-Value arguments
if kwargs is not None:
for key in kwargs:
# Only add arguments that are actually part of this object
if key in replace_names:
setattr(self, replace_names[key], kwargs[key])
def resolve_names(self):
"""
Creates a dictionary representation of this object.
This method converts an object to a dictionary that represents the
format that the model should be in when passed into an API Request.
Because of this, the generated dictionary may have different
property names to that of the model itself.
Returns:
dict: The dictionary representing the object.
"""
# Create a mapping from Model property names to API property names
replace_names = {
"to": "to",
"mfrom": "from",
"content": "content",
"is_mms": "is_mms",
"media_urls": "media_urls"
}
retval = dict()
return APIHelper.resolve_names(self, replace_names, retval)