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

13 statements  

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

1class FileType(object): 

2 """The MIME type of the content you are attaching to an Attachment.""" 

3 

4 def __init__(self, file_type=None): 

5 """Create a FileType object 

6 

7 :param file_type: The MIME type of the content you are attaching 

8 :type file_type: string, optional 

9 """ 

10 self._file_type = None 

11 

12 if file_type is not None: 

13 self.file_type = file_type 

14 

15 @property 

16 def file_type(self): 

17 """The MIME type of the content you are attaching. 

18 

19 :rtype: string 

20 """ 

21 return self._file_type 

22 

23 @file_type.setter 

24 def file_type(self, mime_type): 

25 """The MIME type of the content you are attaching. 

26 

27 :param mime_type: The MIME type of the content you are attaching. 

28 :rtype mime_type: string 

29 """ 

30 self._file_type = mime_type 

31 

32 def get(self): 

33 """ 

34 Get a JSON-ready representation of this FileType. 

35 

36 :returns: This FileType, ready for use in a request body. 

37 :rtype: string 

38 """ 

39 return self.file_type