Coverage for /var/srv/projects/api.amasfac.comuna18.com/tmp/venv/lib/python3.9/site-packages/sendgrid/helpers/mail/batch_id.py: 53%

13 statements  

« prev     ^ index     » next       coverage.py v6.4.4, created at 2023-07-17 14:22 -0600

1class BatchId(object): 

2 """This ID represents a batch of emails to be sent at the same time. 

3 Including a batch_id in your request allows you include this email 

4 in that batch, and also enables you to cancel or pause the delivery 

5 of that batch. For more information, see 

6 https://sendgrid.com/docs/API_Reference/Web_API_v3/cancel_schedule_send. 

7 """ 

8 def __init__(self, batch_id=None): 

9 """Create a batch ID. 

10 

11 :param batch_id: Batch Id 

12 :type batch_id: string 

13 """ 

14 self._batch_id = None 

15 

16 if batch_id is not None: 

17 self.batch_id = batch_id 

18 

19 @property 

20 def batch_id(self): 

21 """The batch ID. 

22 

23 :rtype: string 

24 """ 

25 return self._batch_id 

26 

27 @batch_id.setter 

28 def batch_id(self, value): 

29 """The batch ID. 

30 

31 :param value: Batch Id 

32 :type value: string 

33 """ 

34 self._batch_id = value 

35 

36 def __str__(self): 

37 """Get a JSON representation of this object. 

38 

39 :rtype: string 

40 """ 

41 return str(self.get()) 

42 

43 def get(self): 

44 """ 

45 Get a JSON-ready representation of this BatchId object. 

46 

47 :returns: The BatchId, ready for use in a request body. 

48 :rtype: string 

49 """ 

50 return self.batch_id