|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +""" |
| 4 | + Patch API V1 |
| 5 | +
|
| 6 | + The core API used to integrate with Patch's service # noqa: E501 |
| 7 | +
|
| 8 | + The version of the OpenAPI document: v1 |
| 9 | + Contact: developers@usepatch.com |
| 10 | + Generated by: https://openapi-generator.tech |
| 11 | +""" |
| 12 | + |
| 13 | + |
| 14 | +import pprint |
| 15 | +import re # noqa: F401 |
| 16 | + |
| 17 | +import six |
| 18 | + |
| 19 | +from patch_api.configuration import Configuration |
| 20 | + |
| 21 | + |
| 22 | +class Highlight(object): |
| 23 | + """NOTE: This class is auto generated by OpenAPI Generator. |
| 24 | + Ref: https://openapi-generator.tech |
| 25 | +
|
| 26 | + Do not edit the class manually. |
| 27 | + """ |
| 28 | + |
| 29 | + """ |
| 30 | + Attributes: |
| 31 | + openapi_types (dict): The key is attribute name |
| 32 | + and the value is attribute type. |
| 33 | + attribute_map (dict): The key is attribute name |
| 34 | + and the value is json key in definition. |
| 35 | + """ |
| 36 | + openapi_types = {"slug": "str", "title": "str", "icon_url": "str"} |
| 37 | + |
| 38 | + attribute_map = {"slug": "slug", "title": "title", "icon_url": "icon_url"} |
| 39 | + |
| 40 | + def __init__( |
| 41 | + self, slug=None, title=None, icon_url=None, local_vars_configuration=None |
| 42 | + ): # noqa: E501 |
| 43 | + """Highlight - a model defined in OpenAPI""" # noqa: E501 |
| 44 | + if local_vars_configuration is None: |
| 45 | + local_vars_configuration = Configuration() |
| 46 | + self.local_vars_configuration = local_vars_configuration |
| 47 | + |
| 48 | + self._slug = None |
| 49 | + self._title = None |
| 50 | + self._icon_url = None |
| 51 | + self.discriminator = None |
| 52 | + |
| 53 | + self.slug = slug |
| 54 | + self.title = title |
| 55 | + self.icon_url = icon_url |
| 56 | + |
| 57 | + @property |
| 58 | + def slug(self): |
| 59 | + """Gets the slug of this Highlight. # noqa: E501 |
| 60 | +
|
| 61 | + A unique identifier for each highlight. # noqa: E501 |
| 62 | +
|
| 63 | + :return: The slug of this Highlight. # noqa: E501 |
| 64 | + :rtype: str |
| 65 | + """ |
| 66 | + return self._slug |
| 67 | + |
| 68 | + @slug.setter |
| 69 | + def slug(self, slug): |
| 70 | + """Sets the slug of this Highlight. |
| 71 | +
|
| 72 | + A unique identifier for each highlight. # noqa: E501 |
| 73 | +
|
| 74 | + :param slug: The slug of this Highlight. # noqa: E501 |
| 75 | + :type: str |
| 76 | + """ |
| 77 | + if ( |
| 78 | + self.local_vars_configuration.client_side_validation and slug is None |
| 79 | + ): # noqa: E501 |
| 80 | + raise ValueError( |
| 81 | + "Invalid value for `slug`, must not be `None`" |
| 82 | + ) # noqa: E501 |
| 83 | + |
| 84 | + self._slug = slug |
| 85 | + |
| 86 | + @property |
| 87 | + def title(self): |
| 88 | + """Gets the title of this Highlight. # noqa: E501 |
| 89 | +
|
| 90 | + A short string that spotlights a characteristic about the project. # noqa: E501 |
| 91 | +
|
| 92 | + :return: The title of this Highlight. # noqa: E501 |
| 93 | + :rtype: str |
| 94 | + """ |
| 95 | + return self._title |
| 96 | + |
| 97 | + @title.setter |
| 98 | + def title(self, title): |
| 99 | + """Sets the title of this Highlight. |
| 100 | +
|
| 101 | + A short string that spotlights a characteristic about the project. # noqa: E501 |
| 102 | +
|
| 103 | + :param title: The title of this Highlight. # noqa: E501 |
| 104 | + :type: str |
| 105 | + """ |
| 106 | + if ( |
| 107 | + self.local_vars_configuration.client_side_validation and title is None |
| 108 | + ): # noqa: E501 |
| 109 | + raise ValueError( |
| 110 | + "Invalid value for `title`, must not be `None`" |
| 111 | + ) # noqa: E501 |
| 112 | + |
| 113 | + self._title = title |
| 114 | + |
| 115 | + @property |
| 116 | + def icon_url(self): |
| 117 | + """Gets the icon_url of this Highlight. # noqa: E501 |
| 118 | +
|
| 119 | + A URL for the corresponding icon. # noqa: E501 |
| 120 | +
|
| 121 | + :return: The icon_url of this Highlight. # noqa: E501 |
| 122 | + :rtype: str |
| 123 | + """ |
| 124 | + return self._icon_url |
| 125 | + |
| 126 | + @icon_url.setter |
| 127 | + def icon_url(self, icon_url): |
| 128 | + """Sets the icon_url of this Highlight. |
| 129 | +
|
| 130 | + A URL for the corresponding icon. # noqa: E501 |
| 131 | +
|
| 132 | + :param icon_url: The icon_url of this Highlight. # noqa: E501 |
| 133 | + :type: str |
| 134 | + """ |
| 135 | + if ( |
| 136 | + self.local_vars_configuration.client_side_validation and icon_url is None |
| 137 | + ): # noqa: E501 |
| 138 | + raise ValueError( |
| 139 | + "Invalid value for `icon_url`, must not be `None`" |
| 140 | + ) # noqa: E501 |
| 141 | + |
| 142 | + self._icon_url = icon_url |
| 143 | + |
| 144 | + def to_dict(self): |
| 145 | + """Returns the model properties as a dict""" |
| 146 | + result = {} |
| 147 | + |
| 148 | + for attr, _ in six.iteritems(self.openapi_types): |
| 149 | + value = getattr(self, attr) |
| 150 | + if isinstance(value, list): |
| 151 | + result[attr] = list( |
| 152 | + map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) |
| 153 | + ) |
| 154 | + elif hasattr(value, "to_dict"): |
| 155 | + result[attr] = value.to_dict() |
| 156 | + elif isinstance(value, dict): |
| 157 | + result[attr] = dict( |
| 158 | + map( |
| 159 | + lambda item: (item[0], item[1].to_dict()) |
| 160 | + if hasattr(item[1], "to_dict") |
| 161 | + else item, |
| 162 | + value.items(), |
| 163 | + ) |
| 164 | + ) |
| 165 | + else: |
| 166 | + result[attr] = value |
| 167 | + |
| 168 | + return result |
| 169 | + |
| 170 | + def to_str(self): |
| 171 | + """Returns the string representation of the model""" |
| 172 | + return pprint.pformat(self.to_dict()) |
| 173 | + |
| 174 | + def __repr__(self): |
| 175 | + """For `print` and `pprint`""" |
| 176 | + return self.to_str() |
| 177 | + |
| 178 | + def __eq__(self, other): |
| 179 | + """Returns true if both objects are equal""" |
| 180 | + if not isinstance(other, Highlight): |
| 181 | + return False |
| 182 | + |
| 183 | + return self.to_dict() == other.to_dict() |
| 184 | + |
| 185 | + def __ne__(self, other): |
| 186 | + """Returns true if both objects are not equal""" |
| 187 | + if not isinstance(other, Highlight): |
| 188 | + return True |
| 189 | + |
| 190 | + return self.to_dict() != other.to_dict() |
0 commit comments