Skip to content

Commit 70c1e9d

Browse files
committed
Updated sources
1 parent 5a19f89 commit 70c1e9d

11 files changed

Lines changed: 701 additions & 17 deletions

File tree

groupdocs_viewer_cloud/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from groupdocs_viewer_cloud.apis.storage_api import GetDiscUsageRequest, GetFileVersionsRequest, ObjectExistsRequest, StorageExistsRequest
1818
from groupdocs_viewer_cloud.apis.folder_api import CopyFolderRequest, CreateFolderRequest, DeleteFolderRequest, GetFilesListRequest, MoveFolderRequest
1919
from groupdocs_viewer_cloud.apis.info_api import GetInfoRequest
20-
from groupdocs_viewer_cloud.apis.view_api import CreateViewRequest, DeleteViewRequest
20+
from groupdocs_viewer_cloud.apis.view_api import ConvertAndDownloadRequest, CreateViewRequest, DeleteViewRequest
2121

2222
# import related types
2323
from groupdocs_viewer_cloud.auth import Auth
@@ -26,6 +26,8 @@
2626
from groupdocs_viewer_cloud.configuration import Configuration
2727

2828
# import models
29+
from groupdocs_viewer_cloud.models.api_error import ApiError
30+
from groupdocs_viewer_cloud.models.api_error_response import ApiErrorResponse
2931
from groupdocs_viewer_cloud.models.archive_options import ArchiveOptions
3032
from groupdocs_viewer_cloud.models.archive_view_info import ArchiveViewInfo
3133
from groupdocs_viewer_cloud.models.attachment_info import AttachmentInfo

groupdocs_viewer_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': '24.2'}
77+
self.default_headers = {'x-groupdocs-client': 'python sdk', 'x-groupdocs-version': '24.3'}
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 24.2'
82+
self.user_agent = 'python sdk 24.3'
8383

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

groupdocs_viewer_cloud/apis/view_api.py

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,118 @@ def from_config(cls, configuration):
8383
"""
8484
return ViewApi(configuration)
8585

86+
def convert_and_download(self, request,**kwargs): # noqa: E501
87+
"""Converts input document file to format specified # 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 str format: Requested conversion format: HTML, JPG, PNG or PDF (required)
94+
:param file file: Input file to convert (required)
95+
:param str pages: Pages range to render, like \"1,2\" or \"3-5,10\"
96+
:param str password: Input document password
97+
:return: file
98+
If the method is called asynchronously,
99+
returns the request thread.
100+
"""
101+
kwargs['_return_http_data_only'] = True
102+
103+
if kwargs.get('is_async'):
104+
return self._convert_and_download_with_http_info(request, **kwargs) # noqa: E501
105+
106+
(data) = self._convert_and_download_with_http_info(request, **kwargs) # noqa: E501
107+
return data
108+
109+
def _convert_and_download_with_http_info(self, request, **kwargs): # noqa: E501
110+
"""Converts input document file to format specified # noqa: E501
111+
112+
This method makes a synchronous HTTP request by default. To make an
113+
asynchronous HTTP request, please pass is_async=True
114+
115+
:param is_async bool
116+
:param ConvertAndDownloadRequest request object with parameters
117+
:return: file
118+
If the method is called asynchronously,
119+
returns the request thread.
120+
"""
121+
params = locals()
122+
params['is_async'] = ''
123+
params['_return_http_data_only'] = False
124+
params['_preload_content'] = True
125+
params['_request_timeout'] = ''
126+
for key, val in six.iteritems(params['kwargs']):
127+
if key not in params:
128+
raise TypeError(
129+
"Got an unexpected keyword argument '%s'"
130+
" to method convert_and_download" % key
131+
)
132+
params[key] = val
133+
del params['kwargs']
134+
# verify the required parameter 'format' is set
135+
if request.format is None:
136+
raise ValueError("Missing the required parameter `format` when calling `convert_and_download`") # noqa: E501
137+
# verify the required parameter 'file' is set
138+
if request.file is None:
139+
raise ValueError("Missing the required parameter `file` when calling `convert_and_download`") # noqa: E501
140+
141+
collection_formats = {}
142+
path = '/viewer/convertAndDownload'
143+
path_params = {}
144+
145+
query_params = []
146+
if self.__downcase_first_letter('format') in path:
147+
path = path.replace('{' + self.__downcase_first_letter('format' + '}'), request.format if request.format is not None else '')
148+
else:
149+
if request.format is not None:
150+
query_params.append((self.__downcase_first_letter('format'), request.format)) # noqa: E501
151+
if self.__downcase_first_letter('pages') in path:
152+
path = path.replace('{' + self.__downcase_first_letter('pages' + '}'), request.pages if request.pages is not None else '')
153+
else:
154+
if request.pages is not None:
155+
query_params.append((self.__downcase_first_letter('pages'), request.pages)) # noqa: E501
156+
if self.__downcase_first_letter('password') in path:
157+
path = path.replace('{' + self.__downcase_first_letter('password' + '}'), request.password if request.password is not None else '')
158+
else:
159+
if request.password is not None:
160+
query_params.append((self.__downcase_first_letter('password'), request.password)) # noqa: E501
161+
162+
header_params = {}
163+
164+
form_params = []
165+
local_var_files = []
166+
if request.file is not None:
167+
local_var_files.append((self.__downcase_first_letter('File'), request.file)) # noqa: E501
168+
169+
body_params = None
170+
# HTTP header `Accept`
171+
header_params['Accept'] = self.api_client.select_header_accept(
172+
['application/json']) # noqa: E501
173+
174+
# HTTP header `Content-Type`
175+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
176+
['multipart/form-data']) # noqa: E501
177+
178+
call_kwargs = {
179+
'resource_path':path,
180+
'method':'PUT',
181+
'path_params':path_params,
182+
'query_params':query_params,
183+
'header_params':header_params,
184+
'body':body_params,
185+
'post_params':form_params,
186+
'files':local_var_files,
187+
'response_type':'file', # noqa: E501
188+
'auth_settings':self.auth.get_auth_settings(),
189+
'is_async':params.get('is_async'),
190+
'_return_http_data_only':params.get('_return_http_data_only'),
191+
'_preload_content':params.get('_preload_content', True),
192+
'_request_timeout':params.get('_request_timeout'),
193+
'collection_formats':collection_formats
194+
}
195+
196+
return self.api_client.call_api(**call_kwargs) # noqa: E501
197+
86198
def create_view(self, request,**kwargs): # noqa: E501
87199
"""Render document pages # noqa: E501
88200
@@ -273,6 +385,48 @@ def __downcase_first_letter(self, s):
273385

274386
# coding: utf-8
275387

388+
# --------------------------------------------------------------------------------
389+
# <copyright company="Aspose Pty Ltd" file="convert_and_download_request.py">
390+
# Copyright (c) 2003-2024 Aspose Pty Ltd
391+
# </copyright>
392+
# <summary>
393+
# Permission is hereby granted, free of charge, to any person obtaining a copy
394+
# of this software and associated documentation files (the "Software"), to deal
395+
# in the Software without restriction, including without limitation the rights
396+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
397+
# copies of the Software, and to permit persons to whom the Software is
398+
# furnished to do so, subject to the following conditions:
399+
#
400+
# The above copyright notice and this permission notice shall be included in all
401+
# copies or substantial portions of the Software.
402+
#
403+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
404+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
405+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
406+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
407+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
408+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
409+
# SOFTWARE.
410+
# </summary>
411+
# --------------------------------------------------------------------------------
412+
413+
class ConvertAndDownloadRequest(object):
414+
"""
415+
Request model for convert_and_download operation.
416+
:param format Requested conversion format: HTML, JPG, PNG or PDF
417+
:param file Input file to convert
418+
:param pages Pages range to render, like \"1,2\" or \"3-5,10\"
419+
:param password Input document password
420+
"""
421+
422+
def __init__(self, format, file, pages=None, password=None):
423+
"""Initializes new instance of ConvertAndDownloadRequest.""" # noqa: E501
424+
self.format = format
425+
self.file = file
426+
self.pages = pages
427+
self.password = password
428+
# coding: utf-8
429+
276430
# --------------------------------------------------------------------------------
277431
# <copyright company="Aspose Pty Ltd" file="create_view_request.py">
278432
# Copyright (c) 2003-2024 Aspose Pty Ltd

groupdocs_viewer_cloud/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,6 @@ def to_debug_report(self):
202202
return "Python SDK Debug Report:\n"\
203203
"OS: {env}\n"\
204204
"Python Version: {pyversion}\n"\
205-
"Version of the API: 24.2\n"\
206-
"SDK Package Version: 24.2".\
205+
"Version of the API: 24.3\n"\
206+
"SDK Package Version: 24.3".\
207207
format(env=sys.platform, pyversion=sys.version)

groupdocs_viewer_cloud/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from __future__ import absolute_import
55

66
# import models
7+
from groupdocs_viewer_cloud.models.api_error import ApiError
8+
from groupdocs_viewer_cloud.models.api_error_response import ApiErrorResponse
79
from groupdocs_viewer_cloud.models.archive_options import ArchiveOptions
810
from groupdocs_viewer_cloud.models.archive_view_info import ArchiveViewInfo
911
from groupdocs_viewer_cloud.models.attachment_info import AttachmentInfo

0 commit comments

Comments
 (0)