Coverage for /var/srv/projects/api.amasfac.comuna18.com/tmp/venv/lib/python3.9/site-packages/sendgrid/helpers/mail/send_at.py: 46%
22 statements
« prev ^ index » next coverage.py v6.4.4, created at 2023-07-17 14:22 -0600
« prev ^ index » next coverage.py v6.4.4, created at 2023-07-17 14:22 -0600
1class SendAt(object):
2 """A unix timestamp allowing you to specify when you want your
3 email to be delivered. This may be overridden by the
4 personalizations[x].send_at parameter. You can't schedule more
5 than 72 hours in advance. If you have the flexibility, it's
6 better to schedule mail for off-peak times. Most emails are
7 scheduled and sent at the top of the hour or half hour.
8 Scheduling email to avoid those times (for example, scheduling
9 at 10:53) can result in lower deferral rates because it won't
10 be going through our servers at the same times as everyone else's
11 mail."""
12 def __init__(self, send_at=None, p=None):
13 """Create a unix timestamp specifying when your email should
14 be delivered.
16 :param send_at: Unix timestamp
17 :type send_at: integer
18 :param name: p is the Personalization object or Personalization object
19 index
20 :type name: Personalization, integer, optional
21 """
22 self._send_at = None
23 self._personalization = None
25 if send_at is not None:
26 self.send_at = send_at
27 if p is not None:
28 self.personalization = p
30 @property
31 def send_at(self):
32 """A unix timestamp.
34 :rtype: integer
35 """
36 return self._send_at
38 @send_at.setter
39 def send_at(self, value):
40 """A unix timestamp.
42 :param value: A unix timestamp.
43 :type value: integer
44 """
45 self._send_at = value
47 @property
48 def personalization(self):
49 """The Personalization object or Personalization object index
51 :rtype: Personalization, integer
52 """
53 return self._personalization
55 @personalization.setter
56 def personalization(self, value):
57 """The Personalization object or Personalization object index
59 :param value: The Personalization object or Personalization object
60 index
61 :type value: Personalization, integer
62 """
63 self._personalization = value
65 def __str__(self):
66 """Get a JSON representation of this object.
68 :rtype: integer
69 """
70 return str(self.get())
72 def get(self):
73 """
74 Get a JSON-ready representation of this SendAt object.
76 :returns: The unix timestamp, ready for use in a request body.
77 :rtype: integer
78 """
79 return self.send_at