baiducloud-python-sdk-aihc 0.0.1__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.
- baiducloud_python_sdk_aihc/__init__.py +5 -0
- baiducloud_python_sdk_aihc/api/__init__.py +0 -0
- baiducloud_python_sdk_aihc/api/aihc_client.py +643 -0
- baiducloud_python_sdk_aihc/models/__init__.py +39 -0
- baiducloud_python_sdk_aihc/models/create_a_dataset_v2_request.py +147 -0
- baiducloud_python_sdk_aihc/models/create_a_dataset_v2_response.py +61 -0
- baiducloud_python_sdk_aihc/models/create_a_model_v2_request.py +101 -0
- baiducloud_python_sdk_aihc/models/create_a_model_v2_response.py +61 -0
- baiducloud_python_sdk_aihc/models/create_dataset_version_v2_request.py +82 -0
- baiducloud_python_sdk_aihc/models/create_dataset_version_v2_response.py +61 -0
- baiducloud_python_sdk_aihc/models/dataset.py +200 -0
- baiducloud_python_sdk_aihc/models/dataset_version_entry.py +98 -0
- baiducloud_python_sdk_aihc/models/delete_dataset_v2_request.py +58 -0
- baiducloud_python_sdk_aihc/models/delete_dataset_version_v2_request.py +64 -0
- baiducloud_python_sdk_aihc/models/delete_model_v2_request.py +58 -0
- baiducloud_python_sdk_aihc/models/delete_model_version_v2_request.py +64 -0
- baiducloud_python_sdk_aihc/models/get_a_list_of_model_versions_v2_request.py +70 -0
- baiducloud_python_sdk_aihc/models/get_a_list_of_model_versions_v2_response.py +70 -0
- baiducloud_python_sdk_aihc/models/get_dataset_details_v2_request.py +58 -0
- baiducloud_python_sdk_aihc/models/get_dataset_details_v2_response.py +211 -0
- baiducloud_python_sdk_aihc/models/get_dataset_version_details_v2_request.py +64 -0
- baiducloud_python_sdk_aihc/models/get_dataset_version_details_v2_response.py +193 -0
- baiducloud_python_sdk_aihc/models/get_model_details_v2_request.py +58 -0
- baiducloud_python_sdk_aihc/models/get_model_details_v2_response.py +155 -0
- baiducloud_python_sdk_aihc/models/get_model_list_v2_request.py +64 -0
- baiducloud_python_sdk_aihc/models/get_model_list_v2_response.py +70 -0
- baiducloud_python_sdk_aihc/models/get_model_version_details_v2_request.py +64 -0
- baiducloud_python_sdk_aihc/models/get_model_version_details_v2_response.py +155 -0
- baiducloud_python_sdk_aihc/models/model.py +160 -0
- baiducloud_python_sdk_aihc/models/model_version_entry.py +115 -0
- baiducloud_python_sdk_aihc/models/modify_dataset_v2_request.py +108 -0
- baiducloud_python_sdk_aihc/models/modify_the_model_v2_request.py +74 -0
- baiducloud_python_sdk_aihc/models/new_model_version_v2_request.py +98 -0
- baiducloud_python_sdk_aihc/models/new_model_version_v2_response.py +61 -0
- baiducloud_python_sdk_aihc/models/permission_entry.py +74 -0
- baiducloud_python_sdk_aihc/models/retrieve_the_dataset_list_v2_request.py +84 -0
- baiducloud_python_sdk_aihc/models/retrieve_the_dataset_list_v2_response.py +70 -0
- baiducloud_python_sdk_aihc/models/retrieve_the_dataset_version_list_v2_request.py +70 -0
- baiducloud_python_sdk_aihc/models/retrieve_the_dataset_version_list_v2_response.py +70 -0
- baiducloud_python_sdk_aihc-0.0.1.dist-info/LICENSE +177 -0
- baiducloud_python_sdk_aihc-0.0.1.dist-info/METADATA +76 -0
- baiducloud_python_sdk_aihc-0.0.1.dist-info/RECORD +44 -0
- baiducloud_python_sdk_aihc-0.0.1.dist-info/WHEEL +5 -0
- baiducloud_python_sdk_aihc-0.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for GetModelDetailsV2Response information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.bce_response import BceResponse
|
|
6
|
+
from baiducloud_python_sdk_aihc.models.model_version_entry import ModelVersionEntry
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class GetModelDetailsV2Response(BceResponse):
|
|
10
|
+
"""
|
|
11
|
+
GetModelDetailsV2Response
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(
|
|
15
|
+
self,
|
|
16
|
+
name=None,
|
|
17
|
+
id=None,
|
|
18
|
+
init_source=None,
|
|
19
|
+
model_format=None,
|
|
20
|
+
description=None,
|
|
21
|
+
created_at=None,
|
|
22
|
+
updated_at=None,
|
|
23
|
+
owner=None,
|
|
24
|
+
owner_name=None,
|
|
25
|
+
visibility_scope=None,
|
|
26
|
+
version_entry=None,
|
|
27
|
+
):
|
|
28
|
+
"""
|
|
29
|
+
Initialize GetModelDetailsV2Response response.
|
|
30
|
+
|
|
31
|
+
:param name: 模型名称
|
|
32
|
+
:type name: str (optional)
|
|
33
|
+
|
|
34
|
+
:param id: 模型ID
|
|
35
|
+
:type id: str (optional)
|
|
36
|
+
|
|
37
|
+
:param init_source: 模型创建时的来源UserUpload:用户上传
|
|
38
|
+
:type init_source: str (optional)
|
|
39
|
+
|
|
40
|
+
:param model_format: 模型格式
|
|
41
|
+
:type model_format: str (optional)
|
|
42
|
+
|
|
43
|
+
:param description: 描述
|
|
44
|
+
:type description: str (optional)
|
|
45
|
+
|
|
46
|
+
:param created_at: 创建时间
|
|
47
|
+
:type created_at: str (optional)
|
|
48
|
+
|
|
49
|
+
:param updated_at: 更新时间
|
|
50
|
+
:type updated_at: str (optional)
|
|
51
|
+
|
|
52
|
+
:param owner: 所有者
|
|
53
|
+
:type owner: str (optional)
|
|
54
|
+
|
|
55
|
+
:param owner_name: 所有者名称
|
|
56
|
+
:type owner_name: str (optional)
|
|
57
|
+
|
|
58
|
+
:param visibility_scope: 可见范围
|
|
59
|
+
:type visibility_scope: str (optional)
|
|
60
|
+
|
|
61
|
+
:param version_entry: version_entry field
|
|
62
|
+
:type version_entry: ModelVersionEntry (optional)
|
|
63
|
+
"""
|
|
64
|
+
super().__init__()
|
|
65
|
+
self.name = name
|
|
66
|
+
self.id = id
|
|
67
|
+
self.init_source = init_source
|
|
68
|
+
self.model_format = model_format
|
|
69
|
+
self.description = description
|
|
70
|
+
self.created_at = created_at
|
|
71
|
+
self.updated_at = updated_at
|
|
72
|
+
self.owner = owner
|
|
73
|
+
self.owner_name = owner_name
|
|
74
|
+
self.visibility_scope = visibility_scope
|
|
75
|
+
self.version_entry = version_entry
|
|
76
|
+
|
|
77
|
+
def to_dict(self):
|
|
78
|
+
"""
|
|
79
|
+
Convert the response instance to a dictionary representation.
|
|
80
|
+
|
|
81
|
+
Includes metadata from the parent BceResponse class.
|
|
82
|
+
Nested model objects are recursively converted to dictionaries.
|
|
83
|
+
|
|
84
|
+
:return: Dictionary representation of the response
|
|
85
|
+
:rtype: dict
|
|
86
|
+
"""
|
|
87
|
+
_map = super().to_dict()
|
|
88
|
+
if _map is not None:
|
|
89
|
+
return _map
|
|
90
|
+
result = dict()
|
|
91
|
+
if self.metadata is not None:
|
|
92
|
+
result['metadata'] = dict(self.metadata)
|
|
93
|
+
if self.name is not None:
|
|
94
|
+
result['name'] = self.name
|
|
95
|
+
if self.id is not None:
|
|
96
|
+
result['id'] = self.id
|
|
97
|
+
if self.init_source is not None:
|
|
98
|
+
result['initSource'] = self.init_source
|
|
99
|
+
if self.model_format is not None:
|
|
100
|
+
result['modelFormat'] = self.model_format
|
|
101
|
+
if self.description is not None:
|
|
102
|
+
result['description'] = self.description
|
|
103
|
+
if self.created_at is not None:
|
|
104
|
+
result['createdAt'] = self.created_at
|
|
105
|
+
if self.updated_at is not None:
|
|
106
|
+
result['updatedAt'] = self.updated_at
|
|
107
|
+
if self.owner is not None:
|
|
108
|
+
result['owner'] = self.owner
|
|
109
|
+
if self.owner_name is not None:
|
|
110
|
+
result['ownerName'] = self.owner_name
|
|
111
|
+
if self.visibility_scope is not None:
|
|
112
|
+
result['visibilityScope'] = self.visibility_scope
|
|
113
|
+
if self.version_entry is not None:
|
|
114
|
+
result['versionEntry'] = self.version_entry.to_dict()
|
|
115
|
+
return result
|
|
116
|
+
|
|
117
|
+
def from_dict(self, m):
|
|
118
|
+
"""
|
|
119
|
+
Populate the response instance from a dictionary.
|
|
120
|
+
|
|
121
|
+
Nested dictionaries are recursively converted to model objects.
|
|
122
|
+
|
|
123
|
+
:param m: Dictionary containing response data
|
|
124
|
+
:type m: dict
|
|
125
|
+
|
|
126
|
+
:return: Self reference for method chaining
|
|
127
|
+
:rtype: GetModelDetailsV2Response
|
|
128
|
+
|
|
129
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
130
|
+
:raises ValueError: If nested model conversion fails
|
|
131
|
+
"""
|
|
132
|
+
m = m or dict()
|
|
133
|
+
if m.get('name') is not None:
|
|
134
|
+
self.name = m.get('name')
|
|
135
|
+
if m.get('id') is not None:
|
|
136
|
+
self.id = m.get('id')
|
|
137
|
+
if m.get('initSource') is not None:
|
|
138
|
+
self.init_source = m.get('initSource')
|
|
139
|
+
if m.get('modelFormat') is not None:
|
|
140
|
+
self.model_format = m.get('modelFormat')
|
|
141
|
+
if m.get('description') is not None:
|
|
142
|
+
self.description = m.get('description')
|
|
143
|
+
if m.get('createdAt') is not None:
|
|
144
|
+
self.created_at = m.get('createdAt')
|
|
145
|
+
if m.get('updatedAt') is not None:
|
|
146
|
+
self.updated_at = m.get('updatedAt')
|
|
147
|
+
if m.get('owner') is not None:
|
|
148
|
+
self.owner = m.get('owner')
|
|
149
|
+
if m.get('ownerName') is not None:
|
|
150
|
+
self.owner_name = m.get('ownerName')
|
|
151
|
+
if m.get('visibilityScope') is not None:
|
|
152
|
+
self.visibility_scope = m.get('visibilityScope')
|
|
153
|
+
if m.get('versionEntry') is not None:
|
|
154
|
+
self.version_entry = ModelVersionEntry().from_dict(m.get('versionEntry'))
|
|
155
|
+
return self
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for GetModelListV2Request information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class GetModelListV2Request(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
Request entity for GetModelListV2Request operation.
|
|
11
|
+
|
|
12
|
+
This class encapsulates all parameters for the API request.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, page_number=None, page_size=None):
|
|
16
|
+
"""
|
|
17
|
+
Initialize GetModelListV2Request request entity.
|
|
18
|
+
|
|
19
|
+
:param page_number: page_number parameter
|
|
20
|
+
:type page_number: int (optional)
|
|
21
|
+
|
|
22
|
+
:param page_size: page_size parameter
|
|
23
|
+
:type page_size: int (optional)
|
|
24
|
+
"""
|
|
25
|
+
super().__init__()
|
|
26
|
+
self.page_number = page_number
|
|
27
|
+
self.page_size = page_size
|
|
28
|
+
|
|
29
|
+
def to_dict(self):
|
|
30
|
+
"""
|
|
31
|
+
Convert the request entity to a dictionary representation.
|
|
32
|
+
|
|
33
|
+
Nested model objects are recursively converted to dictionaries.
|
|
34
|
+
|
|
35
|
+
:return: Dictionary representation of the request
|
|
36
|
+
:rtype: dict
|
|
37
|
+
"""
|
|
38
|
+
_map = super().to_dict()
|
|
39
|
+
if _map is not None:
|
|
40
|
+
return _map
|
|
41
|
+
result = dict()
|
|
42
|
+
return result
|
|
43
|
+
|
|
44
|
+
def from_dict(self, m):
|
|
45
|
+
"""
|
|
46
|
+
Populate the request entity from a dictionary.
|
|
47
|
+
|
|
48
|
+
Nested dictionaries are recursively converted to model objects.
|
|
49
|
+
|
|
50
|
+
:param m: Dictionary containing request data
|
|
51
|
+
:type m: dict
|
|
52
|
+
|
|
53
|
+
:return: Self reference for method chaining
|
|
54
|
+
:rtype: GetModelListV2Request
|
|
55
|
+
|
|
56
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
57
|
+
:raises ValueError: If nested model conversion fails
|
|
58
|
+
"""
|
|
59
|
+
m = m or dict()
|
|
60
|
+
if m.get('pageNumber') is not None:
|
|
61
|
+
self.page_number = m.get('pageNumber')
|
|
62
|
+
if m.get('pageSize') is not None:
|
|
63
|
+
self.page_size = m.get('pageSize')
|
|
64
|
+
return self
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for GetModelListV2Response information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.bce_response import BceResponse
|
|
6
|
+
from baiducloud_python_sdk_aihc.models.model import Model
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class GetModelListV2Response(BceResponse):
|
|
10
|
+
"""
|
|
11
|
+
GetModelListV2Response
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(self, total_count=None, models=None):
|
|
15
|
+
"""
|
|
16
|
+
Initialize GetModelListV2Response response.
|
|
17
|
+
|
|
18
|
+
:param total_count: 模型总数
|
|
19
|
+
:type total_count: int (optional)
|
|
20
|
+
|
|
21
|
+
:param models: 模型列表
|
|
22
|
+
:type models: List[Model] (optional)
|
|
23
|
+
"""
|
|
24
|
+
super().__init__()
|
|
25
|
+
self.total_count = total_count
|
|
26
|
+
self.models = models
|
|
27
|
+
|
|
28
|
+
def to_dict(self):
|
|
29
|
+
"""
|
|
30
|
+
Convert the response instance to a dictionary representation.
|
|
31
|
+
|
|
32
|
+
Includes metadata from the parent BceResponse class.
|
|
33
|
+
Nested model objects are recursively converted to dictionaries.
|
|
34
|
+
|
|
35
|
+
:return: Dictionary representation of the response
|
|
36
|
+
:rtype: dict
|
|
37
|
+
"""
|
|
38
|
+
_map = super().to_dict()
|
|
39
|
+
if _map is not None:
|
|
40
|
+
return _map
|
|
41
|
+
result = dict()
|
|
42
|
+
if self.metadata is not None:
|
|
43
|
+
result['metadata'] = dict(self.metadata)
|
|
44
|
+
if self.total_count is not None:
|
|
45
|
+
result['totalCount'] = self.total_count
|
|
46
|
+
if self.models is not None:
|
|
47
|
+
result['models'] = [i.to_dict() for i in self.models]
|
|
48
|
+
return result
|
|
49
|
+
|
|
50
|
+
def from_dict(self, m):
|
|
51
|
+
"""
|
|
52
|
+
Populate the response instance from a dictionary.
|
|
53
|
+
|
|
54
|
+
Nested dictionaries are recursively converted to model objects.
|
|
55
|
+
|
|
56
|
+
:param m: Dictionary containing response data
|
|
57
|
+
:type m: dict
|
|
58
|
+
|
|
59
|
+
:return: Self reference for method chaining
|
|
60
|
+
:rtype: GetModelListV2Response
|
|
61
|
+
|
|
62
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
63
|
+
:raises ValueError: If nested model conversion fails
|
|
64
|
+
"""
|
|
65
|
+
m = m or dict()
|
|
66
|
+
if m.get('totalCount') is not None:
|
|
67
|
+
self.total_count = m.get('totalCount')
|
|
68
|
+
if m.get('models') is not None:
|
|
69
|
+
self.models = [Model().from_dict(i) for i in m.get('models')]
|
|
70
|
+
return self
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for GetModelVersionDetailsV2Request information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class GetModelVersionDetailsV2Request(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
Request entity for GetModelVersionDetailsV2Request operation.
|
|
11
|
+
|
|
12
|
+
This class encapsulates all parameters for the API request.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, model_id, version_id):
|
|
16
|
+
"""
|
|
17
|
+
Initialize GetModelVersionDetailsV2Request request entity.
|
|
18
|
+
|
|
19
|
+
:param model_id: model_id parameter
|
|
20
|
+
:type model_id: str (required)
|
|
21
|
+
|
|
22
|
+
:param version_id: version_id parameter
|
|
23
|
+
:type version_id: str (required)
|
|
24
|
+
"""
|
|
25
|
+
super().__init__()
|
|
26
|
+
self.model_id = model_id
|
|
27
|
+
self.version_id = version_id
|
|
28
|
+
|
|
29
|
+
def to_dict(self):
|
|
30
|
+
"""
|
|
31
|
+
Convert the request entity to a dictionary representation.
|
|
32
|
+
|
|
33
|
+
Nested model objects are recursively converted to dictionaries.
|
|
34
|
+
|
|
35
|
+
:return: Dictionary representation of the request
|
|
36
|
+
:rtype: dict
|
|
37
|
+
"""
|
|
38
|
+
_map = super().to_dict()
|
|
39
|
+
if _map is not None:
|
|
40
|
+
return _map
|
|
41
|
+
result = dict()
|
|
42
|
+
return result
|
|
43
|
+
|
|
44
|
+
def from_dict(self, m):
|
|
45
|
+
"""
|
|
46
|
+
Populate the request entity from a dictionary.
|
|
47
|
+
|
|
48
|
+
Nested dictionaries are recursively converted to model objects.
|
|
49
|
+
|
|
50
|
+
:param m: Dictionary containing request data
|
|
51
|
+
:type m: dict
|
|
52
|
+
|
|
53
|
+
:return: Self reference for method chaining
|
|
54
|
+
:rtype: GetModelVersionDetailsV2Request
|
|
55
|
+
|
|
56
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
57
|
+
:raises ValueError: If nested model conversion fails
|
|
58
|
+
"""
|
|
59
|
+
m = m or dict()
|
|
60
|
+
if m.get('modelId') is not None:
|
|
61
|
+
self.model_id = m.get('modelId')
|
|
62
|
+
if m.get('versionId') is not None:
|
|
63
|
+
self.version_id = m.get('versionId')
|
|
64
|
+
return self
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for GetModelVersionDetailsV2Response information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.bce_response import BceResponse
|
|
6
|
+
from baiducloud_python_sdk_aihc.models.model_version_entry import ModelVersionEntry
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class GetModelVersionDetailsV2Response(BceResponse):
|
|
10
|
+
"""
|
|
11
|
+
GetModelVersionDetailsV2Response
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(
|
|
15
|
+
self,
|
|
16
|
+
name=None,
|
|
17
|
+
id=None,
|
|
18
|
+
init_source=None,
|
|
19
|
+
model_format=None,
|
|
20
|
+
description=None,
|
|
21
|
+
created_at=None,
|
|
22
|
+
updated_at=None,
|
|
23
|
+
owner=None,
|
|
24
|
+
owner_name=None,
|
|
25
|
+
visibility_scope=None,
|
|
26
|
+
version_entry=None,
|
|
27
|
+
):
|
|
28
|
+
"""
|
|
29
|
+
Initialize GetModelVersionDetailsV2Response response.
|
|
30
|
+
|
|
31
|
+
:param name: 模型名称
|
|
32
|
+
:type name: str (optional)
|
|
33
|
+
|
|
34
|
+
:param id: 模型ID
|
|
35
|
+
:type id: str (optional)
|
|
36
|
+
|
|
37
|
+
:param init_source: 模型创建时的来源UserUpload:用户上传
|
|
38
|
+
:type init_source: str (optional)
|
|
39
|
+
|
|
40
|
+
:param model_format: 模型格式
|
|
41
|
+
:type model_format: str (optional)
|
|
42
|
+
|
|
43
|
+
:param description: 描述
|
|
44
|
+
:type description: str (optional)
|
|
45
|
+
|
|
46
|
+
:param created_at: 模型创建时间
|
|
47
|
+
:type created_at: str (optional)
|
|
48
|
+
|
|
49
|
+
:param updated_at: 模型更新时间
|
|
50
|
+
:type updated_at: str (optional)
|
|
51
|
+
|
|
52
|
+
:param owner: 所有者
|
|
53
|
+
:type owner: str (optional)
|
|
54
|
+
|
|
55
|
+
:param owner_name: 所有者名称
|
|
56
|
+
:type owner_name: str (optional)
|
|
57
|
+
|
|
58
|
+
:param visibility_scope: 可见范围
|
|
59
|
+
:type visibility_scope: str (optional)
|
|
60
|
+
|
|
61
|
+
:param version_entry: version_entry field
|
|
62
|
+
:type version_entry: ModelVersionEntry (optional)
|
|
63
|
+
"""
|
|
64
|
+
super().__init__()
|
|
65
|
+
self.name = name
|
|
66
|
+
self.id = id
|
|
67
|
+
self.init_source = init_source
|
|
68
|
+
self.model_format = model_format
|
|
69
|
+
self.description = description
|
|
70
|
+
self.created_at = created_at
|
|
71
|
+
self.updated_at = updated_at
|
|
72
|
+
self.owner = owner
|
|
73
|
+
self.owner_name = owner_name
|
|
74
|
+
self.visibility_scope = visibility_scope
|
|
75
|
+
self.version_entry = version_entry
|
|
76
|
+
|
|
77
|
+
def to_dict(self):
|
|
78
|
+
"""
|
|
79
|
+
Convert the response instance to a dictionary representation.
|
|
80
|
+
|
|
81
|
+
Includes metadata from the parent BceResponse class.
|
|
82
|
+
Nested model objects are recursively converted to dictionaries.
|
|
83
|
+
|
|
84
|
+
:return: Dictionary representation of the response
|
|
85
|
+
:rtype: dict
|
|
86
|
+
"""
|
|
87
|
+
_map = super().to_dict()
|
|
88
|
+
if _map is not None:
|
|
89
|
+
return _map
|
|
90
|
+
result = dict()
|
|
91
|
+
if self.metadata is not None:
|
|
92
|
+
result['metadata'] = dict(self.metadata)
|
|
93
|
+
if self.name is not None:
|
|
94
|
+
result['name'] = self.name
|
|
95
|
+
if self.id is not None:
|
|
96
|
+
result['id'] = self.id
|
|
97
|
+
if self.init_source is not None:
|
|
98
|
+
result['initSource'] = self.init_source
|
|
99
|
+
if self.model_format is not None:
|
|
100
|
+
result['modelFormat'] = self.model_format
|
|
101
|
+
if self.description is not None:
|
|
102
|
+
result['description'] = self.description
|
|
103
|
+
if self.created_at is not None:
|
|
104
|
+
result['createdAt'] = self.created_at
|
|
105
|
+
if self.updated_at is not None:
|
|
106
|
+
result['updatedAt'] = self.updated_at
|
|
107
|
+
if self.owner is not None:
|
|
108
|
+
result['owner'] = self.owner
|
|
109
|
+
if self.owner_name is not None:
|
|
110
|
+
result['ownerName'] = self.owner_name
|
|
111
|
+
if self.visibility_scope is not None:
|
|
112
|
+
result['visibilityScope'] = self.visibility_scope
|
|
113
|
+
if self.version_entry is not None:
|
|
114
|
+
result['versionEntry'] = self.version_entry.to_dict()
|
|
115
|
+
return result
|
|
116
|
+
|
|
117
|
+
def from_dict(self, m):
|
|
118
|
+
"""
|
|
119
|
+
Populate the response instance from a dictionary.
|
|
120
|
+
|
|
121
|
+
Nested dictionaries are recursively converted to model objects.
|
|
122
|
+
|
|
123
|
+
:param m: Dictionary containing response data
|
|
124
|
+
:type m: dict
|
|
125
|
+
|
|
126
|
+
:return: Self reference for method chaining
|
|
127
|
+
:rtype: GetModelVersionDetailsV2Response
|
|
128
|
+
|
|
129
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
130
|
+
:raises ValueError: If nested model conversion fails
|
|
131
|
+
"""
|
|
132
|
+
m = m or dict()
|
|
133
|
+
if m.get('name') is not None:
|
|
134
|
+
self.name = m.get('name')
|
|
135
|
+
if m.get('id') is not None:
|
|
136
|
+
self.id = m.get('id')
|
|
137
|
+
if m.get('initSource') is not None:
|
|
138
|
+
self.init_source = m.get('initSource')
|
|
139
|
+
if m.get('modelFormat') is not None:
|
|
140
|
+
self.model_format = m.get('modelFormat')
|
|
141
|
+
if m.get('description') is not None:
|
|
142
|
+
self.description = m.get('description')
|
|
143
|
+
if m.get('createdAt') is not None:
|
|
144
|
+
self.created_at = m.get('createdAt')
|
|
145
|
+
if m.get('updatedAt') is not None:
|
|
146
|
+
self.updated_at = m.get('updatedAt')
|
|
147
|
+
if m.get('owner') is not None:
|
|
148
|
+
self.owner = m.get('owner')
|
|
149
|
+
if m.get('ownerName') is not None:
|
|
150
|
+
self.owner_name = m.get('ownerName')
|
|
151
|
+
if m.get('visibilityScope') is not None:
|
|
152
|
+
self.visibility_scope = m.get('visibilityScope')
|
|
153
|
+
if m.get('versionEntry') is not None:
|
|
154
|
+
self.version_entry = ModelVersionEntry().from_dict(m.get('versionEntry'))
|
|
155
|
+
return self
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Model information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Model(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
Model
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(
|
|
14
|
+
self,
|
|
15
|
+
id=None,
|
|
16
|
+
name=None,
|
|
17
|
+
init_source=None,
|
|
18
|
+
latest_version=None,
|
|
19
|
+
latest_version_id=None,
|
|
20
|
+
model_format=None,
|
|
21
|
+
description=None,
|
|
22
|
+
updated_at=None,
|
|
23
|
+
created_at=None,
|
|
24
|
+
owner=None,
|
|
25
|
+
owner_name=None,
|
|
26
|
+
visibility_scope=None,
|
|
27
|
+
):
|
|
28
|
+
"""
|
|
29
|
+
Initialize Model instance.
|
|
30
|
+
|
|
31
|
+
:param id: 否
|
|
32
|
+
:type id: str (optional)
|
|
33
|
+
|
|
34
|
+
:param name: 是
|
|
35
|
+
:type name: str (optional)
|
|
36
|
+
|
|
37
|
+
:param init_source: 是
|
|
38
|
+
:type init_source: str (optional)
|
|
39
|
+
|
|
40
|
+
:param latest_version: 否
|
|
41
|
+
:type latest_version: str (optional)
|
|
42
|
+
|
|
43
|
+
:param latest_version_id: 否
|
|
44
|
+
:type latest_version_id: str (optional)
|
|
45
|
+
|
|
46
|
+
:param model_format: 是
|
|
47
|
+
:type model_format: str (optional)
|
|
48
|
+
|
|
49
|
+
:param description: 否
|
|
50
|
+
:type description: str (optional)
|
|
51
|
+
|
|
52
|
+
:param updated_at: 否
|
|
53
|
+
:type updated_at: str (optional)
|
|
54
|
+
|
|
55
|
+
:param created_at: 否
|
|
56
|
+
:type created_at: str (optional)
|
|
57
|
+
|
|
58
|
+
:param owner: 是
|
|
59
|
+
:type owner: str (optional)
|
|
60
|
+
|
|
61
|
+
:param owner_name: 是
|
|
62
|
+
:type owner_name: str (optional)
|
|
63
|
+
|
|
64
|
+
:param visibility_scope: 是
|
|
65
|
+
:type visibility_scope: str (optional)
|
|
66
|
+
"""
|
|
67
|
+
super().__init__()
|
|
68
|
+
self.id = id
|
|
69
|
+
self.name = name
|
|
70
|
+
self.init_source = init_source
|
|
71
|
+
self.latest_version = latest_version
|
|
72
|
+
self.latest_version_id = latest_version_id
|
|
73
|
+
self.model_format = model_format
|
|
74
|
+
self.description = description
|
|
75
|
+
self.updated_at = updated_at
|
|
76
|
+
self.created_at = created_at
|
|
77
|
+
self.owner = owner
|
|
78
|
+
self.owner_name = owner_name
|
|
79
|
+
self.visibility_scope = visibility_scope
|
|
80
|
+
|
|
81
|
+
def to_dict(self):
|
|
82
|
+
"""
|
|
83
|
+
Convert the model instance to a dictionary representation.
|
|
84
|
+
|
|
85
|
+
Nested model objects are recursively converted to dictionaries.
|
|
86
|
+
|
|
87
|
+
:return: Dictionary representation of the model
|
|
88
|
+
:rtype: dict
|
|
89
|
+
"""
|
|
90
|
+
_map = super().to_dict()
|
|
91
|
+
if _map is not None:
|
|
92
|
+
return _map
|
|
93
|
+
result = dict()
|
|
94
|
+
if self.id is not None:
|
|
95
|
+
result['id'] = self.id
|
|
96
|
+
if self.name is not None:
|
|
97
|
+
result['name'] = self.name
|
|
98
|
+
if self.init_source is not None:
|
|
99
|
+
result['initSource'] = self.init_source
|
|
100
|
+
if self.latest_version is not None:
|
|
101
|
+
result['latestVersion'] = self.latest_version
|
|
102
|
+
if self.latest_version_id is not None:
|
|
103
|
+
result['latestVersionId'] = self.latest_version_id
|
|
104
|
+
if self.model_format is not None:
|
|
105
|
+
result['modelFormat'] = self.model_format
|
|
106
|
+
if self.description is not None:
|
|
107
|
+
result['description'] = self.description
|
|
108
|
+
if self.updated_at is not None:
|
|
109
|
+
result['updatedAt'] = self.updated_at
|
|
110
|
+
if self.created_at is not None:
|
|
111
|
+
result['createdAt'] = self.created_at
|
|
112
|
+
if self.owner is not None:
|
|
113
|
+
result['owner'] = self.owner
|
|
114
|
+
if self.owner_name is not None:
|
|
115
|
+
result['ownerName'] = self.owner_name
|
|
116
|
+
if self.visibility_scope is not None:
|
|
117
|
+
result['visibilityScope'] = self.visibility_scope
|
|
118
|
+
return result
|
|
119
|
+
|
|
120
|
+
def from_dict(self, m):
|
|
121
|
+
"""
|
|
122
|
+
Populate the model instance from a dictionary.
|
|
123
|
+
|
|
124
|
+
Nested dictionaries are recursively converted to model objects.
|
|
125
|
+
|
|
126
|
+
:param m: Dictionary containing model data
|
|
127
|
+
:type m: dict
|
|
128
|
+
|
|
129
|
+
:return: Self reference for method chaining
|
|
130
|
+
:rtype: Model
|
|
131
|
+
|
|
132
|
+
:raises TypeError: If input is not a dictionary type
|
|
133
|
+
:raises ValueError: If nested model conversion fails
|
|
134
|
+
"""
|
|
135
|
+
m = m or dict()
|
|
136
|
+
if m.get('id') is not None:
|
|
137
|
+
self.id = m.get('id')
|
|
138
|
+
if m.get('name') is not None:
|
|
139
|
+
self.name = m.get('name')
|
|
140
|
+
if m.get('initSource') is not None:
|
|
141
|
+
self.init_source = m.get('initSource')
|
|
142
|
+
if m.get('latestVersion') is not None:
|
|
143
|
+
self.latest_version = m.get('latestVersion')
|
|
144
|
+
if m.get('latestVersionId') is not None:
|
|
145
|
+
self.latest_version_id = m.get('latestVersionId')
|
|
146
|
+
if m.get('modelFormat') is not None:
|
|
147
|
+
self.model_format = m.get('modelFormat')
|
|
148
|
+
if m.get('description') is not None:
|
|
149
|
+
self.description = m.get('description')
|
|
150
|
+
if m.get('updatedAt') is not None:
|
|
151
|
+
self.updated_at = m.get('updatedAt')
|
|
152
|
+
if m.get('createdAt') is not None:
|
|
153
|
+
self.created_at = m.get('createdAt')
|
|
154
|
+
if m.get('owner') is not None:
|
|
155
|
+
self.owner = m.get('owner')
|
|
156
|
+
if m.get('ownerName') is not None:
|
|
157
|
+
self.owner_name = m.get('ownerName')
|
|
158
|
+
if m.get('visibilityScope') is not None:
|
|
159
|
+
self.visibility_scope = m.get('visibilityScope')
|
|
160
|
+
return self
|