aboutsummaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/sendgrid/helpers/mail/groups_to_display.py
blob: 2e3fca77af8a2bddebd7e83a5c99ba4aec612d4e (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
class GroupsToDisplay(object):
    """The unsubscribe groups that you would like to be displayed on the
    unsubscribe preferences page.."""

    def __init__(self, groups_to_display=None):
        """Create a GroupsToDisplay object

        :param groups_to_display: An array containing the unsubscribe groups
                                  that you would like to be displayed on the
                                  unsubscribe preferences page.
        :type groups_to_display: array of integers, optional
        """
        self._groups_to_display = None

        if groups_to_display is not None:
            self.groups_to_display = groups_to_display

    @property
    def groups_to_display(self):
        """An array containing the unsubscribe groups that you would like to be
        displayed on the unsubscribe preferences page.

        :rtype: array(int)
        """
        return self._groups_to_display

    @groups_to_display.setter
    def groups_to_display(self, value):
        """An array containing the unsubscribe groups that you would like to be
        displayed on the unsubscribe preferences page.

        :param value: An array containing the unsubscribe groups that you
                      would like to be displayed on the unsubscribe
                      preferences page.
        :type value: array(int)
        """
        if value is not None and len(value) > 25:
            raise ValueError("New groups_to_display exceeds max length of 25.")
        self._groups_to_display = value

    def get(self):
        """
        Get a JSON-ready representation of this GroupsToDisplay.

        :returns: This GroupsToDisplay, ready for use in a request body.
        :rtype: array of integers
        """
        return self.groups_to_display