huaweicloudsdkimagesearch 3.1.183__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.
- 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 +195 -0
- huaweicloudsdkimagesearch/v2/model/add_data_param.py +335 -0
- huaweicloudsdkimagesearch/v2/model/add_data_rest_info.py +104 -0
- huaweicloudsdkimagesearch/v2/model/add_data_rest_info_image_info.py +108 -0
- huaweicloudsdkimagesearch/v2/model/add_data_rest_info_image_info_objects.py +166 -0
- huaweicloudsdkimagesearch/v2/model/check_info.py +162 -0
- huaweicloudsdkimagesearch/v2/model/check_param.py +220 -0
- huaweicloudsdkimagesearch/v2/model/check_rest_info.py +187 -0
- huaweicloudsdkimagesearch/v2/model/delete_info.py +137 -0
- huaweicloudsdkimagesearch/v2/model/delete_param.py +195 -0
- huaweicloudsdkimagesearch/v2/model/delete_rest_info.py +133 -0
- huaweicloudsdkimagesearch/v2/model/delete_rest_info_items.py +108 -0
- huaweicloudsdkimagesearch/v2/model/item_source.py +195 -0
- huaweicloudsdkimagesearch/v2/model/range_param.py +137 -0
- huaweicloudsdkimagesearch/v2/model/run_add_data_request.py +132 -0
- huaweicloudsdkimagesearch/v2/model/run_add_data_response.py +137 -0
- huaweicloudsdkimagesearch/v2/model/run_check_data_request.py +132 -0
- huaweicloudsdkimagesearch/v2/model/run_check_data_response.py +137 -0
- huaweicloudsdkimagesearch/v2/model/run_delete_data_request.py +132 -0
- huaweicloudsdkimagesearch/v2/model/run_delete_data_response.py +137 -0
- huaweicloudsdkimagesearch/v2/model/run_search_request.py +132 -0
- huaweicloudsdkimagesearch/v2/model/run_search_response.py +137 -0
- huaweicloudsdkimagesearch/v2/model/run_update_data_request.py +132 -0
- huaweicloudsdkimagesearch/v2/model/run_update_data_response.py +112 -0
- huaweicloudsdkimagesearch/v2/model/search_after_param.py +137 -0
- huaweicloudsdkimagesearch/v2/model/search_info.py +191 -0
- huaweicloudsdkimagesearch/v2/model/search_item.py +162 -0
- huaweicloudsdkimagesearch/v2/model/search_optional_param.py +311 -0
- huaweicloudsdkimagesearch/v2/model/search_param.py +418 -0
- huaweicloudsdkimagesearch/v2/model/search_rest_info.py +158 -0
- huaweicloudsdkimagesearch/v2/model/search_rest_info_image_info.py +195 -0
- huaweicloudsdkimagesearch/v2/model/update_param.py +194 -0
- huaweicloudsdkimagesearch/v2/region/__init__.py +0 -0
- huaweicloudsdkimagesearch/v2/region/imagesearch_region.py +32 -0
- huaweicloudsdkimagesearch-3.1.183.dist-info/METADATA +25 -0
- huaweicloudsdkimagesearch-3.1.183.dist-info/RECORD +43 -0
- huaweicloudsdkimagesearch-3.1.183.dist-info/WHEEL +4 -0
- huaweicloudsdkimagesearch-3.1.183.dist-info/licenses/LICENSE +13 -0
|
File without changes
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
from __future__ import absolute_import
|
|
4
|
+
|
|
5
|
+
from huaweicloudsdkimagesearch.v2.imagesearch_client import ImageSearchClient
|
|
6
|
+
from huaweicloudsdkimagesearch.v2.imagesearch_async_client import ImageSearchAsyncClient
|
|
7
|
+
|
|
8
|
+
from huaweicloudsdkimagesearch.v2.model.add_data_optional_param import AddDataOptionalParam
|
|
9
|
+
from huaweicloudsdkimagesearch.v2.model.add_data_param import AddDataParam
|
|
10
|
+
from huaweicloudsdkimagesearch.v2.model.add_data_rest_info import AddDataRestInfo
|
|
11
|
+
from huaweicloudsdkimagesearch.v2.model.add_data_rest_info_image_info import AddDataRestInfoImageInfo
|
|
12
|
+
from huaweicloudsdkimagesearch.v2.model.add_data_rest_info_image_info_objects import AddDataRestInfoImageInfoObjects
|
|
13
|
+
from huaweicloudsdkimagesearch.v2.model.check_info import CheckInfo
|
|
14
|
+
from huaweicloudsdkimagesearch.v2.model.check_param import CheckParam
|
|
15
|
+
from huaweicloudsdkimagesearch.v2.model.check_rest_info import CheckRestInfo
|
|
16
|
+
from huaweicloudsdkimagesearch.v2.model.delete_info import DeleteInfo
|
|
17
|
+
from huaweicloudsdkimagesearch.v2.model.delete_param import DeleteParam
|
|
18
|
+
from huaweicloudsdkimagesearch.v2.model.delete_rest_info import DeleteRestInfo
|
|
19
|
+
from huaweicloudsdkimagesearch.v2.model.delete_rest_info_items import DeleteRestInfoItems
|
|
20
|
+
from huaweicloudsdkimagesearch.v2.model.item_source import ItemSource
|
|
21
|
+
from huaweicloudsdkimagesearch.v2.model.range_param import RangeParam
|
|
22
|
+
from huaweicloudsdkimagesearch.v2.model.run_add_data_request import RunAddDataRequest
|
|
23
|
+
from huaweicloudsdkimagesearch.v2.model.run_add_data_response import RunAddDataResponse
|
|
24
|
+
from huaweicloudsdkimagesearch.v2.model.run_check_data_request import RunCheckDataRequest
|
|
25
|
+
from huaweicloudsdkimagesearch.v2.model.run_check_data_response import RunCheckDataResponse
|
|
26
|
+
from huaweicloudsdkimagesearch.v2.model.run_delete_data_request import RunDeleteDataRequest
|
|
27
|
+
from huaweicloudsdkimagesearch.v2.model.run_delete_data_response import RunDeleteDataResponse
|
|
28
|
+
from huaweicloudsdkimagesearch.v2.model.run_search_request import RunSearchRequest
|
|
29
|
+
from huaweicloudsdkimagesearch.v2.model.run_search_response import RunSearchResponse
|
|
30
|
+
from huaweicloudsdkimagesearch.v2.model.run_update_data_request import RunUpdateDataRequest
|
|
31
|
+
from huaweicloudsdkimagesearch.v2.model.run_update_data_response import RunUpdateDataResponse
|
|
32
|
+
from huaweicloudsdkimagesearch.v2.model.search_after_param import SearchAfterParam
|
|
33
|
+
from huaweicloudsdkimagesearch.v2.model.search_info import SearchInfo
|
|
34
|
+
from huaweicloudsdkimagesearch.v2.model.search_item import SearchItem
|
|
35
|
+
from huaweicloudsdkimagesearch.v2.model.search_optional_param import SearchOptionalParam
|
|
36
|
+
from huaweicloudsdkimagesearch.v2.model.search_param import SearchParam
|
|
37
|
+
from huaweicloudsdkimagesearch.v2.model.search_rest_info import SearchRestInfo
|
|
38
|
+
from huaweicloudsdkimagesearch.v2.model.search_rest_info_image_info import SearchRestInfoImageInfo
|
|
39
|
+
from huaweicloudsdkimagesearch.v2.model.update_param import UpdateParam
|
|
40
|
+
|
|
@@ -0,0 +1,418 @@
|
|
|
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 AsyncInvoker
|
|
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 ImageSearchAsyncClient(Client):
|
|
19
|
+
def __init__(self):
|
|
20
|
+
super().__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__ != "ImageSearchAsyncClient":
|
|
29
|
+
raise TypeError("client type error, support client type is ImageSearchAsyncClient")
|
|
30
|
+
client_builder = ClientBuilder(clazz)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
return client_builder
|
|
35
|
+
|
|
36
|
+
def run_add_data_async(self, request):
|
|
37
|
+
r"""添加数据
|
|
38
|
+
|
|
39
|
+
添加数据到指定服务实例中。
|
|
40
|
+
|
|
41
|
+
Please refer to HUAWEI cloud API Explorer for details.
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
:param request: Request instance for RunAddData
|
|
45
|
+
:type request: :class:`huaweicloudsdkimagesearch.v2.RunAddDataRequest`
|
|
46
|
+
:rtype: :class:`huaweicloudsdkimagesearch.v2.RunAddDataResponse`
|
|
47
|
+
"""
|
|
48
|
+
http_info = self._run_add_data_http_info(request)
|
|
49
|
+
return self._call_api(**http_info)
|
|
50
|
+
|
|
51
|
+
def run_add_data_async_invoker(self, request):
|
|
52
|
+
http_info = self._run_add_data_http_info(request)
|
|
53
|
+
return AsyncInvoker(self, http_info)
|
|
54
|
+
|
|
55
|
+
def _run_add_data_http_info(self, 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_async(self, request):
|
|
104
|
+
r"""检查数据
|
|
105
|
+
|
|
106
|
+
检查指定服务实例中的对应数据,支持指定ID检查和条件检查。
|
|
107
|
+
|
|
108
|
+
Please refer to HUAWEI cloud API Explorer for details.
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
:param request: Request instance for RunCheckData
|
|
112
|
+
:type request: :class:`huaweicloudsdkimagesearch.v2.RunCheckDataRequest`
|
|
113
|
+
:rtype: :class:`huaweicloudsdkimagesearch.v2.RunCheckDataResponse`
|
|
114
|
+
"""
|
|
115
|
+
http_info = self._run_check_data_http_info(request)
|
|
116
|
+
return self._call_api(**http_info)
|
|
117
|
+
|
|
118
|
+
def run_check_data_async_invoker(self, request):
|
|
119
|
+
http_info = self._run_check_data_http_info(request)
|
|
120
|
+
return AsyncInvoker(self, http_info)
|
|
121
|
+
|
|
122
|
+
def _run_check_data_http_info(self, 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_async(self, request):
|
|
171
|
+
r"""删除数据
|
|
172
|
+
|
|
173
|
+
删除指定服务实例中的对应数据,支持指定ID删除和条件删除。
|
|
174
|
+
|
|
175
|
+
Please refer to HUAWEI cloud API Explorer for details.
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
:param request: Request instance for RunDeleteData
|
|
179
|
+
:type request: :class:`huaweicloudsdkimagesearch.v2.RunDeleteDataRequest`
|
|
180
|
+
:rtype: :class:`huaweicloudsdkimagesearch.v2.RunDeleteDataResponse`
|
|
181
|
+
"""
|
|
182
|
+
http_info = self._run_delete_data_http_info(request)
|
|
183
|
+
return self._call_api(**http_info)
|
|
184
|
+
|
|
185
|
+
def run_delete_data_async_invoker(self, request):
|
|
186
|
+
http_info = self._run_delete_data_http_info(request)
|
|
187
|
+
return AsyncInvoker(self, http_info)
|
|
188
|
+
|
|
189
|
+
def _run_delete_data_http_info(self, 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_async(self, request):
|
|
238
|
+
r"""搜索
|
|
239
|
+
|
|
240
|
+
从指定服务实例中进行搜索。
|
|
241
|
+
|
|
242
|
+
Please refer to HUAWEI cloud API Explorer for details.
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
:param request: Request instance for RunSearch
|
|
246
|
+
:type request: :class:`huaweicloudsdkimagesearch.v2.RunSearchRequest`
|
|
247
|
+
:rtype: :class:`huaweicloudsdkimagesearch.v2.RunSearchResponse`
|
|
248
|
+
"""
|
|
249
|
+
http_info = self._run_search_http_info(request)
|
|
250
|
+
return self._call_api(**http_info)
|
|
251
|
+
|
|
252
|
+
def run_search_async_invoker(self, request):
|
|
253
|
+
http_info = self._run_search_http_info(request)
|
|
254
|
+
return AsyncInvoker(self, http_info)
|
|
255
|
+
|
|
256
|
+
def _run_search_http_info(self, 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_async(self, request):
|
|
305
|
+
r"""更新数据
|
|
306
|
+
|
|
307
|
+
更新指定服务实例中的对应数据。
|
|
308
|
+
|
|
309
|
+
Please refer to HUAWEI cloud API Explorer for details.
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
:param request: Request instance for RunUpdateData
|
|
313
|
+
:type request: :class:`huaweicloudsdkimagesearch.v2.RunUpdateDataRequest`
|
|
314
|
+
:rtype: :class:`huaweicloudsdkimagesearch.v2.RunUpdateDataResponse`
|
|
315
|
+
"""
|
|
316
|
+
http_info = self._run_update_data_http_info(request)
|
|
317
|
+
return self._call_api(**http_info)
|
|
318
|
+
|
|
319
|
+
def run_update_data_async_invoker(self, request):
|
|
320
|
+
http_info = self._run_update_data_http_info(request)
|
|
321
|
+
return AsyncInvoker(self, http_info)
|
|
322
|
+
|
|
323
|
+
def _run_update_data_http_info(self, 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
|
+
kwargs["async_request"] = True
|
|
374
|
+
return self.do_http_request(**kwargs)
|
|
375
|
+
except TypeError:
|
|
376
|
+
import inspect
|
|
377
|
+
params = inspect.signature(self.do_http_request).parameters
|
|
378
|
+
http_info = {param_name: kwargs.get(param_name) for param_name in params if param_name in kwargs}
|
|
379
|
+
return self.do_http_request(**http_info)
|
|
380
|
+
|
|
381
|
+
def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None,
|
|
382
|
+
post_params=None, cname=None, response_type=None, response_headers=None, auth_settings=None,
|
|
383
|
+
collection_formats=None, request_type=None):
|
|
384
|
+
"""Makes the HTTP request and returns deserialized data.
|
|
385
|
+
|
|
386
|
+
:param resource_path: Path to method endpoint.
|
|
387
|
+
:param method: Method to call.
|
|
388
|
+
:param path_params: Path parameters in the url.
|
|
389
|
+
:param query_params: Query parameters in the url.
|
|
390
|
+
:param header_params: Header parameters to be
|
|
391
|
+
placed in the request header.
|
|
392
|
+
:param body: Request body.
|
|
393
|
+
:param post_params: Request post form parameters,
|
|
394
|
+
for `application/x-www-form-urlencoded`, `multipart/form-data`.
|
|
395
|
+
:param cname: Used for obs endpoint.
|
|
396
|
+
:param auth_settings: Auth Settings names for the request.
|
|
397
|
+
:param response_type: Response data type.
|
|
398
|
+
:param response_headers: Header should be added to response data.
|
|
399
|
+
:param collection_formats: dict of collection formats for path, query,
|
|
400
|
+
header, and post parameters.
|
|
401
|
+
:param request_type: Request data type.
|
|
402
|
+
:return:
|
|
403
|
+
Return the response directly.
|
|
404
|
+
"""
|
|
405
|
+
return self.do_http_request(
|
|
406
|
+
method=method,
|
|
407
|
+
resource_path=resource_path,
|
|
408
|
+
path_params=path_params,
|
|
409
|
+
query_params=query_params,
|
|
410
|
+
header_params=header_params,
|
|
411
|
+
body=body,
|
|
412
|
+
post_params=post_params,
|
|
413
|
+
cname=cname,
|
|
414
|
+
response_type=response_type,
|
|
415
|
+
response_headers=response_headers,
|
|
416
|
+
collection_formats=collection_formats,
|
|
417
|
+
request_type=request_type,
|
|
418
|
+
async_request=True)
|