aboutsummaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/sendgrid/helpers/mail/disposition.py
blob: a0bdc35434e51bfd49234af68741367177fc491c (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
class Disposition(object):
    """The content-disposition of the Attachment specifying how you would like
    the attachment to be displayed."""

    def __init__(self, disposition=None):
        """Create a Disposition object

        :param disposition: The content-disposition of the attachment,
                            specifying display style.
                            Specifies how you would like the attachment to be
                            displayed.
                            - "inline" results in the attached file being
                              displayed automatically within the message.
                            - "attachment" results in the attached file
                              requiring some action to display (e.g. opening
                              or downloading the file).
                            If unspecified, "attachment" is used. Must be one
                            of the two choices.
        :type disposition: string, optional
        """
        self._disposition = None

        if disposition is not None:
            self.disposition = disposition

    @property
    def disposition(self):
        """The content-disposition of the attachment, specifying display style.
           Specifies how you would like the attachment to be displayed.
           - "inline" results in the attached file being displayed
             automatically within the message.
           - "attachment" results in the attached file requiring some action to
             display (e.g. opening or downloading the file).
           If unspecified, "attachment" is used. Must be one of the two
           choices.

        :rtype: string
        """
        return self._disposition

    @disposition.setter
    def disposition(self, value):
        """The content-disposition of the attachment, specifying display style.
           Specifies how you would like the attachment to be displayed.
           - "inline" results in the attached file being displayed
             automatically within the message.
           - "attachment" results in the attached file requiring some action to
             display (e.g. opening or downloading the file).
           If unspecified, "attachment" is used. Must be one of the two
           choices.

        :param value: The content-disposition of the attachment, specifying
                      display style.
           Specifies how you would like the attachment to be displayed.
           - "inline" results in the attached file being displayed
             automatically within the message.
           - "attachment" results in the attached file requiring some action to
             display (e.g. opening or downloading the file).
           If unspecified, "attachment" is used. Must be one of the two
           choices.
        :type value: string
        """
        self._disposition = value

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

        :returns: This Disposition, ready for use in a request body.
        :rtype: string
        """
        return self.disposition