huaweicloudsdkworkspace 3.1.122__py2.py3-none-any.whl → 3.1.124__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.
Potentially problematic release.
This version of huaweicloudsdkworkspace might be problematic. Click here for more details.
- huaweicloudsdkworkspace/v2/__init__.py +54 -0
- huaweicloudsdkworkspace/v2/model/__init__.py +54 -0
- huaweicloudsdkworkspace/v2/model/add_desktop_pool_volumes_req.py +144 -0
- huaweicloudsdkworkspace/v2/model/add_desktop_pool_volumes_request.py +168 -0
- huaweicloudsdkworkspace/v2/model/add_desktop_pool_volumes_response.py +319 -0
- huaweicloudsdkworkspace/v2/model/authorized_objects.py +227 -0
- huaweicloudsdkworkspace/v2/model/autoscale_policy.py +202 -0
- huaweicloudsdkworkspace/v2/model/base_error.py +144 -0
- huaweicloudsdkworkspace/v2/model/batch_delete_user_req.py +114 -0
- huaweicloudsdkworkspace/v2/model/batch_delete_user_request.py +111 -0
- huaweicloudsdkworkspace/v2/model/batch_delete_user_response.py +85 -0
- huaweicloudsdkworkspace/v2/model/cbc_callback_rsp.py +289 -0
- huaweicloudsdkworkspace/v2/model/create_desktop_pool_authorized_objects_request.py +139 -0
- huaweicloudsdkworkspace/v2/model/create_desktop_pool_authorized_objects_request_body.py +143 -0
- huaweicloudsdkworkspace/v2/model/create_desktop_pool_authorized_objects_response.py +85 -0
- huaweicloudsdkworkspace/v2/model/create_desktop_pool_req.py +708 -0
- huaweicloudsdkworkspace/v2/model/create_desktop_pool_request.py +140 -0
- huaweicloudsdkworkspace/v2/model/create_desktop_pool_response.py +116 -0
- huaweicloudsdkworkspace/v2/model/create_desktop_rsp.py +115 -0
- huaweicloudsdkworkspace/v2/model/delete_desktop_pool_request.py +114 -0
- huaweicloudsdkworkspace/v2/model/delete_desktop_pool_response.py +85 -0
- huaweicloudsdkworkspace/v2/model/delete_desktop_pool_volumes_req.py +115 -0
- huaweicloudsdkworkspace/v2/model/delete_desktop_pool_volumes_request.py +139 -0
- huaweicloudsdkworkspace/v2/model/delete_desktop_pool_volumes_response.py +116 -0
- huaweicloudsdkworkspace/v2/model/desktop_pool_action_req.py +143 -0
- huaweicloudsdkworkspace/v2/model/execute_desktop_pool_action_request.py +139 -0
- huaweicloudsdkworkspace/v2/model/execute_desktop_pool_action_response.py +116 -0
- huaweicloudsdkworkspace/v2/model/expand_desktop_pool_req.py +143 -0
- huaweicloudsdkworkspace/v2/model/expand_desktop_pool_request.py +168 -0
- huaweicloudsdkworkspace/v2/model/expand_desktop_pool_response.py +116 -0
- huaweicloudsdkworkspace/v2/model/expand_desktop_pool_volumes_req.py +144 -0
- huaweicloudsdkworkspace/v2/model/expand_desktop_pool_volumes_request.py +168 -0
- huaweicloudsdkworkspace/v2/model/expand_desktop_pool_volumes_response.py +319 -0
- huaweicloudsdkworkspace/v2/model/list_desktop_pool_authorized_objects_request.py +172 -0
- huaweicloudsdkworkspace/v2/model/list_desktop_pool_authorized_objects_response.py +145 -0
- huaweicloudsdkworkspace/v2/model/list_desktop_pools_request.py +260 -0
- huaweicloudsdkworkspace/v2/model/list_desktop_pools_response.py +145 -0
- huaweicloudsdkworkspace/v2/model/list_pool_desktops_detail_request.py +201 -0
- huaweicloudsdkworkspace/v2/model/list_pool_desktops_detail_response.py +203 -0
- huaweicloudsdkworkspace/v2/model/pool_desktops_detail_info.py +1147 -0
- huaweicloudsdkworkspace/v2/model/rebuild_desktop_pool_req.py +288 -0
- huaweicloudsdkworkspace/v2/model/rebuild_desktop_pool_request.py +168 -0
- huaweicloudsdkworkspace/v2/model/rebuild_desktop_pool_response.py +232 -0
- huaweicloudsdkworkspace/v2/model/resize_desktop_extend_param.py +115 -0
- huaweicloudsdkworkspace/v2/model/resize_desktop_pool_job_response.py +144 -0
- huaweicloudsdkworkspace/v2/model/resize_desktop_pool_req.py +197 -0
- huaweicloudsdkworkspace/v2/model/resize_desktop_pool_request.py +168 -0
- huaweicloudsdkworkspace/v2/model/resize_desktop_pool_response.py +174 -0
- huaweicloudsdkworkspace/v2/model/show_desktop_pool_detail_request.py +114 -0
- huaweicloudsdkworkspace/v2/model/show_desktop_pool_detail_response.py +887 -0
- huaweicloudsdkworkspace/v2/model/simple_desktop_pool_info.py +886 -0
- huaweicloudsdkworkspace/v2/model/update_desktop_pool_attributes_req.py +372 -0
- huaweicloudsdkworkspace/v2/model/update_desktop_pool_request.py +139 -0
- huaweicloudsdkworkspace/v2/model/update_desktop_pool_response.py +85 -0
- huaweicloudsdkworkspace/v2/model/volume_add_info.py +200 -0
- huaweicloudsdkworkspace/v2/model/volume_info.py +229 -0
- huaweicloudsdkworkspace/v2/workspace_async_client.py +1091 -0
- huaweicloudsdkworkspace/v2/workspace_client.py +1091 -0
- {huaweicloudsdkworkspace-3.1.122.dist-info → huaweicloudsdkworkspace-3.1.124.dist-info}/METADATA +2 -2
- {huaweicloudsdkworkspace-3.1.122.dist-info → huaweicloudsdkworkspace-3.1.124.dist-info}/RECORD +63 -9
- {huaweicloudsdkworkspace-3.1.122.dist-info → huaweicloudsdkworkspace-3.1.124.dist-info}/WHEEL +1 -1
- {huaweicloudsdkworkspace-3.1.122.dist-info → huaweicloudsdkworkspace-3.1.124.dist-info}/LICENSE +0 -0
- {huaweicloudsdkworkspace-3.1.122.dist-info → huaweicloudsdkworkspace-3.1.124.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
import six
|
|
4
|
+
|
|
5
|
+
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class VolumeAddInfo:
|
|
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
|
+
'id': 'str',
|
|
21
|
+
'type': 'str',
|
|
22
|
+
'size': 'int',
|
|
23
|
+
'cluster_id': 'str'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
attribute_map = {
|
|
27
|
+
'id': 'id',
|
|
28
|
+
'type': 'type',
|
|
29
|
+
'size': 'size',
|
|
30
|
+
'cluster_id': 'cluster_id'
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
def __init__(self, id=None, type=None, size=None, cluster_id=None):
|
|
34
|
+
"""VolumeAddInfo
|
|
35
|
+
|
|
36
|
+
The model defined in huaweicloud sdk
|
|
37
|
+
|
|
38
|
+
:param id: 磁盘记录ID,删除或者扩容磁盘时必选。
|
|
39
|
+
:type id: str
|
|
40
|
+
:param type: 桌面数据盘对应的磁盘类型,需要与系统所提供的磁盘类型相匹配。 - SAS:高IO。 - SSD:超高IO。
|
|
41
|
+
:type type: str
|
|
42
|
+
:param size: 磁盘容量,单位GB。
|
|
43
|
+
:type size: int
|
|
44
|
+
:param cluster_id: 云服务器系统盘对应的存储池的ID。
|
|
45
|
+
:type cluster_id: str
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
self._id = None
|
|
51
|
+
self._type = None
|
|
52
|
+
self._size = None
|
|
53
|
+
self._cluster_id = None
|
|
54
|
+
self.discriminator = None
|
|
55
|
+
|
|
56
|
+
if id is not None:
|
|
57
|
+
self.id = id
|
|
58
|
+
self.type = type
|
|
59
|
+
self.size = size
|
|
60
|
+
if cluster_id is not None:
|
|
61
|
+
self.cluster_id = cluster_id
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def id(self):
|
|
65
|
+
"""Gets the id of this VolumeAddInfo.
|
|
66
|
+
|
|
67
|
+
磁盘记录ID,删除或者扩容磁盘时必选。
|
|
68
|
+
|
|
69
|
+
:return: The id of this VolumeAddInfo.
|
|
70
|
+
:rtype: str
|
|
71
|
+
"""
|
|
72
|
+
return self._id
|
|
73
|
+
|
|
74
|
+
@id.setter
|
|
75
|
+
def id(self, id):
|
|
76
|
+
"""Sets the id of this VolumeAddInfo.
|
|
77
|
+
|
|
78
|
+
磁盘记录ID,删除或者扩容磁盘时必选。
|
|
79
|
+
|
|
80
|
+
:param id: The id of this VolumeAddInfo.
|
|
81
|
+
:type id: str
|
|
82
|
+
"""
|
|
83
|
+
self._id = id
|
|
84
|
+
|
|
85
|
+
@property
|
|
86
|
+
def type(self):
|
|
87
|
+
"""Gets the type of this VolumeAddInfo.
|
|
88
|
+
|
|
89
|
+
桌面数据盘对应的磁盘类型,需要与系统所提供的磁盘类型相匹配。 - SAS:高IO。 - SSD:超高IO。
|
|
90
|
+
|
|
91
|
+
:return: The type of this VolumeAddInfo.
|
|
92
|
+
:rtype: str
|
|
93
|
+
"""
|
|
94
|
+
return self._type
|
|
95
|
+
|
|
96
|
+
@type.setter
|
|
97
|
+
def type(self, type):
|
|
98
|
+
"""Sets the type of this VolumeAddInfo.
|
|
99
|
+
|
|
100
|
+
桌面数据盘对应的磁盘类型,需要与系统所提供的磁盘类型相匹配。 - SAS:高IO。 - SSD:超高IO。
|
|
101
|
+
|
|
102
|
+
:param type: The type of this VolumeAddInfo.
|
|
103
|
+
:type type: str
|
|
104
|
+
"""
|
|
105
|
+
self._type = type
|
|
106
|
+
|
|
107
|
+
@property
|
|
108
|
+
def size(self):
|
|
109
|
+
"""Gets the size of this VolumeAddInfo.
|
|
110
|
+
|
|
111
|
+
磁盘容量,单位GB。
|
|
112
|
+
|
|
113
|
+
:return: The size of this VolumeAddInfo.
|
|
114
|
+
:rtype: int
|
|
115
|
+
"""
|
|
116
|
+
return self._size
|
|
117
|
+
|
|
118
|
+
@size.setter
|
|
119
|
+
def size(self, size):
|
|
120
|
+
"""Sets the size of this VolumeAddInfo.
|
|
121
|
+
|
|
122
|
+
磁盘容量,单位GB。
|
|
123
|
+
|
|
124
|
+
:param size: The size of this VolumeAddInfo.
|
|
125
|
+
:type size: int
|
|
126
|
+
"""
|
|
127
|
+
self._size = size
|
|
128
|
+
|
|
129
|
+
@property
|
|
130
|
+
def cluster_id(self):
|
|
131
|
+
"""Gets the cluster_id of this VolumeAddInfo.
|
|
132
|
+
|
|
133
|
+
云服务器系统盘对应的存储池的ID。
|
|
134
|
+
|
|
135
|
+
:return: The cluster_id of this VolumeAddInfo.
|
|
136
|
+
:rtype: str
|
|
137
|
+
"""
|
|
138
|
+
return self._cluster_id
|
|
139
|
+
|
|
140
|
+
@cluster_id.setter
|
|
141
|
+
def cluster_id(self, cluster_id):
|
|
142
|
+
"""Sets the cluster_id of this VolumeAddInfo.
|
|
143
|
+
|
|
144
|
+
云服务器系统盘对应的存储池的ID。
|
|
145
|
+
|
|
146
|
+
:param cluster_id: The cluster_id of this VolumeAddInfo.
|
|
147
|
+
:type cluster_id: str
|
|
148
|
+
"""
|
|
149
|
+
self._cluster_id = cluster_id
|
|
150
|
+
|
|
151
|
+
def to_dict(self):
|
|
152
|
+
"""Returns the model properties as a dict"""
|
|
153
|
+
result = {}
|
|
154
|
+
|
|
155
|
+
for attr, _ in six.iteritems(self.openapi_types):
|
|
156
|
+
value = getattr(self, attr)
|
|
157
|
+
if isinstance(value, list):
|
|
158
|
+
result[attr] = list(map(
|
|
159
|
+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
160
|
+
value
|
|
161
|
+
))
|
|
162
|
+
elif hasattr(value, "to_dict"):
|
|
163
|
+
result[attr] = value.to_dict()
|
|
164
|
+
elif isinstance(value, dict):
|
|
165
|
+
result[attr] = dict(map(
|
|
166
|
+
lambda item: (item[0], item[1].to_dict())
|
|
167
|
+
if hasattr(item[1], "to_dict") else item,
|
|
168
|
+
value.items()
|
|
169
|
+
))
|
|
170
|
+
else:
|
|
171
|
+
if attr in self.sensitive_list:
|
|
172
|
+
result[attr] = "****"
|
|
173
|
+
else:
|
|
174
|
+
result[attr] = value
|
|
175
|
+
|
|
176
|
+
return result
|
|
177
|
+
|
|
178
|
+
def to_str(self):
|
|
179
|
+
"""Returns the string representation of the model"""
|
|
180
|
+
import simplejson as json
|
|
181
|
+
if six.PY2:
|
|
182
|
+
import sys
|
|
183
|
+
reload(sys)
|
|
184
|
+
sys.setdefaultencoding("utf-8")
|
|
185
|
+
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
|
|
186
|
+
|
|
187
|
+
def __repr__(self):
|
|
188
|
+
"""For `print`"""
|
|
189
|
+
return self.to_str()
|
|
190
|
+
|
|
191
|
+
def __eq__(self, other):
|
|
192
|
+
"""Returns true if both objects are equal"""
|
|
193
|
+
if not isinstance(other, VolumeAddInfo):
|
|
194
|
+
return False
|
|
195
|
+
|
|
196
|
+
return self.__dict__ == other.__dict__
|
|
197
|
+
|
|
198
|
+
def __ne__(self, other):
|
|
199
|
+
"""Returns true if both objects are not equal"""
|
|
200
|
+
return not self == other
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
import six
|
|
4
|
+
|
|
5
|
+
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class VolumeInfo:
|
|
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
|
+
'id': 'str',
|
|
21
|
+
'type': 'str',
|
|
22
|
+
'size': 'int',
|
|
23
|
+
'cluster_id': 'str',
|
|
24
|
+
'resource_spec_code': 'str'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
attribute_map = {
|
|
28
|
+
'id': 'id',
|
|
29
|
+
'type': 'type',
|
|
30
|
+
'size': 'size',
|
|
31
|
+
'cluster_id': 'cluster_id',
|
|
32
|
+
'resource_spec_code': 'resource_spec_code'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
def __init__(self, id=None, type=None, size=None, cluster_id=None, resource_spec_code=None):
|
|
36
|
+
"""VolumeInfo
|
|
37
|
+
|
|
38
|
+
The model defined in huaweicloud sdk
|
|
39
|
+
|
|
40
|
+
:param id: 批量操作磁盘的磁盘集合id。
|
|
41
|
+
:type id: str
|
|
42
|
+
:param type: 桌面数据盘对应的磁盘类型,需要与系统所提供的磁盘类型相匹配。 - SAS:高IO。 - SSD:超高IO。
|
|
43
|
+
:type type: str
|
|
44
|
+
:param size: 磁盘容量,单位GB。
|
|
45
|
+
:type size: int
|
|
46
|
+
:param cluster_id: 云服务器系统盘对应的存储池的ID。
|
|
47
|
+
:type cluster_id: str
|
|
48
|
+
:param resource_spec_code: 规格
|
|
49
|
+
:type resource_spec_code: str
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
self._id = None
|
|
55
|
+
self._type = None
|
|
56
|
+
self._size = None
|
|
57
|
+
self._cluster_id = None
|
|
58
|
+
self._resource_spec_code = None
|
|
59
|
+
self.discriminator = None
|
|
60
|
+
|
|
61
|
+
if id is not None:
|
|
62
|
+
self.id = id
|
|
63
|
+
self.type = type
|
|
64
|
+
self.size = size
|
|
65
|
+
if cluster_id is not None:
|
|
66
|
+
self.cluster_id = cluster_id
|
|
67
|
+
if resource_spec_code is not None:
|
|
68
|
+
self.resource_spec_code = resource_spec_code
|
|
69
|
+
|
|
70
|
+
@property
|
|
71
|
+
def id(self):
|
|
72
|
+
"""Gets the id of this VolumeInfo.
|
|
73
|
+
|
|
74
|
+
批量操作磁盘的磁盘集合id。
|
|
75
|
+
|
|
76
|
+
:return: The id of this VolumeInfo.
|
|
77
|
+
:rtype: str
|
|
78
|
+
"""
|
|
79
|
+
return self._id
|
|
80
|
+
|
|
81
|
+
@id.setter
|
|
82
|
+
def id(self, id):
|
|
83
|
+
"""Sets the id of this VolumeInfo.
|
|
84
|
+
|
|
85
|
+
批量操作磁盘的磁盘集合id。
|
|
86
|
+
|
|
87
|
+
:param id: The id of this VolumeInfo.
|
|
88
|
+
:type id: str
|
|
89
|
+
"""
|
|
90
|
+
self._id = id
|
|
91
|
+
|
|
92
|
+
@property
|
|
93
|
+
def type(self):
|
|
94
|
+
"""Gets the type of this VolumeInfo.
|
|
95
|
+
|
|
96
|
+
桌面数据盘对应的磁盘类型,需要与系统所提供的磁盘类型相匹配。 - SAS:高IO。 - SSD:超高IO。
|
|
97
|
+
|
|
98
|
+
:return: The type of this VolumeInfo.
|
|
99
|
+
:rtype: str
|
|
100
|
+
"""
|
|
101
|
+
return self._type
|
|
102
|
+
|
|
103
|
+
@type.setter
|
|
104
|
+
def type(self, type):
|
|
105
|
+
"""Sets the type of this VolumeInfo.
|
|
106
|
+
|
|
107
|
+
桌面数据盘对应的磁盘类型,需要与系统所提供的磁盘类型相匹配。 - SAS:高IO。 - SSD:超高IO。
|
|
108
|
+
|
|
109
|
+
:param type: The type of this VolumeInfo.
|
|
110
|
+
:type type: str
|
|
111
|
+
"""
|
|
112
|
+
self._type = type
|
|
113
|
+
|
|
114
|
+
@property
|
|
115
|
+
def size(self):
|
|
116
|
+
"""Gets the size of this VolumeInfo.
|
|
117
|
+
|
|
118
|
+
磁盘容量,单位GB。
|
|
119
|
+
|
|
120
|
+
:return: The size of this VolumeInfo.
|
|
121
|
+
:rtype: int
|
|
122
|
+
"""
|
|
123
|
+
return self._size
|
|
124
|
+
|
|
125
|
+
@size.setter
|
|
126
|
+
def size(self, size):
|
|
127
|
+
"""Sets the size of this VolumeInfo.
|
|
128
|
+
|
|
129
|
+
磁盘容量,单位GB。
|
|
130
|
+
|
|
131
|
+
:param size: The size of this VolumeInfo.
|
|
132
|
+
:type size: int
|
|
133
|
+
"""
|
|
134
|
+
self._size = size
|
|
135
|
+
|
|
136
|
+
@property
|
|
137
|
+
def cluster_id(self):
|
|
138
|
+
"""Gets the cluster_id of this VolumeInfo.
|
|
139
|
+
|
|
140
|
+
云服务器系统盘对应的存储池的ID。
|
|
141
|
+
|
|
142
|
+
:return: The cluster_id of this VolumeInfo.
|
|
143
|
+
:rtype: str
|
|
144
|
+
"""
|
|
145
|
+
return self._cluster_id
|
|
146
|
+
|
|
147
|
+
@cluster_id.setter
|
|
148
|
+
def cluster_id(self, cluster_id):
|
|
149
|
+
"""Sets the cluster_id of this VolumeInfo.
|
|
150
|
+
|
|
151
|
+
云服务器系统盘对应的存储池的ID。
|
|
152
|
+
|
|
153
|
+
:param cluster_id: The cluster_id of this VolumeInfo.
|
|
154
|
+
:type cluster_id: str
|
|
155
|
+
"""
|
|
156
|
+
self._cluster_id = cluster_id
|
|
157
|
+
|
|
158
|
+
@property
|
|
159
|
+
def resource_spec_code(self):
|
|
160
|
+
"""Gets the resource_spec_code of this VolumeInfo.
|
|
161
|
+
|
|
162
|
+
规格
|
|
163
|
+
|
|
164
|
+
:return: The resource_spec_code of this VolumeInfo.
|
|
165
|
+
:rtype: str
|
|
166
|
+
"""
|
|
167
|
+
return self._resource_spec_code
|
|
168
|
+
|
|
169
|
+
@resource_spec_code.setter
|
|
170
|
+
def resource_spec_code(self, resource_spec_code):
|
|
171
|
+
"""Sets the resource_spec_code of this VolumeInfo.
|
|
172
|
+
|
|
173
|
+
规格
|
|
174
|
+
|
|
175
|
+
:param resource_spec_code: The resource_spec_code of this VolumeInfo.
|
|
176
|
+
:type resource_spec_code: str
|
|
177
|
+
"""
|
|
178
|
+
self._resource_spec_code = resource_spec_code
|
|
179
|
+
|
|
180
|
+
def to_dict(self):
|
|
181
|
+
"""Returns the model properties as a dict"""
|
|
182
|
+
result = {}
|
|
183
|
+
|
|
184
|
+
for attr, _ in six.iteritems(self.openapi_types):
|
|
185
|
+
value = getattr(self, attr)
|
|
186
|
+
if isinstance(value, list):
|
|
187
|
+
result[attr] = list(map(
|
|
188
|
+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
189
|
+
value
|
|
190
|
+
))
|
|
191
|
+
elif hasattr(value, "to_dict"):
|
|
192
|
+
result[attr] = value.to_dict()
|
|
193
|
+
elif isinstance(value, dict):
|
|
194
|
+
result[attr] = dict(map(
|
|
195
|
+
lambda item: (item[0], item[1].to_dict())
|
|
196
|
+
if hasattr(item[1], "to_dict") else item,
|
|
197
|
+
value.items()
|
|
198
|
+
))
|
|
199
|
+
else:
|
|
200
|
+
if attr in self.sensitive_list:
|
|
201
|
+
result[attr] = "****"
|
|
202
|
+
else:
|
|
203
|
+
result[attr] = value
|
|
204
|
+
|
|
205
|
+
return result
|
|
206
|
+
|
|
207
|
+
def to_str(self):
|
|
208
|
+
"""Returns the string representation of the model"""
|
|
209
|
+
import simplejson as json
|
|
210
|
+
if six.PY2:
|
|
211
|
+
import sys
|
|
212
|
+
reload(sys)
|
|
213
|
+
sys.setdefaultencoding("utf-8")
|
|
214
|
+
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
|
|
215
|
+
|
|
216
|
+
def __repr__(self):
|
|
217
|
+
"""For `print`"""
|
|
218
|
+
return self.to_str()
|
|
219
|
+
|
|
220
|
+
def __eq__(self, other):
|
|
221
|
+
"""Returns true if both objects are equal"""
|
|
222
|
+
if not isinstance(other, VolumeInfo):
|
|
223
|
+
return False
|
|
224
|
+
|
|
225
|
+
return self.__dict__ == other.__dict__
|
|
226
|
+
|
|
227
|
+
def __ne__(self, other):
|
|
228
|
+
"""Returns true if both objects are not equal"""
|
|
229
|
+
return not self == other
|