Skip to content

Commit 0057042

Browse files
committed
CELLSCLOUD-10181 Add format parameter to some APIs to specify export file format in Python sdk
1 parent ee3ac76 commit 0057042

21 files changed

+1352
-34
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ Class | Method | HTTP request | Description
393393
- [WorksheetMovingRequest](docs/WorksheetMovingRequest.md)
394394
- [AutoFilter](docs/AutoFilter.md)
395395
- [AutoFilterResponse](docs/AutoFilterResponse.md)
396+
- [AutoShapeResponse](docs/AutoShapeResponse.md)
396397
- [AutoShapes](docs/AutoShapes.md)
397398
- [AutoShapesResponse](docs/AutoShapesResponse.md)
398399
- [Cell](docs/Cell.md)
@@ -525,6 +526,7 @@ Class | Method | HTTP request | Description
525526
- [XlsSaveOptions](docs/XlsSaveOptions.md)
526527
- [XlsbSaveOptions](docs/XlsbSaveOptions.md)
527528
- [XpsSaveOptions](docs/XpsSaveOptions.md)
529+
- [AutoShape](docs/AutoShape.md)
528530
- [ChartArea](docs/ChartArea.md)
529531
- [Legend](docs/Legend.md)
530532
- [OleObject](docs/OleObject.md)

asposecellscloud/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
from .models.worksheet_moving_request import WorksheetMovingRequest
102102
from .models.auto_filter import AutoFilter
103103
from .models.auto_filter_response import AutoFilterResponse
104+
from .models.auto_shape_response import AutoShapeResponse
104105
from .models.auto_shapes import AutoShapes
105106
from .models.auto_shapes_response import AutoShapesResponse
106107
from .models.cell import Cell
@@ -233,6 +234,7 @@
233234
from .models.xls_save_options import XlsSaveOptions
234235
from .models.xlsb_save_options import XlsbSaveOptions
235236
from .models.xps_save_options import XpsSaveOptions
237+
from .models.auto_shape import AutoShape
236238
from .models.chart_area import ChartArea
237239
from .models.legend import Legend
238240
from .models.ole_object import OleObject

asposecellscloud/api_client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,17 @@ def __call_api(self, resource_path, method,
143143

144144
# request url
145145
url = self.host + resource_path
146+
147+
preload_content = _preload_content
148+
if response_type == 'file':
149+
preload_content = False
146150

147151
# perform request and return response
148152
response_data = self.request(method, url,
149153
query_params=query_params,
150154
headers=header_params,
151155
post_params=post_params, body=body,
152-
_preload_content=_preload_content,
156+
_preload_content=preload_content,
153157
_request_timeout=_request_timeout)
154158

155159
self.last_response = response_data

asposecellscloud/apis/cells_autoshapes_api.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def cells_autoshapes_get_worksheet_autoshape(self, name, sheet_name, autoshape_n
5656
:param str name: Document name. (required)
5757
:param str sheet_name: Worksheet name. (required)
5858
:param int autoshape_number: The autoshape number. (required)
59+
:param str format: Exported format.
5960
:param str folder: The document folder.
6061
:param str storage: storage name.
6162
:return: file
@@ -85,14 +86,15 @@ def cells_autoshapes_get_worksheet_autoshape_with_http_info(self, name, sheet_na
8586
:param str name: Document name. (required)
8687
:param str sheet_name: Worksheet name. (required)
8788
:param int autoshape_number: The autoshape number. (required)
89+
:param str format: Exported format.
8890
:param str folder: The document folder.
8991
:param str storage: storage name.
9092
:return: file
9193
If the method is called asynchronously,
9294
returns the request thread.
9395
"""
9496

95-
all_params = ['name', 'sheet_name', 'autoshape_number', 'folder', 'storage']
97+
all_params = ['name', 'sheet_name', 'autoshape_number', 'format', 'folder', 'storage']
9698
all_params.append('callback')
9799
all_params.append('_return_http_data_only')
98100
all_params.append('_preload_content')
@@ -129,6 +131,8 @@ def cells_autoshapes_get_worksheet_autoshape_with_http_info(self, name, sheet_na
129131
path_params['autoshapeNumber'] = params['autoshape_number']
130132

131133
query_params = []
134+
if 'format' in params:
135+
query_params.append(('format', params['format']))
132136
if 'folder' in params:
133137
query_params.append(('folder', params['folder']))
134138
if 'storage' in params:

asposecellscloud/apis/cells_ole_objects_api.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ def cells_ole_objects_get_worksheet_ole_object(self, name, sheet_name, object_nu
301301
:param str name: Document name. (required)
302302
:param str sheet_name: Worksheet name. (required)
303303
:param int object_number: The object number. (required)
304+
:param str format: The exported object format.
304305
:param str folder: The document folder.
305306
:param str storage: storage name.
306307
:return: file
@@ -330,14 +331,15 @@ def cells_ole_objects_get_worksheet_ole_object_with_http_info(self, name, sheet_
330331
:param str name: Document name. (required)
331332
:param str sheet_name: Worksheet name. (required)
332333
:param int object_number: The object number. (required)
334+
:param str format: The exported object format.
333335
:param str folder: The document folder.
334336
:param str storage: storage name.
335337
:return: file
336338
If the method is called asynchronously,
337339
returns the request thread.
338340
"""
339341

340-
all_params = ['name', 'sheet_name', 'object_number', 'folder', 'storage']
342+
all_params = ['name', 'sheet_name', 'object_number', 'format', 'folder', 'storage']
341343
all_params.append('callback')
342344
all_params.append('_return_http_data_only')
343345
all_params.append('_preload_content')
@@ -374,6 +376,8 @@ def cells_ole_objects_get_worksheet_ole_object_with_http_info(self, name, sheet_
374376
path_params['objectNumber'] = params['object_number']
375377

376378
query_params = []
379+
if 'format' in params:
380+
query_params.append(('format', params['format']))
377381
if 'folder' in params:
378382
query_params.append(('folder', params['folder']))
379383
if 'storage' in params:

asposecellscloud/apis/cells_pictures_api.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def cells_pictures_delete_worksheet_pictures_with_http_info(self, name, sheet_na
285285
_request_timeout=params.get('_request_timeout'),
286286
collection_formats=collection_formats)
287287

288-
def cells_pictures_get_worksheet_picture(self, name, sheet_name, picture_number, **kwargs):
288+
def cells_pictures_get_worksheet_picture(self, name, sheet_name, picture_index, **kwargs):
289289
"""
290290
GRead worksheet picture by number.
291291
This method makes a synchronous HTTP request by default. To make an
@@ -294,13 +294,14 @@ def cells_pictures_get_worksheet_picture(self, name, sheet_name, picture_number,
294294
>>> def callback_function(response):
295295
>>> pprint(response)
296296
>>>
297-
>>> thread = api.cells_pictures_get_worksheet_picture(name, sheet_name, picture_number, callback=callback_function)
297+
>>> thread = api.cells_pictures_get_worksheet_picture(name, sheet_name, picture_index, callback=callback_function)
298298
299299
:param callback function: The callback function
300300
for asynchronous request. (optional)
301301
:param str name: Document name. (required)
302302
:param str sheet_name: Worksheet name. (required)
303-
:param int picture_number: The picture number. (required)
303+
:param int picture_index: The picture index. (required)
304+
:param str format: The exported object format.
304305
:param str folder: The document folder.
305306
:param str storage: storage name.
306307
:return: file
@@ -309,12 +310,12 @@ def cells_pictures_get_worksheet_picture(self, name, sheet_name, picture_number,
309310
"""
310311
kwargs['_return_http_data_only'] = True
311312
if kwargs.get('callback'):
312-
return self.cells_pictures_get_worksheet_picture_with_http_info(name, sheet_name, picture_number, **kwargs)
313+
return self.cells_pictures_get_worksheet_picture_with_http_info(name, sheet_name, picture_index, **kwargs)
313314
else:
314-
(data) = self.cells_pictures_get_worksheet_picture_with_http_info(name, sheet_name, picture_number, **kwargs)
315+
(data) = self.cells_pictures_get_worksheet_picture_with_http_info(name, sheet_name, picture_index, **kwargs)
315316
return data
316317

317-
def cells_pictures_get_worksheet_picture_with_http_info(self, name, sheet_name, picture_number, **kwargs):
318+
def cells_pictures_get_worksheet_picture_with_http_info(self, name, sheet_name, picture_index, **kwargs):
318319
"""
319320
GRead worksheet picture by number.
320321
This method makes a synchronous HTTP request by default. To make an
@@ -323,21 +324,22 @@ def cells_pictures_get_worksheet_picture_with_http_info(self, name, sheet_name,
323324
>>> def callback_function(response):
324325
>>> pprint(response)
325326
>>>
326-
>>> thread = api.cells_pictures_get_worksheet_picture_with_http_info(name, sheet_name, picture_number, callback=callback_function)
327+
>>> thread = api.cells_pictures_get_worksheet_picture_with_http_info(name, sheet_name, picture_index, callback=callback_function)
327328
328329
:param callback function: The callback function
329330
for asynchronous request. (optional)
330331
:param str name: Document name. (required)
331332
:param str sheet_name: Worksheet name. (required)
332-
:param int picture_number: The picture number. (required)
333+
:param int picture_index: The picture index. (required)
334+
:param str format: The exported object format.
333335
:param str folder: The document folder.
334336
:param str storage: storage name.
335337
:return: file
336338
If the method is called asynchronously,
337339
returns the request thread.
338340
"""
339341

340-
all_params = ['name', 'sheet_name', 'picture_number', 'folder', 'storage']
342+
all_params = ['name', 'sheet_name', 'picture_index', 'format', 'folder', 'storage']
341343
all_params.append('callback')
342344
all_params.append('_return_http_data_only')
343345
all_params.append('_preload_content')
@@ -358,9 +360,9 @@ def cells_pictures_get_worksheet_picture_with_http_info(self, name, sheet_name,
358360
# verify the required parameter 'sheet_name' is set
359361
if ('sheet_name' not in params) or (params['sheet_name'] is None):
360362
raise ValueError("Missing the required parameter `sheet_name` when calling `cells_pictures_get_worksheet_picture`")
361-
# verify the required parameter 'picture_number' is set
362-
if ('picture_number' not in params) or (params['picture_number'] is None):
363-
raise ValueError("Missing the required parameter `picture_number` when calling `cells_pictures_get_worksheet_picture`")
363+
# verify the required parameter 'picture_index' is set
364+
if ('picture_index' not in params) or (params['picture_index'] is None):
365+
raise ValueError("Missing the required parameter `picture_index` when calling `cells_pictures_get_worksheet_picture`")
364366

365367

366368
collection_formats = {}
@@ -370,10 +372,12 @@ def cells_pictures_get_worksheet_picture_with_http_info(self, name, sheet_name,
370372
path_params['name'] = params['name']
371373
if 'sheet_name' in params:
372374
path_params['sheetName'] = params['sheet_name']
373-
if 'picture_number' in params:
374-
path_params['pictureNumber'] = params['picture_number']
375+
if 'picture_index' in params:
376+
path_params['pictureIndex'] = params['picture_index']
375377

376378
query_params = []
379+
if 'format' in params:
380+
query_params.append(('format', params['format']))
377381
if 'folder' in params:
378382
query_params.append(('folder', params['folder']))
379383
if 'storage' in params:
@@ -396,7 +400,7 @@ def cells_pictures_get_worksheet_picture_with_http_info(self, name, sheet_name,
396400
# Authentication setting
397401
auth_settings = []
398402

399-
return self.api_client.call_api('/cells/{name}/worksheets/{sheetName}/pictures/{pictureNumber}', 'GET',
403+
return self.api_client.call_api('/cells/{name}/worksheets/{sheetName}/pictures/{pictureIndex}', 'GET',
400404
path_params,
401405
query_params,
402406
header_params,

asposecellscloud/apis/cells_workbook_api.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,9 +630,12 @@ def cells_workbook_get_workbook(self, name, **kwargs):
630630
for asynchronous request. (optional)
631631
:param str name: The document name. (required)
632632
:param str password: The document password.
633+
:param str format: The exported file format.
633634
:param bool is_auto_fit: Set document rows to be autofit.
635+
:param bool only_save_table: Only save table data.
634636
:param str folder: The document folder.
635637
:param str storage: storage name.
638+
:param str out_path: The document output folder.
636639
:return: file
637640
If the method is called asynchronously,
638641
returns the request thread.
@@ -659,15 +662,18 @@ def cells_workbook_get_workbook_with_http_info(self, name, **kwargs):
659662
for asynchronous request. (optional)
660663
:param str name: The document name. (required)
661664
:param str password: The document password.
665+
:param str format: The exported file format.
662666
:param bool is_auto_fit: Set document rows to be autofit.
667+
:param bool only_save_table: Only save table data.
663668
:param str folder: The document folder.
664669
:param str storage: storage name.
670+
:param str out_path: The document output folder.
665671
:return: file
666672
If the method is called asynchronously,
667673
returns the request thread.
668674
"""
669675

670-
all_params = ['name', 'password', 'is_auto_fit', 'folder', 'storage']
676+
all_params = ['name', 'password', 'format', 'is_auto_fit', 'only_save_table', 'folder', 'storage', 'out_path']
671677
all_params.append('callback')
672678
all_params.append('_return_http_data_only')
673679
all_params.append('_preload_content')
@@ -696,12 +702,18 @@ def cells_workbook_get_workbook_with_http_info(self, name, **kwargs):
696702
query_params = []
697703
if 'password' in params:
698704
query_params.append(('password', params['password']))
705+
if 'format' in params:
706+
query_params.append(('format', params['format']))
699707
if 'is_auto_fit' in params:
700708
query_params.append(('isAutoFit', params['is_auto_fit']))
709+
if 'only_save_table' in params:
710+
query_params.append(('onlySaveTable', params['only_save_table']))
701711
if 'folder' in params:
702712
query_params.append(('folder', params['folder']))
703713
if 'storage' in params:
704714
query_params.append(('storage', params['storage']))
715+
if 'out_path' in params:
716+
query_params.append(('outPath', params['out_path']))
705717

706718
header_params = {}
707719

asposecellscloud/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
from .worksheet_moving_request import WorksheetMovingRequest
102102
from .auto_filter import AutoFilter
103103
from .auto_filter_response import AutoFilterResponse
104+
from .auto_shape_response import AutoShapeResponse
104105
from .auto_shapes import AutoShapes
105106
from .auto_shapes_response import AutoShapesResponse
106107
from .cell import Cell
@@ -233,6 +234,7 @@
233234
from .xls_save_options import XlsSaveOptions
234235
from .xlsb_save_options import XlsbSaveOptions
235236
from .xps_save_options import XpsSaveOptions
237+
from .auto_shape import AutoShape
236238
from .chart_area import ChartArea
237239
from .legend import Legend
238240
from .ole_object import OleObject

0 commit comments

Comments
 (0)