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

21 statements  

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

1class Subject(object): 

2 """A subject for an email message.""" 

3 

4 def __init__(self, subject, p=None): 

5 """Create a Subject. 

6 

7 :param subject: The subject for an email 

8 :type subject: string 

9 :param name: p is the Personalization object or Personalization object 

10 index 

11 :type name: Personalization, integer, optional 

12 """ 

13 self._subject = None 

14 self._personalization = None 

15 

16 self.subject = subject 

17 if p is not None: 

18 self.personalization = p 

19 

20 @property 

21 def subject(self): 

22 """The subject of an email. 

23 

24 :rtype: string 

25 """ 

26 return self._subject 

27 

28 @subject.setter 

29 def subject(self, value): 

30 """The subject of an email. 

31 

32 :param value: The subject of an email. 

33 :type value: string 

34 """ 

35 self._subject = value 

36 

37 @property 

38 def personalization(self): 

39 """The Personalization object or Personalization object index 

40 

41 :rtype: Personalization, integer 

42 """ 

43 return self._personalization 

44 

45 @personalization.setter 

46 def personalization(self, value): 

47 """The Personalization object or Personalization object index 

48 

49 :param value: The Personalization object or Personalization object 

50 index 

51 :type value: Personalization, integer 

52 """ 

53 self._personalization = value 

54 

55 def __str__(self): 

56 """Get a JSON representation of this Mail request. 

57 

58 :rtype: string 

59 """ 

60 return str(self.get()) 

61 

62 def get(self): 

63 """ 

64 Get a JSON-ready representation of this Subject. 

65 

66 :returns: This Subject, ready for use in a request body. 

67 :rtype: string 

68 """ 

69 return self.subject