diff options
| author | S. Solomon Darnell | 2025-03-28 21:52:21 -0500 |
|---|---|---|
| committer | S. Solomon Darnell | 2025-03-28 21:52:21 -0500 |
| commit | 4a52a71956a8d46fcb7294ac71734504bb09bcc2 (patch) | |
| tree | ee3dc5af3b6313e921cd920906356f5d4febc4ed /.venv/lib/python3.12/site-packages/sendgrid/helpers/mail/section.py | |
| parent | cc961e04ba734dd72309fb548a2f97d67d578813 (diff) | |
| download | gn-ai-master.tar.gz | |
Diffstat (limited to '.venv/lib/python3.12/site-packages/sendgrid/helpers/mail/section.py')
| -rw-r--r-- | .venv/lib/python3.12/site-packages/sendgrid/helpers/mail/section.py | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/.venv/lib/python3.12/site-packages/sendgrid/helpers/mail/section.py b/.venv/lib/python3.12/site-packages/sendgrid/helpers/mail/section.py new file mode 100644 index 00000000..cea949b1 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/sendgrid/helpers/mail/section.py @@ -0,0 +1,64 @@ +class Section(object): + """A block section of code to be used as a substitution.""" + + def __init__(self, key=None, value=None): + """Create a section with the given key and value. + + :param key: section of code key + :type key: string + :param value: section of code value + :type value: string + """ + self._key = None + self._value = None + + if key is not None: + self.key = key + if value is not None: + self.value = value + + @property + def key(self): + """A section of code's key. + + :rtype key: string + """ + return self._key + + @key.setter + def key(self, value): + """A section of code's key. + + :param key: section of code key + :type key: string + """ + self._key = value + + @property + def value(self): + """A section of code's value. + + :rtype: string + """ + return self._value + + @value.setter + def value(self, value): + """A section of code's value. + + :param value: A section of code's value. + :type value: string + """ + self._value = value + + def get(self): + """ + Get a JSON-ready representation of this Section. + + :returns: This Section, ready for use in a request body. + :rtype: dict + """ + section = {} + if self.key is not None and self.value is not None: + section[self.key] = self.value + return section |
