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
« 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.
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 """
8 def __init__(self, enable=None, email=None):
9 """Create a BCCSettings.
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
19 if enable is not None:
20 self.enable = enable
22 if email is not None:
23 self.email = email
25 @property
26 def enable(self):
27 """Indicates if this setting is enabled.
29 :rtype: boolean
30 """
31 return self._enable
33 @enable.setter
34 def enable(self, value):
35 """Indicates if this setting is enabled.
37 :type param: Indicates if this setting is enabled.
38 :type value: boolean
39 """
40 self._enable = value
42 @property
43 def email(self):
44 """The email address that you would like to receive the BCC.
46 :rtype: string
47 """
48 return self._email
50 @email.setter
51 def email(self, value):
52 """The email address that you would like to receive the BCC.
54 :param value: The email address that you would like to receive the BCC.
55 :type value: string
56 """
57 self._email = value
59 def get(self):
60 """
61 Get a JSON-ready representation of this BCCSettings.
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
70 if self.email is not None:
71 bcc_settings["email"] = self.email.get()
72 return bcc_settings