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,231 @@
1
+ # coding: utf-8
2
+
3
+ import six
4
+
5
+ from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
6
+
7
+
8
+ class TaskListItemVo:
9
+
10
+ """
11
+ Attributes:
12
+ openapi_types (dict): The key is attribute name
13
+ and the value is attribute type.
14
+ attribute_map (dict): The key is attribute name
15
+ and the value is json key in definition.
16
+ """
17
+ sensitive_list = []
18
+
19
+ openapi_types = {
20
+ 'id': 'str',
21
+ 'status': 'str',
22
+ 'start_time': 'datetime',
23
+ 'end_time': 'datetime',
24
+ 'create_time': 'datetime'
25
+ }
26
+
27
+ attribute_map = {
28
+ 'id': 'id',
29
+ 'status': 'status',
30
+ 'start_time': 'start_time',
31
+ 'end_time': 'end_time',
32
+ 'create_time': 'create_time'
33
+ }
34
+
35
+ def __init__(self, id=None, status=None, start_time=None, end_time=None, create_time=None):
36
+ r"""TaskListItemVo
37
+
38
+ The model defined in huaweicloud sdk
39
+
40
+ :param id: 任务编号
41
+ :type id: str
42
+ :param status: 状态
43
+ :type status: str
44
+ :param start_time: 开始时间(UTC)
45
+ :type start_time: datetime
46
+ :param end_time: 结束时间(UTC)
47
+ :type end_time: datetime
48
+ :param create_time: 创建时间(UTC)
49
+ :type create_time: datetime
50
+ """
51
+
52
+
53
+
54
+ self._id = None
55
+ self._status = None
56
+ self._start_time = None
57
+ self._end_time = None
58
+ self._create_time = None
59
+ self.discriminator = None
60
+
61
+ if id is not None:
62
+ self.id = id
63
+ if status is not None:
64
+ self.status = status
65
+ if start_time is not None:
66
+ self.start_time = start_time
67
+ if end_time is not None:
68
+ self.end_time = end_time
69
+ if create_time is not None:
70
+ self.create_time = create_time
71
+
72
+ @property
73
+ def id(self):
74
+ r"""Gets the id of this TaskListItemVo.
75
+
76
+ 任务编号
77
+
78
+ :return: The id of this TaskListItemVo.
79
+ :rtype: str
80
+ """
81
+ return self._id
82
+
83
+ @id.setter
84
+ def id(self, id):
85
+ r"""Sets the id of this TaskListItemVo.
86
+
87
+ 任务编号
88
+
89
+ :param id: The id of this TaskListItemVo.
90
+ :type id: str
91
+ """
92
+ self._id = id
93
+
94
+ @property
95
+ def status(self):
96
+ r"""Gets the status of this TaskListItemVo.
97
+
98
+ 状态
99
+
100
+ :return: The status of this TaskListItemVo.
101
+ :rtype: str
102
+ """
103
+ return self._status
104
+
105
+ @status.setter
106
+ def status(self, status):
107
+ r"""Sets the status of this TaskListItemVo.
108
+
109
+ 状态
110
+
111
+ :param status: The status of this TaskListItemVo.
112
+ :type status: str
113
+ """
114
+ self._status = status
115
+
116
+ @property
117
+ def start_time(self):
118
+ r"""Gets the start_time of this TaskListItemVo.
119
+
120
+ 开始时间(UTC)
121
+
122
+ :return: The start_time of this TaskListItemVo.
123
+ :rtype: datetime
124
+ """
125
+ return self._start_time
126
+
127
+ @start_time.setter
128
+ def start_time(self, start_time):
129
+ r"""Sets the start_time of this TaskListItemVo.
130
+
131
+ 开始时间(UTC)
132
+
133
+ :param start_time: The start_time of this TaskListItemVo.
134
+ :type start_time: datetime
135
+ """
136
+ self._start_time = start_time
137
+
138
+ @property
139
+ def end_time(self):
140
+ r"""Gets the end_time of this TaskListItemVo.
141
+
142
+ 结束时间(UTC)
143
+
144
+ :return: The end_time of this TaskListItemVo.
145
+ :rtype: datetime
146
+ """
147
+ return self._end_time
148
+
149
+ @end_time.setter
150
+ def end_time(self, end_time):
151
+ r"""Sets the end_time of this TaskListItemVo.
152
+
153
+ 结束时间(UTC)
154
+
155
+ :param end_time: The end_time of this TaskListItemVo.
156
+ :type end_time: datetime
157
+ """
158
+ self._end_time = end_time
159
+
160
+ @property
161
+ def create_time(self):
162
+ r"""Gets the create_time of this TaskListItemVo.
163
+
164
+ 创建时间(UTC)
165
+
166
+ :return: The create_time of this TaskListItemVo.
167
+ :rtype: datetime
168
+ """
169
+ return self._create_time
170
+
171
+ @create_time.setter
172
+ def create_time(self, create_time):
173
+ r"""Sets the create_time of this TaskListItemVo.
174
+
175
+ 创建时间(UTC)
176
+
177
+ :param create_time: The create_time of this TaskListItemVo.
178
+ :type create_time: datetime
179
+ """
180
+ self._create_time = create_time
181
+
182
+ def to_dict(self):
183
+ """Returns the model properties as a dict"""
184
+ result = {}
185
+
186
+ for attr, _ in six.iteritems(self.openapi_types):
187
+ value = getattr(self, attr)
188
+ if isinstance(value, list):
189
+ result[attr] = list(map(
190
+ lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
191
+ value
192
+ ))
193
+ elif hasattr(value, "to_dict"):
194
+ result[attr] = value.to_dict()
195
+ elif isinstance(value, dict):
196
+ result[attr] = dict(map(
197
+ lambda item: (item[0], item[1].to_dict())
198
+ if hasattr(item[1], "to_dict") else item,
199
+ value.items()
200
+ ))
201
+ else:
202
+ if attr in self.sensitive_list:
203
+ result[attr] = "****"
204
+ else:
205
+ result[attr] = value
206
+
207
+ return result
208
+
209
+ def to_str(self):
210
+ """Returns the string representation of the model"""
211
+ import simplejson as json
212
+ if six.PY2:
213
+ import sys
214
+ reload(sys)
215
+ sys.setdefaultencoding("utf-8")
216
+ return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
217
+
218
+ def __repr__(self):
219
+ """For `print`"""
220
+ return self.to_str()
221
+
222
+ def __eq__(self, other):
223
+ """Returns true if both objects are equal"""
224
+ if not isinstance(other, TaskListItemVo):
225
+ return False
226
+
227
+ return self.__dict__ == other.__dict__
228
+
229
+ def __ne__(self, other):
230
+ """Returns true if both objects are not equal"""
231
+ return not self == other
@@ -0,0 +1,371 @@
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 'huaweicloudsdkoroas'")
16
+
17
+
18
+ class OroasAsyncClient(Client):
19
+ def __init__(self):
20
+ super(OroasAsyncClient, 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__ != "OroasAsyncClient":
29
+ raise TypeError("client type error, support client type is OroasAsyncClient")
30
+ client_builder = ClientBuilder(clazz)
31
+
32
+
33
+
34
+ return client_builder
35
+
36
+ def create_task_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 CreateTask
45
+ :type request: :class:`huaweicloudsdkoroas.v1.CreateTaskRequest`
46
+ :rtype: :class:`huaweicloudsdkoroas.v1.CreateTaskResponse`
47
+ """
48
+ http_info = self._create_task_http_info(request)
49
+ return self._call_api(**http_info)
50
+
51
+ def create_task_async_invoker(self, request):
52
+ http_info = self._create_task_http_info(request)
53
+ return AsyncInvoker(self, http_info)
54
+
55
+ def _create_task_http_info(self, 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_async(self, request):
108
+ r"""删除任务
109
+
110
+ 删除任务
111
+
112
+ Please refer to HUAWEI cloud API Explorer for details.
113
+
114
+
115
+ :param request: Request instance for DeleteTask
116
+ :type request: :class:`huaweicloudsdkoroas.v1.DeleteTaskRequest`
117
+ :rtype: :class:`huaweicloudsdkoroas.v1.DeleteTaskResponse`
118
+ """
119
+ http_info = self._delete_task_http_info(request)
120
+ return self._call_api(**http_info)
121
+
122
+ def delete_task_async_invoker(self, request):
123
+ http_info = self._delete_task_http_info(request)
124
+ return AsyncInvoker(self, http_info)
125
+
126
+ def _delete_task_http_info(self, 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_async(self, request):
179
+ r"""查询任务列表
180
+
181
+ 查询任务列表
182
+
183
+ Please refer to HUAWEI cloud API Explorer for details.
184
+
185
+
186
+ :param request: Request instance for ListTask
187
+ :type request: :class:`huaweicloudsdkoroas.v1.ListTaskRequest`
188
+ :rtype: :class:`huaweicloudsdkoroas.v1.ListTaskResponse`
189
+ """
190
+ http_info = self._list_task_http_info(request)
191
+ return self._call_api(**http_info)
192
+
193
+ def list_task_async_invoker(self, request):
194
+ http_info = self._list_task_http_info(request)
195
+ return AsyncInvoker(self, http_info)
196
+
197
+ def _list_task_http_info(self, 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_async(self, request):
252
+ r"""获取任务详情
253
+
254
+ 获取任务详情
255
+
256
+ Please refer to HUAWEI cloud API Explorer for details.
257
+
258
+
259
+ :param request: Request instance for ShowTask
260
+ :type request: :class:`huaweicloudsdkoroas.v1.ShowTaskRequest`
261
+ :rtype: :class:`huaweicloudsdkoroas.v1.ShowTaskResponse`
262
+ """
263
+ http_info = self._show_task_http_info(request)
264
+ return self._call_api(**http_info)
265
+
266
+ def show_task_async_invoker(self, request):
267
+ http_info = self._show_task_http_info(request)
268
+ return AsyncInvoker(self, http_info)
269
+
270
+ def _show_task_http_info(self, 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
+ kwargs["async_request"] = True
327
+ return self.do_http_request(**kwargs)
328
+ except TypeError:
329
+ import inspect
330
+ params = inspect.signature(self.do_http_request).parameters
331
+ http_info = {param_name: kwargs.get(param_name) for param_name in params if param_name in kwargs}
332
+ return self.do_http_request(**http_info)
333
+
334
+ def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None,
335
+ post_params=None, cname=None, response_type=None, response_headers=None, auth_settings=None,
336
+ collection_formats=None, request_type=None):
337
+ """Makes the HTTP request and returns deserialized data.
338
+
339
+ :param resource_path: Path to method endpoint.
340
+ :param method: Method to call.
341
+ :param path_params: Path parameters in the url.
342
+ :param query_params: Query parameters in the url.
343
+ :param header_params: Header parameters to be
344
+ placed in the request header.
345
+ :param body: Request body.
346
+ :param post_params: Request post form parameters,
347
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
348
+ :param cname: Used for obs endpoint.
349
+ :param auth_settings: Auth Settings names for the request.
350
+ :param response_type: Response data type.
351
+ :param response_headers: Header should be added to response data.
352
+ :param collection_formats: dict of collection formats for path, query,
353
+ header, and post parameters.
354
+ :param request_type: Request data type.
355
+ :return:
356
+ Return the response directly.
357
+ """
358
+ return self.do_http_request(
359
+ method=method,
360
+ resource_path=resource_path,
361
+ path_params=path_params,
362
+ query_params=query_params,
363
+ header_params=header_params,
364
+ body=body,
365
+ post_params=post_params,
366
+ cname=cname,
367
+ response_type=response_type,
368
+ response_headers=response_headers,
369
+ collection_formats=collection_formats,
370
+ request_type=request_type,
371
+ async_request=True)