Skip to content

Commit ff258cc

Browse files
SDK regenerated by CI server [ci skip]
1 parent ccc8241 commit ff258cc

File tree

18 files changed

+890
-6
lines changed

18 files changed

+890
-6
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Python Cloud SDK wraps Aspose.Words Cloud API so you could seamlessly integrate
1919
## Enhancements in Version 22.7
2020

2121
- Expand 'AppendDocument' API method to support 'ImageEntryList' for directly appending images to documents and another images.
22+
- Added 'CompressDocument' API method to support compression and resizing images inside the document for reduce the size of the document.
2223

2324

2425
## Enhancements in Version 22.6
232 KB
Binary file not shown.

asposewordscloud/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
from asposewordscloud.models.comment_update import CommentUpdate
3737
from asposewordscloud.models.compare_data import CompareData
3838
from asposewordscloud.models.compare_options import CompareOptions
39+
from asposewordscloud.models.compress_options import CompressOptions
40+
from asposewordscloud.models.compress_response import CompressResponse
3941
from asposewordscloud.models.csv_data_load_options import CsvDataLoadOptions
4042
from asposewordscloud.models.custom_xml_part import CustomXmlPart
4143
from asposewordscloud.models.custom_xml_part_insert import CustomXmlPartInsert

asposewordscloud/api_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
8383

8484
self.pool = None
8585
self.rest_client = rest.RESTClientObject(configuration)
86-
self.default_headers = {'x-aspose-client': 'python sdk', 'x-aspose-version': '22.6'}
86+
self.default_headers = {'x-aspose-client': 'python sdk', 'x-aspose-version': '22.7'}
8787
if header_name is not None:
8888
self.default_headers[header_name] = header_value
8989
self.cookie = cookie
9090
# Set default User-Agent.
91-
self.user_agent = 'python sdk 22.6'
91+
self.user_agent = 'python sdk 22.7'
9292

9393
def __del__(self):
9494
if not self.pool is None:

asposewordscloud/apis/words_api.py

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,166 @@ def compare_document_online_with_http_info(self, request, **kwargs): # noqa: E5
11081108
_request_timeout=params.get('_request_timeout'),
11091109
collection_formats=http_params['collection_formats']))
11101110

1111+
def compress_document(self, request, **kwargs): # noqa: E501
1112+
"""The default settings allows to reduce the size of the document without any visible degradation of images quality. # noqa: E501
1113+
1114+
This method makes a synchronous HTTP request by default. To make an
1115+
asynchronous HTTP request, please pass is_async=True
1116+
1117+
:param is_async bool
1118+
:param name str : The filename of the input document. (required)
1119+
:param compress_options CompressOptions : Options for compress the document. (required)
1120+
:param folder str : Original document folder.
1121+
:param storage str : Original document storage.
1122+
:param load_encoding str : Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
1123+
:param password str : Password of protected Word document. Use the parameter to pass a password via SDK. SDK encrypts it automatically. We don't recommend to use the parameter to pass a plain password for direct call of API.
1124+
:param encrypted_password str : Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details.
1125+
:param dest_file_name str : Result path of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document.
1126+
:return: CompressResponse
1127+
If the method is called asynchronously,
1128+
returns the request thread.
1129+
"""
1130+
try:
1131+
if kwargs.get('is_async'):
1132+
return self.compress_document_with_http_info(request, **kwargs) # noqa: E501
1133+
data = self.compress_document_with_http_info(request, **kwargs) # noqa: E501
1134+
return data
1135+
except ApiException as e:
1136+
if e.status == 401:
1137+
self.api_client.request_token()
1138+
if kwargs.get('is_async'):
1139+
return self.compress_document_with_http_info(request, **kwargs) # noqa: E501
1140+
data = self.compress_document_with_http_info(request, **kwargs) # noqa: E501
1141+
return data
1142+
1143+
def compress_document_with_http_info(self, request, **kwargs): # noqa: E501
1144+
"""The default settings allows to reduce the size of the document without any visible degradation of images quality. # noqa: E501
1145+
1146+
This method makes a synchronous HTTP request by default. To make an
1147+
asynchronous HTTP request, please pass is_async=True
1148+
1149+
:param is_async bool
1150+
:param request CompressDocumentRequest object with parameters
1151+
:return: CompressResponse
1152+
If the method is called asynchronously,
1153+
returns the request thread.
1154+
"""
1155+
1156+
params = locals()
1157+
params['is_async'] = ''
1158+
params['_preload_content'] = True
1159+
params['_request_timeout'] = self.timeout
1160+
for key, val in six.iteritems(params['kwargs']):
1161+
if key not in params:
1162+
raise TypeError(
1163+
"Got an unexpected keyword argument '%s'"
1164+
" to method compress_document" % key
1165+
)
1166+
params[key] = val
1167+
del params['kwargs']
1168+
http_params = request.create_http_request(self.api_client)
1169+
1170+
# HTTP header `Accept`
1171+
http_params['header_params']['Accept'] = self.api_client.select_header_accept(
1172+
['application/xml', 'application/json']) # noqa: E501
1173+
# Authentication setting
1174+
auth_settings = ['JWT'] # noqa: E501
1175+
1176+
self.api_client.handle_password(http_params, self)
1177+
1178+
return request.deserialize_response(self.api_client, self.api_client.call_api(
1179+
http_params['path'],
1180+
http_params['method'],
1181+
http_params['query_params'],
1182+
http_params['header_params'],
1183+
body=http_params['body'],
1184+
post_params=http_params['form_params'],
1185+
response_type=http_params['response_type'], # noqa: E501
1186+
auth_settings=auth_settings,
1187+
is_async=params.get('is_async'),
1188+
_preload_content=params.get('_preload_content', True),
1189+
_request_timeout=params.get('_request_timeout'),
1190+
collection_formats=http_params['collection_formats']))
1191+
1192+
def compress_document_online(self, request, **kwargs): # noqa: E501
1193+
"""Compress and resize images inside the document. # noqa: E501
1194+
1195+
This method makes a synchronous HTTP request by default. To make an
1196+
asynchronous HTTP request, please pass is_async=True
1197+
1198+
:param is_async bool
1199+
:param document file : The document. (required)
1200+
:param compress_options CompressOptions : Options for compress the document. (required)
1201+
:param load_encoding str : Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
1202+
:param password str : Password of protected Word document. Use the parameter to pass a password via SDK. SDK encrypts it automatically. We don't recommend to use the parameter to pass a plain password for direct call of API.
1203+
:param encrypted_password str : Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details.
1204+
:param dest_file_name str : Result path of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document.
1205+
:return: CompressDocumentOnlineResponse
1206+
If the method is called asynchronously,
1207+
returns the request thread.
1208+
"""
1209+
try:
1210+
if kwargs.get('is_async'):
1211+
return self.compress_document_online_with_http_info(request, **kwargs) # noqa: E501
1212+
data = self.compress_document_online_with_http_info(request, **kwargs) # noqa: E501
1213+
return data
1214+
except ApiException as e:
1215+
if e.status == 401:
1216+
self.api_client.request_token()
1217+
if kwargs.get('is_async'):
1218+
return self.compress_document_online_with_http_info(request, **kwargs) # noqa: E501
1219+
data = self.compress_document_online_with_http_info(request, **kwargs) # noqa: E501
1220+
return data
1221+
1222+
def compress_document_online_with_http_info(self, request, **kwargs): # noqa: E501
1223+
"""Compress and resize images inside the document. # noqa: E501
1224+
1225+
This method makes a synchronous HTTP request by default. To make an
1226+
asynchronous HTTP request, please pass is_async=True
1227+
1228+
:param is_async bool
1229+
:param request CompressDocumentOnlineRequest object with parameters
1230+
:return: CompressDocumentOnlineResponse
1231+
If the method is called asynchronously,
1232+
returns the request thread.
1233+
"""
1234+
1235+
params = locals()
1236+
params['is_async'] = ''
1237+
params['_preload_content'] = True
1238+
params['_request_timeout'] = self.timeout
1239+
for key, val in six.iteritems(params['kwargs']):
1240+
if key not in params:
1241+
raise TypeError(
1242+
"Got an unexpected keyword argument '%s'"
1243+
" to method compress_document_online" % key
1244+
)
1245+
params[key] = val
1246+
del params['kwargs']
1247+
http_params = request.create_http_request(self.api_client)
1248+
1249+
# HTTP header `Accept`
1250+
http_params['header_params']['Accept'] = self.api_client.select_header_accept(
1251+
['application/xml', 'application/json']) # noqa: E501
1252+
# Authentication setting
1253+
auth_settings = ['JWT'] # noqa: E501
1254+
1255+
self.api_client.handle_password(http_params, self)
1256+
1257+
return request.deserialize_response(self.api_client, self.api_client.call_api(
1258+
http_params['path'],
1259+
http_params['method'],
1260+
http_params['query_params'],
1261+
http_params['header_params'],
1262+
body=http_params['body'],
1263+
post_params=http_params['form_params'],
1264+
response_type=http_params['response_type'], # noqa: E501
1265+
auth_settings=auth_settings,
1266+
is_async=params.get('is_async'),
1267+
_preload_content=params.get('_preload_content', True),
1268+
_request_timeout=params.get('_request_timeout'),
1269+
collection_formats=http_params['collection_formats']))
1270+
11111271
def convert_document(self, request, **kwargs): # noqa: E501
11121272
"""Converts a document on a local drive to the specified format. # noqa: E501
11131273

asposewordscloud/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,6 @@ def to_debug_report(self):
262262
return "Python SDK Debug Report:\n"\
263263
"OS: {env}\n"\
264264
"Python Version: {pyversion}\n"\
265-
"Version of the API: 22.6\n"\
266-
"SDK Package Version: 22.6".\
265+
"Version of the API: 22.7\n"\
266+
"SDK Package Version: 22.7".\
267267
format(env=sys.platform, pyversion=sys.version)

asposewordscloud/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
from asposewordscloud.models.comment_update import CommentUpdate
3232
from asposewordscloud.models.compare_data import CompareData
3333
from asposewordscloud.models.compare_options import CompareOptions
34+
from asposewordscloud.models.compress_options import CompressOptions
35+
from asposewordscloud.models.compress_response import CompressResponse
3436
from asposewordscloud.models.csv_data_load_options import CsvDataLoadOptions
3537
from asposewordscloud.models.custom_xml_part import CustomXmlPart
3638
from asposewordscloud.models.custom_xml_part_insert import CustomXmlPartInsert

0 commit comments

Comments
 (0)