groupdocs-conversion-cloud 24.4__py3-none-any.whl → 24.11__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.
- groupdocs_conversion_cloud/__init__.py +3 -0
- groupdocs_conversion_cloud/api_client.py +2 -2
- groupdocs_conversion_cloud/apis/__init__.py +1 -0
- groupdocs_conversion_cloud/apis/async_api.py +633 -0
- groupdocs_conversion_cloud/configuration.py +2 -2
- groupdocs_conversion_cloud/models/__init__.py +1 -0
- groupdocs_conversion_cloud/models/email_load_options.py +1 -32
- groupdocs_conversion_cloud/models/operation_result.py +389 -0
- groupdocs_conversion_cloud/models/web_load_options.py +102 -3
- {groupdocs_conversion_cloud-24.4.dist-info → groupdocs_conversion_cloud-24.11.dist-info}/METADATA +3 -3
- {groupdocs_conversion_cloud-24.4.dist-info → groupdocs_conversion_cloud-24.11.dist-info}/RECORD +14 -12
- {groupdocs_conversion_cloud-24.4.dist-info → groupdocs_conversion_cloud-24.11.dist-info}/WHEEL +1 -1
- {groupdocs_conversion_cloud-24.4.dist-info → groupdocs_conversion_cloud-24.11.dist-info}/LICENSE +0 -0
- {groupdocs_conversion_cloud-24.4.dist-info → groupdocs_conversion_cloud-24.11.dist-info}/top_level.txt +0 -0
@@ -5,6 +5,7 @@
|
|
5
5
|
from __future__ import absolute_import
|
6
6
|
|
7
7
|
# import apis
|
8
|
+
from groupdocs_conversion_cloud.apis.async_api import AsyncApi
|
8
9
|
from groupdocs_conversion_cloud.apis.convert_api import ConvertApi
|
9
10
|
from groupdocs_conversion_cloud.apis.file_api import FileApi
|
10
11
|
from groupdocs_conversion_cloud.apis.folder_api import FolderApi
|
@@ -18,6 +19,7 @@ from groupdocs_conversion_cloud.apis.storage_api import GetDiscUsageRequest, Get
|
|
18
19
|
from groupdocs_conversion_cloud.apis.folder_api import CopyFolderRequest, CreateFolderRequest, DeleteFolderRequest, GetFilesListRequest, MoveFolderRequest
|
19
20
|
from groupdocs_conversion_cloud.apis.convert_api import ConvertDocumentRequest, ConvertDocumentDirectRequest
|
20
21
|
from groupdocs_conversion_cloud.apis.info_api import GetSupportedConversionTypesRequest, GetDocumentMetadataRequest
|
22
|
+
from groupdocs_conversion_cloud.apis.async_api import GetOperationResultRequest, GetOperationStatusRequest, StartConvertRequest, StartConvertAndSaveRequest
|
21
23
|
|
22
24
|
# import related types
|
23
25
|
from groupdocs_conversion_cloud.auth import Auth
|
@@ -42,6 +44,7 @@ from groupdocs_conversion_cloud.models.files_upload_result import FilesUploadRes
|
|
42
44
|
from groupdocs_conversion_cloud.models.license_info import LicenseInfo
|
43
45
|
from groupdocs_conversion_cloud.models.load_options import LoadOptions
|
44
46
|
from groupdocs_conversion_cloud.models.object_exist import ObjectExist
|
47
|
+
from groupdocs_conversion_cloud.models.operation_result import OperationResult
|
45
48
|
from groupdocs_conversion_cloud.models.storage_exist import StorageExist
|
46
49
|
from groupdocs_conversion_cloud.models.storage_file import StorageFile
|
47
50
|
from groupdocs_conversion_cloud.models.stored_converted_result import StoredConvertedResult
|
@@ -74,12 +74,12 @@ class ApiClient(object):
|
|
74
74
|
self.configuration = configuration
|
75
75
|
self.pool = None
|
76
76
|
self.rest_client = rest.RESTClientObject(configuration)
|
77
|
-
self.default_headers = {'x-groupdocs-client': 'python sdk', 'x-groupdocs-version': '24.
|
77
|
+
self.default_headers = {'x-groupdocs-client': 'python sdk', 'x-groupdocs-version': '24.11'}
|
78
78
|
if header_name is not None:
|
79
79
|
self.default_headers[header_name] = header_value
|
80
80
|
self.cookie = cookie
|
81
81
|
# Set default User-Agent.
|
82
|
-
self.user_agent = 'python sdk 24.
|
82
|
+
self.user_agent = 'python sdk 24.11'
|
83
83
|
|
84
84
|
def __del__(self):
|
85
85
|
if self.pool is not None:
|
@@ -3,6 +3,7 @@ from __future__ import absolute_import
|
|
3
3
|
# flake8: noqa
|
4
4
|
|
5
5
|
# import apis
|
6
|
+
from groupdocs_conversion_cloud.apis.async_api import AsyncApi
|
6
7
|
from groupdocs_conversion_cloud.apis.convert_api import ConvertApi
|
7
8
|
from groupdocs_conversion_cloud.apis.file_api import FileApi
|
8
9
|
from groupdocs_conversion_cloud.apis.folder_api import FolderApi
|
@@ -0,0 +1,633 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
# -----------------------------------------------------------------------------------
|
4
|
+
# <copyright company="Aspose Pty Ltd">
|
5
|
+
# Copyright (c) 2003-2024 Aspose Pty Ltd
|
6
|
+
# </copyright>
|
7
|
+
# <summary>
|
8
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
+
# of this software and associated documentation files (the "Software"), to deal
|
10
|
+
# in the Software without restriction, including without limitation the rights
|
11
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
+
# copies of the Software, and to permit persons to whom the Software is
|
13
|
+
# furnished to do so, subject to the following conditions:
|
14
|
+
#
|
15
|
+
# The above copyright notice and this permission notice shall be included in all
|
16
|
+
# copies or substantial portions of the Software.
|
17
|
+
#
|
18
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
24
|
+
# SOFTWARE.
|
25
|
+
# </summary>
|
26
|
+
# -----------------------------------------------------------------------------------
|
27
|
+
|
28
|
+
from __future__ import absolute_import
|
29
|
+
|
30
|
+
import re # noqa: F401
|
31
|
+
|
32
|
+
# python 2 and python 3 compatibility library
|
33
|
+
import six
|
34
|
+
import json
|
35
|
+
|
36
|
+
from groupdocs_conversion_cloud.auth import Auth
|
37
|
+
from groupdocs_conversion_cloud.api_client import ApiClient
|
38
|
+
from groupdocs_conversion_cloud.api_exception import ApiException
|
39
|
+
from groupdocs_conversion_cloud.configuration import Configuration
|
40
|
+
|
41
|
+
class AsyncApi(object):
|
42
|
+
"""
|
43
|
+
GroupDocs.Conversion Cloud API
|
44
|
+
|
45
|
+
:param configuration: API configuration
|
46
|
+
"""
|
47
|
+
|
48
|
+
def __init__(self, configuration):
|
49
|
+
api_client = ApiClient(configuration)
|
50
|
+
|
51
|
+
self.auth = Auth(configuration, api_client)
|
52
|
+
self.api_client = api_client
|
53
|
+
self.configuration = configuration
|
54
|
+
|
55
|
+
def close(self): # noqa: E501
|
56
|
+
"""
|
57
|
+
Closes thread pool. This method should be called when
|
58
|
+
methods are executed asynchronously (is_async=True is passed as parameter)
|
59
|
+
and this instance of AsyncApi is not going to be used any more.
|
60
|
+
"""
|
61
|
+
if self.api_client is not None:
|
62
|
+
if(self.api_client.pool is not None):
|
63
|
+
self.api_client.pool.close()
|
64
|
+
self.api_client.pool.join()
|
65
|
+
self.api_client.pool = None
|
66
|
+
|
67
|
+
@classmethod
|
68
|
+
def from_keys(cls, app_sid, app_key):
|
69
|
+
"""
|
70
|
+
Initializes new instance of AsyncApi with API keys
|
71
|
+
|
72
|
+
:param app_sid Application identifier (App SID)
|
73
|
+
:param app_key Application private key (App Key)
|
74
|
+
"""
|
75
|
+
configuration = Configuration(app_sid, app_key)
|
76
|
+
return AsyncApi(configuration)
|
77
|
+
|
78
|
+
@classmethod
|
79
|
+
def from_config(cls, configuration):
|
80
|
+
"""
|
81
|
+
Initializes new instance of AsyncApi with configuration options
|
82
|
+
|
83
|
+
:param configuration API configuration
|
84
|
+
"""
|
85
|
+
return AsyncApi(configuration)
|
86
|
+
|
87
|
+
def get_operation_result(self, request,**kwargs): # noqa: E501
|
88
|
+
"""Get async operation result # noqa: E501
|
89
|
+
|
90
|
+
This method makes a synchronous HTTP request by default. To make an
|
91
|
+
asynchronous HTTP request, please pass is_async=True
|
92
|
+
|
93
|
+
:param is_async bool
|
94
|
+
:param str id: (required)
|
95
|
+
:return: file
|
96
|
+
If the method is called asynchronously,
|
97
|
+
returns the request thread.
|
98
|
+
"""
|
99
|
+
kwargs['_return_http_data_only'] = True
|
100
|
+
|
101
|
+
if kwargs.get('is_async'):
|
102
|
+
return self._get_operation_result_with_http_info(request, **kwargs) # noqa: E501
|
103
|
+
|
104
|
+
(data) = self._get_operation_result_with_http_info(request, **kwargs) # noqa: E501
|
105
|
+
return data
|
106
|
+
|
107
|
+
def _get_operation_result_with_http_info(self, request, **kwargs): # noqa: E501
|
108
|
+
"""Get async operation result # noqa: E501
|
109
|
+
|
110
|
+
This method makes a synchronous HTTP request by default. To make an
|
111
|
+
asynchronous HTTP request, please pass is_async=True
|
112
|
+
|
113
|
+
:param is_async bool
|
114
|
+
:param GetOperationResultRequest request object with parameters
|
115
|
+
:return: file
|
116
|
+
If the method is called asynchronously,
|
117
|
+
returns the request thread.
|
118
|
+
"""
|
119
|
+
params = locals()
|
120
|
+
params['is_async'] = ''
|
121
|
+
params['_return_http_data_only'] = False
|
122
|
+
params['_preload_content'] = True
|
123
|
+
params['_request_timeout'] = ''
|
124
|
+
for key, val in six.iteritems(params['kwargs']):
|
125
|
+
if key not in params:
|
126
|
+
raise TypeError(
|
127
|
+
"Got an unexpected keyword argument '%s'"
|
128
|
+
" to method get_operation_result" % key
|
129
|
+
)
|
130
|
+
params[key] = val
|
131
|
+
del params['kwargs']
|
132
|
+
# verify the required parameter 'id' is set
|
133
|
+
if request.id is None:
|
134
|
+
raise ValueError("Missing the required parameter `id` when calling `get_operation_result`") # noqa: E501
|
135
|
+
|
136
|
+
collection_formats = {}
|
137
|
+
path = '/conversion/async/result'
|
138
|
+
path_params = {}
|
139
|
+
|
140
|
+
query_params = []
|
141
|
+
if self.__downcase_first_letter('id') in path:
|
142
|
+
path = path.replace('{' + self.__downcase_first_letter('id' + '}'), request.id if request.id is not None else '')
|
143
|
+
else:
|
144
|
+
if request.id is not None:
|
145
|
+
query_params.append((self.__downcase_first_letter('id'), request.id)) # noqa: E501
|
146
|
+
|
147
|
+
header_params = {}
|
148
|
+
|
149
|
+
form_params = []
|
150
|
+
local_var_files = []
|
151
|
+
|
152
|
+
body_params = None
|
153
|
+
# HTTP header `Accept`
|
154
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
155
|
+
['application/json']) # noqa: E501
|
156
|
+
|
157
|
+
# HTTP header `Content-Type`
|
158
|
+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
159
|
+
['application/json']) # noqa: E501
|
160
|
+
|
161
|
+
call_kwargs = {
|
162
|
+
'resource_path':path,
|
163
|
+
'method':'GET',
|
164
|
+
'path_params':path_params,
|
165
|
+
'query_params':query_params,
|
166
|
+
'header_params':header_params,
|
167
|
+
'body':body_params,
|
168
|
+
'post_params':form_params,
|
169
|
+
'files':local_var_files,
|
170
|
+
'response_type':'file', # noqa: E501
|
171
|
+
'auth_settings':self.auth.get_auth_settings(),
|
172
|
+
'is_async':params.get('is_async'),
|
173
|
+
'_return_http_data_only':params.get('_return_http_data_only'),
|
174
|
+
'_preload_content':params.get('_preload_content', True),
|
175
|
+
'_request_timeout':params.get('_request_timeout'),
|
176
|
+
'collection_formats':collection_formats
|
177
|
+
}
|
178
|
+
|
179
|
+
return self.api_client.call_api(**call_kwargs) # noqa: E501
|
180
|
+
|
181
|
+
def get_operation_status(self, request,**kwargs): # noqa: E501
|
182
|
+
"""Get async operation status # noqa: E501
|
183
|
+
|
184
|
+
This method makes a synchronous HTTP request by default. To make an
|
185
|
+
asynchronous HTTP request, please pass is_async=True
|
186
|
+
|
187
|
+
:param is_async bool
|
188
|
+
:param str id: (required)
|
189
|
+
:return: OperationResult
|
190
|
+
If the method is called asynchronously,
|
191
|
+
returns the request thread.
|
192
|
+
"""
|
193
|
+
kwargs['_return_http_data_only'] = True
|
194
|
+
|
195
|
+
if kwargs.get('is_async'):
|
196
|
+
return self._get_operation_status_with_http_info(request, **kwargs) # noqa: E501
|
197
|
+
|
198
|
+
(data) = self._get_operation_status_with_http_info(request, **kwargs) # noqa: E501
|
199
|
+
return data
|
200
|
+
|
201
|
+
def _get_operation_status_with_http_info(self, request, **kwargs): # noqa: E501
|
202
|
+
"""Get async operation status # noqa: E501
|
203
|
+
|
204
|
+
This method makes a synchronous HTTP request by default. To make an
|
205
|
+
asynchronous HTTP request, please pass is_async=True
|
206
|
+
|
207
|
+
:param is_async bool
|
208
|
+
:param GetOperationStatusRequest request object with parameters
|
209
|
+
:return: OperationResult
|
210
|
+
If the method is called asynchronously,
|
211
|
+
returns the request thread.
|
212
|
+
"""
|
213
|
+
params = locals()
|
214
|
+
params['is_async'] = ''
|
215
|
+
params['_return_http_data_only'] = False
|
216
|
+
params['_preload_content'] = True
|
217
|
+
params['_request_timeout'] = ''
|
218
|
+
for key, val in six.iteritems(params['kwargs']):
|
219
|
+
if key not in params:
|
220
|
+
raise TypeError(
|
221
|
+
"Got an unexpected keyword argument '%s'"
|
222
|
+
" to method get_operation_status" % key
|
223
|
+
)
|
224
|
+
params[key] = val
|
225
|
+
del params['kwargs']
|
226
|
+
# verify the required parameter 'id' is set
|
227
|
+
if request.id is None:
|
228
|
+
raise ValueError("Missing the required parameter `id` when calling `get_operation_status`") # noqa: E501
|
229
|
+
|
230
|
+
collection_formats = {}
|
231
|
+
path = '/conversion/async'
|
232
|
+
path_params = {}
|
233
|
+
|
234
|
+
query_params = []
|
235
|
+
if self.__downcase_first_letter('id') in path:
|
236
|
+
path = path.replace('{' + self.__downcase_first_letter('id' + '}'), request.id if request.id is not None else '')
|
237
|
+
else:
|
238
|
+
if request.id is not None:
|
239
|
+
query_params.append((self.__downcase_first_letter('id'), request.id)) # noqa: E501
|
240
|
+
|
241
|
+
header_params = {}
|
242
|
+
|
243
|
+
form_params = []
|
244
|
+
local_var_files = []
|
245
|
+
|
246
|
+
body_params = None
|
247
|
+
# HTTP header `Accept`
|
248
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
249
|
+
['application/json']) # noqa: E501
|
250
|
+
|
251
|
+
# HTTP header `Content-Type`
|
252
|
+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
253
|
+
['application/json']) # noqa: E501
|
254
|
+
|
255
|
+
call_kwargs = {
|
256
|
+
'resource_path':path,
|
257
|
+
'method':'GET',
|
258
|
+
'path_params':path_params,
|
259
|
+
'query_params':query_params,
|
260
|
+
'header_params':header_params,
|
261
|
+
'body':body_params,
|
262
|
+
'post_params':form_params,
|
263
|
+
'files':local_var_files,
|
264
|
+
'response_type':'OperationResult', # noqa: E501
|
265
|
+
'auth_settings':self.auth.get_auth_settings(),
|
266
|
+
'is_async':params.get('is_async'),
|
267
|
+
'_return_http_data_only':params.get('_return_http_data_only'),
|
268
|
+
'_preload_content':params.get('_preload_content', True),
|
269
|
+
'_request_timeout':params.get('_request_timeout'),
|
270
|
+
'collection_formats':collection_formats
|
271
|
+
}
|
272
|
+
|
273
|
+
return self.api_client.call_api(**call_kwargs) # noqa: E501
|
274
|
+
|
275
|
+
def start_convert(self, request,**kwargs): # noqa: E501
|
276
|
+
"""Starts async conversion specified input document, from request body, to format specified # noqa: E501
|
277
|
+
|
278
|
+
This method makes a synchronous HTTP request by default. To make an
|
279
|
+
asynchronous HTTP request, please pass is_async=True
|
280
|
+
|
281
|
+
:param is_async bool
|
282
|
+
:param str format: Requested conversion format (required)
|
283
|
+
:param file file: Input file to convert (required)
|
284
|
+
:param int from_page: Page start conversion from
|
285
|
+
:param int pages_count: Number of pages to convert
|
286
|
+
:return: str
|
287
|
+
If the method is called asynchronously,
|
288
|
+
returns the request thread.
|
289
|
+
"""
|
290
|
+
kwargs['_return_http_data_only'] = True
|
291
|
+
|
292
|
+
if kwargs.get('is_async'):
|
293
|
+
return self._start_convert_with_http_info(request, **kwargs) # noqa: E501
|
294
|
+
|
295
|
+
(data) = self._start_convert_with_http_info(request, **kwargs) # noqa: E501
|
296
|
+
return data
|
297
|
+
|
298
|
+
def _start_convert_with_http_info(self, request, **kwargs): # noqa: E501
|
299
|
+
"""Starts async conversion specified input document, from request body, to format specified # noqa: E501
|
300
|
+
|
301
|
+
This method makes a synchronous HTTP request by default. To make an
|
302
|
+
asynchronous HTTP request, please pass is_async=True
|
303
|
+
|
304
|
+
:param is_async bool
|
305
|
+
:param StartConvertRequest request object with parameters
|
306
|
+
:return: str
|
307
|
+
If the method is called asynchronously,
|
308
|
+
returns the request thread.
|
309
|
+
"""
|
310
|
+
params = locals()
|
311
|
+
params['is_async'] = ''
|
312
|
+
params['_return_http_data_only'] = False
|
313
|
+
params['_preload_content'] = True
|
314
|
+
params['_request_timeout'] = ''
|
315
|
+
for key, val in six.iteritems(params['kwargs']):
|
316
|
+
if key not in params:
|
317
|
+
raise TypeError(
|
318
|
+
"Got an unexpected keyword argument '%s'"
|
319
|
+
" to method start_convert" % key
|
320
|
+
)
|
321
|
+
params[key] = val
|
322
|
+
del params['kwargs']
|
323
|
+
# verify the required parameter 'format' is set
|
324
|
+
if request.format is None:
|
325
|
+
raise ValueError("Missing the required parameter `format` when calling `start_convert`") # noqa: E501
|
326
|
+
# verify the required parameter 'file' is set
|
327
|
+
if request.file is None:
|
328
|
+
raise ValueError("Missing the required parameter `file` when calling `start_convert`") # noqa: E501
|
329
|
+
|
330
|
+
collection_formats = {}
|
331
|
+
path = '/conversion/async'
|
332
|
+
path_params = {}
|
333
|
+
|
334
|
+
query_params = []
|
335
|
+
if self.__downcase_first_letter('format') in path:
|
336
|
+
path = path.replace('{' + self.__downcase_first_letter('format' + '}'), request.format if request.format is not None else '')
|
337
|
+
else:
|
338
|
+
if request.format is not None:
|
339
|
+
query_params.append((self.__downcase_first_letter('format'), request.format)) # noqa: E501
|
340
|
+
if self.__downcase_first_letter('fromPage') in path:
|
341
|
+
path = path.replace('{' + self.__downcase_first_letter('fromPage' + '}'), request.from_page if request.from_page is not None else '')
|
342
|
+
else:
|
343
|
+
if request.from_page is not None:
|
344
|
+
query_params.append((self.__downcase_first_letter('fromPage'), request.from_page)) # noqa: E501
|
345
|
+
if self.__downcase_first_letter('pagesCount') in path:
|
346
|
+
path = path.replace('{' + self.__downcase_first_letter('pagesCount' + '}'), request.pages_count if request.pages_count is not None else '')
|
347
|
+
else:
|
348
|
+
if request.pages_count is not None:
|
349
|
+
query_params.append((self.__downcase_first_letter('pagesCount'), request.pages_count)) # noqa: E501
|
350
|
+
|
351
|
+
header_params = {}
|
352
|
+
|
353
|
+
form_params = []
|
354
|
+
local_var_files = []
|
355
|
+
if request.file is not None:
|
356
|
+
local_var_files.append((self.__downcase_first_letter('File'), request.file)) # noqa: E501
|
357
|
+
|
358
|
+
body_params = None
|
359
|
+
# HTTP header `Accept`
|
360
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
361
|
+
['application/json']) # noqa: E501
|
362
|
+
|
363
|
+
# HTTP header `Content-Type`
|
364
|
+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
365
|
+
['multipart/form-data']) # noqa: E501
|
366
|
+
|
367
|
+
call_kwargs = {
|
368
|
+
'resource_path':path,
|
369
|
+
'method':'PUT',
|
370
|
+
'path_params':path_params,
|
371
|
+
'query_params':query_params,
|
372
|
+
'header_params':header_params,
|
373
|
+
'body':body_params,
|
374
|
+
'post_params':form_params,
|
375
|
+
'files':local_var_files,
|
376
|
+
'response_type':'str', # noqa: E501
|
377
|
+
'auth_settings':self.auth.get_auth_settings(),
|
378
|
+
'is_async':params.get('is_async'),
|
379
|
+
'_return_http_data_only':params.get('_return_http_data_only'),
|
380
|
+
'_preload_content':params.get('_preload_content', True),
|
381
|
+
'_request_timeout':params.get('_request_timeout'),
|
382
|
+
'collection_formats':collection_formats
|
383
|
+
}
|
384
|
+
|
385
|
+
return self.api_client.call_api(**call_kwargs) # noqa: E501
|
386
|
+
|
387
|
+
def start_convert_and_save(self, request,**kwargs): # noqa: E501
|
388
|
+
"""Starts async conversion specified input document to format specified in the convertSettings with specified options # noqa: E501
|
389
|
+
|
390
|
+
This method makes a synchronous HTTP request by default. To make an
|
391
|
+
asynchronous HTTP request, please pass is_async=True
|
392
|
+
|
393
|
+
:param is_async bool
|
394
|
+
:param ConvertSettings convert_settings: Conversion settings (required)
|
395
|
+
:return: str
|
396
|
+
If the method is called asynchronously,
|
397
|
+
returns the request thread.
|
398
|
+
"""
|
399
|
+
kwargs['_return_http_data_only'] = True
|
400
|
+
|
401
|
+
if kwargs.get('is_async'):
|
402
|
+
return self._start_convert_and_save_with_http_info(request, **kwargs) # noqa: E501
|
403
|
+
|
404
|
+
(data) = self._start_convert_and_save_with_http_info(request, **kwargs) # noqa: E501
|
405
|
+
return data
|
406
|
+
|
407
|
+
def _start_convert_and_save_with_http_info(self, request, **kwargs): # noqa: E501
|
408
|
+
"""Starts async conversion specified input document to format specified in the convertSettings with specified options # noqa: E501
|
409
|
+
|
410
|
+
This method makes a synchronous HTTP request by default. To make an
|
411
|
+
asynchronous HTTP request, please pass is_async=True
|
412
|
+
|
413
|
+
:param is_async bool
|
414
|
+
:param StartConvertAndSaveRequest request object with parameters
|
415
|
+
:return: str
|
416
|
+
If the method is called asynchronously,
|
417
|
+
returns the request thread.
|
418
|
+
"""
|
419
|
+
params = locals()
|
420
|
+
params['is_async'] = ''
|
421
|
+
params['_return_http_data_only'] = False
|
422
|
+
params['_preload_content'] = True
|
423
|
+
params['_request_timeout'] = ''
|
424
|
+
for key, val in six.iteritems(params['kwargs']):
|
425
|
+
if key not in params:
|
426
|
+
raise TypeError(
|
427
|
+
"Got an unexpected keyword argument '%s'"
|
428
|
+
" to method start_convert_and_save" % key
|
429
|
+
)
|
430
|
+
params[key] = val
|
431
|
+
del params['kwargs']
|
432
|
+
# verify the required parameter 'convert_settings' is set
|
433
|
+
if request.convert_settings is None:
|
434
|
+
raise ValueError("Missing the required parameter `convert_settings` when calling `start_convert_and_save`") # noqa: E501
|
435
|
+
|
436
|
+
collection_formats = {}
|
437
|
+
path = '/conversion/async'
|
438
|
+
path_params = {}
|
439
|
+
|
440
|
+
query_params = []
|
441
|
+
|
442
|
+
header_params = {}
|
443
|
+
|
444
|
+
form_params = []
|
445
|
+
local_var_files = []
|
446
|
+
|
447
|
+
body_params = None
|
448
|
+
if request.convert_settings is not None:
|
449
|
+
body_params = request.convert_settings
|
450
|
+
# HTTP header `Accept`
|
451
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
452
|
+
['application/json']) # noqa: E501
|
453
|
+
|
454
|
+
# HTTP header `Content-Type`
|
455
|
+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
456
|
+
['application/json']) # noqa: E501
|
457
|
+
|
458
|
+
call_kwargs = {
|
459
|
+
'resource_path':path,
|
460
|
+
'method':'POST',
|
461
|
+
'path_params':path_params,
|
462
|
+
'query_params':query_params,
|
463
|
+
'header_params':header_params,
|
464
|
+
'body':body_params,
|
465
|
+
'post_params':form_params,
|
466
|
+
'files':local_var_files,
|
467
|
+
'response_type':'str', # noqa: E501
|
468
|
+
'auth_settings':self.auth.get_auth_settings(),
|
469
|
+
'is_async':params.get('is_async'),
|
470
|
+
'_return_http_data_only':params.get('_return_http_data_only'),
|
471
|
+
'_preload_content':params.get('_preload_content', True),
|
472
|
+
'_request_timeout':params.get('_request_timeout'),
|
473
|
+
'collection_formats':collection_formats
|
474
|
+
}
|
475
|
+
|
476
|
+
return self.api_client.call_api(**call_kwargs) # noqa: E501
|
477
|
+
|
478
|
+
def __downcase_first_letter(self, s):
|
479
|
+
if len(s) == 0:
|
480
|
+
return str
|
481
|
+
else:
|
482
|
+
return s[0].lower() + s[1:]
|
483
|
+
|
484
|
+
# coding: utf-8
|
485
|
+
|
486
|
+
# --------------------------------------------------------------------------------
|
487
|
+
# <copyright company="Aspose Pty Ltd" file="get_operation_result_request.py">
|
488
|
+
# Copyright (c) 2003-2024 Aspose Pty Ltd
|
489
|
+
# </copyright>
|
490
|
+
# <summary>
|
491
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
492
|
+
# of this software and associated documentation files (the "Software"), to deal
|
493
|
+
# in the Software without restriction, including without limitation the rights
|
494
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
495
|
+
# copies of the Software, and to permit persons to whom the Software is
|
496
|
+
# furnished to do so, subject to the following conditions:
|
497
|
+
#
|
498
|
+
# The above copyright notice and this permission notice shall be included in all
|
499
|
+
# copies or substantial portions of the Software.
|
500
|
+
#
|
501
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
502
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
503
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
504
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
505
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
506
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
507
|
+
# SOFTWARE.
|
508
|
+
# </summary>
|
509
|
+
# --------------------------------------------------------------------------------
|
510
|
+
|
511
|
+
class GetOperationResultRequest(object):
|
512
|
+
"""
|
513
|
+
Request model for get_operation_result operation.
|
514
|
+
:param id
|
515
|
+
"""
|
516
|
+
|
517
|
+
def __init__(self, id):
|
518
|
+
"""Initializes new instance of GetOperationResultRequest.""" # noqa: E501
|
519
|
+
self.id = id
|
520
|
+
# coding: utf-8
|
521
|
+
|
522
|
+
# --------------------------------------------------------------------------------
|
523
|
+
# <copyright company="Aspose Pty Ltd" file="get_operation_status_request.py">
|
524
|
+
# Copyright (c) 2003-2024 Aspose Pty Ltd
|
525
|
+
# </copyright>
|
526
|
+
# <summary>
|
527
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
528
|
+
# of this software and associated documentation files (the "Software"), to deal
|
529
|
+
# in the Software without restriction, including without limitation the rights
|
530
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
531
|
+
# copies of the Software, and to permit persons to whom the Software is
|
532
|
+
# furnished to do so, subject to the following conditions:
|
533
|
+
#
|
534
|
+
# The above copyright notice and this permission notice shall be included in all
|
535
|
+
# copies or substantial portions of the Software.
|
536
|
+
#
|
537
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
538
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
539
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
540
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
541
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
542
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
543
|
+
# SOFTWARE.
|
544
|
+
# </summary>
|
545
|
+
# --------------------------------------------------------------------------------
|
546
|
+
|
547
|
+
class GetOperationStatusRequest(object):
|
548
|
+
"""
|
549
|
+
Request model for get_operation_status operation.
|
550
|
+
:param id
|
551
|
+
"""
|
552
|
+
|
553
|
+
def __init__(self, id):
|
554
|
+
"""Initializes new instance of GetOperationStatusRequest.""" # noqa: E501
|
555
|
+
self.id = id
|
556
|
+
# coding: utf-8
|
557
|
+
|
558
|
+
# --------------------------------------------------------------------------------
|
559
|
+
# <copyright company="Aspose Pty Ltd" file="start_convert_request.py">
|
560
|
+
# Copyright (c) 2003-2024 Aspose Pty Ltd
|
561
|
+
# </copyright>
|
562
|
+
# <summary>
|
563
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
564
|
+
# of this software and associated documentation files (the "Software"), to deal
|
565
|
+
# in the Software without restriction, including without limitation the rights
|
566
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
567
|
+
# copies of the Software, and to permit persons to whom the Software is
|
568
|
+
# furnished to do so, subject to the following conditions:
|
569
|
+
#
|
570
|
+
# The above copyright notice and this permission notice shall be included in all
|
571
|
+
# copies or substantial portions of the Software.
|
572
|
+
#
|
573
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
574
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
575
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
576
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
577
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
578
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
579
|
+
# SOFTWARE.
|
580
|
+
# </summary>
|
581
|
+
# --------------------------------------------------------------------------------
|
582
|
+
|
583
|
+
class StartConvertRequest(object):
|
584
|
+
"""
|
585
|
+
Request model for start_convert operation.
|
586
|
+
:param format Requested conversion format
|
587
|
+
:param file Input file to convert
|
588
|
+
:param from_page Page start conversion from
|
589
|
+
:param pages_count Number of pages to convert
|
590
|
+
"""
|
591
|
+
|
592
|
+
def __init__(self, format, file, from_page=None, pages_count=None):
|
593
|
+
"""Initializes new instance of StartConvertRequest.""" # noqa: E501
|
594
|
+
self.format = format
|
595
|
+
self.file = file
|
596
|
+
self.from_page = from_page
|
597
|
+
self.pages_count = pages_count
|
598
|
+
# coding: utf-8
|
599
|
+
|
600
|
+
# --------------------------------------------------------------------------------
|
601
|
+
# <copyright company="Aspose Pty Ltd" file="start_convert_and_save_request.py">
|
602
|
+
# Copyright (c) 2003-2024 Aspose Pty Ltd
|
603
|
+
# </copyright>
|
604
|
+
# <summary>
|
605
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
606
|
+
# of this software and associated documentation files (the "Software"), to deal
|
607
|
+
# in the Software without restriction, including without limitation the rights
|
608
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
609
|
+
# copies of the Software, and to permit persons to whom the Software is
|
610
|
+
# furnished to do so, subject to the following conditions:
|
611
|
+
#
|
612
|
+
# The above copyright notice and this permission notice shall be included in all
|
613
|
+
# copies or substantial portions of the Software.
|
614
|
+
#
|
615
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
616
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
617
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
618
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
619
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
620
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
621
|
+
# SOFTWARE.
|
622
|
+
# </summary>
|
623
|
+
# --------------------------------------------------------------------------------
|
624
|
+
|
625
|
+
class StartConvertAndSaveRequest(object):
|
626
|
+
"""
|
627
|
+
Request model for start_convert_and_save operation.
|
628
|
+
:param convert_settings Conversion settings
|
629
|
+
"""
|
630
|
+
|
631
|
+
def __init__(self, convert_settings):
|
632
|
+
"""Initializes new instance of StartConvertAndSaveRequest.""" # noqa: E501
|
633
|
+
self.convert_settings = convert_settings
|