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

13 statements  

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

1class ContentId(object): 

2 """The ContentId of an Attachment.""" 

3 

4 def __init__(self, content_id=None): 

5 """Create a ContentId object 

6 

7 :param content_id: The content id for the attachment. 

8 This is used when the Disposition is set to "inline" 

9 and the attachment is an image, allowing the file to 

10 be displayed within the email body. 

11 :type content_id: string, optional 

12 """ 

13 self._content_id = None 

14 

15 if content_id is not None: 

16 self.content_id = content_id 

17 

18 @property 

19 def content_id(self): 

20 """The content id for the attachment. 

21 This is used when the Disposition is set to "inline" and the 

22 attachment is an image, allowing the file to be displayed within 

23 the email body. 

24 

25 :rtype: string 

26 """ 

27 return self._content_id 

28 

29 @content_id.setter 

30 def content_id(self, value): 

31 """The content id for the attachment. 

32 This is used when the Disposition is set to "inline" and the 

33 attachment is an image, allowing the file to be displayed within 

34 the email body. 

35 

36 :param value: The content id for the attachment. 

37 This is used when the Disposition is set to "inline" and the attachment 

38 is an image, allowing the file to be displayed within the email body. 

39 :type value: string 

40 """ 

41 self._content_id = value 

42 

43 def get(self): 

44 """ 

45 Get a JSON-ready representation of this ContentId. 

46 

47 :returns: This ContentId, ready for use in a request body. 

48 :rtype: string 

49 """ 

50 return self.content_id