Coverage for /var/srv/projects/api.amasfac.comuna18.com/tmp/venv/lib/python3.9/site-packages/sendgrid/helpers/mail/click_tracking.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 ClickTracking(object):
2 """Allows you to track whether a recipient clicked a link in your email."""
4 def __init__(self, enable=None, enable_text=None):
5 """Create a ClickTracking to track clicked links in your email.
7 :param enable: Whether click tracking is enabled
8 :type enable: boolean, optional
9 :param enable_text: If click tracking is on in your email's text/plain.
10 :type enable_text: boolean, optional
11 """
12 self._enable = None
13 self._enable_text = None
15 if enable is not None:
16 self.enable = enable
18 if enable_text is not None:
19 self.enable_text = enable_text
21 @property
22 def enable(self):
23 """Indicates if this setting is enabled.
25 :rtype: boolean
26 """
27 return self._enable
29 @enable.setter
30 def enable(self, value):
31 """Indicates if this setting is enabled.
33 :param value: Indicates if this setting is enabled.
34 :type value: boolean
35 """
36 self._enable = value
38 @property
39 def enable_text(self):
40 """Indicates if this setting should be included in the text/plain
41 portion of your email.
43 :rtype: boolean
44 """
45 return self._enable_text
47 @enable_text.setter
48 def enable_text(self, value):
49 """Indicates if this setting should be included in the text/plain
50 portion of your email.
52 :param value: Indicates if this setting should be included in the
53 text/plain portion of your email.
54 :type value: boolean
55 """
56 self._enable_text = value
58 def get(self):
59 """
60 Get a JSON-ready representation of this ClickTracking.
62 :returns: This ClickTracking, ready for use in a request body.
63 :rtype: dict
64 """
65 click_tracking = {}
66 if self.enable is not None:
67 click_tracking["enable"] = self.enable
69 if self.enable_text is not None:
70 click_tracking["enable_text"] = self.enable_text
71 return click_tracking