Skip to content

Commit bf2b129

Browse files
committed
Updated sources
1 parent c089b6c commit bf2b129

File tree

17 files changed

+1057
-155
lines changed

17 files changed

+1057
-155
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ app_sid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
3131
app_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
3232

3333
# Create instance of the API
34-
api = groupdocs_conversion_cloud.ConversionApi.from_keys(app_sid, app_key)
34+
api = groupdocs_conversion_cloud.InfoApi.from_keys(app_sid, app_key)
3535

3636
try:
3737
# Retrieve supported conversion types

groupdocs_conversion_cloud/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
from __future__ import absolute_import
66

77
# import apis
8-
from groupdocs_conversion_cloud.apis.conversion_api import ConversionApi
8+
from groupdocs_conversion_cloud.apis.convert_api import ConvertApi
9+
from groupdocs_conversion_cloud.apis.info_api import InfoApi
910
from groupdocs_conversion_cloud.apis.file_api import FileApi
1011
from groupdocs_conversion_cloud.apis.folder_api import FolderApi
1112
from groupdocs_conversion_cloud.apis.storage_api import StorageApi
@@ -14,7 +15,8 @@
1415
from groupdocs_conversion_cloud.apis.file_api import CopyFileRequest, DeleteFileRequest, DownloadFileRequest, MoveFileRequest, UploadFileRequest
1516
from groupdocs_conversion_cloud.apis.storage_api import GetDiscUsageRequest, GetFileVersionsRequest, ObjectExistsRequest, StorageExistsRequest
1617
from groupdocs_conversion_cloud.apis.folder_api import CopyFolderRequest, CreateFolderRequest, DeleteFolderRequest, GetFilesListRequest, MoveFolderRequest
17-
from groupdocs_conversion_cloud.apis.conversion_api import ConvertDocumentRequest, GetSupportedConversionTypesRequest
18+
from groupdocs_conversion_cloud.apis.convert_api import ConvertDocumentRequest
19+
from groupdocs_conversion_cloud.apis.info_api import GetSupportedConversionTypesRequest, GetDocumentMetadataRequest
1820

1921
# import related types
2022
from groupdocs_conversion_cloud.auth import Auth

groupdocs_conversion_cloud/api_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ def __init__(self, configuration, header_name=None, header_value=None,
7474
self.configuration = configuration
7575
self.pool = None
7676
self.rest_client = rest.RESTClientObject(configuration)
77-
self.default_headers = {'x-groupdocs-client': 'python sdk', 'x-groupdocs-version': '19.4'}
77+
self.default_headers = {'x-groupdocs-client': 'python sdk', 'x-groupdocs-version': '19.5'}
7878
if header_name is not None:
7979
self.default_headers[header_name] = header_value
8080
self.cookie = cookie
8181
# Set default User-Agent.
82-
self.user_agent = 'python sdk 19.4'
82+
self.user_agent = 'python sdk 19.5'
8383

8484
def __del__(self):
8585
if self.pool is not None:

groupdocs_conversion_cloud/apis/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# flake8: noqa
44

55
# import apis
6-
from groupdocs_conversion_cloud.apis.conversion_api import ConversionApi
6+
from groupdocs_conversion_cloud.apis.convert_api import ConvertApi
77
from groupdocs_conversion_cloud.apis.file_api import FileApi
88
from groupdocs_conversion_cloud.apis.folder_api import FolderApi
9+
from groupdocs_conversion_cloud.apis.info_api import InfoApi
910
from groupdocs_conversion_cloud.apis.storage_api import StorageApi
Lines changed: 309 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,309 @@
1+
# coding: utf-8
2+
3+
# -----------------------------------------------------------------------------------
4+
# <copyright company="Aspose Pty Ltd">
5+
# Copyright (c) 2003-2019 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+
35+
from groupdocs_conversion_cloud.auth import Auth
36+
from groupdocs_conversion_cloud.api_client import ApiClient
37+
from groupdocs_conversion_cloud.api_exception import ApiException
38+
from groupdocs_conversion_cloud.configuration import Configuration
39+
40+
class ConvertApi(object):
41+
"""
42+
GroupDocs.Conversion Cloud API
43+
44+
:param configuration: API configuration
45+
"""
46+
47+
def __init__(self, configuration):
48+
api_client = ApiClient(configuration)
49+
50+
self.auth = Auth(configuration, api_client)
51+
self.api_client = api_client
52+
self.configuration = configuration
53+
54+
def close(self): # noqa: E501
55+
"""
56+
Closes thread pool. This method should be called when
57+
methods are executed asynchronously (is_async=True is passed as parameter)
58+
and this instance of ConvertApi is not going to be used any more.
59+
"""
60+
if self.api_client is not None:
61+
if(self.api_client.pool is not None):
62+
self.api_client.pool.close()
63+
self.api_client.pool.join()
64+
self.api_client.pool = None
65+
66+
@classmethod
67+
def from_keys(cls, app_sid, app_key):
68+
"""
69+
Initializes new instance of ConvertApi with API keys
70+
71+
:param app_sid Application identifier (App SID)
72+
:param app_key Application private key (App Key)
73+
"""
74+
configuration = Configuration(app_sid, app_key)
75+
return ConvertApi(configuration)
76+
77+
@classmethod
78+
def from_config(cls, configuration):
79+
"""
80+
Initializes new instance of ConvertApi with configuration options
81+
82+
:param configuration API configuration
83+
"""
84+
return ConvertApi(configuration)
85+
86+
def convert_document(self, request,**kwargs): # noqa: E501
87+
"""Converts specified input document to format specified in the convertSettings with specified options # noqa: E501
88+
89+
This method makes a synchronous HTTP request by default. To make an
90+
asynchronous HTTP request, please pass is_async=True
91+
92+
:param is_async bool
93+
:param ConvertSettings convert_settings: (required)
94+
:return: list[StoredConvertedResult]
95+
If the method is called asynchronously,
96+
returns the request thread.
97+
"""
98+
kwargs['_return_http_data_only'] = True
99+
100+
if kwargs.get('is_async'):
101+
return self._convert_document_with_http_info(request, **kwargs) # noqa: E501
102+
103+
(data) = self._convert_document_with_http_info(request, **kwargs) # noqa: E501
104+
return data
105+
106+
def _convert_document_with_http_info(self, request, **kwargs): # noqa: E501
107+
"""Converts specified input document to format specified in the convertSettings with specified options # noqa: E501
108+
109+
This method makes a synchronous HTTP request by default. To make an
110+
asynchronous HTTP request, please pass is_async=True
111+
112+
:param is_async bool
113+
:param ConvertDocumentRequest request object with parameters
114+
:return: list[StoredConvertedResult]
115+
If the method is called asynchronously,
116+
returns the request thread.
117+
"""
118+
params = locals()
119+
params['is_async'] = ''
120+
params['_return_http_data_only'] = False
121+
params['_preload_content'] = True
122+
params['_request_timeout'] = ''
123+
for key, val in six.iteritems(params['kwargs']):
124+
if key not in params:
125+
raise TypeError(
126+
"Got an unexpected keyword argument '%s'"
127+
" to method convert_document" % key
128+
)
129+
params[key] = val
130+
del params['kwargs']
131+
# verify the required parameter 'convert_settings' is set
132+
if request.convert_settings is None:
133+
raise ValueError("Missing the required parameter `convert_settings` when calling `convert_document`") # noqa: E501
134+
135+
collection_formats = {}
136+
path = '/conversion'
137+
path_params = {}
138+
139+
query_params = []
140+
141+
header_params = {}
142+
143+
form_params = []
144+
local_var_files = []
145+
146+
body_params = None
147+
if request.convert_settings is not None:
148+
body_params = request.convert_settings
149+
# HTTP header `Accept`
150+
header_params['Accept'] = self.api_client.select_header_accept(
151+
['application/json']) # noqa: E501
152+
153+
# HTTP header `Content-Type`
154+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
155+
['application/json']) # noqa: E501
156+
157+
call_kwargs = {
158+
'resource_path':path,
159+
'method':'POST',
160+
'path_params':path_params,
161+
'query_params':query_params,
162+
'header_params':header_params,
163+
'body':body_params,
164+
'post_params':form_params,
165+
'files':local_var_files,
166+
'response_type':'list[StoredConvertedResult]', # noqa: E501
167+
'auth_settings':self.auth.get_auth_settings(),
168+
'is_async':params.get('is_async'),
169+
'_return_http_data_only':params.get('_return_http_data_only'),
170+
'_preload_content':params.get('_preload_content', True),
171+
'_request_timeout':params.get('_request_timeout'),
172+
'collection_formats':collection_formats
173+
}
174+
175+
return self.api_client.call_api(**call_kwargs) # noqa: E501
176+
177+
def convert_document_download(self, request,**kwargs): # noqa: E501
178+
"""Converts specified input document to format specified in the convertSettings with specified options # noqa: E501
179+
180+
This method makes a synchronous HTTP request by default. To make an
181+
asynchronous HTTP request, please pass is_async=True
182+
183+
:param is_async bool
184+
:param ConvertSettings convert_settings: (required)
185+
:return: file
186+
If the method is called asynchronously,
187+
returns the request thread.
188+
"""
189+
kwargs['_return_http_data_only'] = True
190+
191+
if kwargs.get('is_async'):
192+
return self._convert_document_download_with_http_info(request, **kwargs) # noqa: E501
193+
194+
(data) = self._convert_document_download_with_http_info(request, **kwargs) # noqa: E501
195+
return data
196+
197+
def _convert_document_download_with_http_info(self, request, **kwargs): # noqa: E501
198+
"""Converts specified input document to format specified in the convertSettings with specified options # noqa: E501
199+
200+
This method makes a synchronous HTTP request by default. To make an
201+
asynchronous HTTP request, please pass is_async=True
202+
203+
:param is_async bool
204+
:param ConvertDocumentRequest request object with parameters
205+
:return: list[StoredConvertedResult]
206+
If the method is called asynchronously,
207+
returns the request thread.
208+
"""
209+
params = locals()
210+
params['is_async'] = ''
211+
params['_return_http_data_only'] = False
212+
params['_preload_content'] = True
213+
params['_request_timeout'] = ''
214+
for key, val in six.iteritems(params['kwargs']):
215+
if key not in params:
216+
raise TypeError(
217+
"Got an unexpected keyword argument '%s'"
218+
" to method convert_document" % key
219+
)
220+
params[key] = val
221+
del params['kwargs']
222+
# verify the required parameter 'convert_settings' is set
223+
if request.convert_settings is None:
224+
raise ValueError("Missing the required parameter `convert_settings` when calling `convert_document`") # noqa: E501
225+
226+
collection_formats = {}
227+
path = '/conversion'
228+
path_params = {}
229+
230+
query_params = []
231+
232+
header_params = {}
233+
234+
form_params = []
235+
local_var_files = []
236+
237+
body_params = None
238+
if request.convert_settings is not None:
239+
body_params = request.convert_settings
240+
# HTTP header `Accept`
241+
header_params['Accept'] = self.api_client.select_header_accept(
242+
['application/json']) # noqa: E501
243+
244+
# HTTP header `Content-Type`
245+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
246+
['application/json']) # noqa: E501
247+
248+
call_kwargs = {
249+
'resource_path':path,
250+
'method':'POST',
251+
'path_params':path_params,
252+
'query_params':query_params,
253+
'header_params':header_params,
254+
'body':body_params,
255+
'post_params':form_params,
256+
'files':local_var_files,
257+
'response_type':'file', # noqa: E501
258+
'auth_settings':self.auth.get_auth_settings(),
259+
'is_async':params.get('is_async'),
260+
'_return_http_data_only':params.get('_return_http_data_only'),
261+
'_preload_content':params.get('_preload_content', True),
262+
'_request_timeout':params.get('_request_timeout'),
263+
'collection_formats':collection_formats
264+
}
265+
266+
return self.api_client.call_api(**call_kwargs) # noqa: E501
267+
268+
def __downcase_first_letter(self, s):
269+
if len(s) == 0:
270+
return str
271+
else:
272+
return s[0].lower() + s[1:]
273+
274+
# coding: utf-8
275+
276+
# --------------------------------------------------------------------------------
277+
# <copyright company="Aspose Pty Ltd" file="convert_document_request.py">
278+
# Copyright (c) 2003-2019 Aspose Pty Ltd
279+
# </copyright>
280+
# <summary>
281+
# Permission is hereby granted, free of charge, to any person obtaining a copy
282+
# of this software and associated documentation files (the "Software"), to deal
283+
# in the Software without restriction, including without limitation the rights
284+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
285+
# copies of the Software, and to permit persons to whom the Software is
286+
# furnished to do so, subject to the following conditions:
287+
#
288+
# The above copyright notice and this permission notice shall be included in all
289+
# copies or substantial portions of the Software.
290+
#
291+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
292+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
293+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
294+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
295+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
296+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
297+
# SOFTWARE.
298+
# </summary>
299+
# --------------------------------------------------------------------------------
300+
301+
class ConvertDocumentRequest(object):
302+
"""
303+
Request model for convert_document operation.
304+
:param convert_settings
305+
"""
306+
307+
def __init__(self, convert_settings):
308+
"""Initializes new instance of ConvertDocumentRequest.""" # noqa: E501
309+
self.convert_settings = convert_settings

groupdocs_conversion_cloud/apis/file_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ def _upload_file_with_http_info(self, request, **kwargs): # noqa: E501
610610

611611
call_kwargs = {
612612
'resource_path':path,
613-
'method':'POST',
613+
'method':'PUT',
614614
'path_params':path_params,
615615
'query_params':query_params,
616616
'header_params':header_params,

groupdocs_conversion_cloud/apis/folder_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def _create_folder_with_http_info(self, request, **kwargs): # noqa: E501
274274

275275
call_kwargs = {
276276
'resource_path':path,
277-
'method':'POST',
277+
'method':'PUT',
278278
'path_params':path_params,
279279
'query_params':query_params,
280280
'header_params':header_params,

0 commit comments

Comments
 (0)