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

27 statements  

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

1class BccSettings(object): 

2 """Settings object for automatic BCC. 

3 

4 This allows you to have a blind carbon copy automatically sent to the 

5 specified email address for every email that is sent. 

6 """ 

7 

8 def __init__(self, enable=None, email=None): 

9 """Create a BCCSettings. 

10 

11 :param enable: Whether this BCCSettings is applied to sent emails. 

12 :type enable: boolean, optional 

13 :param email: Who should be BCCed. 

14 :type email: BccSettingEmail, optional 

15 """ 

16 self._enable = None 

17 self._email = None 

18 

19 if enable is not None: 

20 self.enable = enable 

21 

22 if email is not None: 

23 self.email = email 

24 

25 @property 

26 def enable(self): 

27 """Indicates if this setting is enabled. 

28 

29 :rtype: boolean 

30 """ 

31 return self._enable 

32 

33 @enable.setter 

34 def enable(self, value): 

35 """Indicates if this setting is enabled. 

36 

37 :type param: Indicates if this setting is enabled. 

38 :type value: boolean 

39 """ 

40 self._enable = value 

41 

42 @property 

43 def email(self): 

44 """The email address that you would like to receive the BCC. 

45 

46 :rtype: string 

47 """ 

48 return self._email 

49 

50 @email.setter 

51 def email(self, value): 

52 """The email address that you would like to receive the BCC. 

53 

54 :param value: The email address that you would like to receive the BCC. 

55 :type value: string 

56 """ 

57 self._email = value 

58 

59 def get(self): 

60 """ 

61 Get a JSON-ready representation of this BCCSettings. 

62 

63 :returns: This BCCSettings, ready for use in a request body. 

64 :rtype: dict 

65 """ 

66 bcc_settings = {} 

67 if self.enable is not None: 

68 bcc_settings["enable"] = self.enable 

69 

70 if self.email is not None: 

71 bcc_settings["email"] = self.email.get() 

72 return bcc_settings