huaweicloudsdkdrs 3.1.75__py2.py3-none-any.whl → 3.1.77__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. huaweicloudsdkdrs/v3/__init__.py +1 -0
  2. huaweicloudsdkdrs/v3/model/__init__.py +1 -0
  3. huaweicloudsdkdrs/v3/model/customized_dns.py +170 -0
  4. huaweicloudsdkdrs/v3/model/test_end_point.py +28 -3
  5. huaweicloudsdkdrs/v5/__init__.py +30 -0
  6. huaweicloudsdkdrs/v5/drs_async_client.py +736 -94
  7. huaweicloudsdkdrs/v5/drs_client.py +736 -94
  8. huaweicloudsdkdrs/v5/model/__init__.py +30 -0
  9. huaweicloudsdkdrs/v5/model/action_req.py +3 -3
  10. huaweicloudsdkdrs/v5/model/base_endpoint.py +6 -6
  11. huaweicloudsdkdrs/v5/model/base_endpoint_config.py +32 -3
  12. huaweicloudsdkdrs/v5/model/batch_add_tag_req.py +114 -0
  13. huaweicloudsdkdrs/v5/model/batch_create_tags_request.py +196 -0
  14. huaweicloudsdkdrs/v5/model/batch_create_tags_response.py +116 -0
  15. huaweicloudsdkdrs/v5/model/batch_delete_tag_req.py +114 -0
  16. huaweicloudsdkdrs/v5/model/batch_delete_tags_request.py +196 -0
  17. huaweicloudsdkdrs/v5/model/batch_delete_tags_response.py +116 -0
  18. huaweicloudsdkdrs/v5/model/children_job_list_resp.py +3 -3
  19. huaweicloudsdkdrs/v5/model/count_instance_by_tags_request.py +168 -0
  20. huaweicloudsdkdrs/v5/model/count_instance_by_tags_response.py +116 -0
  21. huaweicloudsdkdrs/v5/model/customized_dns.py +170 -0
  22. huaweicloudsdkdrs/v5/model/job_base_info.py +3 -3
  23. huaweicloudsdkdrs/v5/model/job_endpoint_info.py +31 -6
  24. huaweicloudsdkdrs/v5/model/job_link_resp.py +3 -3
  25. huaweicloudsdkdrs/v5/model/job_list_resp.py +3 -3
  26. huaweicloudsdkdrs/v5/model/list_instance_by_tags_request.py +226 -0
  27. huaweicloudsdkdrs/v5/model/list_instance_by_tags_response.py +145 -0
  28. huaweicloudsdkdrs/v5/model/list_instance_tags_request.py +171 -0
  29. huaweicloudsdkdrs/v5/model/list_instance_tags_response.py +116 -0
  30. huaweicloudsdkdrs/v5/model/list_job_history_parameter.py +283 -0
  31. huaweicloudsdkdrs/v5/model/list_job_history_parameters_request.py +288 -0
  32. huaweicloudsdkdrs/v5/model/list_job_history_parameters_response.py +145 -0
  33. huaweicloudsdkdrs/v5/model/list_job_parameters_request.py +230 -0
  34. huaweicloudsdkdrs/v5/model/list_job_parameters_response.py +145 -0
  35. huaweicloudsdkdrs/v5/model/list_jobs_request.py +3 -3
  36. huaweicloudsdkdrs/v5/model/list_tags_request.py +143 -0
  37. huaweicloudsdkdrs/v5/model/list_tags_response.py +116 -0
  38. huaweicloudsdkdrs/v5/model/modify_parameter_req.py +114 -0
  39. huaweicloudsdkdrs/v5/model/parameter_config.py +312 -0
  40. huaweicloudsdkdrs/v5/model/parameter_info.py +142 -0
  41. huaweicloudsdkdrs/v5/model/query_instance_by_tag_req.py +173 -0
  42. huaweicloudsdkdrs/v5/model/resource_instance.py +202 -0
  43. huaweicloudsdkdrs/v5/model/resource_tag_info.py +144 -0
  44. huaweicloudsdkdrs/v5/model/tag.py +142 -0
  45. huaweicloudsdkdrs/v5/model/tag_match.py +142 -0
  46. huaweicloudsdkdrs/v5/model/update_job_configurations_request.py +168 -0
  47. huaweicloudsdkdrs/v5/model/update_job_configurations_response.py +116 -0
  48. {huaweicloudsdkdrs-3.1.75.dist-info → huaweicloudsdkdrs-3.1.77.dist-info}/METADATA +2 -2
  49. {huaweicloudsdkdrs-3.1.75.dist-info → huaweicloudsdkdrs-3.1.77.dist-info}/RECORD +52 -21
  50. {huaweicloudsdkdrs-3.1.75.dist-info → huaweicloudsdkdrs-3.1.77.dist-info}/LICENSE +0 -0
  51. {huaweicloudsdkdrs-3.1.75.dist-info → huaweicloudsdkdrs-3.1.77.dist-info}/WHEEL +0 -0
  52. {huaweicloudsdkdrs-3.1.75.dist-info → huaweicloudsdkdrs-3.1.77.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,173 @@
1
+ # coding: utf-8
2
+
3
+ import six
4
+
5
+ from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
6
+
7
+
8
+ class QueryInstanceByTagReq:
9
+
10
+ """
11
+ Attributes:
12
+ openapi_types (dict): The key is attribute name
13
+ and the value is attribute type.
14
+ attribute_map (dict): The key is attribute name
15
+ and the value is json key in definition.
16
+ """
17
+ sensitive_list = []
18
+
19
+ openapi_types = {
20
+ 'without_any_tag': 'bool',
21
+ 'tags': 'list[Tag]',
22
+ 'matches': 'list[TagMatch]'
23
+ }
24
+
25
+ attribute_map = {
26
+ 'without_any_tag': 'without_any_tag',
27
+ 'tags': 'tags',
28
+ 'matches': 'matches'
29
+ }
30
+
31
+ def __init__(self, without_any_tag=None, tags=None, matches=None):
32
+ """QueryInstanceByTagReq
33
+
34
+ The model defined in huaweicloud sdk
35
+
36
+ :param without_any_tag: 不包含任意一个标签,该字段为true时查询所有不带标签的资源,此时忽略 “tags”字段。该字段为false或者未提供该参数时,该条件不生效,即返回所有资源或按\"tags\",\"matches\"等条件过滤。
37
+ :type without_any_tag: bool
38
+ :param tags: 包含标签,最多包含20个key,每个key下面的value最多20个。
39
+ :type tags: list[:class:`huaweicloudsdkdrs.v5.Tag`]
40
+ :param matches: 搜索字段,key为要匹配的字段,如resource_name等。value为匹配的值。
41
+ :type matches: list[:class:`huaweicloudsdkdrs.v5.TagMatch`]
42
+ """
43
+
44
+
45
+
46
+ self._without_any_tag = None
47
+ self._tags = None
48
+ self._matches = None
49
+ self.discriminator = None
50
+
51
+ if without_any_tag is not None:
52
+ self.without_any_tag = without_any_tag
53
+ if tags is not None:
54
+ self.tags = tags
55
+ if matches is not None:
56
+ self.matches = matches
57
+
58
+ @property
59
+ def without_any_tag(self):
60
+ """Gets the without_any_tag of this QueryInstanceByTagReq.
61
+
62
+ 不包含任意一个标签,该字段为true时查询所有不带标签的资源,此时忽略 “tags”字段。该字段为false或者未提供该参数时,该条件不生效,即返回所有资源或按\"tags\",\"matches\"等条件过滤。
63
+
64
+ :return: The without_any_tag of this QueryInstanceByTagReq.
65
+ :rtype: bool
66
+ """
67
+ return self._without_any_tag
68
+
69
+ @without_any_tag.setter
70
+ def without_any_tag(self, without_any_tag):
71
+ """Sets the without_any_tag of this QueryInstanceByTagReq.
72
+
73
+ 不包含任意一个标签,该字段为true时查询所有不带标签的资源,此时忽略 “tags”字段。该字段为false或者未提供该参数时,该条件不生效,即返回所有资源或按\"tags\",\"matches\"等条件过滤。
74
+
75
+ :param without_any_tag: The without_any_tag of this QueryInstanceByTagReq.
76
+ :type without_any_tag: bool
77
+ """
78
+ self._without_any_tag = without_any_tag
79
+
80
+ @property
81
+ def tags(self):
82
+ """Gets the tags of this QueryInstanceByTagReq.
83
+
84
+ 包含标签,最多包含20个key,每个key下面的value最多20个。
85
+
86
+ :return: The tags of this QueryInstanceByTagReq.
87
+ :rtype: list[:class:`huaweicloudsdkdrs.v5.Tag`]
88
+ """
89
+ return self._tags
90
+
91
+ @tags.setter
92
+ def tags(self, tags):
93
+ """Sets the tags of this QueryInstanceByTagReq.
94
+
95
+ 包含标签,最多包含20个key,每个key下面的value最多20个。
96
+
97
+ :param tags: The tags of this QueryInstanceByTagReq.
98
+ :type tags: list[:class:`huaweicloudsdkdrs.v5.Tag`]
99
+ """
100
+ self._tags = tags
101
+
102
+ @property
103
+ def matches(self):
104
+ """Gets the matches of this QueryInstanceByTagReq.
105
+
106
+ 搜索字段,key为要匹配的字段,如resource_name等。value为匹配的值。
107
+
108
+ :return: The matches of this QueryInstanceByTagReq.
109
+ :rtype: list[:class:`huaweicloudsdkdrs.v5.TagMatch`]
110
+ """
111
+ return self._matches
112
+
113
+ @matches.setter
114
+ def matches(self, matches):
115
+ """Sets the matches of this QueryInstanceByTagReq.
116
+
117
+ 搜索字段,key为要匹配的字段,如resource_name等。value为匹配的值。
118
+
119
+ :param matches: The matches of this QueryInstanceByTagReq.
120
+ :type matches: list[:class:`huaweicloudsdkdrs.v5.TagMatch`]
121
+ """
122
+ self._matches = matches
123
+
124
+ def to_dict(self):
125
+ """Returns the model properties as a dict"""
126
+ result = {}
127
+
128
+ for attr, _ in six.iteritems(self.openapi_types):
129
+ value = getattr(self, attr)
130
+ if isinstance(value, list):
131
+ result[attr] = list(map(
132
+ lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
133
+ value
134
+ ))
135
+ elif hasattr(value, "to_dict"):
136
+ result[attr] = value.to_dict()
137
+ elif isinstance(value, dict):
138
+ result[attr] = dict(map(
139
+ lambda item: (item[0], item[1].to_dict())
140
+ if hasattr(item[1], "to_dict") else item,
141
+ value.items()
142
+ ))
143
+ else:
144
+ if attr in self.sensitive_list:
145
+ result[attr] = "****"
146
+ else:
147
+ result[attr] = value
148
+
149
+ return result
150
+
151
+ def to_str(self):
152
+ """Returns the string representation of the model"""
153
+ import simplejson as json
154
+ if six.PY2:
155
+ import sys
156
+ reload(sys)
157
+ sys.setdefaultencoding("utf-8")
158
+ return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
159
+
160
+ def __repr__(self):
161
+ """For `print`"""
162
+ return self.to_str()
163
+
164
+ def __eq__(self, other):
165
+ """Returns true if both objects are equal"""
166
+ if not isinstance(other, QueryInstanceByTagReq):
167
+ return False
168
+
169
+ return self.__dict__ == other.__dict__
170
+
171
+ def __ne__(self, other):
172
+ """Returns true if both objects are not equal"""
173
+ return not self == other
@@ -0,0 +1,202 @@
1
+ # coding: utf-8
2
+
3
+ import six
4
+
5
+ from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
6
+
7
+
8
+ class ResourceInstance:
9
+
10
+ """
11
+ Attributes:
12
+ openapi_types (dict): The key is attribute name
13
+ and the value is attribute type.
14
+ attribute_map (dict): The key is attribute name
15
+ and the value is json key in definition.
16
+ """
17
+ sensitive_list = []
18
+
19
+ openapi_types = {
20
+ 'resource_id': 'str',
21
+ 'resource_detail': 'str',
22
+ 'resource_name': 'str',
23
+ 'tags': 'list[ResourceTagInfo]'
24
+ }
25
+
26
+ attribute_map = {
27
+ 'resource_id': 'resource_id',
28
+ 'resource_detail': 'resource_detail',
29
+ 'resource_name': 'resource_name',
30
+ 'tags': 'tags'
31
+ }
32
+
33
+ def __init__(self, resource_id=None, resource_detail=None, resource_name=None, tags=None):
34
+ """ResourceInstance
35
+
36
+ The model defined in huaweicloud sdk
37
+
38
+ :param resource_id: 资源ID。
39
+ :type resource_id: str
40
+ :param resource_detail: 资源详情。 资源对象,用于扩展。默认为空。
41
+ :type resource_detail: str
42
+ :param resource_name: 资源名称。
43
+ :type resource_name: str
44
+ :param tags: 标签列表。
45
+ :type tags: list[:class:`huaweicloudsdkdrs.v5.ResourceTagInfo`]
46
+ """
47
+
48
+
49
+
50
+ self._resource_id = None
51
+ self._resource_detail = None
52
+ self._resource_name = None
53
+ self._tags = None
54
+ self.discriminator = None
55
+
56
+ if resource_id is not None:
57
+ self.resource_id = resource_id
58
+ if resource_detail is not None:
59
+ self.resource_detail = resource_detail
60
+ if resource_name is not None:
61
+ self.resource_name = resource_name
62
+ if tags is not None:
63
+ self.tags = tags
64
+
65
+ @property
66
+ def resource_id(self):
67
+ """Gets the resource_id of this ResourceInstance.
68
+
69
+ 资源ID。
70
+
71
+ :return: The resource_id of this ResourceInstance.
72
+ :rtype: str
73
+ """
74
+ return self._resource_id
75
+
76
+ @resource_id.setter
77
+ def resource_id(self, resource_id):
78
+ """Sets the resource_id of this ResourceInstance.
79
+
80
+ 资源ID。
81
+
82
+ :param resource_id: The resource_id of this ResourceInstance.
83
+ :type resource_id: str
84
+ """
85
+ self._resource_id = resource_id
86
+
87
+ @property
88
+ def resource_detail(self):
89
+ """Gets the resource_detail of this ResourceInstance.
90
+
91
+ 资源详情。 资源对象,用于扩展。默认为空。
92
+
93
+ :return: The resource_detail of this ResourceInstance.
94
+ :rtype: str
95
+ """
96
+ return self._resource_detail
97
+
98
+ @resource_detail.setter
99
+ def resource_detail(self, resource_detail):
100
+ """Sets the resource_detail of this ResourceInstance.
101
+
102
+ 资源详情。 资源对象,用于扩展。默认为空。
103
+
104
+ :param resource_detail: The resource_detail of this ResourceInstance.
105
+ :type resource_detail: str
106
+ """
107
+ self._resource_detail = resource_detail
108
+
109
+ @property
110
+ def resource_name(self):
111
+ """Gets the resource_name of this ResourceInstance.
112
+
113
+ 资源名称。
114
+
115
+ :return: The resource_name of this ResourceInstance.
116
+ :rtype: str
117
+ """
118
+ return self._resource_name
119
+
120
+ @resource_name.setter
121
+ def resource_name(self, resource_name):
122
+ """Sets the resource_name of this ResourceInstance.
123
+
124
+ 资源名称。
125
+
126
+ :param resource_name: The resource_name of this ResourceInstance.
127
+ :type resource_name: str
128
+ """
129
+ self._resource_name = resource_name
130
+
131
+ @property
132
+ def tags(self):
133
+ """Gets the tags of this ResourceInstance.
134
+
135
+ 标签列表。
136
+
137
+ :return: The tags of this ResourceInstance.
138
+ :rtype: list[:class:`huaweicloudsdkdrs.v5.ResourceTagInfo`]
139
+ """
140
+ return self._tags
141
+
142
+ @tags.setter
143
+ def tags(self, tags):
144
+ """Sets the tags of this ResourceInstance.
145
+
146
+ 标签列表。
147
+
148
+ :param tags: The tags of this ResourceInstance.
149
+ :type tags: list[:class:`huaweicloudsdkdrs.v5.ResourceTagInfo`]
150
+ """
151
+ self._tags = tags
152
+
153
+ def to_dict(self):
154
+ """Returns the model properties as a dict"""
155
+ result = {}
156
+
157
+ for attr, _ in six.iteritems(self.openapi_types):
158
+ value = getattr(self, attr)
159
+ if isinstance(value, list):
160
+ result[attr] = list(map(
161
+ lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
162
+ value
163
+ ))
164
+ elif hasattr(value, "to_dict"):
165
+ result[attr] = value.to_dict()
166
+ elif isinstance(value, dict):
167
+ result[attr] = dict(map(
168
+ lambda item: (item[0], item[1].to_dict())
169
+ if hasattr(item[1], "to_dict") else item,
170
+ value.items()
171
+ ))
172
+ else:
173
+ if attr in self.sensitive_list:
174
+ result[attr] = "****"
175
+ else:
176
+ result[attr] = value
177
+
178
+ return result
179
+
180
+ def to_str(self):
181
+ """Returns the string representation of the model"""
182
+ import simplejson as json
183
+ if six.PY2:
184
+ import sys
185
+ reload(sys)
186
+ sys.setdefaultencoding("utf-8")
187
+ return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
188
+
189
+ def __repr__(self):
190
+ """For `print`"""
191
+ return self.to_str()
192
+
193
+ def __eq__(self, other):
194
+ """Returns true if both objects are equal"""
195
+ if not isinstance(other, ResourceInstance):
196
+ return False
197
+
198
+ return self.__dict__ == other.__dict__
199
+
200
+ def __ne__(self, other):
201
+ """Returns true if both objects are not equal"""
202
+ return not self == other
@@ -0,0 +1,144 @@
1
+ # coding: utf-8
2
+
3
+ import six
4
+
5
+ from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
6
+
7
+
8
+ class ResourceTagInfo:
9
+
10
+ """
11
+ Attributes:
12
+ openapi_types (dict): The key is attribute name
13
+ and the value is attribute type.
14
+ attribute_map (dict): The key is attribute name
15
+ and the value is json key in definition.
16
+ """
17
+ sensitive_list = []
18
+
19
+ openapi_types = {
20
+ 'key': 'str',
21
+ 'value': 'str'
22
+ }
23
+
24
+ attribute_map = {
25
+ 'key': 'key',
26
+ 'value': 'value'
27
+ }
28
+
29
+ def __init__(self, key=None, value=None):
30
+ """ResourceTagInfo
31
+
32
+ The model defined in huaweicloud sdk
33
+
34
+ :param key: 标签键。
35
+ :type key: str
36
+ :param value: 标签值。
37
+ :type value: str
38
+ """
39
+
40
+
41
+
42
+ self._key = None
43
+ self._value = None
44
+ self.discriminator = None
45
+
46
+ if key is not None:
47
+ self.key = key
48
+ if value is not None:
49
+ self.value = value
50
+
51
+ @property
52
+ def key(self):
53
+ """Gets the key of this ResourceTagInfo.
54
+
55
+ 标签键。
56
+
57
+ :return: The key of this ResourceTagInfo.
58
+ :rtype: str
59
+ """
60
+ return self._key
61
+
62
+ @key.setter
63
+ def key(self, key):
64
+ """Sets the key of this ResourceTagInfo.
65
+
66
+ 标签键。
67
+
68
+ :param key: The key of this ResourceTagInfo.
69
+ :type key: str
70
+ """
71
+ self._key = key
72
+
73
+ @property
74
+ def value(self):
75
+ """Gets the value of this ResourceTagInfo.
76
+
77
+ 标签值。
78
+
79
+ :return: The value of this ResourceTagInfo.
80
+ :rtype: str
81
+ """
82
+ return self._value
83
+
84
+ @value.setter
85
+ def value(self, value):
86
+ """Sets the value of this ResourceTagInfo.
87
+
88
+ 标签值。
89
+
90
+ :param value: The value of this ResourceTagInfo.
91
+ :type value: str
92
+ """
93
+ self._value = value
94
+
95
+ def to_dict(self):
96
+ """Returns the model properties as a dict"""
97
+ result = {}
98
+
99
+ for attr, _ in six.iteritems(self.openapi_types):
100
+ value = getattr(self, attr)
101
+ if isinstance(value, list):
102
+ result[attr] = list(map(
103
+ lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
104
+ value
105
+ ))
106
+ elif hasattr(value, "to_dict"):
107
+ result[attr] = value.to_dict()
108
+ elif isinstance(value, dict):
109
+ result[attr] = dict(map(
110
+ lambda item: (item[0], item[1].to_dict())
111
+ if hasattr(item[1], "to_dict") else item,
112
+ value.items()
113
+ ))
114
+ else:
115
+ if attr in self.sensitive_list:
116
+ result[attr] = "****"
117
+ else:
118
+ result[attr] = value
119
+
120
+ return result
121
+
122
+ def to_str(self):
123
+ """Returns the string representation of the model"""
124
+ import simplejson as json
125
+ if six.PY2:
126
+ import sys
127
+ reload(sys)
128
+ sys.setdefaultencoding("utf-8")
129
+ return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
130
+
131
+ def __repr__(self):
132
+ """For `print`"""
133
+ return self.to_str()
134
+
135
+ def __eq__(self, other):
136
+ """Returns true if both objects are equal"""
137
+ if not isinstance(other, ResourceTagInfo):
138
+ return False
139
+
140
+ return self.__dict__ == other.__dict__
141
+
142
+ def __ne__(self, other):
143
+ """Returns true if both objects are not equal"""
144
+ return not self == other
@@ -0,0 +1,142 @@
1
+ # coding: utf-8
2
+
3
+ import six
4
+
5
+ from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
6
+
7
+
8
+ class Tag:
9
+
10
+ """
11
+ Attributes:
12
+ openapi_types (dict): The key is attribute name
13
+ and the value is attribute type.
14
+ attribute_map (dict): The key is attribute name
15
+ and the value is json key in definition.
16
+ """
17
+ sensitive_list = []
18
+
19
+ openapi_types = {
20
+ 'key': 'str',
21
+ 'values': 'list[str]'
22
+ }
23
+
24
+ attribute_map = {
25
+ 'key': 'key',
26
+ 'values': 'values'
27
+ }
28
+
29
+ def __init__(self, key=None, values=None):
30
+ """Tag
31
+
32
+ The model defined in huaweicloud sdk
33
+
34
+ :param key: 标签键。
35
+ :type key: str
36
+ :param values: 标签值。
37
+ :type values: list[str]
38
+ """
39
+
40
+
41
+
42
+ self._key = None
43
+ self._values = None
44
+ self.discriminator = None
45
+
46
+ self.key = key
47
+ self.values = values
48
+
49
+ @property
50
+ def key(self):
51
+ """Gets the key of this Tag.
52
+
53
+ 标签键。
54
+
55
+ :return: The key of this Tag.
56
+ :rtype: str
57
+ """
58
+ return self._key
59
+
60
+ @key.setter
61
+ def key(self, key):
62
+ """Sets the key of this Tag.
63
+
64
+ 标签键。
65
+
66
+ :param key: The key of this Tag.
67
+ :type key: str
68
+ """
69
+ self._key = key
70
+
71
+ @property
72
+ def values(self):
73
+ """Gets the values of this Tag.
74
+
75
+ 标签值。
76
+
77
+ :return: The values of this Tag.
78
+ :rtype: list[str]
79
+ """
80
+ return self._values
81
+
82
+ @values.setter
83
+ def values(self, values):
84
+ """Sets the values of this Tag.
85
+
86
+ 标签值。
87
+
88
+ :param values: The values of this Tag.
89
+ :type values: list[str]
90
+ """
91
+ self._values = values
92
+
93
+ def to_dict(self):
94
+ """Returns the model properties as a dict"""
95
+ result = {}
96
+
97
+ for attr, _ in six.iteritems(self.openapi_types):
98
+ value = getattr(self, attr)
99
+ if isinstance(value, list):
100
+ result[attr] = list(map(
101
+ lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
102
+ value
103
+ ))
104
+ elif hasattr(value, "to_dict"):
105
+ result[attr] = value.to_dict()
106
+ elif isinstance(value, dict):
107
+ result[attr] = dict(map(
108
+ lambda item: (item[0], item[1].to_dict())
109
+ if hasattr(item[1], "to_dict") else item,
110
+ value.items()
111
+ ))
112
+ else:
113
+ if attr in self.sensitive_list:
114
+ result[attr] = "****"
115
+ else:
116
+ result[attr] = value
117
+
118
+ return result
119
+
120
+ def to_str(self):
121
+ """Returns the string representation of the model"""
122
+ import simplejson as json
123
+ if six.PY2:
124
+ import sys
125
+ reload(sys)
126
+ sys.setdefaultencoding("utf-8")
127
+ return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
128
+
129
+ def __repr__(self):
130
+ """For `print`"""
131
+ return self.to_str()
132
+
133
+ def __eq__(self, other):
134
+ """Returns true if both objects are equal"""
135
+ if not isinstance(other, Tag):
136
+ return False
137
+
138
+ return self.__dict__ == other.__dict__
139
+
140
+ def __ne__(self, other):
141
+ """Returns true if both objects are not equal"""
142
+ return not self == other