|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +# ----------------------------------------------------------------------------------- |
| 4 | +# <copyright company="Aspose Pty Ltd" file="ApiError.py"> |
| 5 | +# Copyright (c) 2003-2023 Aspose Pty Ltd |
| 6 | +# </copyright> |
| 7 | +# <summary> |
| 8 | +# Permission is hereby granted, free of charge, to any person obtaining a copy |
| 9 | +# of this software and associated documentation files (the "Software"), to deal |
| 10 | +# in the Software without restriction, including without limitation the rights |
| 11 | +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 12 | +# copies of the Software, and to permit persons to whom the Software is |
| 13 | +# furnished to do so, subject to the following conditions: |
| 14 | +# |
| 15 | +# The above copyright notice and this permission notice shall be included in all |
| 16 | +# copies or substantial portions of the Software. |
| 17 | +# |
| 18 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 19 | +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 20 | +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 21 | +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 22 | +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 23 | +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 24 | +# SOFTWARE. |
| 25 | +# </summary> |
| 26 | +# ----------------------------------------------------------------------------------- |
| 27 | + |
| 28 | +import pprint |
| 29 | +import re # noqa: F401 |
| 30 | + |
| 31 | +import six |
| 32 | + |
| 33 | +class ApiError(object): |
| 34 | + """ |
| 35 | + |
| 36 | + """ |
| 37 | + |
| 38 | + """ |
| 39 | + Attributes: |
| 40 | + swagger_types (dict): The key is attribute name |
| 41 | + and the value is attribute type. |
| 42 | + attribute_map (dict): The key is attribute name |
| 43 | + and the value is json key in definition. |
| 44 | + """ |
| 45 | + swagger_types = { |
| 46 | + 'code': 'str', |
| 47 | + 'message': 'str', |
| 48 | + 'description': 'str', |
| 49 | + 'date_time': 'datetime', |
| 50 | + 'inner_error': 'ApiError' |
| 51 | + } |
| 52 | + |
| 53 | + attribute_map = { |
| 54 | + 'code': 'Code', |
| 55 | + 'message': 'Message', |
| 56 | + 'description': 'Description', |
| 57 | + 'date_time': 'DateTime', |
| 58 | + 'inner_error': 'InnerError' |
| 59 | + } |
| 60 | + |
| 61 | + def __init__(self, code=None, message=None, description=None, date_time=None, inner_error=None, **kwargs): # noqa: E501 |
| 62 | + """Initializes new instance of ApiError""" # noqa: E501 |
| 63 | + |
| 64 | + self._code = None |
| 65 | + self._message = None |
| 66 | + self._description = None |
| 67 | + self._date_time = None |
| 68 | + self._inner_error = None |
| 69 | + |
| 70 | + if code is not None: |
| 71 | + self.code = code |
| 72 | + if message is not None: |
| 73 | + self.message = message |
| 74 | + if description is not None: |
| 75 | + self.description = description |
| 76 | + if date_time is not None: |
| 77 | + self.date_time = date_time |
| 78 | + if inner_error is not None: |
| 79 | + self.inner_error = inner_error |
| 80 | + |
| 81 | + @property |
| 82 | + def code(self): |
| 83 | + """ |
| 84 | + Gets the code. # noqa: E501 |
| 85 | +
|
| 86 | +
|
| 87 | + :return: The code. # noqa: E501 |
| 88 | + :rtype: str |
| 89 | + """ |
| 90 | + return self._code |
| 91 | + |
| 92 | + @code.setter |
| 93 | + def code(self, code): |
| 94 | + """ |
| 95 | + Sets the code. |
| 96 | +
|
| 97 | +
|
| 98 | + :param code: The code. # noqa: E501 |
| 99 | + :type: str |
| 100 | + """ |
| 101 | + self._code = code |
| 102 | + |
| 103 | + @property |
| 104 | + def message(self): |
| 105 | + """ |
| 106 | + Gets the message. # noqa: E501 |
| 107 | +
|
| 108 | +
|
| 109 | + :return: The message. # noqa: E501 |
| 110 | + :rtype: str |
| 111 | + """ |
| 112 | + return self._message |
| 113 | + |
| 114 | + @message.setter |
| 115 | + def message(self, message): |
| 116 | + """ |
| 117 | + Sets the message. |
| 118 | +
|
| 119 | +
|
| 120 | + :param message: The message. # noqa: E501 |
| 121 | + :type: str |
| 122 | + """ |
| 123 | + self._message = message |
| 124 | + |
| 125 | + @property |
| 126 | + def description(self): |
| 127 | + """ |
| 128 | + Gets the description. # noqa: E501 |
| 129 | +
|
| 130 | +
|
| 131 | + :return: The description. # noqa: E501 |
| 132 | + :rtype: str |
| 133 | + """ |
| 134 | + return self._description |
| 135 | + |
| 136 | + @description.setter |
| 137 | + def description(self, description): |
| 138 | + """ |
| 139 | + Sets the description. |
| 140 | +
|
| 141 | +
|
| 142 | + :param description: The description. # noqa: E501 |
| 143 | + :type: str |
| 144 | + """ |
| 145 | + self._description = description |
| 146 | + |
| 147 | + @property |
| 148 | + def date_time(self): |
| 149 | + """ |
| 150 | + Gets the date_time. # noqa: E501 |
| 151 | +
|
| 152 | +
|
| 153 | + :return: The date_time. # noqa: E501 |
| 154 | + :rtype: datetime |
| 155 | + """ |
| 156 | + return self._date_time |
| 157 | + |
| 158 | + @date_time.setter |
| 159 | + def date_time(self, date_time): |
| 160 | + """ |
| 161 | + Sets the date_time. |
| 162 | +
|
| 163 | +
|
| 164 | + :param date_time: The date_time. # noqa: E501 |
| 165 | + :type: datetime |
| 166 | + """ |
| 167 | + self._date_time = date_time |
| 168 | + |
| 169 | + @property |
| 170 | + def inner_error(self): |
| 171 | + """ |
| 172 | + Gets the inner_error. # noqa: E501 |
| 173 | +
|
| 174 | +
|
| 175 | + :return: The inner_error. # noqa: E501 |
| 176 | + :rtype: ApiError |
| 177 | + """ |
| 178 | + return self._inner_error |
| 179 | + |
| 180 | + @inner_error.setter |
| 181 | + def inner_error(self, inner_error): |
| 182 | + """ |
| 183 | + Sets the inner_error. |
| 184 | +
|
| 185 | +
|
| 186 | + :param inner_error: The inner_error. # noqa: E501 |
| 187 | + :type: ApiError |
| 188 | + """ |
| 189 | + self._inner_error = inner_error |
| 190 | + |
| 191 | + def to_dict(self): |
| 192 | + """Returns the model properties as a dict""" |
| 193 | + result = {} |
| 194 | + |
| 195 | + for attr, _ in six.iteritems(self.swagger_types): |
| 196 | + value = getattr(self, attr) |
| 197 | + if isinstance(value, list): |
| 198 | + result[attr] = list(map( |
| 199 | + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, |
| 200 | + value |
| 201 | + )) |
| 202 | + elif hasattr(value, "to_dict"): |
| 203 | + result[attr] = value.to_dict() |
| 204 | + elif isinstance(value, dict): |
| 205 | + result[attr] = dict(map( |
| 206 | + lambda item: (item[0], item[1].to_dict()) |
| 207 | + if hasattr(item[1], "to_dict") else item, |
| 208 | + value.items() |
| 209 | + )) |
| 210 | + else: |
| 211 | + result[attr] = value |
| 212 | + |
| 213 | + return result |
| 214 | + |
| 215 | + def to_str(self): |
| 216 | + """Returns the string representation of the model""" |
| 217 | + return pprint.pformat(self.to_dict()) |
| 218 | + |
| 219 | + def __repr__(self): |
| 220 | + """For `print` and `pprint`""" |
| 221 | + return self.to_str() |
| 222 | + |
| 223 | + def __eq__(self, other): |
| 224 | + """Returns true if both objects are equal""" |
| 225 | + if not isinstance(other, ApiError): |
| 226 | + return False |
| 227 | + |
| 228 | + return self.__dict__ == other.__dict__ |
| 229 | + |
| 230 | + def __ne__(self, other): |
| 231 | + """Returns true if both objects are not equal""" |
| 232 | + return not self == other |
0 commit comments