alibabacloud-emr-serverless-spark20230808 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of alibabacloud-emr-serverless-spark20230808 might be problematic. Click here for more details.

@@ -0,0 +1,13 @@
1
+ Copyright (c) 2009-present, Alibaba Cloud 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,2 @@
1
+ include LICENSE
2
+ include *.md
@@ -0,0 +1,64 @@
1
+ Metadata-Version: 2.1
2
+ Name: alibabacloud_emr-serverless-spark20230808
3
+ Version: 1.0.0
4
+ Summary: Alibaba Cloud emr-serverless-spark (20230808) SDK Library for Python
5
+ Home-page: https://github.com/aliyun/alibabacloud-python-sdk
6
+ Author: Alibaba Cloud SDK
7
+ Author-email: sdk-team@alibabacloud.com
8
+ License: Apache License 2.0
9
+ Description: English | [简体中文](README-CN.md)
10
+ ![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg)
11
+
12
+ ## Alibaba Cloud emr-serverless-spark SDK for Python
13
+
14
+ ## Requirements
15
+
16
+ - Python >= 3.6
17
+
18
+ ## Installation
19
+
20
+ - **Install with pip**
21
+
22
+ Python SDK uses a common package management tool named `pip`. If pip is not installed, see the [pip user guide](https://pip.pypa.io/en/stable/installing/ "pip User Guide") to install pip.
23
+
24
+ ```bash
25
+ # Install the alibabacloud_emr_serverless_spark20230808
26
+ pip install alibabacloud_emr_serverless_spark20230808
27
+ ```
28
+
29
+ ## Issues
30
+
31
+ [Opening an Issue](https://github.com/aliyun/alibabacloud-sdk/issues/new), Issues not conforming to the guidelines may be closed immediately.
32
+
33
+ ## Usage
34
+
35
+ [Quick Examples](https://github.com/aliyun/alibabacloud-python-sdk/blob/master/docs/0-Usage-EN.md#quick-examples)
36
+
37
+ ## Changelog
38
+
39
+ Detailed changes for each release are documented in the [release notes](https://github.com/aliyun/alibabacloud-python-sdk/blob/master/emr-serverless-spark-20230808/ChangeLog.md).
40
+
41
+ ## References
42
+
43
+ - [Latest Release](https://github.com/aliyun/alibabacloud-sdk/tree/master/python)
44
+
45
+ ## License
46
+
47
+ [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
48
+
49
+ Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
50
+
51
+ Keywords: alibabacloud,emr,serverless,spark20230808
52
+ Platform: any
53
+ Classifier: Development Status :: 4 - Beta
54
+ Classifier: Intended Audience :: Developers
55
+ Classifier: License :: OSI Approved :: Apache Software License
56
+ Classifier: Programming Language :: Python
57
+ Classifier: Programming Language :: Python :: 3
58
+ Classifier: Programming Language :: Python :: 3.6
59
+ Classifier: Programming Language :: Python :: 3.7
60
+ Classifier: Programming Language :: Python :: 3.8
61
+ Classifier: Programming Language :: Python :: 3.9
62
+ Classifier: Topic :: Software Development
63
+ Requires-Python: >=3.6
64
+ Description-Content-Type: text/markdown
@@ -0,0 +1,42 @@
1
+ [English](README.md) | 简体中文
2
+
3
+ ![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg)
4
+
5
+ ## Alibaba Cloud emr-serverless-spark SDK for Python
6
+
7
+ ## 要求
8
+
9
+ - Python >= 3.6
10
+
11
+ ## 安装
12
+
13
+ - **使用 pip 安装(推荐)**
14
+
15
+ 如未安装 `pip`, 请先至pip官网 [pip user guide](https://pip.pypa.io/en/stable/installing/ "pip User Guide") 安装pip .
16
+
17
+ ```bash
18
+ # 安装 alibabacloud_emr_serverless_spark20230808
19
+ pip install alibabacloud_emr_serverless_spark20230808
20
+ ```
21
+
22
+ ## 问题
23
+
24
+ [提交 Issue](https://github.com/aliyun/alibabacloud-python-sdk/issues/new),不符合指南的问题可能会立即关闭。
25
+
26
+ ## 使用说明
27
+
28
+ [快速使用](https://github.com/aliyun/alibabacloud-python-sdk/blob/master/docs/0-Usage-CN.md#%E5%BF%AB%E9%80%9F%E4%BD%BF%E7%94%A8)
29
+
30
+ ## 发行说明
31
+
32
+ 每个版本的详细更改记录在[发行说明](https://github.com/aliyun/alibabacloud-python-sdk/blob/master/emr-serverless-spark-20230808/ChangeLog.md)中。
33
+
34
+ ## 相关
35
+
36
+ - [最新源码](https://github.com/aliyun/alibabacloud-python-sdk/)
37
+
38
+ ## 许可证
39
+
40
+ [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
41
+
42
+ Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
@@ -0,0 +1,41 @@
1
+ English | [简体中文](README-CN.md)
2
+ ![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg)
3
+
4
+ ## Alibaba Cloud emr-serverless-spark SDK for Python
5
+
6
+ ## Requirements
7
+
8
+ - Python >= 3.6
9
+
10
+ ## Installation
11
+
12
+ - **Install with pip**
13
+
14
+ Python SDK uses a common package management tool named `pip`. If pip is not installed, see the [pip user guide](https://pip.pypa.io/en/stable/installing/ "pip User Guide") to install pip.
15
+
16
+ ```bash
17
+ # Install the alibabacloud_emr_serverless_spark20230808
18
+ pip install alibabacloud_emr_serverless_spark20230808
19
+ ```
20
+
21
+ ## Issues
22
+
23
+ [Opening an Issue](https://github.com/aliyun/alibabacloud-sdk/issues/new), Issues not conforming to the guidelines may be closed immediately.
24
+
25
+ ## Usage
26
+
27
+ [Quick Examples](https://github.com/aliyun/alibabacloud-python-sdk/blob/master/docs/0-Usage-EN.md#quick-examples)
28
+
29
+ ## Changelog
30
+
31
+ Detailed changes for each release are documented in the [release notes](https://github.com/aliyun/alibabacloud-python-sdk/blob/master/emr-serverless-spark-20230808/ChangeLog.md).
32
+
33
+ ## References
34
+
35
+ - [Latest Release](https://github.com/aliyun/alibabacloud-sdk/tree/master/python)
36
+
37
+ ## License
38
+
39
+ [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
40
+
41
+ Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
@@ -0,0 +1,474 @@
1
+ # -*- coding: utf-8 -*-
2
+ # This file is auto-generated, don't edit it. Thanks.
3
+ from typing import Dict
4
+ from Tea.core import TeaCore
5
+
6
+ from alibabacloud_tea_openapi.client import Client as OpenApiClient
7
+ from alibabacloud_tea_openapi import models as open_api_models
8
+ from alibabacloud_tea_util.client import Client as UtilClient
9
+ from alibabacloud_endpoint_util.client import Client as EndpointUtilClient
10
+ from alibabacloud_emr_serverless_spark20230808 import models as emr_serverless_spark_20230808_models
11
+ from alibabacloud_tea_util import models as util_models
12
+ from alibabacloud_openapi_util.client import Client as OpenApiUtilClient
13
+
14
+
15
+ class Client(OpenApiClient):
16
+ """
17
+ *\
18
+ """
19
+ def __init__(
20
+ self,
21
+ config: open_api_models.Config,
22
+ ):
23
+ super().__init__(config)
24
+ self._endpoint_rule = ''
25
+ self.check_config(config)
26
+ self._endpoint = self.get_endpoint('emr-serverless-spark', self._region_id, self._endpoint_rule, self._network, self._suffix, self._endpoint_map, self._endpoint)
27
+
28
+ def get_endpoint(
29
+ self,
30
+ product_id: str,
31
+ region_id: str,
32
+ endpoint_rule: str,
33
+ network: str,
34
+ suffix: str,
35
+ endpoint_map: Dict[str, str],
36
+ endpoint: str,
37
+ ) -> str:
38
+ if not UtilClient.empty(endpoint):
39
+ return endpoint
40
+ if not UtilClient.is_unset(endpoint_map) and not UtilClient.empty(endpoint_map.get(region_id)):
41
+ return endpoint_map.get(region_id)
42
+ return EndpointUtilClient.get_endpoint_rules(product_id, region_id, endpoint_rule, network, suffix)
43
+
44
+ def cancel_job_run_with_options(
45
+ self,
46
+ workspace_id: str,
47
+ job_run_id: str,
48
+ request: emr_serverless_spark_20230808_models.CancelJobRunRequest,
49
+ headers: Dict[str, str],
50
+ runtime: util_models.RuntimeOptions,
51
+ ) -> emr_serverless_spark_20230808_models.CancelJobRunResponse:
52
+ UtilClient.validate_model(request)
53
+ query = {}
54
+ if not UtilClient.is_unset(request.region_id):
55
+ query['regionId'] = request.region_id
56
+ req = open_api_models.OpenApiRequest(
57
+ headers=headers,
58
+ query=OpenApiUtilClient.query(query)
59
+ )
60
+ params = open_api_models.Params(
61
+ action='CancelJobRun',
62
+ version='2023-08-08',
63
+ protocol='HTTPS',
64
+ pathname=f'/api/v1/workspaces/{OpenApiUtilClient.get_encode_param(workspace_id)}/jobRuns/{OpenApiUtilClient.get_encode_param(job_run_id)}',
65
+ method='DELETE',
66
+ auth_type='AK',
67
+ style='ROA',
68
+ req_body_type='json',
69
+ body_type='json'
70
+ )
71
+ return TeaCore.from_map(
72
+ emr_serverless_spark_20230808_models.CancelJobRunResponse(),
73
+ self.call_api(params, req, runtime)
74
+ )
75
+
76
+ async def cancel_job_run_with_options_async(
77
+ self,
78
+ workspace_id: str,
79
+ job_run_id: str,
80
+ request: emr_serverless_spark_20230808_models.CancelJobRunRequest,
81
+ headers: Dict[str, str],
82
+ runtime: util_models.RuntimeOptions,
83
+ ) -> emr_serverless_spark_20230808_models.CancelJobRunResponse:
84
+ UtilClient.validate_model(request)
85
+ query = {}
86
+ if not UtilClient.is_unset(request.region_id):
87
+ query['regionId'] = request.region_id
88
+ req = open_api_models.OpenApiRequest(
89
+ headers=headers,
90
+ query=OpenApiUtilClient.query(query)
91
+ )
92
+ params = open_api_models.Params(
93
+ action='CancelJobRun',
94
+ version='2023-08-08',
95
+ protocol='HTTPS',
96
+ pathname=f'/api/v1/workspaces/{OpenApiUtilClient.get_encode_param(workspace_id)}/jobRuns/{OpenApiUtilClient.get_encode_param(job_run_id)}',
97
+ method='DELETE',
98
+ auth_type='AK',
99
+ style='ROA',
100
+ req_body_type='json',
101
+ body_type='json'
102
+ )
103
+ return TeaCore.from_map(
104
+ emr_serverless_spark_20230808_models.CancelJobRunResponse(),
105
+ await self.call_api_async(params, req, runtime)
106
+ )
107
+
108
+ def cancel_job_run(
109
+ self,
110
+ workspace_id: str,
111
+ job_run_id: str,
112
+ request: emr_serverless_spark_20230808_models.CancelJobRunRequest,
113
+ ) -> emr_serverless_spark_20230808_models.CancelJobRunResponse:
114
+ runtime = util_models.RuntimeOptions()
115
+ headers = {}
116
+ return self.cancel_job_run_with_options(workspace_id, job_run_id, request, headers, runtime)
117
+
118
+ async def cancel_job_run_async(
119
+ self,
120
+ workspace_id: str,
121
+ job_run_id: str,
122
+ request: emr_serverless_spark_20230808_models.CancelJobRunRequest,
123
+ ) -> emr_serverless_spark_20230808_models.CancelJobRunResponse:
124
+ runtime = util_models.RuntimeOptions()
125
+ headers = {}
126
+ return await self.cancel_job_run_with_options_async(workspace_id, job_run_id, request, headers, runtime)
127
+
128
+ def get_job_run_with_options(
129
+ self,
130
+ workspace_id: str,
131
+ job_run_id: str,
132
+ request: emr_serverless_spark_20230808_models.GetJobRunRequest,
133
+ headers: Dict[str, str],
134
+ runtime: util_models.RuntimeOptions,
135
+ ) -> emr_serverless_spark_20230808_models.GetJobRunResponse:
136
+ UtilClient.validate_model(request)
137
+ query = {}
138
+ if not UtilClient.is_unset(request.region_id):
139
+ query['regionId'] = request.region_id
140
+ req = open_api_models.OpenApiRequest(
141
+ headers=headers,
142
+ query=OpenApiUtilClient.query(query)
143
+ )
144
+ params = open_api_models.Params(
145
+ action='GetJobRun',
146
+ version='2023-08-08',
147
+ protocol='HTTPS',
148
+ pathname=f'/api/v1/workspaces/{OpenApiUtilClient.get_encode_param(workspace_id)}/jobRuns/{OpenApiUtilClient.get_encode_param(job_run_id)}',
149
+ method='GET',
150
+ auth_type='AK',
151
+ style='ROA',
152
+ req_body_type='json',
153
+ body_type='json'
154
+ )
155
+ return TeaCore.from_map(
156
+ emr_serverless_spark_20230808_models.GetJobRunResponse(),
157
+ self.call_api(params, req, runtime)
158
+ )
159
+
160
+ async def get_job_run_with_options_async(
161
+ self,
162
+ workspace_id: str,
163
+ job_run_id: str,
164
+ request: emr_serverless_spark_20230808_models.GetJobRunRequest,
165
+ headers: Dict[str, str],
166
+ runtime: util_models.RuntimeOptions,
167
+ ) -> emr_serverless_spark_20230808_models.GetJobRunResponse:
168
+ UtilClient.validate_model(request)
169
+ query = {}
170
+ if not UtilClient.is_unset(request.region_id):
171
+ query['regionId'] = request.region_id
172
+ req = open_api_models.OpenApiRequest(
173
+ headers=headers,
174
+ query=OpenApiUtilClient.query(query)
175
+ )
176
+ params = open_api_models.Params(
177
+ action='GetJobRun',
178
+ version='2023-08-08',
179
+ protocol='HTTPS',
180
+ pathname=f'/api/v1/workspaces/{OpenApiUtilClient.get_encode_param(workspace_id)}/jobRuns/{OpenApiUtilClient.get_encode_param(job_run_id)}',
181
+ method='GET',
182
+ auth_type='AK',
183
+ style='ROA',
184
+ req_body_type='json',
185
+ body_type='json'
186
+ )
187
+ return TeaCore.from_map(
188
+ emr_serverless_spark_20230808_models.GetJobRunResponse(),
189
+ await self.call_api_async(params, req, runtime)
190
+ )
191
+
192
+ def get_job_run(
193
+ self,
194
+ workspace_id: str,
195
+ job_run_id: str,
196
+ request: emr_serverless_spark_20230808_models.GetJobRunRequest,
197
+ ) -> emr_serverless_spark_20230808_models.GetJobRunResponse:
198
+ runtime = util_models.RuntimeOptions()
199
+ headers = {}
200
+ return self.get_job_run_with_options(workspace_id, job_run_id, request, headers, runtime)
201
+
202
+ async def get_job_run_async(
203
+ self,
204
+ workspace_id: str,
205
+ job_run_id: str,
206
+ request: emr_serverless_spark_20230808_models.GetJobRunRequest,
207
+ ) -> emr_serverless_spark_20230808_models.GetJobRunResponse:
208
+ runtime = util_models.RuntimeOptions()
209
+ headers = {}
210
+ return await self.get_job_run_with_options_async(workspace_id, job_run_id, request, headers, runtime)
211
+
212
+ def list_job_runs_with_options(
213
+ self,
214
+ workspace_id: str,
215
+ tmp_req: emr_serverless_spark_20230808_models.ListJobRunsRequest,
216
+ headers: Dict[str, str],
217
+ runtime: util_models.RuntimeOptions,
218
+ ) -> emr_serverless_spark_20230808_models.ListJobRunsResponse:
219
+ UtilClient.validate_model(tmp_req)
220
+ request = emr_serverless_spark_20230808_models.ListJobRunsShrinkRequest()
221
+ OpenApiUtilClient.convert(tmp_req, request)
222
+ if not UtilClient.is_unset(tmp_req.end_time):
223
+ request.end_time_shrink = OpenApiUtilClient.array_to_string_with_specified_style(tmp_req.end_time, 'endTime', 'json')
224
+ if not UtilClient.is_unset(tmp_req.start_time):
225
+ request.start_time_shrink = OpenApiUtilClient.array_to_string_with_specified_style(tmp_req.start_time, 'startTime', 'json')
226
+ if not UtilClient.is_unset(tmp_req.states):
227
+ request.states_shrink = OpenApiUtilClient.array_to_string_with_specified_style(tmp_req.states, 'states', 'json')
228
+ if not UtilClient.is_unset(tmp_req.tags):
229
+ request.tags_shrink = OpenApiUtilClient.array_to_string_with_specified_style(tmp_req.tags, 'tags', 'json')
230
+ query = {}
231
+ if not UtilClient.is_unset(request.creator):
232
+ query['creator'] = request.creator
233
+ if not UtilClient.is_unset(request.end_time_shrink):
234
+ query['endTime'] = request.end_time_shrink
235
+ if not UtilClient.is_unset(request.job_run_id):
236
+ query['jobRunId'] = request.job_run_id
237
+ if not UtilClient.is_unset(request.max_results):
238
+ query['maxResults'] = request.max_results
239
+ if not UtilClient.is_unset(request.name):
240
+ query['name'] = request.name
241
+ if not UtilClient.is_unset(request.next_token):
242
+ query['nextToken'] = request.next_token
243
+ if not UtilClient.is_unset(request.region_id):
244
+ query['regionId'] = request.region_id
245
+ if not UtilClient.is_unset(request.resource_queue_id):
246
+ query['resourceQueueId'] = request.resource_queue_id
247
+ if not UtilClient.is_unset(request.start_time_shrink):
248
+ query['startTime'] = request.start_time_shrink
249
+ if not UtilClient.is_unset(request.states_shrink):
250
+ query['states'] = request.states_shrink
251
+ if not UtilClient.is_unset(request.tags_shrink):
252
+ query['tags'] = request.tags_shrink
253
+ req = open_api_models.OpenApiRequest(
254
+ headers=headers,
255
+ query=OpenApiUtilClient.query(query)
256
+ )
257
+ params = open_api_models.Params(
258
+ action='ListJobRuns',
259
+ version='2023-08-08',
260
+ protocol='HTTPS',
261
+ pathname=f'/api/v1/workspaces/{OpenApiUtilClient.get_encode_param(workspace_id)}/jobRuns',
262
+ method='GET',
263
+ auth_type='AK',
264
+ style='ROA',
265
+ req_body_type='json',
266
+ body_type='json'
267
+ )
268
+ return TeaCore.from_map(
269
+ emr_serverless_spark_20230808_models.ListJobRunsResponse(),
270
+ self.call_api(params, req, runtime)
271
+ )
272
+
273
+ async def list_job_runs_with_options_async(
274
+ self,
275
+ workspace_id: str,
276
+ tmp_req: emr_serverless_spark_20230808_models.ListJobRunsRequest,
277
+ headers: Dict[str, str],
278
+ runtime: util_models.RuntimeOptions,
279
+ ) -> emr_serverless_spark_20230808_models.ListJobRunsResponse:
280
+ UtilClient.validate_model(tmp_req)
281
+ request = emr_serverless_spark_20230808_models.ListJobRunsShrinkRequest()
282
+ OpenApiUtilClient.convert(tmp_req, request)
283
+ if not UtilClient.is_unset(tmp_req.end_time):
284
+ request.end_time_shrink = OpenApiUtilClient.array_to_string_with_specified_style(tmp_req.end_time, 'endTime', 'json')
285
+ if not UtilClient.is_unset(tmp_req.start_time):
286
+ request.start_time_shrink = OpenApiUtilClient.array_to_string_with_specified_style(tmp_req.start_time, 'startTime', 'json')
287
+ if not UtilClient.is_unset(tmp_req.states):
288
+ request.states_shrink = OpenApiUtilClient.array_to_string_with_specified_style(tmp_req.states, 'states', 'json')
289
+ if not UtilClient.is_unset(tmp_req.tags):
290
+ request.tags_shrink = OpenApiUtilClient.array_to_string_with_specified_style(tmp_req.tags, 'tags', 'json')
291
+ query = {}
292
+ if not UtilClient.is_unset(request.creator):
293
+ query['creator'] = request.creator
294
+ if not UtilClient.is_unset(request.end_time_shrink):
295
+ query['endTime'] = request.end_time_shrink
296
+ if not UtilClient.is_unset(request.job_run_id):
297
+ query['jobRunId'] = request.job_run_id
298
+ if not UtilClient.is_unset(request.max_results):
299
+ query['maxResults'] = request.max_results
300
+ if not UtilClient.is_unset(request.name):
301
+ query['name'] = request.name
302
+ if not UtilClient.is_unset(request.next_token):
303
+ query['nextToken'] = request.next_token
304
+ if not UtilClient.is_unset(request.region_id):
305
+ query['regionId'] = request.region_id
306
+ if not UtilClient.is_unset(request.resource_queue_id):
307
+ query['resourceQueueId'] = request.resource_queue_id
308
+ if not UtilClient.is_unset(request.start_time_shrink):
309
+ query['startTime'] = request.start_time_shrink
310
+ if not UtilClient.is_unset(request.states_shrink):
311
+ query['states'] = request.states_shrink
312
+ if not UtilClient.is_unset(request.tags_shrink):
313
+ query['tags'] = request.tags_shrink
314
+ req = open_api_models.OpenApiRequest(
315
+ headers=headers,
316
+ query=OpenApiUtilClient.query(query)
317
+ )
318
+ params = open_api_models.Params(
319
+ action='ListJobRuns',
320
+ version='2023-08-08',
321
+ protocol='HTTPS',
322
+ pathname=f'/api/v1/workspaces/{OpenApiUtilClient.get_encode_param(workspace_id)}/jobRuns',
323
+ method='GET',
324
+ auth_type='AK',
325
+ style='ROA',
326
+ req_body_type='json',
327
+ body_type='json'
328
+ )
329
+ return TeaCore.from_map(
330
+ emr_serverless_spark_20230808_models.ListJobRunsResponse(),
331
+ await self.call_api_async(params, req, runtime)
332
+ )
333
+
334
+ def list_job_runs(
335
+ self,
336
+ workspace_id: str,
337
+ request: emr_serverless_spark_20230808_models.ListJobRunsRequest,
338
+ ) -> emr_serverless_spark_20230808_models.ListJobRunsResponse:
339
+ runtime = util_models.RuntimeOptions()
340
+ headers = {}
341
+ return self.list_job_runs_with_options(workspace_id, request, headers, runtime)
342
+
343
+ async def list_job_runs_async(
344
+ self,
345
+ workspace_id: str,
346
+ request: emr_serverless_spark_20230808_models.ListJobRunsRequest,
347
+ ) -> emr_serverless_spark_20230808_models.ListJobRunsResponse:
348
+ runtime = util_models.RuntimeOptions()
349
+ headers = {}
350
+ return await self.list_job_runs_with_options_async(workspace_id, request, headers, runtime)
351
+
352
+ def start_job_run_with_options(
353
+ self,
354
+ workspace_id: str,
355
+ request: emr_serverless_spark_20230808_models.StartJobRunRequest,
356
+ headers: Dict[str, str],
357
+ runtime: util_models.RuntimeOptions,
358
+ ) -> emr_serverless_spark_20230808_models.StartJobRunResponse:
359
+ UtilClient.validate_model(request)
360
+ query = {}
361
+ if not UtilClient.is_unset(request.region_id):
362
+ query['regionId'] = request.region_id
363
+ body = {}
364
+ if not UtilClient.is_unset(request.client_token):
365
+ body['clientToken'] = request.client_token
366
+ if not UtilClient.is_unset(request.code_type):
367
+ body['codeType'] = request.code_type
368
+ if not UtilClient.is_unset(request.configuration_overrides):
369
+ body['configurationOverrides'] = request.configuration_overrides
370
+ if not UtilClient.is_unset(request.execution_timeout_seconds):
371
+ body['executionTimeoutSeconds'] = request.execution_timeout_seconds
372
+ if not UtilClient.is_unset(request.job_driver):
373
+ body['jobDriver'] = request.job_driver
374
+ if not UtilClient.is_unset(request.job_id):
375
+ body['jobId'] = request.job_id
376
+ if not UtilClient.is_unset(request.name):
377
+ body['name'] = request.name
378
+ if not UtilClient.is_unset(request.release_version):
379
+ body['releaseVersion'] = request.release_version
380
+ if not UtilClient.is_unset(request.resource_queue_id):
381
+ body['resourceQueueId'] = request.resource_queue_id
382
+ if not UtilClient.is_unset(request.tags):
383
+ body['tags'] = request.tags
384
+ req = open_api_models.OpenApiRequest(
385
+ headers=headers,
386
+ query=OpenApiUtilClient.query(query),
387
+ body=OpenApiUtilClient.parse_to_map(body)
388
+ )
389
+ params = open_api_models.Params(
390
+ action='StartJobRun',
391
+ version='2023-08-08',
392
+ protocol='HTTPS',
393
+ pathname=f'/api/v1/workspaces/{OpenApiUtilClient.get_encode_param(workspace_id)}/jobRuns',
394
+ method='POST',
395
+ auth_type='AK',
396
+ style='ROA',
397
+ req_body_type='json',
398
+ body_type='json'
399
+ )
400
+ return TeaCore.from_map(
401
+ emr_serverless_spark_20230808_models.StartJobRunResponse(),
402
+ self.call_api(params, req, runtime)
403
+ )
404
+
405
+ async def start_job_run_with_options_async(
406
+ self,
407
+ workspace_id: str,
408
+ request: emr_serverless_spark_20230808_models.StartJobRunRequest,
409
+ headers: Dict[str, str],
410
+ runtime: util_models.RuntimeOptions,
411
+ ) -> emr_serverless_spark_20230808_models.StartJobRunResponse:
412
+ UtilClient.validate_model(request)
413
+ query = {}
414
+ if not UtilClient.is_unset(request.region_id):
415
+ query['regionId'] = request.region_id
416
+ body = {}
417
+ if not UtilClient.is_unset(request.client_token):
418
+ body['clientToken'] = request.client_token
419
+ if not UtilClient.is_unset(request.code_type):
420
+ body['codeType'] = request.code_type
421
+ if not UtilClient.is_unset(request.configuration_overrides):
422
+ body['configurationOverrides'] = request.configuration_overrides
423
+ if not UtilClient.is_unset(request.execution_timeout_seconds):
424
+ body['executionTimeoutSeconds'] = request.execution_timeout_seconds
425
+ if not UtilClient.is_unset(request.job_driver):
426
+ body['jobDriver'] = request.job_driver
427
+ if not UtilClient.is_unset(request.job_id):
428
+ body['jobId'] = request.job_id
429
+ if not UtilClient.is_unset(request.name):
430
+ body['name'] = request.name
431
+ if not UtilClient.is_unset(request.release_version):
432
+ body['releaseVersion'] = request.release_version
433
+ if not UtilClient.is_unset(request.resource_queue_id):
434
+ body['resourceQueueId'] = request.resource_queue_id
435
+ if not UtilClient.is_unset(request.tags):
436
+ body['tags'] = request.tags
437
+ req = open_api_models.OpenApiRequest(
438
+ headers=headers,
439
+ query=OpenApiUtilClient.query(query),
440
+ body=OpenApiUtilClient.parse_to_map(body)
441
+ )
442
+ params = open_api_models.Params(
443
+ action='StartJobRun',
444
+ version='2023-08-08',
445
+ protocol='HTTPS',
446
+ pathname=f'/api/v1/workspaces/{OpenApiUtilClient.get_encode_param(workspace_id)}/jobRuns',
447
+ method='POST',
448
+ auth_type='AK',
449
+ style='ROA',
450
+ req_body_type='json',
451
+ body_type='json'
452
+ )
453
+ return TeaCore.from_map(
454
+ emr_serverless_spark_20230808_models.StartJobRunResponse(),
455
+ await self.call_api_async(params, req, runtime)
456
+ )
457
+
458
+ def start_job_run(
459
+ self,
460
+ workspace_id: str,
461
+ request: emr_serverless_spark_20230808_models.StartJobRunRequest,
462
+ ) -> emr_serverless_spark_20230808_models.StartJobRunResponse:
463
+ runtime = util_models.RuntimeOptions()
464
+ headers = {}
465
+ return self.start_job_run_with_options(workspace_id, request, headers, runtime)
466
+
467
+ async def start_job_run_async(
468
+ self,
469
+ workspace_id: str,
470
+ request: emr_serverless_spark_20230808_models.StartJobRunRequest,
471
+ ) -> emr_serverless_spark_20230808_models.StartJobRunResponse:
472
+ runtime = util_models.RuntimeOptions()
473
+ headers = {}
474
+ return await self.start_job_run_with_options_async(workspace_id, request, headers, runtime)