|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +import pprint |
| 4 | +import re # noqa: F401 |
| 5 | + |
| 6 | +import six |
| 7 | + |
| 8 | + |
| 9 | +class ResponseMetadata(object): |
| 10 | + swagger_types = { |
| 11 | + 'service': 'str', |
| 12 | + 'request_id': 'str', |
| 13 | + 'action': 'str', |
| 14 | + 'version': 'str', |
| 15 | + 'region': 'str' |
| 16 | + } |
| 17 | + |
| 18 | + attribute_map = { |
| 19 | + 'service': 'Service', |
| 20 | + 'request_id': 'RequestId', |
| 21 | + 'action': 'Action', |
| 22 | + 'version': 'Version', |
| 23 | + 'region': 'Region' |
| 24 | + } |
| 25 | + |
| 26 | + def __init__(self, service=None, request_id=None, action=None, version=None, region=None): |
| 27 | + self._service = None |
| 28 | + self._request_id = None |
| 29 | + self._action = None |
| 30 | + self._version = None |
| 31 | + self._region = None |
| 32 | + self.discriminator = None |
| 33 | + |
| 34 | + if service is not None: |
| 35 | + self.service = service |
| 36 | + if request_id is not None: |
| 37 | + self.request_id = request_id |
| 38 | + if action is not None: |
| 39 | + self.action = action |
| 40 | + if version is not None: |
| 41 | + self.version = version |
| 42 | + if region is not None: |
| 43 | + self.region = region |
| 44 | + |
| 45 | + @property |
| 46 | + def service(self): |
| 47 | + return self._service |
| 48 | + |
| 49 | + @service.setter |
| 50 | + def service(self, service): |
| 51 | + self._service = service |
| 52 | + |
| 53 | + @property |
| 54 | + def request_id(self): |
| 55 | + return self._request_id |
| 56 | + |
| 57 | + @request_id.setter |
| 58 | + def request_id(self, request_id): |
| 59 | + self._request_id = request_id |
| 60 | + |
| 61 | + @property |
| 62 | + def action(self): |
| 63 | + return self._action |
| 64 | + |
| 65 | + @action.setter |
| 66 | + def action(self, action): |
| 67 | + self._action = action |
| 68 | + |
| 69 | + @property |
| 70 | + def version(self): |
| 71 | + return self._version |
| 72 | + |
| 73 | + @version.setter |
| 74 | + def version(self, version): |
| 75 | + self._version = version |
| 76 | + |
| 77 | + @property |
| 78 | + def region(self): |
| 79 | + return self._region |
| 80 | + |
| 81 | + @region.setter |
| 82 | + def region(self, region): |
| 83 | + self._region = region |
| 84 | + |
| 85 | + def to_dict(self): |
| 86 | + """Returns the model properties as a dict""" |
| 87 | + result = {} |
| 88 | + |
| 89 | + for attr, _ in six.iteritems(self.swagger_types): |
| 90 | + value = getattr(self, attr) |
| 91 | + if isinstance(value, list): |
| 92 | + result[attr] = list(map( |
| 93 | + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, |
| 94 | + value |
| 95 | + )) |
| 96 | + elif hasattr(value, "to_dict"): |
| 97 | + result[attr] = value.to_dict() |
| 98 | + elif isinstance(value, dict): |
| 99 | + result[attr] = dict(map( |
| 100 | + lambda item: (item[0], item[1].to_dict()) |
| 101 | + if hasattr(item[1], "to_dict") else item, |
| 102 | + value.items() |
| 103 | + )) |
| 104 | + else: |
| 105 | + result[attr] = value |
| 106 | + if issubclass(ResponseMetadata, dict): |
| 107 | + for key, value in self.items(): |
| 108 | + result[key] = value |
| 109 | + |
| 110 | + return result |
| 111 | + |
| 112 | + def to_str(self): |
| 113 | + """Returns the string representation of the model""" |
| 114 | + return pprint.pformat(self.to_dict()) |
| 115 | + |
| 116 | + def __repr__(self): |
| 117 | + """For `print` and `pprint`""" |
| 118 | + return self.to_str() |
| 119 | + |
| 120 | + def __eq__(self, other): |
| 121 | + """Returns true if both objects are equal""" |
| 122 | + if not isinstance(other, ResponseMetadata): |
| 123 | + return False |
| 124 | + |
| 125 | + return self.to_dict() == other.to_dict() |
| 126 | + |
| 127 | + def __ne__(self, other): |
| 128 | + """Returns true if both objects are not equal""" |
| 129 | + if not isinstance(other, ResponseMetadata): |
| 130 | + return True |
| 131 | + |
| 132 | + return self.to_dict() != other.to_dict() |
0 commit comments