forked from sendgrid/sendgrid-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbatch_id.py
50 lines (40 loc) · 1.28 KB
/
batch_id.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
class BatchId(object):
"""This ID represents a batch of emails to be sent at the same time.
Including a batch_id in your request allows you include this email
in that batch, and also enables you to cancel or pause the delivery
of that batch. For more information, see
https://sendgrid.com/docs/API_Reference/Web_API_v3/cancel_schedule_send.
"""
def __init__(self, batch_id=None):
"""Create a batch ID.
:param batch_id: Batch Id
:type batch_id: string
"""
self._batch_id = None
if batch_id is not None:
self.batch_id = batch_id
@property
def batch_id(self):
"""The batch ID.
:rtype: string
"""
return self._batch_id
@batch_id.setter
def batch_id(self, value):
"""The batch ID.
:param value: Batch Id
:type value: string
"""
self._batch_id = value
def __str__(self):
"""Get a JSON representation of this object.
:rtype: string
"""
return str(self.get())
def get(self):
"""
Get a JSON-ready representation of this BatchId object.
:returns: The BatchId, ready for use in a request body.
:rtype: string
"""
return self.batch_id