maxcompute-tea-openapi 1.0.0__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.
- maxcompute_tea_openapi/__init__.py +1 -0
- maxcompute_tea_openapi/client.py +634 -0
- maxcompute_tea_openapi/models.py +319 -0
- maxcompute_tea_openapi-1.0.0.dist-info/METADATA +36 -0
- maxcompute_tea_openapi-1.0.0.dist-info/RECORD +7 -0
- maxcompute_tea_openapi-1.0.0.dist-info/WHEEL +5 -0
- maxcompute_tea_openapi-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.0.0"
|
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# This file is auto-generated, don't edit it. Thanks.
|
|
3
|
+
import time
|
|
4
|
+
|
|
5
|
+
from Tea.exceptions import TeaException, UnretryableException
|
|
6
|
+
from Tea.request import TeaRequest
|
|
7
|
+
from Tea.core import TeaCore
|
|
8
|
+
from Tea.model import TeaModel
|
|
9
|
+
from typing import Dict, Any
|
|
10
|
+
|
|
11
|
+
from alibabacloud_credentials.client import Client as CredentialClient
|
|
12
|
+
from maxcompute_tea_openapi import models as openapi_models
|
|
13
|
+
from alibabacloud_tea_util.client import Client as UtilClient
|
|
14
|
+
from alibabacloud_credentials import models as credential_models
|
|
15
|
+
from alibabacloud_tea_util import models as util_models
|
|
16
|
+
from maxcompute_tea_util.client import Client as McUtilClient
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class Client:
|
|
20
|
+
_endpoint: str = None
|
|
21
|
+
_project: str = None
|
|
22
|
+
_region_id: str = None
|
|
23
|
+
_protocol: str = None
|
|
24
|
+
_method: str = None
|
|
25
|
+
_user_agent: str = None
|
|
26
|
+
_read_timeout: int = None
|
|
27
|
+
_connect_timeout: int = None
|
|
28
|
+
_credential: CredentialClient = None
|
|
29
|
+
_signature_version: str = None
|
|
30
|
+
_headers: Dict[str, str] = None
|
|
31
|
+
_suffix: str = None
|
|
32
|
+
_global_parameters: openapi_models.GlobalParameters = None
|
|
33
|
+
|
|
34
|
+
def __init__(
|
|
35
|
+
self,
|
|
36
|
+
config: openapi_models.Config,
|
|
37
|
+
):
|
|
38
|
+
"""
|
|
39
|
+
Init client with Config
|
|
40
|
+
@param config: config contains the necessary information to create a client
|
|
41
|
+
"""
|
|
42
|
+
if UtilClient.is_unset(config):
|
|
43
|
+
raise TeaException({
|
|
44
|
+
'code': 'ParameterMissing',
|
|
45
|
+
'message': "'config' can not be unset"
|
|
46
|
+
})
|
|
47
|
+
if not UtilClient.empty(config.access_key_id) and not UtilClient.empty(config.access_key_secret):
|
|
48
|
+
if not UtilClient.empty(config.security_token):
|
|
49
|
+
config.type = 'sts'
|
|
50
|
+
else:
|
|
51
|
+
config.type = 'access_key'
|
|
52
|
+
credential_config = credential_models.Config(
|
|
53
|
+
access_key_id=config.access_key_id,
|
|
54
|
+
type=config.type,
|
|
55
|
+
access_key_secret=config.access_key_secret
|
|
56
|
+
)
|
|
57
|
+
credential_config.security_token = config.security_token
|
|
58
|
+
self._credential = CredentialClient(credential_config)
|
|
59
|
+
elif not UtilClient.empty(config.bearer_token):
|
|
60
|
+
cc = credential_models.Config(
|
|
61
|
+
type='bearer',
|
|
62
|
+
bearer_token=config.bearer_token
|
|
63
|
+
)
|
|
64
|
+
self._credential = CredentialClient(cc)
|
|
65
|
+
elif not UtilClient.is_unset(config.credential):
|
|
66
|
+
self._credential = config.credential
|
|
67
|
+
self._project = config.project
|
|
68
|
+
self._endpoint = config.endpoint
|
|
69
|
+
self._protocol = config.protocol
|
|
70
|
+
self._method = config.method
|
|
71
|
+
self._region_id = config.region_id
|
|
72
|
+
self._user_agent = config.user_agent
|
|
73
|
+
self._read_timeout = config.read_timeout
|
|
74
|
+
self._connect_timeout = config.connect_timeout
|
|
75
|
+
self._signature_version = config.signature_version
|
|
76
|
+
self._global_parameters = config.global_parameters
|
|
77
|
+
self._suffix = config.suffix
|
|
78
|
+
|
|
79
|
+
def do_request(
|
|
80
|
+
self,
|
|
81
|
+
params: openapi_models.Params,
|
|
82
|
+
request: openapi_models.OpenApiRequest,
|
|
83
|
+
runtime: util_models.RuntimeOptions,
|
|
84
|
+
) -> dict:
|
|
85
|
+
"""
|
|
86
|
+
Encapsulate the request and invoke the network
|
|
87
|
+
@param action: api name
|
|
88
|
+
@param version: product version
|
|
89
|
+
@param protocol: http or https
|
|
90
|
+
@param method: e.g. GET
|
|
91
|
+
@param auth_type: authorization type e.g. AK
|
|
92
|
+
@param body_type: response body type e.g. String
|
|
93
|
+
@param request: object of OpenApiRequest
|
|
94
|
+
@param runtime: which controls some details of call api, such as retry times
|
|
95
|
+
@return: the response
|
|
96
|
+
"""
|
|
97
|
+
params.validate()
|
|
98
|
+
request.validate()
|
|
99
|
+
runtime.validate()
|
|
100
|
+
_runtime = {
|
|
101
|
+
'timeouted': 'retry',
|
|
102
|
+
'readTimeout': UtilClient.default_number(runtime.read_timeout, self._read_timeout),
|
|
103
|
+
'connectTimeout': UtilClient.default_number(runtime.connect_timeout, self._connect_timeout),
|
|
104
|
+
'retry': {
|
|
105
|
+
'retryable': runtime.autoretry,
|
|
106
|
+
'maxAttempts': UtilClient.default_number(runtime.max_attempts, 3)
|
|
107
|
+
},
|
|
108
|
+
'backoff': {
|
|
109
|
+
'policy': UtilClient.default_string(runtime.backoff_policy, 'no'),
|
|
110
|
+
'period': UtilClient.default_number(runtime.backoff_period, 1)
|
|
111
|
+
},
|
|
112
|
+
'ignoreSSL': runtime.ignore_ssl
|
|
113
|
+
}
|
|
114
|
+
_last_request = None
|
|
115
|
+
_last_exception = None
|
|
116
|
+
_now = time.time()
|
|
117
|
+
_retry_times = 0
|
|
118
|
+
while TeaCore.allow_retry(_runtime.get('retry'), _retry_times, _now):
|
|
119
|
+
if _retry_times > 0:
|
|
120
|
+
_backoff_time = TeaCore.get_backoff_time(_runtime.get('backoff'), _retry_times)
|
|
121
|
+
if _backoff_time > 0:
|
|
122
|
+
TeaCore.sleep(_backoff_time)
|
|
123
|
+
_retry_times = _retry_times + 1
|
|
124
|
+
try:
|
|
125
|
+
_request = TeaRequest()
|
|
126
|
+
_request.protocol = UtilClient.default_string(self._protocol, params.protocol)
|
|
127
|
+
_request.method = params.method
|
|
128
|
+
if not UtilClient.is_unset(self._suffix):
|
|
129
|
+
_request.pathname = f'/{self._suffix}{params.pathname}'
|
|
130
|
+
else:
|
|
131
|
+
_request.pathname = params.pathname
|
|
132
|
+
global_queries = {}
|
|
133
|
+
global_headers = {}
|
|
134
|
+
if not UtilClient.is_unset(self._global_parameters):
|
|
135
|
+
global_params = self._global_parameters
|
|
136
|
+
if not UtilClient.is_unset(global_params.queries):
|
|
137
|
+
global_queries = global_params.queries
|
|
138
|
+
if not UtilClient.is_unset(global_params.headers):
|
|
139
|
+
global_headers = global_params.headers
|
|
140
|
+
extends_headers = {}
|
|
141
|
+
extends_queries = {}
|
|
142
|
+
if not UtilClient.is_unset(runtime.extends_parameters):
|
|
143
|
+
extends_parameters = runtime.extends_parameters
|
|
144
|
+
if not UtilClient.is_unset(extends_parameters.headers):
|
|
145
|
+
extends_headers = extends_parameters.headers
|
|
146
|
+
if not UtilClient.is_unset(extends_parameters.queries):
|
|
147
|
+
extends_queries = extends_parameters.queries
|
|
148
|
+
_request.query = TeaCore.merge(global_queries,
|
|
149
|
+
extends_queries,
|
|
150
|
+
request.query)
|
|
151
|
+
# endpoint is setted in product client
|
|
152
|
+
_request.headers = TeaCore.merge({
|
|
153
|
+
'host': self._endpoint,
|
|
154
|
+
'user-agent': self.get_user_agent(),
|
|
155
|
+
'x-odps-user-agent': self.get_user_agent(),
|
|
156
|
+
'Date': McUtilClient.get_api_timestamp()
|
|
157
|
+
}, global_headers,
|
|
158
|
+
extends_headers,
|
|
159
|
+
request.headers)
|
|
160
|
+
if not UtilClient.is_unset(request.stream):
|
|
161
|
+
tmp = UtilClient.read_as_bytes(request.stream)
|
|
162
|
+
_request.body = tmp
|
|
163
|
+
if not UtilClient.is_unset(request.body):
|
|
164
|
+
json_obj = UtilClient.to_jsonstring(request.body)
|
|
165
|
+
_request.body = json_obj
|
|
166
|
+
_request.headers['content-type'] = 'application/json; charset=utf-8'
|
|
167
|
+
canonical_string = McUtilClient.build_canonical_string(params.method, params.pathname, _request.query, _request.headers)
|
|
168
|
+
if not UtilClient.equal_string(params.auth_type, 'Anonymous'):
|
|
169
|
+
if UtilClient.is_unset(self._credential):
|
|
170
|
+
raise TeaException({
|
|
171
|
+
'code': f'InvalidCredentials',
|
|
172
|
+
'message': f'Please set up the credentials correctly. If you are setting them through environment variables, please ensure that ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET are set correctly. See https://help.aliyun.com/zh/sdk/developer-reference/configure-the-alibaba-cloud-accesskey-environment-variable-on-linux-macos-and-windows-systems for more details.'
|
|
173
|
+
})
|
|
174
|
+
credential_model = self._credential.get_credential()
|
|
175
|
+
auth_type = credential_model.type
|
|
176
|
+
if UtilClient.equal_string(auth_type, 'bearer'):
|
|
177
|
+
bearer_token = credential_model.bearer_token
|
|
178
|
+
_request.headers['x-odps-bearer-token'] = bearer_token
|
|
179
|
+
else:
|
|
180
|
+
access_key_id = credential_model.access_key_id
|
|
181
|
+
access_key_secret = credential_model.access_key_secret
|
|
182
|
+
security_token = credential_model.security_token
|
|
183
|
+
_request.headers['Authorization'] = McUtilClient.get_signature(canonical_string, access_key_id, access_key_secret)
|
|
184
|
+
if not UtilClient.empty(security_token):
|
|
185
|
+
_request.headers['authorization-sts-token'] = security_token
|
|
186
|
+
_last_request = _request
|
|
187
|
+
_response = TeaCore.do_action(_request, _runtime)
|
|
188
|
+
if UtilClient.equal_number(_response.status_code, 204):
|
|
189
|
+
return {
|
|
190
|
+
'headers': _response.headers
|
|
191
|
+
}
|
|
192
|
+
if UtilClient.is_4xx(_response.status_code) or UtilClient.is_5xx(_response.status_code):
|
|
193
|
+
err = {}
|
|
194
|
+
response_body = UtilClient.read_as_string(_response.body)
|
|
195
|
+
try:
|
|
196
|
+
_res = UtilClient.parse_json(response_body)
|
|
197
|
+
err = UtilClient.assert_as_map(_res)
|
|
198
|
+
except Exception as error:
|
|
199
|
+
err = {}
|
|
200
|
+
err['Code'] = 'Unknown'
|
|
201
|
+
err['Message'] = response_body
|
|
202
|
+
request_id = McUtilClient.to_string(self.default_any(_response.headers.get('x-odps-request-id'), _response.headers.get('X-Odps-Request-Id')))
|
|
203
|
+
err['statusCode'] = _response.status_code
|
|
204
|
+
raise TeaException({
|
|
205
|
+
'code': f"{self.default_any(err.get('Code'), err.get('code'))}",
|
|
206
|
+
'message': f"code: {_response.status_code}, {self.default_any(err.get('Message'), err.get('message'))} request id: {request_id}",
|
|
207
|
+
'data': err,
|
|
208
|
+
'description': f"{self.default_any(err.get('Description'), err.get('description'))}",
|
|
209
|
+
'accessDeniedDetail': self.default_any(err.get('AccessDeniedDetail'), err.get('accessDeniedDetail'))
|
|
210
|
+
})
|
|
211
|
+
if UtilClient.equal_string(params.body_type, 'binary'):
|
|
212
|
+
resp = {
|
|
213
|
+
'body': _response.body,
|
|
214
|
+
'headers': _response.headers,
|
|
215
|
+
'statusCode': _response.status_code
|
|
216
|
+
}
|
|
217
|
+
return resp
|
|
218
|
+
elif UtilClient.equal_string(params.body_type, 'byte'):
|
|
219
|
+
byt = UtilClient.read_as_bytes(_response.body)
|
|
220
|
+
return {
|
|
221
|
+
'body': byt,
|
|
222
|
+
'headers': _response.headers,
|
|
223
|
+
'statusCode': _response.status_code
|
|
224
|
+
}
|
|
225
|
+
elif UtilClient.equal_string(params.body_type, 'string'):
|
|
226
|
+
str = UtilClient.read_as_string(_response.body)
|
|
227
|
+
return {
|
|
228
|
+
'body': str,
|
|
229
|
+
'headers': _response.headers,
|
|
230
|
+
'statusCode': _response.status_code
|
|
231
|
+
}
|
|
232
|
+
elif UtilClient.equal_string(params.body_type, 'json'):
|
|
233
|
+
obj = UtilClient.read_as_json(_response.body)
|
|
234
|
+
res = UtilClient.assert_as_map(obj)
|
|
235
|
+
return res
|
|
236
|
+
elif UtilClient.equal_string(params.body_type, 'array'):
|
|
237
|
+
arr = UtilClient.read_as_json(_response.body)
|
|
238
|
+
return {
|
|
239
|
+
'body': arr,
|
|
240
|
+
'headers': _response.headers,
|
|
241
|
+
'statusCode': _response.status_code
|
|
242
|
+
}
|
|
243
|
+
else:
|
|
244
|
+
anything = UtilClient.read_as_string(_response.body)
|
|
245
|
+
return {
|
|
246
|
+
'body': anything,
|
|
247
|
+
'headers': _response.headers,
|
|
248
|
+
'statusCode': _response.status_code
|
|
249
|
+
}
|
|
250
|
+
except Exception as e:
|
|
251
|
+
if TeaCore.is_retryable(e):
|
|
252
|
+
_last_exception = e
|
|
253
|
+
continue
|
|
254
|
+
raise e
|
|
255
|
+
raise UnretryableException(_last_request, _last_exception)
|
|
256
|
+
|
|
257
|
+
async def do_request_async(
|
|
258
|
+
self,
|
|
259
|
+
params: openapi_models.Params,
|
|
260
|
+
request: openapi_models.OpenApiRequest,
|
|
261
|
+
runtime: util_models.RuntimeOptions,
|
|
262
|
+
) -> dict:
|
|
263
|
+
"""
|
|
264
|
+
Encapsulate the request and invoke the network
|
|
265
|
+
@param action: api name
|
|
266
|
+
@param version: product version
|
|
267
|
+
@param protocol: http or https
|
|
268
|
+
@param method: e.g. GET
|
|
269
|
+
@param auth_type: authorization type e.g. AK
|
|
270
|
+
@param body_type: response body type e.g. String
|
|
271
|
+
@param request: object of OpenApiRequest
|
|
272
|
+
@param runtime: which controls some details of call api, such as retry times
|
|
273
|
+
@return: the response
|
|
274
|
+
"""
|
|
275
|
+
params.validate()
|
|
276
|
+
request.validate()
|
|
277
|
+
runtime.validate()
|
|
278
|
+
_runtime = {
|
|
279
|
+
'timeouted': 'retry',
|
|
280
|
+
'readTimeout': UtilClient.default_number(runtime.read_timeout, self._read_timeout),
|
|
281
|
+
'connectTimeout': UtilClient.default_number(runtime.connect_timeout, self._connect_timeout),
|
|
282
|
+
'retry': {
|
|
283
|
+
'retryable': runtime.autoretry,
|
|
284
|
+
'maxAttempts': UtilClient.default_number(runtime.max_attempts, 3)
|
|
285
|
+
},
|
|
286
|
+
'backoff': {
|
|
287
|
+
'policy': UtilClient.default_string(runtime.backoff_policy, 'no'),
|
|
288
|
+
'period': UtilClient.default_number(runtime.backoff_period, 1)
|
|
289
|
+
},
|
|
290
|
+
'ignoreSSL': runtime.ignore_ssl
|
|
291
|
+
}
|
|
292
|
+
_last_request = None
|
|
293
|
+
_last_exception = None
|
|
294
|
+
_now = time.time()
|
|
295
|
+
_retry_times = 0
|
|
296
|
+
while TeaCore.allow_retry(_runtime.get('retry'), _retry_times, _now):
|
|
297
|
+
if _retry_times > 0:
|
|
298
|
+
_backoff_time = TeaCore.get_backoff_time(_runtime.get('backoff'), _retry_times)
|
|
299
|
+
if _backoff_time > 0:
|
|
300
|
+
TeaCore.sleep(_backoff_time)
|
|
301
|
+
_retry_times = _retry_times + 1
|
|
302
|
+
try:
|
|
303
|
+
_request = TeaRequest()
|
|
304
|
+
_request.protocol = UtilClient.default_string(self._protocol, params.protocol)
|
|
305
|
+
_request.method = params.method
|
|
306
|
+
if not UtilClient.is_unset(self._suffix):
|
|
307
|
+
_request.pathname = f'/{self._suffix}{params.pathname}'
|
|
308
|
+
else:
|
|
309
|
+
_request.pathname = params.pathname
|
|
310
|
+
global_queries = {}
|
|
311
|
+
global_headers = {}
|
|
312
|
+
if not UtilClient.is_unset(self._global_parameters):
|
|
313
|
+
global_params = self._global_parameters
|
|
314
|
+
if not UtilClient.is_unset(global_params.queries):
|
|
315
|
+
global_queries = global_params.queries
|
|
316
|
+
if not UtilClient.is_unset(global_params.headers):
|
|
317
|
+
global_headers = global_params.headers
|
|
318
|
+
extends_headers = {}
|
|
319
|
+
extends_queries = {}
|
|
320
|
+
if not UtilClient.is_unset(runtime.extends_parameters):
|
|
321
|
+
extends_parameters = runtime.extends_parameters
|
|
322
|
+
if not UtilClient.is_unset(extends_parameters.headers):
|
|
323
|
+
extends_headers = extends_parameters.headers
|
|
324
|
+
if not UtilClient.is_unset(extends_parameters.queries):
|
|
325
|
+
extends_queries = extends_parameters.queries
|
|
326
|
+
_request.query = TeaCore.merge(global_queries,
|
|
327
|
+
extends_queries,
|
|
328
|
+
request.query)
|
|
329
|
+
# endpoint is setted in product client
|
|
330
|
+
_request.headers = TeaCore.merge({
|
|
331
|
+
'host': self._endpoint,
|
|
332
|
+
'user-agent': self.get_user_agent(),
|
|
333
|
+
'x-odps-user-agent': self.get_user_agent(),
|
|
334
|
+
'Date': McUtilClient.get_api_timestamp()
|
|
335
|
+
}, global_headers,
|
|
336
|
+
extends_headers,
|
|
337
|
+
request.headers)
|
|
338
|
+
if not UtilClient.is_unset(request.stream):
|
|
339
|
+
tmp = await UtilClient.read_as_bytes_async(request.stream)
|
|
340
|
+
_request.body = tmp
|
|
341
|
+
if not UtilClient.is_unset(request.body):
|
|
342
|
+
json_obj = UtilClient.to_jsonstring(request.body)
|
|
343
|
+
_request.body = json_obj
|
|
344
|
+
_request.headers['content-type'] = 'application/json; charset=utf-8'
|
|
345
|
+
canonical_string = McUtilClient.build_canonical_string(params.method, params.pathname, _request.query, _request.headers)
|
|
346
|
+
if not UtilClient.equal_string(params.auth_type, 'Anonymous'):
|
|
347
|
+
if UtilClient.is_unset(self._credential):
|
|
348
|
+
raise TeaException({
|
|
349
|
+
'code': f'InvalidCredentials',
|
|
350
|
+
'message': f'Please set up the credentials correctly. If you are setting them through environment variables, please ensure that ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET are set correctly. See https://help.aliyun.com/zh/sdk/developer-reference/configure-the-alibaba-cloud-accesskey-environment-variable-on-linux-macos-and-windows-systems for more details.'
|
|
351
|
+
})
|
|
352
|
+
credential_model = await self._credential.get_credential_async()
|
|
353
|
+
auth_type = credential_model.type
|
|
354
|
+
if UtilClient.equal_string(auth_type, 'bearer'):
|
|
355
|
+
bearer_token = credential_model.bearer_token
|
|
356
|
+
_request.headers['x-odps-bearer-token'] = bearer_token
|
|
357
|
+
else:
|
|
358
|
+
access_key_id = credential_model.access_key_id
|
|
359
|
+
access_key_secret = credential_model.access_key_secret
|
|
360
|
+
security_token = credential_model.security_token
|
|
361
|
+
_request.headers['Authorization'] = McUtilClient.get_signature(canonical_string, access_key_id, access_key_secret)
|
|
362
|
+
if not UtilClient.empty(security_token):
|
|
363
|
+
_request.headers['authorization-sts-token'] = security_token
|
|
364
|
+
_last_request = _request
|
|
365
|
+
_response = await TeaCore.async_do_action(_request, _runtime)
|
|
366
|
+
if UtilClient.equal_number(_response.status_code, 204):
|
|
367
|
+
return {
|
|
368
|
+
'headers': _response.headers
|
|
369
|
+
}
|
|
370
|
+
if UtilClient.is_4xx(_response.status_code) or UtilClient.is_5xx(_response.status_code):
|
|
371
|
+
err = {}
|
|
372
|
+
response_body = await UtilClient.read_as_string_async(_response.body)
|
|
373
|
+
try:
|
|
374
|
+
_res = UtilClient.parse_json(response_body)
|
|
375
|
+
err = UtilClient.assert_as_map(_res)
|
|
376
|
+
except Exception as error:
|
|
377
|
+
err = {}
|
|
378
|
+
err['Code'] = 'Unknown'
|
|
379
|
+
err['Message'] = response_body
|
|
380
|
+
request_id = McUtilClient.to_string(self.default_any(_response.headers.get('x-odps-request-id'), _response.headers.get('X-Odps-Request-Id')))
|
|
381
|
+
err['statusCode'] = _response.status_code
|
|
382
|
+
raise TeaException({
|
|
383
|
+
'code': f"{self.default_any(err.get('Code'), err.get('code'))}",
|
|
384
|
+
'message': f"code: {_response.status_code}, {self.default_any(err.get('Message'), err.get('message'))} request id: {request_id}",
|
|
385
|
+
'data': err,
|
|
386
|
+
'description': f"{self.default_any(err.get('Description'), err.get('description'))}",
|
|
387
|
+
'accessDeniedDetail': self.default_any(err.get('AccessDeniedDetail'), err.get('accessDeniedDetail'))
|
|
388
|
+
})
|
|
389
|
+
if UtilClient.equal_string(params.body_type, 'binary'):
|
|
390
|
+
resp = {
|
|
391
|
+
'body': _response.body,
|
|
392
|
+
'headers': _response.headers,
|
|
393
|
+
'statusCode': _response.status_code
|
|
394
|
+
}
|
|
395
|
+
return resp
|
|
396
|
+
elif UtilClient.equal_string(params.body_type, 'byte'):
|
|
397
|
+
byt = await UtilClient.read_as_bytes_async(_response.body)
|
|
398
|
+
return {
|
|
399
|
+
'body': byt,
|
|
400
|
+
'headers': _response.headers,
|
|
401
|
+
'statusCode': _response.status_code
|
|
402
|
+
}
|
|
403
|
+
elif UtilClient.equal_string(params.body_type, 'string'):
|
|
404
|
+
str = await UtilClient.read_as_string_async(_response.body)
|
|
405
|
+
return {
|
|
406
|
+
'body': str,
|
|
407
|
+
'headers': _response.headers,
|
|
408
|
+
'statusCode': _response.status_code
|
|
409
|
+
}
|
|
410
|
+
elif UtilClient.equal_string(params.body_type, 'json'):
|
|
411
|
+
obj = await UtilClient.read_as_json_async(_response.body)
|
|
412
|
+
res = UtilClient.assert_as_map(obj)
|
|
413
|
+
return res
|
|
414
|
+
elif UtilClient.equal_string(params.body_type, 'array'):
|
|
415
|
+
arr = await UtilClient.read_as_json_async(_response.body)
|
|
416
|
+
return {
|
|
417
|
+
'body': arr,
|
|
418
|
+
'headers': _response.headers,
|
|
419
|
+
'statusCode': _response.status_code
|
|
420
|
+
}
|
|
421
|
+
else:
|
|
422
|
+
anything = await UtilClient.read_as_string_async(_response.body)
|
|
423
|
+
return {
|
|
424
|
+
'body': anything,
|
|
425
|
+
'headers': _response.headers,
|
|
426
|
+
'statusCode': _response.status_code
|
|
427
|
+
}
|
|
428
|
+
except Exception as e:
|
|
429
|
+
if TeaCore.is_retryable(e):
|
|
430
|
+
_last_exception = e
|
|
431
|
+
continue
|
|
432
|
+
raise e
|
|
433
|
+
raise UnretryableException(_last_request, _last_exception)
|
|
434
|
+
|
|
435
|
+
def request_with_model(
|
|
436
|
+
self,
|
|
437
|
+
model: TeaModel,
|
|
438
|
+
method: str,
|
|
439
|
+
path: str,
|
|
440
|
+
runtime: util_models.RuntimeOptions,
|
|
441
|
+
) -> dict:
|
|
442
|
+
UtilClient.validate_model(model)
|
|
443
|
+
req = openapi_models.OpenApiRequest(
|
|
444
|
+
body=UtilClient.to_map(model)
|
|
445
|
+
)
|
|
446
|
+
openapi_params = openapi_models.Params(
|
|
447
|
+
pathname=path,
|
|
448
|
+
method=method,
|
|
449
|
+
body_type='json'
|
|
450
|
+
)
|
|
451
|
+
return self.call_api(openapi_params, req, runtime)
|
|
452
|
+
|
|
453
|
+
async def request_with_model_async(
|
|
454
|
+
self,
|
|
455
|
+
model: TeaModel,
|
|
456
|
+
method: str,
|
|
457
|
+
path: str,
|
|
458
|
+
runtime: util_models.RuntimeOptions,
|
|
459
|
+
) -> dict:
|
|
460
|
+
UtilClient.validate_model(model)
|
|
461
|
+
req = openapi_models.OpenApiRequest(
|
|
462
|
+
body=UtilClient.to_map(model)
|
|
463
|
+
)
|
|
464
|
+
openapi_params = openapi_models.Params(
|
|
465
|
+
pathname=path,
|
|
466
|
+
method=method,
|
|
467
|
+
body_type='json'
|
|
468
|
+
)
|
|
469
|
+
return await self.call_api_async(openapi_params, req, runtime)
|
|
470
|
+
|
|
471
|
+
def request_without_model(
|
|
472
|
+
self,
|
|
473
|
+
model: TeaModel,
|
|
474
|
+
method: str,
|
|
475
|
+
path: str,
|
|
476
|
+
runtime: util_models.RuntimeOptions,
|
|
477
|
+
) -> dict:
|
|
478
|
+
UtilClient.validate_model(model)
|
|
479
|
+
req = openapi_models.OpenApiRequest(
|
|
480
|
+
body=UtilClient.to_map(model)
|
|
481
|
+
)
|
|
482
|
+
openapi_params = openapi_models.Params(
|
|
483
|
+
pathname=path,
|
|
484
|
+
method=method,
|
|
485
|
+
body_type='none'
|
|
486
|
+
)
|
|
487
|
+
return self.call_api(openapi_params, req, runtime)
|
|
488
|
+
|
|
489
|
+
async def request_without_model_async(
|
|
490
|
+
self,
|
|
491
|
+
model: TeaModel,
|
|
492
|
+
method: str,
|
|
493
|
+
path: str,
|
|
494
|
+
runtime: util_models.RuntimeOptions,
|
|
495
|
+
) -> dict:
|
|
496
|
+
UtilClient.validate_model(model)
|
|
497
|
+
req = openapi_models.OpenApiRequest(
|
|
498
|
+
body=UtilClient.to_map(model)
|
|
499
|
+
)
|
|
500
|
+
openapi_params = openapi_models.Params(
|
|
501
|
+
pathname=path,
|
|
502
|
+
method=method,
|
|
503
|
+
body_type='none'
|
|
504
|
+
)
|
|
505
|
+
return await self.call_api_async(openapi_params, req, runtime)
|
|
506
|
+
|
|
507
|
+
def call_api(
|
|
508
|
+
self,
|
|
509
|
+
params: openapi_models.Params,
|
|
510
|
+
request: openapi_models.OpenApiRequest,
|
|
511
|
+
runtime: util_models.RuntimeOptions,
|
|
512
|
+
) -> dict:
|
|
513
|
+
if UtilClient.is_unset(params):
|
|
514
|
+
raise TeaException({
|
|
515
|
+
'code': 'ParameterMissing',
|
|
516
|
+
'message': "'params' can not be unset"
|
|
517
|
+
})
|
|
518
|
+
return self.do_request(params, request, runtime)
|
|
519
|
+
|
|
520
|
+
async def call_api_async(
|
|
521
|
+
self,
|
|
522
|
+
params: openapi_models.Params,
|
|
523
|
+
request: openapi_models.OpenApiRequest,
|
|
524
|
+
runtime: util_models.RuntimeOptions,
|
|
525
|
+
) -> dict:
|
|
526
|
+
if UtilClient.is_unset(params):
|
|
527
|
+
raise TeaException({
|
|
528
|
+
'code': 'ParameterMissing',
|
|
529
|
+
'message': "'params' can not be unset"
|
|
530
|
+
})
|
|
531
|
+
return await self.do_request_async(params, request, runtime)
|
|
532
|
+
|
|
533
|
+
def get_user_agent(self) -> str:
|
|
534
|
+
"""
|
|
535
|
+
Get user agent
|
|
536
|
+
@return: user agent
|
|
537
|
+
"""
|
|
538
|
+
user_agent = UtilClient.get_user_agent(self._user_agent)
|
|
539
|
+
return user_agent
|
|
540
|
+
|
|
541
|
+
def get_access_key_id(self) -> str:
|
|
542
|
+
"""
|
|
543
|
+
Get accesskey id by using credential
|
|
544
|
+
@return: accesskey id
|
|
545
|
+
"""
|
|
546
|
+
if UtilClient.is_unset(self._credential):
|
|
547
|
+
return ''
|
|
548
|
+
access_key_id = self._credential.get_access_key_id()
|
|
549
|
+
return access_key_id
|
|
550
|
+
|
|
551
|
+
async def get_access_key_id_async(self) -> str:
|
|
552
|
+
"""
|
|
553
|
+
Get accesskey id by using credential
|
|
554
|
+
@return: accesskey id
|
|
555
|
+
"""
|
|
556
|
+
if UtilClient.is_unset(self._credential):
|
|
557
|
+
return ''
|
|
558
|
+
access_key_id = await self._credential.get_access_key_id_async()
|
|
559
|
+
return access_key_id
|
|
560
|
+
|
|
561
|
+
def get_access_key_secret(self) -> str:
|
|
562
|
+
"""
|
|
563
|
+
Get accesskey secret by using credential
|
|
564
|
+
@return: accesskey secret
|
|
565
|
+
"""
|
|
566
|
+
if UtilClient.is_unset(self._credential):
|
|
567
|
+
return ''
|
|
568
|
+
secret = self._credential.get_access_key_secret()
|
|
569
|
+
return secret
|
|
570
|
+
|
|
571
|
+
async def get_access_key_secret_async(self) -> str:
|
|
572
|
+
"""
|
|
573
|
+
Get accesskey secret by using credential
|
|
574
|
+
@return: accesskey secret
|
|
575
|
+
"""
|
|
576
|
+
if UtilClient.is_unset(self._credential):
|
|
577
|
+
return ''
|
|
578
|
+
secret = await self._credential.get_access_key_secret_async()
|
|
579
|
+
return secret
|
|
580
|
+
|
|
581
|
+
def get_security_token(self) -> str:
|
|
582
|
+
"""
|
|
583
|
+
Get security token by using credential
|
|
584
|
+
@return: security token
|
|
585
|
+
"""
|
|
586
|
+
if UtilClient.is_unset(self._credential):
|
|
587
|
+
return ''
|
|
588
|
+
token = self._credential.get_security_token()
|
|
589
|
+
return token
|
|
590
|
+
|
|
591
|
+
async def get_security_token_async(self) -> str:
|
|
592
|
+
"""
|
|
593
|
+
Get security token by using credential
|
|
594
|
+
@return: security token
|
|
595
|
+
"""
|
|
596
|
+
if UtilClient.is_unset(self._credential):
|
|
597
|
+
return ''
|
|
598
|
+
token = await self._credential.get_security_token_async()
|
|
599
|
+
return token
|
|
600
|
+
|
|
601
|
+
def get_bearer_token(self) -> str:
|
|
602
|
+
"""
|
|
603
|
+
Get bearer token by credential
|
|
604
|
+
@return: bearer token
|
|
605
|
+
"""
|
|
606
|
+
if UtilClient.is_unset(self._credential):
|
|
607
|
+
return ''
|
|
608
|
+
token = self._credential.get_bearer_token()
|
|
609
|
+
return token
|
|
610
|
+
|
|
611
|
+
async def get_bearer_token_async(self) -> str:
|
|
612
|
+
"""
|
|
613
|
+
Get bearer token by credential
|
|
614
|
+
@return: bearer token
|
|
615
|
+
"""
|
|
616
|
+
if UtilClient.is_unset(self._credential):
|
|
617
|
+
return ''
|
|
618
|
+
token = self._credential.get_bearer_token()
|
|
619
|
+
return token
|
|
620
|
+
|
|
621
|
+
@staticmethod
|
|
622
|
+
def default_any(
|
|
623
|
+
input_value: Any,
|
|
624
|
+
default_value: Any,
|
|
625
|
+
) -> Any:
|
|
626
|
+
"""
|
|
627
|
+
If inputValue is not null, return it or return defaultValue
|
|
628
|
+
@param input_value: users input value
|
|
629
|
+
@param default_value: default value
|
|
630
|
+
@return: the final result
|
|
631
|
+
"""
|
|
632
|
+
if UtilClient.is_unset(input_value):
|
|
633
|
+
return default_value
|
|
634
|
+
return input_value
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# This file is auto-generated, don't edit it. Thanks.
|
|
3
|
+
from Tea.model import TeaModel
|
|
4
|
+
from typing import Dict, Any, BinaryIO
|
|
5
|
+
|
|
6
|
+
from alibabacloud_credentials.client import Client as CredentialClient
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class GlobalParameters(TeaModel):
|
|
10
|
+
def __init__(
|
|
11
|
+
self,
|
|
12
|
+
headers: Dict[str, str] = None,
|
|
13
|
+
queries: Dict[str, str] = None,
|
|
14
|
+
):
|
|
15
|
+
self.headers = headers
|
|
16
|
+
self.queries = queries
|
|
17
|
+
|
|
18
|
+
def validate(self):
|
|
19
|
+
pass
|
|
20
|
+
|
|
21
|
+
def to_map(self):
|
|
22
|
+
_map = super().to_map()
|
|
23
|
+
if _map is not None:
|
|
24
|
+
return _map
|
|
25
|
+
|
|
26
|
+
result = dict()
|
|
27
|
+
if self.headers is not None:
|
|
28
|
+
result['headers'] = self.headers
|
|
29
|
+
if self.queries is not None:
|
|
30
|
+
result['queries'] = self.queries
|
|
31
|
+
return result
|
|
32
|
+
|
|
33
|
+
def from_map(self, m: dict = None):
|
|
34
|
+
m = m or dict()
|
|
35
|
+
if m.get('headers') is not None:
|
|
36
|
+
self.headers = m.get('headers')
|
|
37
|
+
if m.get('queries') is not None:
|
|
38
|
+
self.queries = m.get('queries')
|
|
39
|
+
return self
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class Config(TeaModel):
|
|
43
|
+
"""
|
|
44
|
+
Model for initing client
|
|
45
|
+
"""
|
|
46
|
+
def __init__(
|
|
47
|
+
self,
|
|
48
|
+
project: str = None,
|
|
49
|
+
access_key_id: str = None,
|
|
50
|
+
access_key_secret: str = None,
|
|
51
|
+
security_token: str = None,
|
|
52
|
+
bearer_token: str = None,
|
|
53
|
+
protocol: str = None,
|
|
54
|
+
method: str = None,
|
|
55
|
+
region_id: str = None,
|
|
56
|
+
read_timeout: int = None,
|
|
57
|
+
connect_timeout: int = None,
|
|
58
|
+
credential: CredentialClient = None,
|
|
59
|
+
endpoint: str = None,
|
|
60
|
+
type: str = None,
|
|
61
|
+
user_agent: str = None,
|
|
62
|
+
suffix: str = None,
|
|
63
|
+
signature_version: str = None,
|
|
64
|
+
global_parameters: GlobalParameters = None,
|
|
65
|
+
):
|
|
66
|
+
# project
|
|
67
|
+
self.project = project
|
|
68
|
+
# accesskey id
|
|
69
|
+
self.access_key_id = access_key_id
|
|
70
|
+
# accesskey secret
|
|
71
|
+
self.access_key_secret = access_key_secret
|
|
72
|
+
# security token
|
|
73
|
+
self.security_token = security_token
|
|
74
|
+
# bearer token
|
|
75
|
+
self.bearer_token = bearer_token
|
|
76
|
+
# http protocol
|
|
77
|
+
self.protocol = protocol
|
|
78
|
+
# http method
|
|
79
|
+
self.method = method
|
|
80
|
+
# region id
|
|
81
|
+
self.region_id = region_id
|
|
82
|
+
# read timeout
|
|
83
|
+
self.read_timeout = read_timeout
|
|
84
|
+
# connect timeout
|
|
85
|
+
self.connect_timeout = connect_timeout
|
|
86
|
+
# credential
|
|
87
|
+
self.credential = credential
|
|
88
|
+
# endpoint
|
|
89
|
+
self.endpoint = endpoint
|
|
90
|
+
# credential type
|
|
91
|
+
self.type = type
|
|
92
|
+
# user agent
|
|
93
|
+
self.user_agent = user_agent
|
|
94
|
+
# suffix for endpoint
|
|
95
|
+
self.suffix = suffix
|
|
96
|
+
# Signature Version
|
|
97
|
+
self.signature_version = signature_version
|
|
98
|
+
# Global Parameters
|
|
99
|
+
self.global_parameters = global_parameters
|
|
100
|
+
|
|
101
|
+
def validate(self):
|
|
102
|
+
if self.global_parameters:
|
|
103
|
+
self.global_parameters.validate()
|
|
104
|
+
|
|
105
|
+
def to_map(self):
|
|
106
|
+
_map = super().to_map()
|
|
107
|
+
if _map is not None:
|
|
108
|
+
return _map
|
|
109
|
+
|
|
110
|
+
result = dict()
|
|
111
|
+
if self.project is not None:
|
|
112
|
+
result['project'] = self.project
|
|
113
|
+
if self.access_key_id is not None:
|
|
114
|
+
result['accessKeyId'] = self.access_key_id
|
|
115
|
+
if self.access_key_secret is not None:
|
|
116
|
+
result['accessKeySecret'] = self.access_key_secret
|
|
117
|
+
if self.security_token is not None:
|
|
118
|
+
result['securityToken'] = self.security_token
|
|
119
|
+
if self.bearer_token is not None:
|
|
120
|
+
result['bearerToken'] = self.bearer_token
|
|
121
|
+
if self.protocol is not None:
|
|
122
|
+
result['protocol'] = self.protocol
|
|
123
|
+
if self.method is not None:
|
|
124
|
+
result['method'] = self.method
|
|
125
|
+
if self.region_id is not None:
|
|
126
|
+
result['regionId'] = self.region_id
|
|
127
|
+
if self.read_timeout is not None:
|
|
128
|
+
result['readTimeout'] = self.read_timeout
|
|
129
|
+
if self.connect_timeout is not None:
|
|
130
|
+
result['connectTimeout'] = self.connect_timeout
|
|
131
|
+
if self.credential is not None:
|
|
132
|
+
result['credential'] = self.credential
|
|
133
|
+
if self.endpoint is not None:
|
|
134
|
+
result['endpoint'] = self.endpoint
|
|
135
|
+
if self.type is not None:
|
|
136
|
+
result['type'] = self.type
|
|
137
|
+
if self.user_agent is not None:
|
|
138
|
+
result['userAgent'] = self.user_agent
|
|
139
|
+
if self.suffix is not None:
|
|
140
|
+
result['suffix'] = self.suffix
|
|
141
|
+
if self.signature_version is not None:
|
|
142
|
+
result['signatureVersion'] = self.signature_version
|
|
143
|
+
if self.global_parameters is not None:
|
|
144
|
+
result['globalParameters'] = self.global_parameters.to_map()
|
|
145
|
+
return result
|
|
146
|
+
|
|
147
|
+
def from_map(self, m: dict = None):
|
|
148
|
+
m = m or dict()
|
|
149
|
+
if m.get('project') is not None:
|
|
150
|
+
self.project = m.get('project')
|
|
151
|
+
if m.get('accessKeyId') is not None:
|
|
152
|
+
self.access_key_id = m.get('accessKeyId')
|
|
153
|
+
if m.get('accessKeySecret') is not None:
|
|
154
|
+
self.access_key_secret = m.get('accessKeySecret')
|
|
155
|
+
if m.get('securityToken') is not None:
|
|
156
|
+
self.security_token = m.get('securityToken')
|
|
157
|
+
if m.get('bearerToken') is not None:
|
|
158
|
+
self.bearer_token = m.get('bearerToken')
|
|
159
|
+
if m.get('protocol') is not None:
|
|
160
|
+
self.protocol = m.get('protocol')
|
|
161
|
+
if m.get('method') is not None:
|
|
162
|
+
self.method = m.get('method')
|
|
163
|
+
if m.get('regionId') is not None:
|
|
164
|
+
self.region_id = m.get('regionId')
|
|
165
|
+
if m.get('readTimeout') is not None:
|
|
166
|
+
self.read_timeout = m.get('readTimeout')
|
|
167
|
+
if m.get('connectTimeout') is not None:
|
|
168
|
+
self.connect_timeout = m.get('connectTimeout')
|
|
169
|
+
if m.get('credential') is not None:
|
|
170
|
+
self.credential = m.get('credential')
|
|
171
|
+
if m.get('endpoint') is not None:
|
|
172
|
+
self.endpoint = m.get('endpoint')
|
|
173
|
+
if m.get('type') is not None:
|
|
174
|
+
self.type = m.get('type')
|
|
175
|
+
if m.get('userAgent') is not None:
|
|
176
|
+
self.user_agent = m.get('userAgent')
|
|
177
|
+
if m.get('suffix') is not None:
|
|
178
|
+
self.suffix = m.get('suffix')
|
|
179
|
+
if m.get('signatureVersion') is not None:
|
|
180
|
+
self.signature_version = m.get('signatureVersion')
|
|
181
|
+
if m.get('globalParameters') is not None:
|
|
182
|
+
temp_model = GlobalParameters()
|
|
183
|
+
self.global_parameters = temp_model.from_map(m['globalParameters'])
|
|
184
|
+
return self
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
class Params(TeaModel):
|
|
188
|
+
def __init__(
|
|
189
|
+
self,
|
|
190
|
+
action: str = None,
|
|
191
|
+
version: str = None,
|
|
192
|
+
protocol: str = None,
|
|
193
|
+
pathname: str = None,
|
|
194
|
+
method: str = None,
|
|
195
|
+
auth_type: str = None,
|
|
196
|
+
body_type: str = None,
|
|
197
|
+
req_body_type: str = None,
|
|
198
|
+
style: str = None,
|
|
199
|
+
):
|
|
200
|
+
self.action = action
|
|
201
|
+
self.version = version
|
|
202
|
+
self.protocol = protocol
|
|
203
|
+
self.pathname = pathname
|
|
204
|
+
self.method = method
|
|
205
|
+
self.auth_type = auth_type
|
|
206
|
+
self.body_type = body_type
|
|
207
|
+
self.req_body_type = req_body_type
|
|
208
|
+
self.style = style
|
|
209
|
+
|
|
210
|
+
def validate(self):
|
|
211
|
+
self.validate_required(self.pathname, 'pathname')
|
|
212
|
+
self.validate_required(self.method, 'method')
|
|
213
|
+
|
|
214
|
+
def to_map(self):
|
|
215
|
+
_map = super().to_map()
|
|
216
|
+
if _map is not None:
|
|
217
|
+
return _map
|
|
218
|
+
|
|
219
|
+
result = dict()
|
|
220
|
+
if self.action is not None:
|
|
221
|
+
result['action'] = self.action
|
|
222
|
+
if self.version is not None:
|
|
223
|
+
result['version'] = self.version
|
|
224
|
+
if self.protocol is not None:
|
|
225
|
+
result['protocol'] = self.protocol
|
|
226
|
+
if self.pathname is not None:
|
|
227
|
+
result['pathname'] = self.pathname
|
|
228
|
+
if self.method is not None:
|
|
229
|
+
result['method'] = self.method
|
|
230
|
+
if self.auth_type is not None:
|
|
231
|
+
result['authType'] = self.auth_type
|
|
232
|
+
if self.body_type is not None:
|
|
233
|
+
result['bodyType'] = self.body_type
|
|
234
|
+
if self.req_body_type is not None:
|
|
235
|
+
result['reqBodyType'] = self.req_body_type
|
|
236
|
+
if self.style is not None:
|
|
237
|
+
result['style'] = self.style
|
|
238
|
+
return result
|
|
239
|
+
|
|
240
|
+
def from_map(self, m: dict = None):
|
|
241
|
+
m = m or dict()
|
|
242
|
+
if m.get('action') is not None:
|
|
243
|
+
self.action = m.get('action')
|
|
244
|
+
if m.get('version') is not None:
|
|
245
|
+
self.version = m.get('version')
|
|
246
|
+
if m.get('protocol') is not None:
|
|
247
|
+
self.protocol = m.get('protocol')
|
|
248
|
+
if m.get('pathname') is not None:
|
|
249
|
+
self.pathname = m.get('pathname')
|
|
250
|
+
if m.get('method') is not None:
|
|
251
|
+
self.method = m.get('method')
|
|
252
|
+
if m.get('authType') is not None:
|
|
253
|
+
self.auth_type = m.get('authType')
|
|
254
|
+
if m.get('bodyType') is not None:
|
|
255
|
+
self.body_type = m.get('bodyType')
|
|
256
|
+
if m.get('reqBodyType') is not None:
|
|
257
|
+
self.req_body_type = m.get('reqBodyType')
|
|
258
|
+
if m.get('style') is not None:
|
|
259
|
+
self.style = m.get('style')
|
|
260
|
+
return self
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
class OpenApiRequest(TeaModel):
|
|
264
|
+
def __init__(
|
|
265
|
+
self,
|
|
266
|
+
headers: Dict[str, str] = None,
|
|
267
|
+
query: Dict[str, str] = None,
|
|
268
|
+
body: Any = None,
|
|
269
|
+
stream: BinaryIO = None,
|
|
270
|
+
host_map: Dict[str, str] = None,
|
|
271
|
+
endpoint_override: str = None,
|
|
272
|
+
):
|
|
273
|
+
self.headers = headers
|
|
274
|
+
self.query = query
|
|
275
|
+
self.body = body
|
|
276
|
+
self.stream = stream
|
|
277
|
+
self.host_map = host_map
|
|
278
|
+
self.endpoint_override = endpoint_override
|
|
279
|
+
|
|
280
|
+
def validate(self):
|
|
281
|
+
pass
|
|
282
|
+
|
|
283
|
+
def to_map(self):
|
|
284
|
+
_map = super().to_map()
|
|
285
|
+
if _map is not None:
|
|
286
|
+
return _map
|
|
287
|
+
|
|
288
|
+
result = dict()
|
|
289
|
+
if self.headers is not None:
|
|
290
|
+
result['headers'] = self.headers
|
|
291
|
+
if self.query is not None:
|
|
292
|
+
result['query'] = self.query
|
|
293
|
+
if self.body is not None:
|
|
294
|
+
result['body'] = self.body
|
|
295
|
+
if self.stream is not None:
|
|
296
|
+
result['stream'] = self.stream
|
|
297
|
+
if self.host_map is not None:
|
|
298
|
+
result['hostMap'] = self.host_map
|
|
299
|
+
if self.endpoint_override is not None:
|
|
300
|
+
result['endpointOverride'] = self.endpoint_override
|
|
301
|
+
return result
|
|
302
|
+
|
|
303
|
+
def from_map(self, m: dict = None):
|
|
304
|
+
m = m or dict()
|
|
305
|
+
if m.get('headers') is not None:
|
|
306
|
+
self.headers = m.get('headers')
|
|
307
|
+
if m.get('query') is not None:
|
|
308
|
+
self.query = m.get('query')
|
|
309
|
+
if m.get('body') is not None:
|
|
310
|
+
self.body = m.get('body')
|
|
311
|
+
if m.get('stream') is not None:
|
|
312
|
+
self.stream = m.get('stream')
|
|
313
|
+
if m.get('hostMap') is not None:
|
|
314
|
+
self.host_map = m.get('hostMap')
|
|
315
|
+
if m.get('endpointOverride') is not None:
|
|
316
|
+
self.endpoint_override = m.get('endpointOverride')
|
|
317
|
+
return self
|
|
318
|
+
|
|
319
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: maxcompute_tea_openapi
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Alibaba Cloud MaxCompute openapi SDK Library for Python
|
|
5
|
+
Home-page: https://github.com/aliyun/aliyun-odps-openapi-sdk
|
|
6
|
+
Author: Alibaba Cloud MaxCompute Team
|
|
7
|
+
Author-email: zhangdingxin.zdx@alibaba-inc.com
|
|
8
|
+
License: Apache License 2.0
|
|
9
|
+
Keywords: maxcompute,tea,openapi
|
|
10
|
+
Platform: any
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Programming Language :: Python
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Topic :: Software Development
|
|
21
|
+
Requires-Python: >=3.6
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
Requires-Dist: maxcompute_tea_util<1.0.0,>=0.0.1
|
|
24
|
+
Requires-Dist: alibabacloud_tea_util<1.0.0,>=0.3.13
|
|
25
|
+
Requires-Dist: alibabacloud_credentials<1.0.0,>=0.3.6
|
|
26
|
+
Dynamic: author
|
|
27
|
+
Dynamic: author-email
|
|
28
|
+
Dynamic: classifier
|
|
29
|
+
Dynamic: description-content-type
|
|
30
|
+
Dynamic: home-page
|
|
31
|
+
Dynamic: keywords
|
|
32
|
+
Dynamic: license
|
|
33
|
+
Dynamic: platform
|
|
34
|
+
Dynamic: requires-dist
|
|
35
|
+
Dynamic: requires-python
|
|
36
|
+
Dynamic: summary
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
maxcompute_tea_openapi/__init__.py,sha256=J-j-u0itpEFT6irdmWmixQqYMadNl1X91TxUmoiLHMI,22
|
|
2
|
+
maxcompute_tea_openapi/client.py,sha256=nPojCDSSBnvI5ucQnXQCsFoAZNv54zlG5q1TchaXt_8,28555
|
|
3
|
+
maxcompute_tea_openapi/models.py,sha256=5imGy3fGTo2PfxNRas7kWELVEsbKX2B9dSQmzcdLmnM,10759
|
|
4
|
+
maxcompute_tea_openapi-1.0.0.dist-info/METADATA,sha256=_8bFfDP_KRLon2cbDKpoR5mJo-x_A8YeLXH8XK2bOMc,1282
|
|
5
|
+
maxcompute_tea_openapi-1.0.0.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
|
6
|
+
maxcompute_tea_openapi-1.0.0.dist-info/top_level.txt,sha256=ynGm4_autZM7ZP1j4UsrrMCZIUtYxzjz7rnvGoppTVg,23
|
|
7
|
+
maxcompute_tea_openapi-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
maxcompute_tea_openapi
|