Skip to content

Commit bd0bc22

Browse files
author
BitsAdmin
committed
Merge branch 'flink-Python-2025-01-01-online-1089-2025_04_03_15_25_57' into 'integration_2025-04-10_853697597698'
feat: [development task] flink-1089-Python (1145260) See merge request iaasng/volcengine-python-sdk!559
2 parents 35f9959 + 6ebe695 commit bd0bc22

File tree

5 files changed

+434
-0
lines changed

5 files changed

+434
-0
lines changed

volcenginesdkflink20250101/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
from volcenginesdkflink20250101.models.list_application_instance_request import ListApplicationInstanceRequest
3434
from volcenginesdkflink20250101.models.list_application_instance_response import ListApplicationInstanceResponse
3535
from volcenginesdkflink20250101.models.record_for_list_application_instance_output import RecordForListApplicationInstanceOutput
36+
from volcenginesdkflink20250101.models.restart_gws_application_request import RestartGWSApplicationRequest
37+
from volcenginesdkflink20250101.models.restart_gws_application_response import RestartGWSApplicationResponse
3638
from volcenginesdkflink20250101.models.restore_strategy_for_start_application_instance_input import RestoreStrategyForStartApplicationInstanceInput
3739
from volcenginesdkflink20250101.models.start_application_instance_request import StartApplicationInstanceRequest
3840
from volcenginesdkflink20250101.models.start_application_instance_response import StartApplicationInstanceResponse

volcenginesdkflink20250101/api/flink20250101_api.py

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,103 @@ def list_application_instance_with_http_info(self, body, **kwargs): # noqa: E50
324324
_request_timeout=params.get('_request_timeout'),
325325
collection_formats=collection_formats)
326326

327+
def restart_gws_application(self, body, **kwargs): # noqa: E501
328+
"""restart_gws_application # noqa: E501
329+
330+
This method makes a synchronous HTTP request by default. To make an
331+
asynchronous HTTP request, please pass async_req=True
332+
>>> thread = api.restart_gws_application(body, async_req=True)
333+
>>> result = thread.get()
334+
335+
:param async_req bool
336+
:param RestartGWSApplicationRequest body: (required)
337+
:return: RestartGWSApplicationResponse
338+
If the method is called asynchronously,
339+
returns the request thread.
340+
"""
341+
kwargs['_return_http_data_only'] = True
342+
if kwargs.get('async_req'):
343+
return self.restart_gws_application_with_http_info(body, **kwargs) # noqa: E501
344+
else:
345+
(data) = self.restart_gws_application_with_http_info(body, **kwargs) # noqa: E501
346+
return data
347+
348+
def restart_gws_application_with_http_info(self, body, **kwargs): # noqa: E501
349+
"""restart_gws_application # noqa: E501
350+
351+
This method makes a synchronous HTTP request by default. To make an
352+
asynchronous HTTP request, please pass async_req=True
353+
>>> thread = api.restart_gws_application_with_http_info(body, async_req=True)
354+
>>> result = thread.get()
355+
356+
:param async_req bool
357+
:param RestartGWSApplicationRequest body: (required)
358+
:return: RestartGWSApplicationResponse
359+
If the method is called asynchronously,
360+
returns the request thread.
361+
"""
362+
363+
all_params = ['body'] # noqa: E501
364+
all_params.append('async_req')
365+
all_params.append('_return_http_data_only')
366+
all_params.append('_preload_content')
367+
all_params.append('_request_timeout')
368+
369+
params = locals()
370+
for key, val in six.iteritems(params['kwargs']):
371+
if key not in all_params:
372+
raise TypeError(
373+
"Got an unexpected keyword argument '%s'"
374+
" to method restart_gws_application" % key
375+
)
376+
params[key] = val
377+
del params['kwargs']
378+
# verify the required parameter 'body' is set
379+
if self.api_client.client_side_validation and ('body' not in params or
380+
params['body'] is None): # noqa: E501
381+
raise ValueError("Missing the required parameter `body` when calling `restart_gws_application`") # noqa: E501
382+
383+
collection_formats = {}
384+
385+
path_params = {}
386+
387+
query_params = []
388+
389+
header_params = {}
390+
391+
form_params = []
392+
local_var_files = {}
393+
394+
body_params = None
395+
if 'body' in params:
396+
body_params = params['body']
397+
# HTTP header `Accept`
398+
header_params['Accept'] = self.api_client.select_header_accept(
399+
['application/json']) # noqa: E501
400+
401+
# HTTP header `Content-Type`
402+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
403+
['application/json']) # noqa: E501
404+
405+
# Authentication setting
406+
auth_settings = ['volcengineSign'] # noqa: E501
407+
408+
return self.api_client.call_api(
409+
'/RestartGWSApplication/2025-01-01/flink/post/application_json/', 'POST',
410+
path_params,
411+
query_params,
412+
header_params,
413+
body=body_params,
414+
post_params=form_params,
415+
files=local_var_files,
416+
response_type='RestartGWSApplicationResponse', # noqa: E501
417+
auth_settings=auth_settings,
418+
async_req=params.get('async_req'),
419+
_return_http_data_only=params.get('_return_http_data_only'),
420+
_preload_content=params.get('_preload_content', True),
421+
_request_timeout=params.get('_request_timeout'),
422+
collection_formats=collection_formats)
423+
327424
def start_application_instance(self, body, **kwargs): # noqa: E501
328425
"""start_application_instance # noqa: E501
329426

volcenginesdkflink20250101/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
from volcenginesdkflink20250101.models.list_application_instance_request import ListApplicationInstanceRequest
3030
from volcenginesdkflink20250101.models.list_application_instance_response import ListApplicationInstanceResponse
3131
from volcenginesdkflink20250101.models.record_for_list_application_instance_output import RecordForListApplicationInstanceOutput
32+
from volcenginesdkflink20250101.models.restart_gws_application_request import RestartGWSApplicationRequest
33+
from volcenginesdkflink20250101.models.restart_gws_application_response import RestartGWSApplicationResponse
3234
from volcenginesdkflink20250101.models.restore_strategy_for_start_application_instance_input import RestoreStrategyForStartApplicationInstanceInput
3335
from volcenginesdkflink20250101.models.start_application_instance_request import StartApplicationInstanceRequest
3436
from volcenginesdkflink20250101.models.start_application_instance_response import StartApplicationInstanceResponse
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
# coding: utf-8
2+
3+
"""
4+
flink20250101
5+
6+
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7+
8+
OpenAPI spec version: common-version
9+
10+
Generated by: https://github.com/swagger-api/swagger-codegen.git
11+
"""
12+
13+
14+
import pprint
15+
import re # noqa: F401
16+
17+
import six
18+
19+
from volcenginesdkcore.configuration import Configuration
20+
21+
22+
class RestartGWSApplicationRequest(object):
23+
"""NOTE: This class is auto generated by the swagger code generator program.
24+
25+
Do not edit the class manually.
26+
"""
27+
28+
"""
29+
Attributes:
30+
swagger_types (dict): The key is attribute name
31+
and the value is attribute type.
32+
attribute_map (dict): The key is attribute name
33+
and the value is json key in definition.
34+
"""
35+
swagger_types = {
36+
'id': 'str',
37+
'savepoint_id': 'str',
38+
'type': 'str'
39+
}
40+
41+
attribute_map = {
42+
'id': 'Id',
43+
'savepoint_id': 'SavepointId',
44+
'type': 'Type'
45+
}
46+
47+
def __init__(self, id=None, savepoint_id=None, type=None, _configuration=None): # noqa: E501
48+
"""RestartGWSApplicationRequest - a model defined in Swagger""" # noqa: E501
49+
if _configuration is None:
50+
_configuration = Configuration()
51+
self._configuration = _configuration
52+
53+
self._id = None
54+
self._savepoint_id = None
55+
self._type = None
56+
self.discriminator = None
57+
58+
self.id = id
59+
if savepoint_id is not None:
60+
self.savepoint_id = savepoint_id
61+
self.type = type
62+
63+
@property
64+
def id(self):
65+
"""Gets the id of this RestartGWSApplicationRequest. # noqa: E501
66+
67+
68+
:return: The id of this RestartGWSApplicationRequest. # noqa: E501
69+
:rtype: str
70+
"""
71+
return self._id
72+
73+
@id.setter
74+
def id(self, id):
75+
"""Sets the id of this RestartGWSApplicationRequest.
76+
77+
78+
:param id: The id of this RestartGWSApplicationRequest. # noqa: E501
79+
:type: str
80+
"""
81+
if self._configuration.client_side_validation and id is None:
82+
raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501
83+
84+
self._id = id
85+
86+
@property
87+
def savepoint_id(self):
88+
"""Gets the savepoint_id of this RestartGWSApplicationRequest. # noqa: E501
89+
90+
91+
:return: The savepoint_id of this RestartGWSApplicationRequest. # noqa: E501
92+
:rtype: str
93+
"""
94+
return self._savepoint_id
95+
96+
@savepoint_id.setter
97+
def savepoint_id(self, savepoint_id):
98+
"""Sets the savepoint_id of this RestartGWSApplicationRequest.
99+
100+
101+
:param savepoint_id: The savepoint_id of this RestartGWSApplicationRequest. # noqa: E501
102+
:type: str
103+
"""
104+
105+
self._savepoint_id = savepoint_id
106+
107+
@property
108+
def type(self):
109+
"""Gets the type of this RestartGWSApplicationRequest. # noqa: E501
110+
111+
112+
:return: The type of this RestartGWSApplicationRequest. # noqa: E501
113+
:rtype: str
114+
"""
115+
return self._type
116+
117+
@type.setter
118+
def type(self, type):
119+
"""Sets the type of this RestartGWSApplicationRequest.
120+
121+
122+
:param type: The type of this RestartGWSApplicationRequest. # noqa: E501
123+
:type: str
124+
"""
125+
if self._configuration.client_side_validation and type is None:
126+
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
127+
allowed_values = ["FROM_NEW", "FROM_LATEST", "FROM_SAVEPOINT"] # noqa: E501
128+
if (self._configuration.client_side_validation and
129+
type not in allowed_values):
130+
raise ValueError(
131+
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
132+
.format(type, allowed_values)
133+
)
134+
135+
self._type = type
136+
137+
def to_dict(self):
138+
"""Returns the model properties as a dict"""
139+
result = {}
140+
141+
for attr, _ in six.iteritems(self.swagger_types):
142+
value = getattr(self, attr)
143+
if isinstance(value, list):
144+
result[attr] = list(map(
145+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
146+
value
147+
))
148+
elif hasattr(value, "to_dict"):
149+
result[attr] = value.to_dict()
150+
elif isinstance(value, dict):
151+
result[attr] = dict(map(
152+
lambda item: (item[0], item[1].to_dict())
153+
if hasattr(item[1], "to_dict") else item,
154+
value.items()
155+
))
156+
else:
157+
result[attr] = value
158+
if issubclass(RestartGWSApplicationRequest, dict):
159+
for key, value in self.items():
160+
result[key] = value
161+
162+
return result
163+
164+
def to_str(self):
165+
"""Returns the string representation of the model"""
166+
return pprint.pformat(self.to_dict())
167+
168+
def __repr__(self):
169+
"""For `print` and `pprint`"""
170+
return self.to_str()
171+
172+
def __eq__(self, other):
173+
"""Returns true if both objects are equal"""
174+
if not isinstance(other, RestartGWSApplicationRequest):
175+
return False
176+
177+
return self.to_dict() == other.to_dict()
178+
179+
def __ne__(self, other):
180+
"""Returns true if both objects are not equal"""
181+
if not isinstance(other, RestartGWSApplicationRequest):
182+
return True
183+
184+
return self.to_dict() != other.to_dict()

0 commit comments

Comments
 (0)