huaweicloudsdkimagesearch 3.1.160__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 huaweicloudsdkimagesearch might be problematic. Click here for more details.
- huaweicloudsdkimagesearch/__init__.py +0 -0
- huaweicloudsdkimagesearch/v2/__init__.py +40 -0
- huaweicloudsdkimagesearch/v2/imagesearch_async_client.py +418 -0
- huaweicloudsdkimagesearch/v2/imagesearch_client.py +415 -0
- huaweicloudsdkimagesearch/v2/model/__init__.py +37 -0
- huaweicloudsdkimagesearch/v2/model/add_data_optional_param.py +202 -0
- huaweicloudsdkimagesearch/v2/model/add_data_param.py +342 -0
- huaweicloudsdkimagesearch/v2/model/add_data_rest_info.py +111 -0
- huaweicloudsdkimagesearch/v2/model/add_data_rest_info_image_info.py +115 -0
- huaweicloudsdkimagesearch/v2/model/add_data_rest_info_image_info_objects.py +173 -0
- huaweicloudsdkimagesearch/v2/model/check_info.py +169 -0
- huaweicloudsdkimagesearch/v2/model/check_param.py +227 -0
- huaweicloudsdkimagesearch/v2/model/check_rest_info.py +194 -0
- huaweicloudsdkimagesearch/v2/model/delete_info.py +144 -0
- huaweicloudsdkimagesearch/v2/model/delete_param.py +202 -0
- huaweicloudsdkimagesearch/v2/model/delete_rest_info.py +140 -0
- huaweicloudsdkimagesearch/v2/model/delete_rest_info_items.py +115 -0
- huaweicloudsdkimagesearch/v2/model/item_source.py +202 -0
- huaweicloudsdkimagesearch/v2/model/range_param.py +144 -0
- huaweicloudsdkimagesearch/v2/model/run_add_data_request.py +139 -0
- huaweicloudsdkimagesearch/v2/model/run_add_data_response.py +141 -0
- huaweicloudsdkimagesearch/v2/model/run_check_data_request.py +139 -0
- huaweicloudsdkimagesearch/v2/model/run_check_data_response.py +141 -0
- huaweicloudsdkimagesearch/v2/model/run_delete_data_request.py +139 -0
- huaweicloudsdkimagesearch/v2/model/run_delete_data_response.py +141 -0
- huaweicloudsdkimagesearch/v2/model/run_search_request.py +139 -0
- huaweicloudsdkimagesearch/v2/model/run_search_response.py +141 -0
- huaweicloudsdkimagesearch/v2/model/run_update_data_request.py +139 -0
- huaweicloudsdkimagesearch/v2/model/run_update_data_response.py +116 -0
- huaweicloudsdkimagesearch/v2/model/search_after_param.py +144 -0
- huaweicloudsdkimagesearch/v2/model/search_info.py +198 -0
- huaweicloudsdkimagesearch/v2/model/search_item.py +169 -0
- huaweicloudsdkimagesearch/v2/model/search_optional_param.py +318 -0
- huaweicloudsdkimagesearch/v2/model/search_param.py +425 -0
- huaweicloudsdkimagesearch/v2/model/search_rest_info.py +165 -0
- huaweicloudsdkimagesearch/v2/model/search_rest_info_image_info.py +202 -0
- huaweicloudsdkimagesearch/v2/model/update_param.py +201 -0
- huaweicloudsdkimagesearch/v2/region/__init__.py +0 -0
- huaweicloudsdkimagesearch/v2/region/imagesearch_region.py +32 -0
- huaweicloudsdkimagesearch-3.1.160.dist-info/LICENSE +13 -0
- huaweicloudsdkimagesearch-3.1.160.dist-info/METADATA +26 -0
- huaweicloudsdkimagesearch-3.1.160.dist-info/RECORD +44 -0
- huaweicloudsdkimagesearch-3.1.160.dist-info/WHEEL +5 -0
- huaweicloudsdkimagesearch-3.1.160.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
from __future__ import absolute_import
|
|
4
|
+
|
|
5
|
+
import importlib
|
|
6
|
+
import warnings
|
|
7
|
+
|
|
8
|
+
from huaweicloudsdkcore.client import Client, ClientBuilder
|
|
9
|
+
from huaweicloudsdkcore.utils import http_utils
|
|
10
|
+
from huaweicloudsdkcore.sdk_stream_request import SdkStreamRequest
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
from huaweicloudsdkcore.invoker.invoker import SyncInvoker
|
|
14
|
+
except ImportError as e:
|
|
15
|
+
warnings.warn(str(e) + ", please check if you are using the same versions of 'huaweicloudsdkcore' and 'huaweicloudsdkimagesearch'")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ImageSearchClient(Client):
|
|
19
|
+
def __init__(self):
|
|
20
|
+
super(ImageSearchClient, self).__init__()
|
|
21
|
+
self.model_package = importlib.import_module("huaweicloudsdkimagesearch.v2.model")
|
|
22
|
+
|
|
23
|
+
@classmethod
|
|
24
|
+
def new_builder(cls, clazz=None):
|
|
25
|
+
if not clazz:
|
|
26
|
+
client_builder = ClientBuilder(cls)
|
|
27
|
+
else:
|
|
28
|
+
if clazz.__name__ != "ImageSearchClient":
|
|
29
|
+
raise TypeError("client type error, support client type is ImageSearchClient")
|
|
30
|
+
client_builder = ClientBuilder(clazz)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
return client_builder
|
|
35
|
+
|
|
36
|
+
def run_add_data(self, request):
|
|
37
|
+
r"""添加数据
|
|
38
|
+
|
|
39
|
+
添加数据到指定服务实例中。
|
|
40
|
+
|
|
41
|
+
Please refer to HUAWEI cloud API Explorer for details.
|
|
42
|
+
|
|
43
|
+
:param request: Request instance for RunAddData
|
|
44
|
+
:type request: :class:`huaweicloudsdkimagesearch.v2.RunAddDataRequest`
|
|
45
|
+
:rtype: :class:`huaweicloudsdkimagesearch.v2.RunAddDataResponse`
|
|
46
|
+
"""
|
|
47
|
+
http_info = self._run_add_data_http_info(request)
|
|
48
|
+
return self._call_api(**http_info)
|
|
49
|
+
|
|
50
|
+
def run_add_data_invoker(self, request):
|
|
51
|
+
http_info = self._run_add_data_http_info(request)
|
|
52
|
+
return SyncInvoker(self, http_info)
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def _run_add_data_http_info(cls, request):
|
|
56
|
+
http_info = {
|
|
57
|
+
"method": "POST",
|
|
58
|
+
"resource_path": "/v2/{project_id}/mms/{service_name}/data/add",
|
|
59
|
+
"request_type": request.__class__.__name__,
|
|
60
|
+
"response_type": "RunAddDataResponse"
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
|
64
|
+
|
|
65
|
+
cname = None
|
|
66
|
+
|
|
67
|
+
collection_formats = {}
|
|
68
|
+
|
|
69
|
+
path_params = {}
|
|
70
|
+
if 'service_name' in local_var_params:
|
|
71
|
+
path_params['service_name'] = local_var_params['service_name']
|
|
72
|
+
|
|
73
|
+
query_params = []
|
|
74
|
+
|
|
75
|
+
header_params = {}
|
|
76
|
+
|
|
77
|
+
form_params = {}
|
|
78
|
+
|
|
79
|
+
body = None
|
|
80
|
+
if 'body' in local_var_params:
|
|
81
|
+
body = local_var_params['body']
|
|
82
|
+
if isinstance(request, SdkStreamRequest):
|
|
83
|
+
body = request.get_file_stream()
|
|
84
|
+
|
|
85
|
+
response_headers = []
|
|
86
|
+
|
|
87
|
+
header_params['Content-Type'] = http_utils.select_header_content_type(
|
|
88
|
+
['application/json'])
|
|
89
|
+
|
|
90
|
+
auth_settings = []
|
|
91
|
+
|
|
92
|
+
http_info["cname"] = cname
|
|
93
|
+
http_info["collection_formats"] = collection_formats
|
|
94
|
+
http_info["path_params"] = path_params
|
|
95
|
+
http_info["query_params"] = query_params
|
|
96
|
+
http_info["header_params"] = header_params
|
|
97
|
+
http_info["post_params"] = form_params
|
|
98
|
+
http_info["body"] = body
|
|
99
|
+
http_info["response_headers"] = response_headers
|
|
100
|
+
|
|
101
|
+
return http_info
|
|
102
|
+
|
|
103
|
+
def run_check_data(self, request):
|
|
104
|
+
r"""检查数据
|
|
105
|
+
|
|
106
|
+
检查指定服务实例中的对应数据,支持指定ID检查和条件检查。
|
|
107
|
+
|
|
108
|
+
Please refer to HUAWEI cloud API Explorer for details.
|
|
109
|
+
|
|
110
|
+
:param request: Request instance for RunCheckData
|
|
111
|
+
:type request: :class:`huaweicloudsdkimagesearch.v2.RunCheckDataRequest`
|
|
112
|
+
:rtype: :class:`huaweicloudsdkimagesearch.v2.RunCheckDataResponse`
|
|
113
|
+
"""
|
|
114
|
+
http_info = self._run_check_data_http_info(request)
|
|
115
|
+
return self._call_api(**http_info)
|
|
116
|
+
|
|
117
|
+
def run_check_data_invoker(self, request):
|
|
118
|
+
http_info = self._run_check_data_http_info(request)
|
|
119
|
+
return SyncInvoker(self, http_info)
|
|
120
|
+
|
|
121
|
+
@classmethod
|
|
122
|
+
def _run_check_data_http_info(cls, request):
|
|
123
|
+
http_info = {
|
|
124
|
+
"method": "POST",
|
|
125
|
+
"resource_path": "/v2/{project_id}/mms/{service_name}/data/check",
|
|
126
|
+
"request_type": request.__class__.__name__,
|
|
127
|
+
"response_type": "RunCheckDataResponse"
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
|
131
|
+
|
|
132
|
+
cname = None
|
|
133
|
+
|
|
134
|
+
collection_formats = {}
|
|
135
|
+
|
|
136
|
+
path_params = {}
|
|
137
|
+
if 'service_name' in local_var_params:
|
|
138
|
+
path_params['service_name'] = local_var_params['service_name']
|
|
139
|
+
|
|
140
|
+
query_params = []
|
|
141
|
+
|
|
142
|
+
header_params = {}
|
|
143
|
+
|
|
144
|
+
form_params = {}
|
|
145
|
+
|
|
146
|
+
body = None
|
|
147
|
+
if 'body' in local_var_params:
|
|
148
|
+
body = local_var_params['body']
|
|
149
|
+
if isinstance(request, SdkStreamRequest):
|
|
150
|
+
body = request.get_file_stream()
|
|
151
|
+
|
|
152
|
+
response_headers = []
|
|
153
|
+
|
|
154
|
+
header_params['Content-Type'] = http_utils.select_header_content_type(
|
|
155
|
+
['application/json'])
|
|
156
|
+
|
|
157
|
+
auth_settings = []
|
|
158
|
+
|
|
159
|
+
http_info["cname"] = cname
|
|
160
|
+
http_info["collection_formats"] = collection_formats
|
|
161
|
+
http_info["path_params"] = path_params
|
|
162
|
+
http_info["query_params"] = query_params
|
|
163
|
+
http_info["header_params"] = header_params
|
|
164
|
+
http_info["post_params"] = form_params
|
|
165
|
+
http_info["body"] = body
|
|
166
|
+
http_info["response_headers"] = response_headers
|
|
167
|
+
|
|
168
|
+
return http_info
|
|
169
|
+
|
|
170
|
+
def run_delete_data(self, request):
|
|
171
|
+
r"""删除数据
|
|
172
|
+
|
|
173
|
+
删除指定服务实例中的对应数据,支持指定ID删除和条件删除。
|
|
174
|
+
|
|
175
|
+
Please refer to HUAWEI cloud API Explorer for details.
|
|
176
|
+
|
|
177
|
+
:param request: Request instance for RunDeleteData
|
|
178
|
+
:type request: :class:`huaweicloudsdkimagesearch.v2.RunDeleteDataRequest`
|
|
179
|
+
:rtype: :class:`huaweicloudsdkimagesearch.v2.RunDeleteDataResponse`
|
|
180
|
+
"""
|
|
181
|
+
http_info = self._run_delete_data_http_info(request)
|
|
182
|
+
return self._call_api(**http_info)
|
|
183
|
+
|
|
184
|
+
def run_delete_data_invoker(self, request):
|
|
185
|
+
http_info = self._run_delete_data_http_info(request)
|
|
186
|
+
return SyncInvoker(self, http_info)
|
|
187
|
+
|
|
188
|
+
@classmethod
|
|
189
|
+
def _run_delete_data_http_info(cls, request):
|
|
190
|
+
http_info = {
|
|
191
|
+
"method": "POST",
|
|
192
|
+
"resource_path": "/v2/{project_id}/mms/{service_name}/data/delete",
|
|
193
|
+
"request_type": request.__class__.__name__,
|
|
194
|
+
"response_type": "RunDeleteDataResponse"
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
|
198
|
+
|
|
199
|
+
cname = None
|
|
200
|
+
|
|
201
|
+
collection_formats = {}
|
|
202
|
+
|
|
203
|
+
path_params = {}
|
|
204
|
+
if 'service_name' in local_var_params:
|
|
205
|
+
path_params['service_name'] = local_var_params['service_name']
|
|
206
|
+
|
|
207
|
+
query_params = []
|
|
208
|
+
|
|
209
|
+
header_params = {}
|
|
210
|
+
|
|
211
|
+
form_params = {}
|
|
212
|
+
|
|
213
|
+
body = None
|
|
214
|
+
if 'body' in local_var_params:
|
|
215
|
+
body = local_var_params['body']
|
|
216
|
+
if isinstance(request, SdkStreamRequest):
|
|
217
|
+
body = request.get_file_stream()
|
|
218
|
+
|
|
219
|
+
response_headers = []
|
|
220
|
+
|
|
221
|
+
header_params['Content-Type'] = http_utils.select_header_content_type(
|
|
222
|
+
['application/json'])
|
|
223
|
+
|
|
224
|
+
auth_settings = []
|
|
225
|
+
|
|
226
|
+
http_info["cname"] = cname
|
|
227
|
+
http_info["collection_formats"] = collection_formats
|
|
228
|
+
http_info["path_params"] = path_params
|
|
229
|
+
http_info["query_params"] = query_params
|
|
230
|
+
http_info["header_params"] = header_params
|
|
231
|
+
http_info["post_params"] = form_params
|
|
232
|
+
http_info["body"] = body
|
|
233
|
+
http_info["response_headers"] = response_headers
|
|
234
|
+
|
|
235
|
+
return http_info
|
|
236
|
+
|
|
237
|
+
def run_search(self, request):
|
|
238
|
+
r"""搜索
|
|
239
|
+
|
|
240
|
+
从指定服务实例中进行搜索。
|
|
241
|
+
|
|
242
|
+
Please refer to HUAWEI cloud API Explorer for details.
|
|
243
|
+
|
|
244
|
+
:param request: Request instance for RunSearch
|
|
245
|
+
:type request: :class:`huaweicloudsdkimagesearch.v2.RunSearchRequest`
|
|
246
|
+
:rtype: :class:`huaweicloudsdkimagesearch.v2.RunSearchResponse`
|
|
247
|
+
"""
|
|
248
|
+
http_info = self._run_search_http_info(request)
|
|
249
|
+
return self._call_api(**http_info)
|
|
250
|
+
|
|
251
|
+
def run_search_invoker(self, request):
|
|
252
|
+
http_info = self._run_search_http_info(request)
|
|
253
|
+
return SyncInvoker(self, http_info)
|
|
254
|
+
|
|
255
|
+
@classmethod
|
|
256
|
+
def _run_search_http_info(cls, request):
|
|
257
|
+
http_info = {
|
|
258
|
+
"method": "POST",
|
|
259
|
+
"resource_path": "/v2/{project_id}/mms/{service_name}/search",
|
|
260
|
+
"request_type": request.__class__.__name__,
|
|
261
|
+
"response_type": "RunSearchResponse"
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
|
265
|
+
|
|
266
|
+
cname = None
|
|
267
|
+
|
|
268
|
+
collection_formats = {}
|
|
269
|
+
|
|
270
|
+
path_params = {}
|
|
271
|
+
if 'service_name' in local_var_params:
|
|
272
|
+
path_params['service_name'] = local_var_params['service_name']
|
|
273
|
+
|
|
274
|
+
query_params = []
|
|
275
|
+
|
|
276
|
+
header_params = {}
|
|
277
|
+
|
|
278
|
+
form_params = {}
|
|
279
|
+
|
|
280
|
+
body = None
|
|
281
|
+
if 'body' in local_var_params:
|
|
282
|
+
body = local_var_params['body']
|
|
283
|
+
if isinstance(request, SdkStreamRequest):
|
|
284
|
+
body = request.get_file_stream()
|
|
285
|
+
|
|
286
|
+
response_headers = []
|
|
287
|
+
|
|
288
|
+
header_params['Content-Type'] = http_utils.select_header_content_type(
|
|
289
|
+
['application/json'])
|
|
290
|
+
|
|
291
|
+
auth_settings = []
|
|
292
|
+
|
|
293
|
+
http_info["cname"] = cname
|
|
294
|
+
http_info["collection_formats"] = collection_formats
|
|
295
|
+
http_info["path_params"] = path_params
|
|
296
|
+
http_info["query_params"] = query_params
|
|
297
|
+
http_info["header_params"] = header_params
|
|
298
|
+
http_info["post_params"] = form_params
|
|
299
|
+
http_info["body"] = body
|
|
300
|
+
http_info["response_headers"] = response_headers
|
|
301
|
+
|
|
302
|
+
return http_info
|
|
303
|
+
|
|
304
|
+
def run_update_data(self, request):
|
|
305
|
+
r"""更新数据
|
|
306
|
+
|
|
307
|
+
更新指定服务实例中的对应数据。
|
|
308
|
+
|
|
309
|
+
Please refer to HUAWEI cloud API Explorer for details.
|
|
310
|
+
|
|
311
|
+
:param request: Request instance for RunUpdateData
|
|
312
|
+
:type request: :class:`huaweicloudsdkimagesearch.v2.RunUpdateDataRequest`
|
|
313
|
+
:rtype: :class:`huaweicloudsdkimagesearch.v2.RunUpdateDataResponse`
|
|
314
|
+
"""
|
|
315
|
+
http_info = self._run_update_data_http_info(request)
|
|
316
|
+
return self._call_api(**http_info)
|
|
317
|
+
|
|
318
|
+
def run_update_data_invoker(self, request):
|
|
319
|
+
http_info = self._run_update_data_http_info(request)
|
|
320
|
+
return SyncInvoker(self, http_info)
|
|
321
|
+
|
|
322
|
+
@classmethod
|
|
323
|
+
def _run_update_data_http_info(cls, request):
|
|
324
|
+
http_info = {
|
|
325
|
+
"method": "POST",
|
|
326
|
+
"resource_path": "/v2/{project_id}/mms/{service_name}/data/update",
|
|
327
|
+
"request_type": request.__class__.__name__,
|
|
328
|
+
"response_type": "RunUpdateDataResponse"
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
|
332
|
+
|
|
333
|
+
cname = None
|
|
334
|
+
|
|
335
|
+
collection_formats = {}
|
|
336
|
+
|
|
337
|
+
path_params = {}
|
|
338
|
+
if 'service_name' in local_var_params:
|
|
339
|
+
path_params['service_name'] = local_var_params['service_name']
|
|
340
|
+
|
|
341
|
+
query_params = []
|
|
342
|
+
|
|
343
|
+
header_params = {}
|
|
344
|
+
|
|
345
|
+
form_params = {}
|
|
346
|
+
|
|
347
|
+
body = None
|
|
348
|
+
if 'body' in local_var_params:
|
|
349
|
+
body = local_var_params['body']
|
|
350
|
+
if isinstance(request, SdkStreamRequest):
|
|
351
|
+
body = request.get_file_stream()
|
|
352
|
+
|
|
353
|
+
response_headers = []
|
|
354
|
+
|
|
355
|
+
header_params['Content-Type'] = http_utils.select_header_content_type(
|
|
356
|
+
['application/json'])
|
|
357
|
+
|
|
358
|
+
auth_settings = []
|
|
359
|
+
|
|
360
|
+
http_info["cname"] = cname
|
|
361
|
+
http_info["collection_formats"] = collection_formats
|
|
362
|
+
http_info["path_params"] = path_params
|
|
363
|
+
http_info["query_params"] = query_params
|
|
364
|
+
http_info["header_params"] = header_params
|
|
365
|
+
http_info["post_params"] = form_params
|
|
366
|
+
http_info["body"] = body
|
|
367
|
+
http_info["response_headers"] = response_headers
|
|
368
|
+
|
|
369
|
+
return http_info
|
|
370
|
+
|
|
371
|
+
def _call_api(self, **kwargs):
|
|
372
|
+
try:
|
|
373
|
+
return self.do_http_request(**kwargs)
|
|
374
|
+
except TypeError:
|
|
375
|
+
import inspect
|
|
376
|
+
params = inspect.signature(self.do_http_request).parameters
|
|
377
|
+
http_info = {param_name: kwargs.get(param_name) for param_name in params if param_name in kwargs}
|
|
378
|
+
return self.do_http_request(**http_info)
|
|
379
|
+
|
|
380
|
+
def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None,
|
|
381
|
+
post_params=None, cname=None, response_type=None, response_headers=None, auth_settings=None,
|
|
382
|
+
collection_formats=None, request_type=None):
|
|
383
|
+
"""Makes the HTTP request and returns deserialized data.
|
|
384
|
+
|
|
385
|
+
:param resource_path: Path to method endpoint.
|
|
386
|
+
:param method: Method to call.
|
|
387
|
+
:param path_params: Path parameters in the url.
|
|
388
|
+
:param query_params: Query parameters in the url.
|
|
389
|
+
:param header_params: Header parameters to be placed in the request header.
|
|
390
|
+
:param body: Request body.
|
|
391
|
+
:param post_params: Request post form parameters,
|
|
392
|
+
for `application/x-www-form-urlencoded`, `multipart/form-data`.
|
|
393
|
+
:param cname: Used for obs endpoint.
|
|
394
|
+
:param auth_settings: Auth Settings names for the request.
|
|
395
|
+
:param response_type: Response data type.
|
|
396
|
+
:param response_headers: Header should be added to response data.
|
|
397
|
+
:param collection_formats: dict of collection formats for path, query,
|
|
398
|
+
header, and post parameters.
|
|
399
|
+
:param request_type: Request data type.
|
|
400
|
+
:return:
|
|
401
|
+
Return the response directly.
|
|
402
|
+
"""
|
|
403
|
+
return self.do_http_request(
|
|
404
|
+
method=method,
|
|
405
|
+
resource_path=resource_path,
|
|
406
|
+
path_params=path_params,
|
|
407
|
+
query_params=query_params,
|
|
408
|
+
header_params=header_params,
|
|
409
|
+
body=body,
|
|
410
|
+
post_params=post_params,
|
|
411
|
+
cname=cname,
|
|
412
|
+
response_type=response_type,
|
|
413
|
+
response_headers=response_headers,
|
|
414
|
+
collection_formats=collection_formats,
|
|
415
|
+
request_type=request_type)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
from __future__ import absolute_import
|
|
4
|
+
|
|
5
|
+
# import models into model package
|
|
6
|
+
from huaweicloudsdkimagesearch.v2.model.add_data_optional_param import AddDataOptionalParam
|
|
7
|
+
from huaweicloudsdkimagesearch.v2.model.add_data_param import AddDataParam
|
|
8
|
+
from huaweicloudsdkimagesearch.v2.model.add_data_rest_info import AddDataRestInfo
|
|
9
|
+
from huaweicloudsdkimagesearch.v2.model.add_data_rest_info_image_info import AddDataRestInfoImageInfo
|
|
10
|
+
from huaweicloudsdkimagesearch.v2.model.add_data_rest_info_image_info_objects import AddDataRestInfoImageInfoObjects
|
|
11
|
+
from huaweicloudsdkimagesearch.v2.model.check_info import CheckInfo
|
|
12
|
+
from huaweicloudsdkimagesearch.v2.model.check_param import CheckParam
|
|
13
|
+
from huaweicloudsdkimagesearch.v2.model.check_rest_info import CheckRestInfo
|
|
14
|
+
from huaweicloudsdkimagesearch.v2.model.delete_info import DeleteInfo
|
|
15
|
+
from huaweicloudsdkimagesearch.v2.model.delete_param import DeleteParam
|
|
16
|
+
from huaweicloudsdkimagesearch.v2.model.delete_rest_info import DeleteRestInfo
|
|
17
|
+
from huaweicloudsdkimagesearch.v2.model.delete_rest_info_items import DeleteRestInfoItems
|
|
18
|
+
from huaweicloudsdkimagesearch.v2.model.item_source import ItemSource
|
|
19
|
+
from huaweicloudsdkimagesearch.v2.model.range_param import RangeParam
|
|
20
|
+
from huaweicloudsdkimagesearch.v2.model.run_add_data_request import RunAddDataRequest
|
|
21
|
+
from huaweicloudsdkimagesearch.v2.model.run_add_data_response import RunAddDataResponse
|
|
22
|
+
from huaweicloudsdkimagesearch.v2.model.run_check_data_request import RunCheckDataRequest
|
|
23
|
+
from huaweicloudsdkimagesearch.v2.model.run_check_data_response import RunCheckDataResponse
|
|
24
|
+
from huaweicloudsdkimagesearch.v2.model.run_delete_data_request import RunDeleteDataRequest
|
|
25
|
+
from huaweicloudsdkimagesearch.v2.model.run_delete_data_response import RunDeleteDataResponse
|
|
26
|
+
from huaweicloudsdkimagesearch.v2.model.run_search_request import RunSearchRequest
|
|
27
|
+
from huaweicloudsdkimagesearch.v2.model.run_search_response import RunSearchResponse
|
|
28
|
+
from huaweicloudsdkimagesearch.v2.model.run_update_data_request import RunUpdateDataRequest
|
|
29
|
+
from huaweicloudsdkimagesearch.v2.model.run_update_data_response import RunUpdateDataResponse
|
|
30
|
+
from huaweicloudsdkimagesearch.v2.model.search_after_param import SearchAfterParam
|
|
31
|
+
from huaweicloudsdkimagesearch.v2.model.search_info import SearchInfo
|
|
32
|
+
from huaweicloudsdkimagesearch.v2.model.search_item import SearchItem
|
|
33
|
+
from huaweicloudsdkimagesearch.v2.model.search_optional_param import SearchOptionalParam
|
|
34
|
+
from huaweicloudsdkimagesearch.v2.model.search_param import SearchParam
|
|
35
|
+
from huaweicloudsdkimagesearch.v2.model.search_rest_info import SearchRestInfo
|
|
36
|
+
from huaweicloudsdkimagesearch.v2.model.search_rest_info_image_info import SearchRestInfoImageInfo
|
|
37
|
+
from huaweicloudsdkimagesearch.v2.model.update_param import UpdateParam
|
|
@@ -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 AddDataOptionalParam:
|
|
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
|
+
'do_det': 'bool',
|
|
21
|
+
'box': 'str',
|
|
22
|
+
'do_cls': 'bool',
|
|
23
|
+
'category': 'int'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
attribute_map = {
|
|
27
|
+
'do_det': 'do_det',
|
|
28
|
+
'box': 'box',
|
|
29
|
+
'do_cls': 'do_cls',
|
|
30
|
+
'category': 'category'
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
def __init__(self, do_det=None, box=None, do_cls=None, category=None):
|
|
34
|
+
r"""AddDataOptionalParam
|
|
35
|
+
|
|
36
|
+
The model defined in huaweicloud sdk
|
|
37
|
+
|
|
38
|
+
:param do_det: 是否进行目标检测,默认为true。
|
|
39
|
+
:type do_det: bool
|
|
40
|
+
:param box: 目标矩形框坐标,如给定则不进行目标检测,直接使用该box作为目标。格式为“x1,y1,x2,y2”(无空格),x1/y1为目标左上角坐标,x2/y2为目标右下角坐标,具体要求如下: - 0 <= x1 < x2 <= width,默认要求x2-x1 >= 15,具体可参考服务类型说明。 - 0 <= y1 < y2 <= height,默认要求y2-y1 >= 15,具体可参考服务类型说明。
|
|
41
|
+
:type box: str
|
|
42
|
+
:param do_cls: 是否进行对象分类,默认为true。
|
|
43
|
+
:type do_cls: bool
|
|
44
|
+
:param category: 对象类目,如给定则不进行对象分类,直接使用该category作为类目。具体类目信息可参见对应的服务类型说明。
|
|
45
|
+
:type category: int
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
self._do_det = None
|
|
51
|
+
self._box = None
|
|
52
|
+
self._do_cls = None
|
|
53
|
+
self._category = None
|
|
54
|
+
self.discriminator = None
|
|
55
|
+
|
|
56
|
+
if do_det is not None:
|
|
57
|
+
self.do_det = do_det
|
|
58
|
+
if box is not None:
|
|
59
|
+
self.box = box
|
|
60
|
+
if do_cls is not None:
|
|
61
|
+
self.do_cls = do_cls
|
|
62
|
+
if category is not None:
|
|
63
|
+
self.category = category
|
|
64
|
+
|
|
65
|
+
@property
|
|
66
|
+
def do_det(self):
|
|
67
|
+
r"""Gets the do_det of this AddDataOptionalParam.
|
|
68
|
+
|
|
69
|
+
是否进行目标检测,默认为true。
|
|
70
|
+
|
|
71
|
+
:return: The do_det of this AddDataOptionalParam.
|
|
72
|
+
:rtype: bool
|
|
73
|
+
"""
|
|
74
|
+
return self._do_det
|
|
75
|
+
|
|
76
|
+
@do_det.setter
|
|
77
|
+
def do_det(self, do_det):
|
|
78
|
+
r"""Sets the do_det of this AddDataOptionalParam.
|
|
79
|
+
|
|
80
|
+
是否进行目标检测,默认为true。
|
|
81
|
+
|
|
82
|
+
:param do_det: The do_det of this AddDataOptionalParam.
|
|
83
|
+
:type do_det: bool
|
|
84
|
+
"""
|
|
85
|
+
self._do_det = do_det
|
|
86
|
+
|
|
87
|
+
@property
|
|
88
|
+
def box(self):
|
|
89
|
+
r"""Gets the box of this AddDataOptionalParam.
|
|
90
|
+
|
|
91
|
+
目标矩形框坐标,如给定则不进行目标检测,直接使用该box作为目标。格式为“x1,y1,x2,y2”(无空格),x1/y1为目标左上角坐标,x2/y2为目标右下角坐标,具体要求如下: - 0 <= x1 < x2 <= width,默认要求x2-x1 >= 15,具体可参考服务类型说明。 - 0 <= y1 < y2 <= height,默认要求y2-y1 >= 15,具体可参考服务类型说明。
|
|
92
|
+
|
|
93
|
+
:return: The box of this AddDataOptionalParam.
|
|
94
|
+
:rtype: str
|
|
95
|
+
"""
|
|
96
|
+
return self._box
|
|
97
|
+
|
|
98
|
+
@box.setter
|
|
99
|
+
def box(self, box):
|
|
100
|
+
r"""Sets the box of this AddDataOptionalParam.
|
|
101
|
+
|
|
102
|
+
目标矩形框坐标,如给定则不进行目标检测,直接使用该box作为目标。格式为“x1,y1,x2,y2”(无空格),x1/y1为目标左上角坐标,x2/y2为目标右下角坐标,具体要求如下: - 0 <= x1 < x2 <= width,默认要求x2-x1 >= 15,具体可参考服务类型说明。 - 0 <= y1 < y2 <= height,默认要求y2-y1 >= 15,具体可参考服务类型说明。
|
|
103
|
+
|
|
104
|
+
:param box: The box of this AddDataOptionalParam.
|
|
105
|
+
:type box: str
|
|
106
|
+
"""
|
|
107
|
+
self._box = box
|
|
108
|
+
|
|
109
|
+
@property
|
|
110
|
+
def do_cls(self):
|
|
111
|
+
r"""Gets the do_cls of this AddDataOptionalParam.
|
|
112
|
+
|
|
113
|
+
是否进行对象分类,默认为true。
|
|
114
|
+
|
|
115
|
+
:return: The do_cls of this AddDataOptionalParam.
|
|
116
|
+
:rtype: bool
|
|
117
|
+
"""
|
|
118
|
+
return self._do_cls
|
|
119
|
+
|
|
120
|
+
@do_cls.setter
|
|
121
|
+
def do_cls(self, do_cls):
|
|
122
|
+
r"""Sets the do_cls of this AddDataOptionalParam.
|
|
123
|
+
|
|
124
|
+
是否进行对象分类,默认为true。
|
|
125
|
+
|
|
126
|
+
:param do_cls: The do_cls of this AddDataOptionalParam.
|
|
127
|
+
:type do_cls: bool
|
|
128
|
+
"""
|
|
129
|
+
self._do_cls = do_cls
|
|
130
|
+
|
|
131
|
+
@property
|
|
132
|
+
def category(self):
|
|
133
|
+
r"""Gets the category of this AddDataOptionalParam.
|
|
134
|
+
|
|
135
|
+
对象类目,如给定则不进行对象分类,直接使用该category作为类目。具体类目信息可参见对应的服务类型说明。
|
|
136
|
+
|
|
137
|
+
:return: The category of this AddDataOptionalParam.
|
|
138
|
+
:rtype: int
|
|
139
|
+
"""
|
|
140
|
+
return self._category
|
|
141
|
+
|
|
142
|
+
@category.setter
|
|
143
|
+
def category(self, category):
|
|
144
|
+
r"""Sets the category of this AddDataOptionalParam.
|
|
145
|
+
|
|
146
|
+
对象类目,如给定则不进行对象分类,直接使用该category作为类目。具体类目信息可参见对应的服务类型说明。
|
|
147
|
+
|
|
148
|
+
:param category: The category of this AddDataOptionalParam.
|
|
149
|
+
:type category: int
|
|
150
|
+
"""
|
|
151
|
+
self._category = category
|
|
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, AddDataOptionalParam):
|
|
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
|