aboutsummaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/sendgrid/helpers/mail/batch_id.py
blob: a4c0f8e9dc23d727fe7970c012a40758453bb9fa (about) (plain)
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