forked from sendgrid/sendgrid-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
subject.py
69 lines (54 loc) · 1.76 KB
/
subject.py
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
class Subject(object):
"""A subject for an email message."""
def __init__(self, subject, p=None):
"""Create a Subject.
:param subject: The subject for an email
:type subject: string
:param name: p is the Personalization object or Personalization object
index
:type name: Personalization, integer, optional
"""
self._subject = None
self._personalization = None
self.subject = subject
if p is not None:
self.personalization = p
@property
def subject(self):
"""The subject of an email.
:rtype: string
"""
return self._subject
@subject.setter
def subject(self, value):
"""The subject of an email.
:param value: The subject of an email.
:type value: string
"""
self._subject = value
@property
def personalization(self):
"""The Personalization object or Personalization object index
:rtype: Personalization, integer
"""
return self._personalization
@personalization.setter
def personalization(self, value):
"""The Personalization object or Personalization object index
:param value: The Personalization object or Personalization object
index
:type value: Personalization, integer
"""
self._personalization = value
def __str__(self):
"""Get a JSON representation of this Mail request.
:rtype: string
"""
return str(self.get())
def get(self):
"""
Get a JSON-ready representation of this Subject.
:returns: This Subject, ready for use in a request body.
:rtype: string
"""
return self.subject