huaweicloudsdkrocketmq 3.1.150__py2.py3-none-any.whl → 3.1.152__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.
- huaweicloudsdkrocketmq/v2/__init__.py +26 -2
- huaweicloudsdkrocketmq/v2/model/__init__.py +26 -2
- huaweicloudsdkrocketmq/v2/model/batch_delete_diagnosis_report_req.py +115 -0
- huaweicloudsdkrocketmq/v2/model/batch_delete_diagnosis_report_request.py +167 -0
- huaweicloudsdkrocketmq/v2/model/batch_delete_diagnosis_report_response.py +116 -0
- huaweicloudsdkrocketmq/v2/model/create_diagnosis_task_request.py +167 -0
- huaweicloudsdkrocketmq/v2/model/create_diagnosis_task_response.py +116 -0
- huaweicloudsdkrocketmq/v2/model/create_instance_by_engine_req.py +88 -1
- huaweicloudsdkrocketmq/v2/model/create_post_paid_instance_req.py +90 -3
- huaweicloudsdkrocketmq/v2/model/create_topic_or_batch_delete_topic_req.py +3 -3
- huaweicloudsdkrocketmq/v2/model/create_topic_req.py +3 -3
- huaweicloudsdkrocketmq/v2/model/{restart_instance_response.py → delete_background_task_request.py} +31 -63
- huaweicloudsdkrocketmq/v2/model/delete_background_task_response.py +85 -0
- huaweicloudsdkrocketmq/v2/model/delete_consumer_group_response.py +32 -1
- huaweicloudsdkrocketmq/v2/model/delete_topic_response.py +32 -1
- huaweicloudsdkrocketmq/v2/model/diagnosis_rep.py +144 -0
- huaweicloudsdkrocketmq/v2/model/diagnosis_report_resp.py +289 -0
- huaweicloudsdkrocketmq/v2/model/list_background_tasks_request.py +230 -0
- huaweicloudsdkrocketmq/v2/model/list_background_tasks_resp_tasks.py +318 -0
- huaweicloudsdkrocketmq/v2/model/list_background_tasks_response.py +145 -0
- huaweicloudsdkrocketmq/v2/model/list_diagnosis_reports_request.py +200 -0
- huaweicloudsdkrocketmq/v2/model/list_diagnosis_reports_response.py +116 -0
- huaweicloudsdkrocketmq/v2/model/list_messages_request.py +30 -1
- huaweicloudsdkrocketmq/v2/model/modify_instance_ssl_config_request.py +167 -0
- huaweicloudsdkrocketmq/v2/model/modify_instance_ssl_config_response.py +145 -0
- huaweicloudsdkrocketmq/v2/model/{restart_instance_request.py → plain_ssl_switch_rep.py} +23 -50
- huaweicloudsdkrocketmq/v2/model/send_message_properties.py +144 -0
- huaweicloudsdkrocketmq/v2/model/send_message_request.py +167 -0
- huaweicloudsdkrocketmq/v2/model/send_message_resp.py +289 -0
- huaweicloudsdkrocketmq/v2/model/send_message_response.py +290 -0
- huaweicloudsdkrocketmq/v2/model/show_diagnosis_report_request.py +142 -0
- huaweicloudsdkrocketmq/v2/model/show_diagnosis_report_response.py +435 -0
- huaweicloudsdkrocketmq/v2/model/show_diagnosis_stack_request.py +142 -0
- huaweicloudsdkrocketmq/v2/model/show_diagnosis_stack_response.py +145 -0
- huaweicloudsdkrocketmq/v2/model/update_consumer_group_response.py +32 -1
- huaweicloudsdkrocketmq/v2/model/update_topic_queue_entity.py +173 -0
- huaweicloudsdkrocketmq/v2/model/update_topic_req.py +70 -12
- huaweicloudsdkrocketmq/v2/model/update_topic_response.py +32 -1
- huaweicloudsdkrocketmq/v2/rocketmq_async_client.py +580 -24
- huaweicloudsdkrocketmq/v2/rocketmq_client.py +580 -24
- {huaweicloudsdkrocketmq-3.1.150.dist-info → huaweicloudsdkrocketmq-3.1.152.dist-info}/METADATA +2 -2
- {huaweicloudsdkrocketmq-3.1.150.dist-info → huaweicloudsdkrocketmq-3.1.152.dist-info}/RECORD +45 -21
- {huaweicloudsdkrocketmq-3.1.150.dist-info → huaweicloudsdkrocketmq-3.1.152.dist-info}/LICENSE +0 -0
- {huaweicloudsdkrocketmq-3.1.150.dist-info → huaweicloudsdkrocketmq-3.1.152.dist-info}/WHEEL +0 -0
- {huaweicloudsdkrocketmq-3.1.150.dist-info → huaweicloudsdkrocketmq-3.1.152.dist-info}/top_level.txt +0 -0
huaweicloudsdkrocketmq/v2/model/{restart_instance_response.py → delete_background_task_request.py}
RENAMED
@@ -2,11 +2,10 @@
|
|
2
2
|
|
3
3
|
import six
|
4
4
|
|
5
|
-
from huaweicloudsdkcore.sdk_response import SdkResponse
|
6
5
|
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
|
7
6
|
|
8
7
|
|
9
|
-
class
|
8
|
+
class DeleteBackgroundTaskRequest:
|
10
9
|
|
11
10
|
"""
|
12
11
|
Attributes:
|
@@ -19,108 +18,77 @@ class RestartInstanceResponse(SdkResponse):
|
|
19
18
|
|
20
19
|
openapi_types = {
|
21
20
|
'instance_id': 'str',
|
22
|
-
'
|
23
|
-
'result': 'str'
|
21
|
+
'task_id': 'str'
|
24
22
|
}
|
25
23
|
|
26
24
|
attribute_map = {
|
27
25
|
'instance_id': 'instance_id',
|
28
|
-
'
|
29
|
-
'result': 'result'
|
26
|
+
'task_id': 'task_id'
|
30
27
|
}
|
31
28
|
|
32
|
-
def __init__(self, instance_id=None,
|
33
|
-
r"""
|
29
|
+
def __init__(self, instance_id=None, task_id=None):
|
30
|
+
r"""DeleteBackgroundTaskRequest
|
34
31
|
|
35
32
|
The model defined in huaweicloud sdk
|
36
33
|
|
37
|
-
:param instance_id: 实例ID
|
34
|
+
:param instance_id: **参数解释**: 实例ID。获取方法如下:登录RocketMQ控制台,在RocketMQ实例详情页面查找实例ID。 **约束限制**: 不涉及。 **取值范围**: 不涉及。 **默认取值**: 不涉及。
|
38
35
|
:type instance_id: str
|
39
|
-
:param
|
40
|
-
:type
|
41
|
-
:param result: 结果
|
42
|
-
:type result: str
|
36
|
+
:param task_id: **参数解释**: 任务ID。 **约束限制**: 不涉及。 **取值范围**: 不涉及。 **默认取值**: 不涉及。
|
37
|
+
:type task_id: str
|
43
38
|
"""
|
44
39
|
|
45
|
-
|
40
|
+
|
46
41
|
|
47
42
|
self._instance_id = None
|
48
|
-
self.
|
49
|
-
self._result = None
|
43
|
+
self._task_id = None
|
50
44
|
self.discriminator = None
|
51
45
|
|
52
|
-
|
53
|
-
|
54
|
-
if nodes is not None:
|
55
|
-
self.nodes = nodes
|
56
|
-
if result is not None:
|
57
|
-
self.result = result
|
46
|
+
self.instance_id = instance_id
|
47
|
+
self.task_id = task_id
|
58
48
|
|
59
49
|
@property
|
60
50
|
def instance_id(self):
|
61
|
-
r"""Gets the instance_id of this
|
51
|
+
r"""Gets the instance_id of this DeleteBackgroundTaskRequest.
|
62
52
|
|
63
|
-
实例ID
|
53
|
+
**参数解释**: 实例ID。获取方法如下:登录RocketMQ控制台,在RocketMQ实例详情页面查找实例ID。 **约束限制**: 不涉及。 **取值范围**: 不涉及。 **默认取值**: 不涉及。
|
64
54
|
|
65
|
-
:return: The instance_id of this
|
55
|
+
:return: The instance_id of this DeleteBackgroundTaskRequest.
|
66
56
|
:rtype: str
|
67
57
|
"""
|
68
58
|
return self._instance_id
|
69
59
|
|
70
60
|
@instance_id.setter
|
71
61
|
def instance_id(self, instance_id):
|
72
|
-
r"""Sets the instance_id of this
|
62
|
+
r"""Sets the instance_id of this DeleteBackgroundTaskRequest.
|
73
63
|
|
74
|
-
实例ID
|
64
|
+
**参数解释**: 实例ID。获取方法如下:登录RocketMQ控制台,在RocketMQ实例详情页面查找实例ID。 **约束限制**: 不涉及。 **取值范围**: 不涉及。 **默认取值**: 不涉及。
|
75
65
|
|
76
|
-
:param instance_id: The instance_id of this
|
66
|
+
:param instance_id: The instance_id of this DeleteBackgroundTaskRequest.
|
77
67
|
:type instance_id: str
|
78
68
|
"""
|
79
69
|
self._instance_id = instance_id
|
80
70
|
|
81
71
|
@property
|
82
|
-
def
|
83
|
-
r"""Gets the
|
84
|
-
|
85
|
-
node列表
|
86
|
-
|
87
|
-
:return: The nodes of this RestartInstanceResponse.
|
88
|
-
:rtype: list[str]
|
89
|
-
"""
|
90
|
-
return self._nodes
|
91
|
-
|
92
|
-
@nodes.setter
|
93
|
-
def nodes(self, nodes):
|
94
|
-
r"""Sets the nodes of this RestartInstanceResponse.
|
95
|
-
|
96
|
-
node列表
|
97
|
-
|
98
|
-
:param nodes: The nodes of this RestartInstanceResponse.
|
99
|
-
:type nodes: list[str]
|
100
|
-
"""
|
101
|
-
self._nodes = nodes
|
102
|
-
|
103
|
-
@property
|
104
|
-
def result(self):
|
105
|
-
r"""Gets the result of this RestartInstanceResponse.
|
72
|
+
def task_id(self):
|
73
|
+
r"""Gets the task_id of this DeleteBackgroundTaskRequest.
|
106
74
|
|
107
|
-
|
75
|
+
**参数解释**: 任务ID。 **约束限制**: 不涉及。 **取值范围**: 不涉及。 **默认取值**: 不涉及。
|
108
76
|
|
109
|
-
:return: The
|
77
|
+
:return: The task_id of this DeleteBackgroundTaskRequest.
|
110
78
|
:rtype: str
|
111
79
|
"""
|
112
|
-
return self.
|
80
|
+
return self._task_id
|
113
81
|
|
114
|
-
@
|
115
|
-
def
|
116
|
-
r"""Sets the
|
82
|
+
@task_id.setter
|
83
|
+
def task_id(self, task_id):
|
84
|
+
r"""Sets the task_id of this DeleteBackgroundTaskRequest.
|
117
85
|
|
118
|
-
|
86
|
+
**参数解释**: 任务ID。 **约束限制**: 不涉及。 **取值范围**: 不涉及。 **默认取值**: 不涉及。
|
119
87
|
|
120
|
-
:param
|
121
|
-
:type
|
88
|
+
:param task_id: The task_id of this DeleteBackgroundTaskRequest.
|
89
|
+
:type task_id: str
|
122
90
|
"""
|
123
|
-
self.
|
91
|
+
self._task_id = task_id
|
124
92
|
|
125
93
|
def to_dict(self):
|
126
94
|
"""Returns the model properties as a dict"""
|
@@ -164,7 +132,7 @@ class RestartInstanceResponse(SdkResponse):
|
|
164
132
|
|
165
133
|
def __eq__(self, other):
|
166
134
|
"""Returns true if both objects are equal"""
|
167
|
-
if not isinstance(other,
|
135
|
+
if not isinstance(other, DeleteBackgroundTaskRequest):
|
168
136
|
return False
|
169
137
|
|
170
138
|
return self.__dict__ == other.__dict__
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
import six
|
4
|
+
|
5
|
+
from huaweicloudsdkcore.sdk_response import SdkResponse
|
6
|
+
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
|
7
|
+
|
8
|
+
|
9
|
+
class DeleteBackgroundTaskResponse(SdkResponse):
|
10
|
+
|
11
|
+
"""
|
12
|
+
Attributes:
|
13
|
+
openapi_types (dict): The key is attribute name
|
14
|
+
and the value is attribute type.
|
15
|
+
attribute_map (dict): The key is attribute name
|
16
|
+
and the value is json key in definition.
|
17
|
+
"""
|
18
|
+
sensitive_list = []
|
19
|
+
|
20
|
+
openapi_types = {
|
21
|
+
}
|
22
|
+
|
23
|
+
attribute_map = {
|
24
|
+
}
|
25
|
+
|
26
|
+
def __init__(self):
|
27
|
+
r"""DeleteBackgroundTaskResponse
|
28
|
+
|
29
|
+
The model defined in huaweicloud sdk
|
30
|
+
|
31
|
+
"""
|
32
|
+
|
33
|
+
super(DeleteBackgroundTaskResponse, self).__init__()
|
34
|
+
self.discriminator = None
|
35
|
+
|
36
|
+
def to_dict(self):
|
37
|
+
"""Returns the model properties as a dict"""
|
38
|
+
result = {}
|
39
|
+
|
40
|
+
for attr, _ in six.iteritems(self.openapi_types):
|
41
|
+
value = getattr(self, attr)
|
42
|
+
if isinstance(value, list):
|
43
|
+
result[attr] = list(map(
|
44
|
+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
45
|
+
value
|
46
|
+
))
|
47
|
+
elif hasattr(value, "to_dict"):
|
48
|
+
result[attr] = value.to_dict()
|
49
|
+
elif isinstance(value, dict):
|
50
|
+
result[attr] = dict(map(
|
51
|
+
lambda item: (item[0], item[1].to_dict())
|
52
|
+
if hasattr(item[1], "to_dict") else item,
|
53
|
+
value.items()
|
54
|
+
))
|
55
|
+
else:
|
56
|
+
if attr in self.sensitive_list:
|
57
|
+
result[attr] = "****"
|
58
|
+
else:
|
59
|
+
result[attr] = value
|
60
|
+
|
61
|
+
return result
|
62
|
+
|
63
|
+
def to_str(self):
|
64
|
+
"""Returns the string representation of the model"""
|
65
|
+
import simplejson as json
|
66
|
+
if six.PY2:
|
67
|
+
import sys
|
68
|
+
reload(sys)
|
69
|
+
sys.setdefaultencoding("utf-8")
|
70
|
+
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
|
71
|
+
|
72
|
+
def __repr__(self):
|
73
|
+
"""For `print`"""
|
74
|
+
return self.to_str()
|
75
|
+
|
76
|
+
def __eq__(self, other):
|
77
|
+
"""Returns true if both objects are equal"""
|
78
|
+
if not isinstance(other, DeleteBackgroundTaskResponse):
|
79
|
+
return False
|
80
|
+
|
81
|
+
return self.__dict__ == other.__dict__
|
82
|
+
|
83
|
+
def __ne__(self, other):
|
84
|
+
"""Returns true if both objects are not equal"""
|
85
|
+
return not self == other
|
@@ -18,21 +18,52 @@ class DeleteConsumerGroupResponse(SdkResponse):
|
|
18
18
|
sensitive_list = []
|
19
19
|
|
20
20
|
openapi_types = {
|
21
|
+
'job_id': 'str'
|
21
22
|
}
|
22
23
|
|
23
24
|
attribute_map = {
|
25
|
+
'job_id': 'job_id'
|
24
26
|
}
|
25
27
|
|
26
|
-
def __init__(self):
|
28
|
+
def __init__(self, job_id=None):
|
27
29
|
r"""DeleteConsumerGroupResponse
|
28
30
|
|
29
31
|
The model defined in huaweicloud sdk
|
30
32
|
|
33
|
+
:param job_id: 规格变更任务ID。
|
34
|
+
:type job_id: str
|
31
35
|
"""
|
32
36
|
|
33
37
|
super(DeleteConsumerGroupResponse, self).__init__()
|
38
|
+
|
39
|
+
self._job_id = None
|
34
40
|
self.discriminator = None
|
35
41
|
|
42
|
+
if job_id is not None:
|
43
|
+
self.job_id = job_id
|
44
|
+
|
45
|
+
@property
|
46
|
+
def job_id(self):
|
47
|
+
r"""Gets the job_id of this DeleteConsumerGroupResponse.
|
48
|
+
|
49
|
+
规格变更任务ID。
|
50
|
+
|
51
|
+
:return: The job_id of this DeleteConsumerGroupResponse.
|
52
|
+
:rtype: str
|
53
|
+
"""
|
54
|
+
return self._job_id
|
55
|
+
|
56
|
+
@job_id.setter
|
57
|
+
def job_id(self, job_id):
|
58
|
+
r"""Sets the job_id of this DeleteConsumerGroupResponse.
|
59
|
+
|
60
|
+
规格变更任务ID。
|
61
|
+
|
62
|
+
:param job_id: The job_id of this DeleteConsumerGroupResponse.
|
63
|
+
:type job_id: str
|
64
|
+
"""
|
65
|
+
self._job_id = job_id
|
66
|
+
|
36
67
|
def to_dict(self):
|
37
68
|
"""Returns the model properties as a dict"""
|
38
69
|
result = {}
|
@@ -18,21 +18,52 @@ class DeleteTopicResponse(SdkResponse):
|
|
18
18
|
sensitive_list = []
|
19
19
|
|
20
20
|
openapi_types = {
|
21
|
+
'job_id': 'str'
|
21
22
|
}
|
22
23
|
|
23
24
|
attribute_map = {
|
25
|
+
'job_id': 'job_id'
|
24
26
|
}
|
25
27
|
|
26
|
-
def __init__(self):
|
28
|
+
def __init__(self, job_id=None):
|
27
29
|
r"""DeleteTopicResponse
|
28
30
|
|
29
31
|
The model defined in huaweicloud sdk
|
30
32
|
|
33
|
+
:param job_id: 规格变更任务ID。
|
34
|
+
:type job_id: str
|
31
35
|
"""
|
32
36
|
|
33
37
|
super(DeleteTopicResponse, self).__init__()
|
38
|
+
|
39
|
+
self._job_id = None
|
34
40
|
self.discriminator = None
|
35
41
|
|
42
|
+
if job_id is not None:
|
43
|
+
self.job_id = job_id
|
44
|
+
|
45
|
+
@property
|
46
|
+
def job_id(self):
|
47
|
+
r"""Gets the job_id of this DeleteTopicResponse.
|
48
|
+
|
49
|
+
规格变更任务ID。
|
50
|
+
|
51
|
+
:return: The job_id of this DeleteTopicResponse.
|
52
|
+
:rtype: str
|
53
|
+
"""
|
54
|
+
return self._job_id
|
55
|
+
|
56
|
+
@job_id.setter
|
57
|
+
def job_id(self, job_id):
|
58
|
+
r"""Sets the job_id of this DeleteTopicResponse.
|
59
|
+
|
60
|
+
规格变更任务ID。
|
61
|
+
|
62
|
+
:param job_id: The job_id of this DeleteTopicResponse.
|
63
|
+
:type job_id: str
|
64
|
+
"""
|
65
|
+
self._job_id = job_id
|
66
|
+
|
36
67
|
def to_dict(self):
|
37
68
|
"""Returns the model properties as a dict"""
|
38
69
|
result = {}
|
@@ -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 DiagnosisRep:
|
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
|
+
'group_name': 'str',
|
21
|
+
'node_id_list': 'list[str]'
|
22
|
+
}
|
23
|
+
|
24
|
+
attribute_map = {
|
25
|
+
'group_name': 'group_name',
|
26
|
+
'node_id_list': 'node_id_list'
|
27
|
+
}
|
28
|
+
|
29
|
+
def __init__(self, group_name=None, node_id_list=None):
|
30
|
+
r"""DiagnosisRep
|
31
|
+
|
32
|
+
The model defined in huaweicloud sdk
|
33
|
+
|
34
|
+
:param group_name: **参数解释**: 消费组名称。 **约束限制**: 不涉及。 **取值范围**: 不涉及。 **默认取值**: 不涉及。
|
35
|
+
:type group_name: str
|
36
|
+
:param node_id_list: **参数解释**: 节点ID列表。 **约束限制**: 不涉及。 **取值范围**: 不涉及。 **默认取值**: 不涉及。
|
37
|
+
:type node_id_list: list[str]
|
38
|
+
"""
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
self._group_name = None
|
43
|
+
self._node_id_list = None
|
44
|
+
self.discriminator = None
|
45
|
+
|
46
|
+
if group_name is not None:
|
47
|
+
self.group_name = group_name
|
48
|
+
if node_id_list is not None:
|
49
|
+
self.node_id_list = node_id_list
|
50
|
+
|
51
|
+
@property
|
52
|
+
def group_name(self):
|
53
|
+
r"""Gets the group_name of this DiagnosisRep.
|
54
|
+
|
55
|
+
**参数解释**: 消费组名称。 **约束限制**: 不涉及。 **取值范围**: 不涉及。 **默认取值**: 不涉及。
|
56
|
+
|
57
|
+
:return: The group_name of this DiagnosisRep.
|
58
|
+
:rtype: str
|
59
|
+
"""
|
60
|
+
return self._group_name
|
61
|
+
|
62
|
+
@group_name.setter
|
63
|
+
def group_name(self, group_name):
|
64
|
+
r"""Sets the group_name of this DiagnosisRep.
|
65
|
+
|
66
|
+
**参数解释**: 消费组名称。 **约束限制**: 不涉及。 **取值范围**: 不涉及。 **默认取值**: 不涉及。
|
67
|
+
|
68
|
+
:param group_name: The group_name of this DiagnosisRep.
|
69
|
+
:type group_name: str
|
70
|
+
"""
|
71
|
+
self._group_name = group_name
|
72
|
+
|
73
|
+
@property
|
74
|
+
def node_id_list(self):
|
75
|
+
r"""Gets the node_id_list of this DiagnosisRep.
|
76
|
+
|
77
|
+
**参数解释**: 节点ID列表。 **约束限制**: 不涉及。 **取值范围**: 不涉及。 **默认取值**: 不涉及。
|
78
|
+
|
79
|
+
:return: The node_id_list of this DiagnosisRep.
|
80
|
+
:rtype: list[str]
|
81
|
+
"""
|
82
|
+
return self._node_id_list
|
83
|
+
|
84
|
+
@node_id_list.setter
|
85
|
+
def node_id_list(self, node_id_list):
|
86
|
+
r"""Sets the node_id_list of this DiagnosisRep.
|
87
|
+
|
88
|
+
**参数解释**: 节点ID列表。 **约束限制**: 不涉及。 **取值范围**: 不涉及。 **默认取值**: 不涉及。
|
89
|
+
|
90
|
+
:param node_id_list: The node_id_list of this DiagnosisRep.
|
91
|
+
:type node_id_list: list[str]
|
92
|
+
"""
|
93
|
+
self._node_id_list = node_id_list
|
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, DiagnosisRep):
|
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
|