Skip to content

Commit 0cc32c2

Browse files
authored
feat: Add return types (#2)
1 parent 5b204f1 commit 0cc32c2

File tree

702 files changed

+46138
-32347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

702 files changed

+46138
-32347
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Welcome to Phrase's TMS API documentation. Please visit our [help center](https:
55
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
66

77
- API version: Latest
8-
- Package version: 0.1.1
8+
- Package version: 0.2.0
99
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
1010

1111
## Requirements.

phrasetms_client/api/additional_workflow_step_api.py

+96-74
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
# python 2 and python 3 compatibility library
1818
import six
1919

20+
from phrasetms_client.models import (
21+
PageDtoAdditionalWorkflowStepDto,
22+
AdditionalWorkflowStepDto,
23+
)
2024
from phrasetms_client.api_client import ApiClient
2125

2226

@@ -32,7 +36,7 @@ def __init__(self, api_client=None):
3236
api_client = ApiClient()
3337
self.api_client = api_client
3438

35-
def create_awf_step(self, **kwargs): # noqa: E501
39+
def create_awf_step(self, **kwargs) -> AdditionalWorkflowStepDto: # noqa: E501
3640
"""Create additional workflow step # noqa: E501
3741
3842
This method makes a synchronous HTTP request by default. To make an
@@ -46,14 +50,16 @@ def create_awf_step(self, **kwargs): # noqa: E501
4650
If the method is called asynchronously,
4751
returns the request thread.
4852
"""
49-
kwargs['_return_http_data_only'] = True
50-
if kwargs.get('async_req'):
53+
kwargs["_return_http_data_only"] = True
54+
if kwargs.get("async_req"):
5155
return self.create_awf_step_with_http_info(**kwargs) # noqa: E501
5256
else:
5357
(data) = self.create_awf_step_with_http_info(**kwargs) # noqa: E501
5458
return data
5559

56-
def create_awf_step_with_http_info(self, **kwargs): # noqa: E501
60+
def create_awf_step_with_http_info(
61+
self, **kwargs
62+
) -> AdditionalWorkflowStepDto: # noqa: E501
5763
"""Create additional workflow step # noqa: E501
5864
5965
This method makes a synchronous HTTP request by default. To make an
@@ -68,21 +74,21 @@ def create_awf_step_with_http_info(self, **kwargs): # noqa: E501
6874
returns the request thread.
6975
"""
7076

71-
all_params = ['body'] # noqa: E501
72-
all_params.append('async_req')
73-
all_params.append('_return_http_data_only')
74-
all_params.append('_preload_content')
75-
all_params.append('_request_timeout')
77+
all_params = ["body"] # noqa: E501
78+
all_params.append("async_req")
79+
all_params.append("_return_http_data_only")
80+
all_params.append("_preload_content")
81+
all_params.append("_request_timeout")
7682

7783
params = locals()
78-
for key, val in six.iteritems(params['kwargs']):
84+
for key, val in six.iteritems(params["kwargs"]):
7985
if key not in all_params:
8086
raise TypeError(
8187
"Got an unexpected keyword argument '%s'"
8288
" to method create_awf_step" % key
8389
)
8490
params[key] = val
85-
del params['kwargs']
91+
del params["kwargs"]
8692

8793
collection_formats = {}
8894

@@ -96,36 +102,42 @@ def create_awf_step_with_http_info(self, **kwargs): # noqa: E501
96102
local_var_files = {}
97103

98104
body_params = None
99-
if 'body' in params:
100-
body_params = params['body']
105+
if "body" in params:
106+
body_params = params["body"]
101107
# HTTP header `Accept`
102-
header_params['Accept'] = self.api_client.select_header_accept(
103-
['*/*']) # noqa: E501
108+
header_params["Accept"] = self.api_client.select_header_accept(
109+
["*/*"]
110+
) # noqa: E501
104111

105112
# HTTP header `Content-Type`
106-
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
107-
['*/*']) # noqa: E501
113+
header_params[
114+
"Content-Type"
115+
] = self.api_client.select_header_content_type( # noqa: E501
116+
["*/*"]
117+
) # noqa: E501
108118

109119
# Authentication setting
110120
auth_settings = [] # noqa: E501
111121

112122
return self.api_client.call_api(
113-
'/api2/v1/additionalWorkflowSteps', 'POST',
123+
"/api2/v1/additionalWorkflowSteps",
124+
"POST",
114125
path_params,
115126
query_params,
116127
header_params,
117128
body=body_params,
118129
post_params=form_params,
119130
files=local_var_files,
120-
response_type='AdditionalWorkflowStepDto', # noqa: E501
131+
response_type="AdditionalWorkflowStepDto", # noqa: E501
121132
auth_settings=auth_settings,
122-
async_req=params.get('async_req'),
123-
_return_http_data_only=params.get('_return_http_data_only'),
124-
_preload_content=params.get('_preload_content', True),
125-
_request_timeout=params.get('_request_timeout'),
126-
collection_formats=collection_formats)
127-
128-
def delete_awf_step(self, id, **kwargs): # noqa: E501
133+
async_req=params.get("async_req"),
134+
_return_http_data_only=params.get("_return_http_data_only"),
135+
_preload_content=params.get("_preload_content", True),
136+
_request_timeout=params.get("_request_timeout"),
137+
collection_formats=collection_formats,
138+
)
139+
140+
def delete_awf_step(self, id, **kwargs) -> None: # noqa: E501
129141
"""Delete additional workflow step # noqa: E501
130142
131143
This method makes a synchronous HTTP request by default. To make an
@@ -139,14 +151,14 @@ def delete_awf_step(self, id, **kwargs): # noqa: E501
139151
If the method is called asynchronously,
140152
returns the request thread.
141153
"""
142-
kwargs['_return_http_data_only'] = True
143-
if kwargs.get('async_req'):
154+
kwargs["_return_http_data_only"] = True
155+
if kwargs.get("async_req"):
144156
return self.delete_awf_step_with_http_info(id, **kwargs) # noqa: E501
145157
else:
146158
(data) = self.delete_awf_step_with_http_info(id, **kwargs) # noqa: E501
147159
return data
148160

149-
def delete_awf_step_with_http_info(self, id, **kwargs): # noqa: E501
161+
def delete_awf_step_with_http_info(self, id, **kwargs) -> None: # noqa: E501
150162
"""Delete additional workflow step # noqa: E501
151163
152164
This method makes a synchronous HTTP request by default. To make an
@@ -161,31 +173,32 @@ def delete_awf_step_with_http_info(self, id, **kwargs): # noqa: E501
161173
returns the request thread.
162174
"""
163175

164-
all_params = ['id'] # noqa: E501
165-
all_params.append('async_req')
166-
all_params.append('_return_http_data_only')
167-
all_params.append('_preload_content')
168-
all_params.append('_request_timeout')
176+
all_params = ["id"] # noqa: E501
177+
all_params.append("async_req")
178+
all_params.append("_return_http_data_only")
179+
all_params.append("_preload_content")
180+
all_params.append("_request_timeout")
169181

170182
params = locals()
171-
for key, val in six.iteritems(params['kwargs']):
183+
for key, val in six.iteritems(params["kwargs"]):
172184
if key not in all_params:
173185
raise TypeError(
174186
"Got an unexpected keyword argument '%s'"
175187
" to method delete_awf_step" % key
176188
)
177189
params[key] = val
178-
del params['kwargs']
190+
del params["kwargs"]
179191
# verify the required parameter 'id' is set
180-
if ('id' not in params or
181-
params['id'] is None):
182-
raise ValueError("Missing the required parameter `id` when calling `delete_awf_step`") # noqa: E501
192+
if "id" not in params or params["id"] is None:
193+
raise ValueError(
194+
"Missing the required parameter `id` when calling `delete_awf_step`"
195+
) # noqa: E501
183196

184197
collection_formats = {}
185198

186199
path_params = {}
187-
if 'id' in params:
188-
path_params['id'] = params['id'] # noqa: E501
200+
if "id" in params:
201+
path_params["id"] = params["id"] # noqa: E501
189202

190203
query_params = []
191204

@@ -199,7 +212,8 @@ def delete_awf_step_with_http_info(self, id, **kwargs): # noqa: E501
199212
auth_settings = [] # noqa: E501
200213

201214
return self.api_client.call_api(
202-
'/api2/v1/additionalWorkflowSteps/{id}', 'DELETE',
215+
"/api2/v1/additionalWorkflowSteps/{id}",
216+
"DELETE",
203217
path_params,
204218
query_params,
205219
header_params,
@@ -208,13 +222,16 @@ def delete_awf_step_with_http_info(self, id, **kwargs): # noqa: E501
208222
files=local_var_files,
209223
response_type=None, # noqa: E501
210224
auth_settings=auth_settings,
211-
async_req=params.get('async_req'),
212-
_return_http_data_only=params.get('_return_http_data_only'),
213-
_preload_content=params.get('_preload_content', True),
214-
_request_timeout=params.get('_request_timeout'),
215-
collection_formats=collection_formats)
216-
217-
def list_awf_steps(self, **kwargs): # noqa: E501
225+
async_req=params.get("async_req"),
226+
_return_http_data_only=params.get("_return_http_data_only"),
227+
_preload_content=params.get("_preload_content", True),
228+
_request_timeout=params.get("_request_timeout"),
229+
collection_formats=collection_formats,
230+
)
231+
232+
def list_awf_steps(
233+
self, **kwargs
234+
) -> PageDtoAdditionalWorkflowStepDto: # noqa: E501
218235
"""List additional workflow steps # noqa: E501
219236
220237
This method makes a synchronous HTTP request by default. To make an
@@ -230,14 +247,16 @@ def list_awf_steps(self, **kwargs): # noqa: E501
230247
If the method is called asynchronously,
231248
returns the request thread.
232249
"""
233-
kwargs['_return_http_data_only'] = True
234-
if kwargs.get('async_req'):
250+
kwargs["_return_http_data_only"] = True
251+
if kwargs.get("async_req"):
235252
return self.list_awf_steps_with_http_info(**kwargs) # noqa: E501
236253
else:
237254
(data) = self.list_awf_steps_with_http_info(**kwargs) # noqa: E501
238255
return data
239256

240-
def list_awf_steps_with_http_info(self, **kwargs): # noqa: E501
257+
def list_awf_steps_with_http_info(
258+
self, **kwargs
259+
) -> PageDtoAdditionalWorkflowStepDto: # noqa: E501
241260
"""List additional workflow steps # noqa: E501
242261
243262
This method makes a synchronous HTTP request by default. To make an
@@ -254,33 +273,33 @@ def list_awf_steps_with_http_info(self, **kwargs): # noqa: E501
254273
returns the request thread.
255274
"""
256275

257-
all_params = ['page_number', 'page_size', 'name'] # noqa: E501
258-
all_params.append('async_req')
259-
all_params.append('_return_http_data_only')
260-
all_params.append('_preload_content')
261-
all_params.append('_request_timeout')
276+
all_params = ["page_number", "page_size", "name"] # noqa: E501
277+
all_params.append("async_req")
278+
all_params.append("_return_http_data_only")
279+
all_params.append("_preload_content")
280+
all_params.append("_request_timeout")
262281

263282
params = locals()
264-
for key, val in six.iteritems(params['kwargs']):
283+
for key, val in six.iteritems(params["kwargs"]):
265284
if key not in all_params:
266285
raise TypeError(
267286
"Got an unexpected keyword argument '%s'"
268287
" to method list_awf_steps" % key
269288
)
270289
params[key] = val
271-
del params['kwargs']
290+
del params["kwargs"]
272291

273292
collection_formats = {}
274293

275294
path_params = {}
276295

277296
query_params = []
278-
if 'page_number' in params:
279-
query_params.append(('pageNumber', params['page_number'])) # noqa: E501
280-
if 'page_size' in params:
281-
query_params.append(('pageSize', params['page_size'])) # noqa: E501
282-
if 'name' in params:
283-
query_params.append(('name', params['name'])) # noqa: E501
297+
if "page_number" in params:
298+
query_params.append(("pageNumber", params["page_number"])) # noqa: E501
299+
if "page_size" in params:
300+
query_params.append(("pageSize", params["page_size"])) # noqa: E501
301+
if "name" in params:
302+
query_params.append(("name", params["name"])) # noqa: E501
284303

285304
header_params = {}
286305

@@ -289,24 +308,27 @@ def list_awf_steps_with_http_info(self, **kwargs): # noqa: E501
289308

290309
body_params = None
291310
# HTTP header `Accept`
292-
header_params['Accept'] = self.api_client.select_header_accept(
293-
['application/json']) # noqa: E501
311+
header_params["Accept"] = self.api_client.select_header_accept(
312+
["application/json"]
313+
) # noqa: E501
294314

295315
# Authentication setting
296316
auth_settings = [] # noqa: E501
297317

298318
return self.api_client.call_api(
299-
'/api2/v1/additionalWorkflowSteps', 'GET',
319+
"/api2/v1/additionalWorkflowSteps",
320+
"GET",
300321
path_params,
301322
query_params,
302323
header_params,
303324
body=body_params,
304325
post_params=form_params,
305326
files=local_var_files,
306-
response_type='PageDtoAdditionalWorkflowStepDto', # noqa: E501
327+
response_type="PageDtoAdditionalWorkflowStepDto", # noqa: E501
307328
auth_settings=auth_settings,
308-
async_req=params.get('async_req'),
309-
_return_http_data_only=params.get('_return_http_data_only'),
310-
_preload_content=params.get('_preload_content', True),
311-
_request_timeout=params.get('_request_timeout'),
312-
collection_formats=collection_formats)
329+
async_req=params.get("async_req"),
330+
_return_http_data_only=params.get("_return_http_data_only"),
331+
_preload_content=params.get("_preload_content", True),
332+
_request_timeout=params.get("_request_timeout"),
333+
collection_formats=collection_formats,
334+
)

0 commit comments

Comments
 (0)