|
1 | 1 | # coding: utf-8 |
2 | 2 |
|
3 | 3 | """ |
4 | | -Copyright (c) 2020 Aspose.Cells Cloud |
| 4 | +Copyright (c) 2021 Aspose.Cells Cloud |
5 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy |
6 | 6 | of this software and associated documentation files (the "Software"), to deal |
7 | 7 | in the Software without restriction, including without limitation the rights |
@@ -45,15 +45,16 @@ def __init__(self,clientid, clientsecret, version='v3.0', base_uri= 'https://api |
45 | 45 | self.base_uri = base_uri[0:len(base_uri)-1] |
46 | 46 | else: |
47 | 47 | self.base_uri = base_uri |
| 48 | + |
48 | 49 | if not clientid or not clientsecret : |
49 | 50 | self.needAuth = False |
50 | 51 | else: |
51 | 52 | self.needAuth = True |
52 | | - |
| 53 | + |
53 | 54 | self.api_client = ApiClient(base_uri) |
54 | 55 | if self.needAuth : |
55 | 56 | self.access_token = self.api_client.get_access_token("client_credentials", clientid, clientsecret,version) |
56 | | - # self.auth_data = self.o_auth_post("client_credentials", clientid, clientsecret) |
| 57 | + # self.auth_data = self.o_auth_post("client_credentials", appsid, appkey) |
57 | 58 | config = Configuration() |
58 | 59 | config.host = self.base_uri +'/' + self.version |
59 | 60 | if api_client: |
@@ -20110,6 +20111,140 @@ def cells_put_insert_worksheet_rows_with_http_info(self, name, sheet_name, start |
20110 | 20111 | _request_timeout=params.get('_request_timeout'), |
20111 | 20112 | collection_formats=collection_formats) |
20112 | 20113 |
|
| 20114 | + def cells_ranges_delete_worksheet_cells_range(self, name, sheet_name, range, shift, **kwargs): |
| 20115 | + """ |
| 20116 | + Delete range in the worksheet |
| 20117 | + This method makes a synchronous HTTP request by default. To make an |
| 20118 | + asynchronous HTTP request, please define a `callback` function |
| 20119 | + to be invoked when receiving the response. |
| 20120 | + >>> def callback_function(response): |
| 20121 | + >>> pprint(response) |
| 20122 | + >>> |
| 20123 | + >>> thread = api.cells_ranges_delete_worksheet_cells_range(name, sheet_name, range, shift, callback=callback_function) |
| 20124 | + |
| 20125 | + :param callback function: The callback function |
| 20126 | + for asynchronous request. (optional) |
| 20127 | + :param str name: workbook name (required) |
| 20128 | + :param str sheet_name: worksheet name (required) |
| 20129 | + :param str range: range (required) |
| 20130 | + :param str shift: Represent the shift options when deleting a range of cells. (Left,Up) (required) |
| 20131 | + :param str folder: Workbook folder. |
| 20132 | + :param str storage_name: storage name. |
| 20133 | + :return: CellsCloudResponse |
| 20134 | + If the method is called asynchronously, |
| 20135 | + returns the request thread. |
| 20136 | + """ |
| 20137 | + kwargs['_return_http_data_only'] = True |
| 20138 | + self.check_access_token() |
| 20139 | + if kwargs.get('callback'): |
| 20140 | + return self.cells_ranges_delete_worksheet_cells_range_with_http_info(name, sheet_name, range, shift, **kwargs) |
| 20141 | + else: |
| 20142 | + (data) = self.cells_ranges_delete_worksheet_cells_range_with_http_info(name, sheet_name, range, shift, **kwargs) |
| 20143 | + return data |
| 20144 | + |
| 20145 | + def cells_ranges_delete_worksheet_cells_range_with_http_info(self, name, sheet_name, range, shift, **kwargs): |
| 20146 | + """ |
| 20147 | + Delete range in the worksheet |
| 20148 | + This method makes a synchronous HTTP request by default. To make an |
| 20149 | + asynchronous HTTP request, please define a `callback` function |
| 20150 | + to be invoked when receiving the response. |
| 20151 | + >>> def callback_function(response): |
| 20152 | + >>> pprint(response) |
| 20153 | + >>> |
| 20154 | + >>> thread = api.cells_ranges_delete_worksheet_cells_range_with_http_info(name, sheet_name, range, shift, callback=callback_function) |
| 20155 | + |
| 20156 | + :param callback function: The callback function |
| 20157 | + for asynchronous request. (optional) |
| 20158 | + :param str name: workbook name (required) |
| 20159 | + :param str sheet_name: worksheet name (required) |
| 20160 | + :param str range: range (required) |
| 20161 | + :param str shift: Represent the shift options when deleting a range of cells. (Left,Up) (required) |
| 20162 | + :param str folder: Workbook folder. |
| 20163 | + :param str storage_name: storage name. |
| 20164 | + :return: CellsCloudResponse |
| 20165 | + If the method is called asynchronously, |
| 20166 | + returns the request thread. |
| 20167 | + """ |
| 20168 | + |
| 20169 | + all_params = ['name', 'sheet_name', 'range', 'shift', 'folder', 'storage_name'] |
| 20170 | + all_params.append('callback') |
| 20171 | + all_params.append('_return_http_data_only') |
| 20172 | + all_params.append('_preload_content') |
| 20173 | + all_params.append('_request_timeout') |
| 20174 | + |
| 20175 | + params = locals() |
| 20176 | + for key, val in iteritems(params['kwargs']): |
| 20177 | + if key not in all_params: |
| 20178 | + raise TypeError( |
| 20179 | + "Got an unexpected keyword argument '%s'" |
| 20180 | + " to method cells_ranges_delete_worksheet_cells_range" % key |
| 20181 | + ) |
| 20182 | + params[key] = val |
| 20183 | + del params['kwargs'] |
| 20184 | + # verify the required parameter 'name' is set |
| 20185 | + if ('name' not in params) or (params['name'] is None): |
| 20186 | + raise ValueError("Missing the required parameter `name` when calling `cells_ranges_delete_worksheet_cells_range`") |
| 20187 | + # verify the required parameter 'sheet_name' is set |
| 20188 | + if ('sheet_name' not in params) or (params['sheet_name'] is None): |
| 20189 | + raise ValueError("Missing the required parameter `sheet_name` when calling `cells_ranges_delete_worksheet_cells_range`") |
| 20190 | + # verify the required parameter 'range' is set |
| 20191 | + if ('range' not in params) or (params['range'] is None): |
| 20192 | + raise ValueError("Missing the required parameter `range` when calling `cells_ranges_delete_worksheet_cells_range`") |
| 20193 | + # verify the required parameter 'shift' is set |
| 20194 | + if ('shift' not in params) or (params['shift'] is None): |
| 20195 | + raise ValueError("Missing the required parameter `shift` when calling `cells_ranges_delete_worksheet_cells_range`") |
| 20196 | + |
| 20197 | + |
| 20198 | + collection_formats = {} |
| 20199 | + |
| 20200 | + path_params = {} |
| 20201 | + if 'name' in params: |
| 20202 | + path_params['name'] = params['name'] |
| 20203 | + if 'sheet_name' in params: |
| 20204 | + path_params['sheetName'] = params['sheet_name'] |
| 20205 | + |
| 20206 | + query_params = [] |
| 20207 | + if 'range' in params: |
| 20208 | + query_params.append(('range', params['range'])) |
| 20209 | + if 'shift' in params: |
| 20210 | + query_params.append(('shift', params['shift'])) |
| 20211 | + if 'folder' in params: |
| 20212 | + query_params.append(('folder', params['folder'])) |
| 20213 | + if 'storage_name' in params: |
| 20214 | + query_params.append(('storageName', params['storage_name'])) |
| 20215 | + |
| 20216 | + header_params = {} |
| 20217 | + |
| 20218 | + form_params = [] |
| 20219 | + local_var_files = {} |
| 20220 | + |
| 20221 | + body_params = None |
| 20222 | + # HTTP header `Accept` |
| 20223 | + header_params['Accept'] = self.api_client.\ |
| 20224 | + select_header_accept(['application/json']) |
| 20225 | + |
| 20226 | + # HTTP header `Content-Type` |
| 20227 | + header_params['Content-Type'] = self.api_client.\ |
| 20228 | + select_header_content_type(['application/json']) |
| 20229 | + |
| 20230 | + # Authentication setting |
| 20231 | + auth_settings = [] |
| 20232 | + |
| 20233 | + return self.api_client.call_api('/cells/{name}/worksheets/{sheetName}/ranges', 'DELETE', |
| 20234 | + path_params, |
| 20235 | + query_params, |
| 20236 | + header_params, |
| 20237 | + body=body_params, |
| 20238 | + post_params=form_params, |
| 20239 | + files=local_var_files, |
| 20240 | + response_type='CellsCloudResponse', |
| 20241 | + auth_settings=auth_settings, |
| 20242 | + callback=params.get('callback'), |
| 20243 | + _return_http_data_only=params.get('_return_http_data_only'), |
| 20244 | + _preload_content=params.get('_preload_content', True), |
| 20245 | + _request_timeout=params.get('_request_timeout'), |
| 20246 | + collection_formats=collection_formats) |
| 20247 | + |
20113 | 20248 | def cells_ranges_get_worksheet_cells_range_value(self, name, sheet_name, **kwargs): |
20114 | 20249 | """ |
20115 | 20250 | Get cells list in a range by range name or row column indexes |
@@ -21409,6 +21544,140 @@ def cells_ranges_post_worksheet_cells_ranges_with_http_info(self, name, sheet_na |
21409 | 21544 | _request_timeout=params.get('_request_timeout'), |
21410 | 21545 | collection_formats=collection_formats) |
21411 | 21546 |
|
| 21547 | + def cells_ranges_put_worksheet_cells_range(self, name, sheet_name, range, shift, **kwargs): |
| 21548 | + """ |
| 21549 | + Insert range in the worksheet |
| 21550 | + This method makes a synchronous HTTP request by default. To make an |
| 21551 | + asynchronous HTTP request, please define a `callback` function |
| 21552 | + to be invoked when receiving the response. |
| 21553 | + >>> def callback_function(response): |
| 21554 | + >>> pprint(response) |
| 21555 | + >>> |
| 21556 | + >>> thread = api.cells_ranges_put_worksheet_cells_range(name, sheet_name, range, shift, callback=callback_function) |
| 21557 | + |
| 21558 | + :param callback function: The callback function |
| 21559 | + for asynchronous request. (optional) |
| 21560 | + :param str name: workbook name (required) |
| 21561 | + :param str sheet_name: worksheet name (required) |
| 21562 | + :param str range: range (required) |
| 21563 | + :param str shift: Represent the shift options when deleting a range of cells. (Right,Down) (required) |
| 21564 | + :param str folder: Workbook folder. |
| 21565 | + :param str storage_name: storage name. |
| 21566 | + :return: CellsCloudResponse |
| 21567 | + If the method is called asynchronously, |
| 21568 | + returns the request thread. |
| 21569 | + """ |
| 21570 | + kwargs['_return_http_data_only'] = True |
| 21571 | + self.check_access_token() |
| 21572 | + if kwargs.get('callback'): |
| 21573 | + return self.cells_ranges_put_worksheet_cells_range_with_http_info(name, sheet_name, range, shift, **kwargs) |
| 21574 | + else: |
| 21575 | + (data) = self.cells_ranges_put_worksheet_cells_range_with_http_info(name, sheet_name, range, shift, **kwargs) |
| 21576 | + return data |
| 21577 | + |
| 21578 | + def cells_ranges_put_worksheet_cells_range_with_http_info(self, name, sheet_name, range, shift, **kwargs): |
| 21579 | + """ |
| 21580 | + Insert range in the worksheet |
| 21581 | + This method makes a synchronous HTTP request by default. To make an |
| 21582 | + asynchronous HTTP request, please define a `callback` function |
| 21583 | + to be invoked when receiving the response. |
| 21584 | + >>> def callback_function(response): |
| 21585 | + >>> pprint(response) |
| 21586 | + >>> |
| 21587 | + >>> thread = api.cells_ranges_put_worksheet_cells_range_with_http_info(name, sheet_name, range, shift, callback=callback_function) |
| 21588 | + |
| 21589 | + :param callback function: The callback function |
| 21590 | + for asynchronous request. (optional) |
| 21591 | + :param str name: workbook name (required) |
| 21592 | + :param str sheet_name: worksheet name (required) |
| 21593 | + :param str range: range (required) |
| 21594 | + :param str shift: Represent the shift options when deleting a range of cells. (Right,Down) (required) |
| 21595 | + :param str folder: Workbook folder. |
| 21596 | + :param str storage_name: storage name. |
| 21597 | + :return: CellsCloudResponse |
| 21598 | + If the method is called asynchronously, |
| 21599 | + returns the request thread. |
| 21600 | + """ |
| 21601 | + |
| 21602 | + all_params = ['name', 'sheet_name', 'range', 'shift', 'folder', 'storage_name'] |
| 21603 | + all_params.append('callback') |
| 21604 | + all_params.append('_return_http_data_only') |
| 21605 | + all_params.append('_preload_content') |
| 21606 | + all_params.append('_request_timeout') |
| 21607 | + |
| 21608 | + params = locals() |
| 21609 | + for key, val in iteritems(params['kwargs']): |
| 21610 | + if key not in all_params: |
| 21611 | + raise TypeError( |
| 21612 | + "Got an unexpected keyword argument '%s'" |
| 21613 | + " to method cells_ranges_put_worksheet_cells_range" % key |
| 21614 | + ) |
| 21615 | + params[key] = val |
| 21616 | + del params['kwargs'] |
| 21617 | + # verify the required parameter 'name' is set |
| 21618 | + if ('name' not in params) or (params['name'] is None): |
| 21619 | + raise ValueError("Missing the required parameter `name` when calling `cells_ranges_put_worksheet_cells_range`") |
| 21620 | + # verify the required parameter 'sheet_name' is set |
| 21621 | + if ('sheet_name' not in params) or (params['sheet_name'] is None): |
| 21622 | + raise ValueError("Missing the required parameter `sheet_name` when calling `cells_ranges_put_worksheet_cells_range`") |
| 21623 | + # verify the required parameter 'range' is set |
| 21624 | + if ('range' not in params) or (params['range'] is None): |
| 21625 | + raise ValueError("Missing the required parameter `range` when calling `cells_ranges_put_worksheet_cells_range`") |
| 21626 | + # verify the required parameter 'shift' is set |
| 21627 | + if ('shift' not in params) or (params['shift'] is None): |
| 21628 | + raise ValueError("Missing the required parameter `shift` when calling `cells_ranges_put_worksheet_cells_range`") |
| 21629 | + |
| 21630 | + |
| 21631 | + collection_formats = {} |
| 21632 | + |
| 21633 | + path_params = {} |
| 21634 | + if 'name' in params: |
| 21635 | + path_params['name'] = params['name'] |
| 21636 | + if 'sheet_name' in params: |
| 21637 | + path_params['sheetName'] = params['sheet_name'] |
| 21638 | + |
| 21639 | + query_params = [] |
| 21640 | + if 'range' in params: |
| 21641 | + query_params.append(('range', params['range'])) |
| 21642 | + if 'shift' in params: |
| 21643 | + query_params.append(('shift', params['shift'])) |
| 21644 | + if 'folder' in params: |
| 21645 | + query_params.append(('folder', params['folder'])) |
| 21646 | + if 'storage_name' in params: |
| 21647 | + query_params.append(('storageName', params['storage_name'])) |
| 21648 | + |
| 21649 | + header_params = {} |
| 21650 | + |
| 21651 | + form_params = [] |
| 21652 | + local_var_files = {} |
| 21653 | + |
| 21654 | + body_params = None |
| 21655 | + # HTTP header `Accept` |
| 21656 | + header_params['Accept'] = self.api_client.\ |
| 21657 | + select_header_accept(['application/json']) |
| 21658 | + |
| 21659 | + # HTTP header `Content-Type` |
| 21660 | + header_params['Content-Type'] = self.api_client.\ |
| 21661 | + select_header_content_type(['application/json']) |
| 21662 | + |
| 21663 | + # Authentication setting |
| 21664 | + auth_settings = [] |
| 21665 | + |
| 21666 | + return self.api_client.call_api('/cells/{name}/worksheets/{sheetName}/ranges', 'PUT', |
| 21667 | + path_params, |
| 21668 | + query_params, |
| 21669 | + header_params, |
| 21670 | + body=body_params, |
| 21671 | + post_params=form_params, |
| 21672 | + files=local_var_files, |
| 21673 | + response_type='CellsCloudResponse', |
| 21674 | + auth_settings=auth_settings, |
| 21675 | + callback=params.get('callback'), |
| 21676 | + _return_http_data_only=params.get('_return_http_data_only'), |
| 21677 | + _preload_content=params.get('_preload_content', True), |
| 21678 | + _request_timeout=params.get('_request_timeout'), |
| 21679 | + collection_formats=collection_formats) |
| 21680 | + |
21412 | 21681 | def cells_save_as_post_document_save_as(self, name, **kwargs): |
21413 | 21682 | """ |
21414 | 21683 | Convert document and save result to storage. |
|
0 commit comments