Coverage for /var/srv/projects/api.amasfac.comuna18.com/tmp/venv/lib/python3.9/site-packages/sendgrid/helpers/mail/groups_to_display.py: 43%
15 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 GroupsToDisplay(object):
2 """The unsubscribe groups that you would like to be displayed on the
3 unsubscribe preferences page.."""
5 def __init__(self, groups_to_display=None):
6 """Create a GroupsToDisplay object
8 :param groups_to_display: An array containing the unsubscribe groups
9 that you would like to be displayed on the
10 unsubscribe preferences page.
11 :type groups_to_display: array of integers, optional
12 """
13 self._groups_to_display = None
15 if groups_to_display is not None:
16 self.groups_to_display = groups_to_display
18 @property
19 def groups_to_display(self):
20 """An array containing the unsubscribe groups that you would like to be
21 displayed on the unsubscribe preferences page.
23 :rtype: array(int)
24 """
25 return self._groups_to_display
27 @groups_to_display.setter
28 def groups_to_display(self, value):
29 """An array containing the unsubscribe groups that you would like to be
30 displayed on the unsubscribe preferences page.
32 :param value: An array containing the unsubscribe groups that you
33 would like to be displayed on the unsubscribe
34 preferences page.
35 :type value: array(int)
36 """
37 if value is not None and len(value) > 25:
38 raise ValueError("New groups_to_display exceeds max length of 25.")
39 self._groups_to_display = value
41 def get(self):
42 """
43 Get a JSON-ready representation of this GroupsToDisplay.
45 :returns: This GroupsToDisplay, ready for use in a request body.
46 :rtype: array of integers
47 """
48 return self.groups_to_display