huaweicloudsdkoroas 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.
@@ -0,0 +1,368 @@
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 'huaweicloudsdkoroas'")
16
+
17
+
18
+ class OroasClient(Client):
19
+ def __init__(self):
20
+ super(OroasClient, self).__init__()
21
+ self.model_package = importlib.import_module("huaweicloudsdkoroas.v1.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__ != "OroasClient":
29
+ raise TypeError("client type error, support client type is OroasClient")
30
+ client_builder = ClientBuilder(clazz)
31
+
32
+
33
+
34
+ return client_builder
35
+
36
+ def create_task(self, request):
37
+ r"""创建任务
38
+
39
+ 创建任务
40
+
41
+ Please refer to HUAWEI cloud API Explorer for details.
42
+
43
+ :param request: Request instance for CreateTask
44
+ :type request: :class:`huaweicloudsdkoroas.v1.CreateTaskRequest`
45
+ :rtype: :class:`huaweicloudsdkoroas.v1.CreateTaskResponse`
46
+ """
47
+ http_info = self._create_task_http_info(request)
48
+ return self._call_api(**http_info)
49
+
50
+ def create_task_invoker(self, request):
51
+ http_info = self._create_task_http_info(request)
52
+ return SyncInvoker(self, http_info)
53
+
54
+ @classmethod
55
+ def _create_task_http_info(cls, request):
56
+ http_info = {
57
+ "method": "POST",
58
+ "resource_path": "/v1/{project_id}/oroas/{service_group}/{service_type}/tasks",
59
+ "request_type": request.__class__.__name__,
60
+ "response_type": "CreateTaskResponse"
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_group' in local_var_params:
71
+ path_params['service_group'] = local_var_params['service_group']
72
+ if 'service_type' in local_var_params:
73
+ path_params['service_type'] = local_var_params['service_type']
74
+
75
+ query_params = []
76
+
77
+ header_params = {}
78
+ if 'x_apig_app_code' in local_var_params:
79
+ header_params['X-Apig-AppCode'] = local_var_params['x_apig_app_code']
80
+
81
+ form_params = {}
82
+
83
+ body = None
84
+ if 'body' in local_var_params:
85
+ body = local_var_params['body']
86
+ if isinstance(request, SdkStreamRequest):
87
+ body = request.get_file_stream()
88
+
89
+ response_headers = []
90
+
91
+ header_params['Content-Type'] = http_utils.select_header_content_type(
92
+ ['application/json;charset=utf-8'])
93
+
94
+ auth_settings = []
95
+
96
+ http_info["cname"] = cname
97
+ http_info["collection_formats"] = collection_formats
98
+ http_info["path_params"] = path_params
99
+ http_info["query_params"] = query_params
100
+ http_info["header_params"] = header_params
101
+ http_info["post_params"] = form_params
102
+ http_info["body"] = body
103
+ http_info["response_headers"] = response_headers
104
+
105
+ return http_info
106
+
107
+ def delete_task(self, request):
108
+ r"""删除任务
109
+
110
+ 删除任务
111
+
112
+ Please refer to HUAWEI cloud API Explorer for details.
113
+
114
+ :param request: Request instance for DeleteTask
115
+ :type request: :class:`huaweicloudsdkoroas.v1.DeleteTaskRequest`
116
+ :rtype: :class:`huaweicloudsdkoroas.v1.DeleteTaskResponse`
117
+ """
118
+ http_info = self._delete_task_http_info(request)
119
+ return self._call_api(**http_info)
120
+
121
+ def delete_task_invoker(self, request):
122
+ http_info = self._delete_task_http_info(request)
123
+ return SyncInvoker(self, http_info)
124
+
125
+ @classmethod
126
+ def _delete_task_http_info(cls, request):
127
+ http_info = {
128
+ "method": "DELETE",
129
+ "resource_path": "/v1/{project_id}/oroas/{service_group}/{service_type}/tasks/{task_id}",
130
+ "request_type": request.__class__.__name__,
131
+ "response_type": "DeleteTaskResponse"
132
+ }
133
+
134
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
135
+
136
+ cname = None
137
+
138
+ collection_formats = {}
139
+
140
+ path_params = {}
141
+ if 'service_group' in local_var_params:
142
+ path_params['service_group'] = local_var_params['service_group']
143
+ if 'service_type' in local_var_params:
144
+ path_params['service_type'] = local_var_params['service_type']
145
+ if 'task_id' in local_var_params:
146
+ path_params['task_id'] = local_var_params['task_id']
147
+
148
+ query_params = []
149
+
150
+ header_params = {}
151
+ if 'x_apig_app_code' in local_var_params:
152
+ header_params['X-Apig-AppCode'] = local_var_params['x_apig_app_code']
153
+
154
+ form_params = {}
155
+
156
+ body = None
157
+ if isinstance(request, SdkStreamRequest):
158
+ body = request.get_file_stream()
159
+
160
+ response_headers = []
161
+
162
+ header_params['Content-Type'] = http_utils.select_header_content_type(
163
+ ['application/json'])
164
+
165
+ auth_settings = []
166
+
167
+ http_info["cname"] = cname
168
+ http_info["collection_formats"] = collection_formats
169
+ http_info["path_params"] = path_params
170
+ http_info["query_params"] = query_params
171
+ http_info["header_params"] = header_params
172
+ http_info["post_params"] = form_params
173
+ http_info["body"] = body
174
+ http_info["response_headers"] = response_headers
175
+
176
+ return http_info
177
+
178
+ def list_task(self, request):
179
+ r"""查询任务列表
180
+
181
+ 查询任务列表
182
+
183
+ Please refer to HUAWEI cloud API Explorer for details.
184
+
185
+ :param request: Request instance for ListTask
186
+ :type request: :class:`huaweicloudsdkoroas.v1.ListTaskRequest`
187
+ :rtype: :class:`huaweicloudsdkoroas.v1.ListTaskResponse`
188
+ """
189
+ http_info = self._list_task_http_info(request)
190
+ return self._call_api(**http_info)
191
+
192
+ def list_task_invoker(self, request):
193
+ http_info = self._list_task_http_info(request)
194
+ return SyncInvoker(self, http_info)
195
+
196
+ @classmethod
197
+ def _list_task_http_info(cls, request):
198
+ http_info = {
199
+ "method": "GET",
200
+ "resource_path": "/v1/{project_id}/oroas/{service_group}/{service_type}/tasks",
201
+ "request_type": request.__class__.__name__,
202
+ "response_type": "ListTaskResponse"
203
+ }
204
+
205
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
206
+
207
+ cname = None
208
+
209
+ collection_formats = {}
210
+
211
+ path_params = {}
212
+ if 'service_group' in local_var_params:
213
+ path_params['service_group'] = local_var_params['service_group']
214
+ if 'service_type' in local_var_params:
215
+ path_params['service_type'] = local_var_params['service_type']
216
+
217
+ query_params = []
218
+ if 'limit' in local_var_params:
219
+ query_params.append(('limit', local_var_params['limit']))
220
+ if 'offset' in local_var_params:
221
+ query_params.append(('offset', local_var_params['offset']))
222
+
223
+ header_params = {}
224
+ if 'x_apig_app_code' in local_var_params:
225
+ header_params['X-Apig-AppCode'] = local_var_params['x_apig_app_code']
226
+
227
+ form_params = {}
228
+
229
+ body = None
230
+ if isinstance(request, SdkStreamRequest):
231
+ body = request.get_file_stream()
232
+
233
+ response_headers = []
234
+
235
+ header_params['Content-Type'] = http_utils.select_header_content_type(
236
+ ['application/json'])
237
+
238
+ auth_settings = []
239
+
240
+ http_info["cname"] = cname
241
+ http_info["collection_formats"] = collection_formats
242
+ http_info["path_params"] = path_params
243
+ http_info["query_params"] = query_params
244
+ http_info["header_params"] = header_params
245
+ http_info["post_params"] = form_params
246
+ http_info["body"] = body
247
+ http_info["response_headers"] = response_headers
248
+
249
+ return http_info
250
+
251
+ def show_task(self, request):
252
+ r"""获取任务详情
253
+
254
+ 获取任务详情
255
+
256
+ Please refer to HUAWEI cloud API Explorer for details.
257
+
258
+ :param request: Request instance for ShowTask
259
+ :type request: :class:`huaweicloudsdkoroas.v1.ShowTaskRequest`
260
+ :rtype: :class:`huaweicloudsdkoroas.v1.ShowTaskResponse`
261
+ """
262
+ http_info = self._show_task_http_info(request)
263
+ return self._call_api(**http_info)
264
+
265
+ def show_task_invoker(self, request):
266
+ http_info = self._show_task_http_info(request)
267
+ return SyncInvoker(self, http_info)
268
+
269
+ @classmethod
270
+ def _show_task_http_info(cls, request):
271
+ http_info = {
272
+ "method": "GET",
273
+ "resource_path": "/v1/{project_id}/oroas/{service_group}/{service_type}/tasks/{task_id}",
274
+ "request_type": request.__class__.__name__,
275
+ "response_type": "ShowTaskResponse"
276
+ }
277
+
278
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
279
+
280
+ cname = None
281
+
282
+ collection_formats = {}
283
+
284
+ path_params = {}
285
+ if 'service_group' in local_var_params:
286
+ path_params['service_group'] = local_var_params['service_group']
287
+ if 'service_type' in local_var_params:
288
+ path_params['service_type'] = local_var_params['service_type']
289
+ if 'task_id' in local_var_params:
290
+ path_params['task_id'] = local_var_params['task_id']
291
+
292
+ query_params = []
293
+ if 'input_enable' in local_var_params:
294
+ query_params.append(('input_enable', local_var_params['input_enable']))
295
+
296
+ header_params = {}
297
+ if 'x_apig_app_code' in local_var_params:
298
+ header_params['X-Apig-AppCode'] = local_var_params['x_apig_app_code']
299
+
300
+ form_params = {}
301
+
302
+ body = None
303
+ if isinstance(request, SdkStreamRequest):
304
+ body = request.get_file_stream()
305
+
306
+ response_headers = []
307
+
308
+ header_params['Content-Type'] = http_utils.select_header_content_type(
309
+ ['application/json'])
310
+
311
+ auth_settings = []
312
+
313
+ http_info["cname"] = cname
314
+ http_info["collection_formats"] = collection_formats
315
+ http_info["path_params"] = path_params
316
+ http_info["query_params"] = query_params
317
+ http_info["header_params"] = header_params
318
+ http_info["post_params"] = form_params
319
+ http_info["body"] = body
320
+ http_info["response_headers"] = response_headers
321
+
322
+ return http_info
323
+
324
+ def _call_api(self, **kwargs):
325
+ try:
326
+ return self.do_http_request(**kwargs)
327
+ except TypeError:
328
+ import inspect
329
+ params = inspect.signature(self.do_http_request).parameters
330
+ http_info = {param_name: kwargs.get(param_name) for param_name in params if param_name in kwargs}
331
+ return self.do_http_request(**http_info)
332
+
333
+ def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None,
334
+ post_params=None, cname=None, response_type=None, response_headers=None, auth_settings=None,
335
+ collection_formats=None, request_type=None):
336
+ """Makes the HTTP request and returns deserialized data.
337
+
338
+ :param resource_path: Path to method endpoint.
339
+ :param method: Method to call.
340
+ :param path_params: Path parameters in the url.
341
+ :param query_params: Query parameters in the url.
342
+ :param header_params: Header parameters to be placed in the request header.
343
+ :param body: Request body.
344
+ :param post_params: Request post form parameters,
345
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
346
+ :param cname: Used for obs endpoint.
347
+ :param auth_settings: Auth Settings names for the request.
348
+ :param response_type: Response data type.
349
+ :param response_headers: Header should be added to response data.
350
+ :param collection_formats: dict of collection formats for path, query,
351
+ header, and post parameters.
352
+ :param request_type: Request data type.
353
+ :return:
354
+ Return the response directly.
355
+ """
356
+ return self.do_http_request(
357
+ method=method,
358
+ resource_path=resource_path,
359
+ path_params=path_params,
360
+ query_params=query_params,
361
+ header_params=header_params,
362
+ body=body,
363
+ post_params=post_params,
364
+ cname=cname,
365
+ response_type=response_type,
366
+ response_headers=response_headers,
367
+ collection_formats=collection_formats,
368
+ request_type=request_type)
File without changes
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+
3
+ from huaweicloudsdkcore.region.region import Region
4
+ from huaweicloudsdkcore.region.provider import RegionProviderChain
5
+
6
+ class OroasRegion:
7
+ _PROVIDER = RegionProviderChain.get_default_region_provider_chain("OROAS")
8
+
9
+ CN_NORTH_4 = Region("cn-north-4",
10
+ "https://oroas.cn-north-7.huaweicloud.com")
11
+
12
+ static_fields = {
13
+ "cn-north-4": CN_NORTH_4,
14
+ }
15
+
16
+ @classmethod
17
+ def value_of(cls, region_id, static_fields=None):
18
+ if not region_id:
19
+ raise KeyError("Unexpected empty parameter: region_id")
20
+
21
+ fields = static_fields or cls.static_fields
22
+
23
+ region = cls._PROVIDER.get_region(region_id)
24
+ if region:
25
+ return region
26
+
27
+ if region_id in fields:
28
+ return fields.get(region_id)
29
+
30
+ raise KeyError("region_id '%s' is not in the following supported regions of service 'Oroas': [%s]" % (
31
+ region_id, ", ".join(sorted(fields.keys()))))
@@ -0,0 +1,13 @@
1
+ Copyright (c) Huawei Technologies Co., Ltd. 2020-present. All rights reserved.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
@@ -0,0 +1,26 @@
1
+ Metadata-Version: 2.1
2
+ Name: huaweicloudsdkoroas
3
+ Version: 3.1.160
4
+ Summary: OROAS
5
+ Home-page: https://github.com/huaweicloud/huaweicloud-sdk-python-v3
6
+ Author: HuaweiCloud SDK
7
+ Author-email: hwcloudsdk@huawei.com
8
+ License: Apache LICENSE 2.0
9
+ Keywords: huaweicloud,sdk,OROAS
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python :: 3.6
14
+ Classifier: Programming Language :: Python :: 3.7
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Software Development
21
+ Requires-Python: >=3.6
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: huaweicloudsdkcore>=3.1.160
25
+
26
+ See detailed information in [huaweicloud-sdk-python-v3](https://github.com/huaweicloud/huaweicloud-sdk-python-v3).
@@ -0,0 +1,22 @@
1
+ huaweicloudsdkoroas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ huaweicloudsdkoroas/v1/__init__.py,sha256=w1jlzFrXc-BJe7N15d8FQoR_WqVwlsmBffMaz0H5fgI,946
3
+ huaweicloudsdkoroas/v1/oroas_async_client.py,sha256=aa08P__7pomc5wgzZPbfYSFqPzZ7z4QwjXFF2uoTSJo,13151
4
+ huaweicloudsdkoroas/v1/oroas_client.py,sha256=Bdn_ZDpIWCzu5w7vxDjsMQqzQBw7dvkJBRX6cBx7Opg,13054
5
+ huaweicloudsdkoroas/v1/model/__init__.py,sha256=SBlhUe5R2SpnbF9Bf2YA-qe5ysgFp5kV1X1oAqHdWKQ,848
6
+ huaweicloudsdkoroas/v1/model/create_task_request.py,sha256=Ei4sdMwyyZZdjzRgawCyt_E7JnD6Gj1WOJ3WIXaoToA,6674
7
+ huaweicloudsdkoroas/v1/model/create_task_response.py,sha256=5xcH2M8G4hoULg2C7Oi6zJkvWY6lDBrGaDrYeWLcYhE,3158
8
+ huaweicloudsdkoroas/v1/model/delete_task_request.py,sha256=p7-0Mkk-jfp7oonhY4ReEhk2db6o3Yb4IHHfhx53YVM,6610
9
+ huaweicloudsdkoroas/v1/model/delete_task_response.py,sha256=_ez4nm-TtWVRSQgdeOEtuBEzv9gZpfo6nDaYBnFpWwE,2424
10
+ huaweicloudsdkoroas/v1/model/list_task_request.py,sha256=v_q7RmepZeJ5X7EWJ9scbJLMtXDGDHAGe9lm_JVbEpE,7759
11
+ huaweicloudsdkoroas/v1/model/list_task_response.py,sha256=2WqXcLG5ZVB9TSXZesjweaE4ltOeh2wUXQRm1H3Cu9c,3949
12
+ huaweicloudsdkoroas/v1/model/show_task_request.py,sha256=uv4vf_jnNtnPEgRENdPZnCYPCgQQy1YWzPa2IyMrV4M,7638
13
+ huaweicloudsdkoroas/v1/model/show_task_response.py,sha256=2cmNzMacX8-9V87DPtVi5ji-j7lneygsfstcxJlxhuA,11442
14
+ huaweicloudsdkoroas/v1/model/task_dto.py,sha256=r_QFiRTlHM4G3N7g15sQ461afmfS9z2km4pwNTWobMc,6877
15
+ huaweicloudsdkoroas/v1/model/task_list_item_vo.py,sha256=1rTf4fH62WPMHu1K3tXc80v4CSFUMJHFst12UNY2nnk,6060
16
+ huaweicloudsdkoroas/v1/region/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ huaweicloudsdkoroas/v1/region/oroas_region.py,sha256=97ZBngRX20OV3AokILuKRm-l8sCLv1xbMzygT04qEFk,967
18
+ huaweicloudsdkoroas-3.1.160.dist-info/LICENSE,sha256=4_VSTLuxcsybRG9N4Isktlj1rAIBBsfl0Tjc0gBTijo,604
19
+ huaweicloudsdkoroas-3.1.160.dist-info/METADATA,sha256=xGNUfiPmVbb8ykAjcqAmXz8vjCYbzJpZ9iNI4VhvK1Q,1070
20
+ huaweicloudsdkoroas-3.1.160.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
21
+ huaweicloudsdkoroas-3.1.160.dist-info/top_level.txt,sha256=onHz5byaB6CLNveBHKS-EnC82wxC_n_8EgJMuS_JkE0,20
22
+ huaweicloudsdkoroas-3.1.160.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.45.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ huaweicloudsdkoroas