Skip to content

Commit f967826

Browse files
committed
Add repair api.
1 parent 04ea29f commit f967826

File tree

6 files changed

+147
-8
lines changed

6 files changed

+147
-8
lines changed

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![PyPI](https://img.shields.io/pypi/v/asposecellscloud) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/asposecellscloud) ![PyPI - Downloads](https://img.shields.io/pypi/dm/asposecellscloud) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-python)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-python/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-python/23.6)
1+
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![PyPI](https://img.shields.io/pypi/v/asposecellscloud) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/asposecellscloud) ![PyPI - Downloads](https://img.shields.io/pypi/dm/asposecellscloud) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-python)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-python/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-python/23.7)
22

33

44
# Python SDK for Spreadsheet Processing in Cloud
@@ -21,13 +21,9 @@ Python Cloud SDK wraps Aspose.Cells REST API so you could seamlessly integrate M
2121
- Convert worksheets to PDF, XPS & SVG formats.
2222
- Inter-convert files to popular Excel formats.
2323

24-
## Feature & Enhancements in Version 23.6
24+
## Feature & Enhancements in Version 23.7
2525

26-
- Support to batch lock multi-files.
27-
- Support to batch unlock multi-files.
28-
- Support to protect lock multi-files.
29-
- Support to split lock multi-files.
30-
- Fix put document property api.
26+
- Support to repair api.
3127

3228

3329
## Read & Write Spreadsheet Formats

asposecellscloud/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@
423423
from .requests.post_watermark_request import PostWatermarkRequest
424424
from .requests.post_clear_objects_request import PostClearObjectsRequest
425425
from .requests.post_reverse_request import PostReverseRequest
426+
from .requests.post_repair_request import PostRepairRequest
426427
from .requests.post_rotate_request import PostRotateRequest
427428
from .requests.post_metadata_request import PostMetadataRequest
428429
from .requests.get_metadata_request import GetMetadataRequest

asposecellscloud/apis/cells_api.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6216,6 +6216,51 @@ def post_reverse_with_http_info(self, request, **kwargs):
62166216
collection_formats=http_params['collection_formats'])
62176217

62186218

6219+
# <summary>
6220+
# </summary>
6221+
# <param name="request">Request. <see cref="PostRepairRequest" /></param>
6222+
def post_repair(self, request, **kwargs):
6223+
6224+
kwargs['_return_http_data_only'] = True
6225+
self.check_access_token()
6226+
if kwargs.get('callback'):
6227+
return self.post_repair_with_http_info(request,**kwargs)
6228+
else:
6229+
(data) = self.post_repair_with_http_info(request,**kwargs)
6230+
return data
6231+
6232+
def post_repair_with_http_info(self, request, **kwargs):
6233+
all_params = []
6234+
all_params.append('callback')
6235+
all_params.append('_return_http_data_only')
6236+
all_params.append('_preload_content')
6237+
all_params.append('_request_timeout')
6238+
params = locals()
6239+
for key, val in iteritems(params['kwargs']):
6240+
if key not in all_params:
6241+
raise TypeError(
6242+
"Got an unexpected keyword argument '%s'"
6243+
" to method post_repair" % key
6244+
)
6245+
params[key] = val
6246+
del params['kwargs']
6247+
6248+
http_params = request.create_http_request(self.api_client)
6249+
return self.api_client.call_api(http_params['path'], http_params['method'],
6250+
None,
6251+
http_params['query_params'],
6252+
http_params['header_params'],
6253+
body=http_params['body'],
6254+
post_params=http_params['form_params'],
6255+
files=http_params['files'],
6256+
response_type=http_params['response_type'],
6257+
auth_settings=http_params['auth_settings'],
6258+
callback=params.get('callback'),
6259+
_return_http_data_only=params.get('_return_http_data_only'),
6260+
_preload_content=params.get('_preload_content', True),
6261+
_request_timeout=params.get('_request_timeout'),
6262+
collection_formats=http_params['collection_formats'])
6263+
62196264

62206265
# <summary>
62216266
# </summary>

asposecellscloud/requests/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@
156156
from asposecellscloud.requests.post_watermark_request import PostWatermarkRequest
157157
from asposecellscloud.requests.post_clear_objects_request import PostClearObjectsRequest
158158
from asposecellscloud.requests.post_reverse_request import PostReverseRequest
159+
from asposecellscloud.requests.post_repair_request import PostRepairRequest
159160
from asposecellscloud.requests.post_rotate_request import PostRotateRequest
160161
from asposecellscloud.requests.post_metadata_request import PostMetadataRequest
161162
from asposecellscloud.requests.get_metadata_request import GetMetadataRequest
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# coding: utf-8
2+
"""
3+
<copyright company="Aspose" file="PostRepairRequest.cs">
4+
Copyright (c) 2023 Aspose.Cells Cloud
5+
</copyright>
6+
<summary>
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.
24+
</summary>
25+
"""
26+
27+
import json
28+
29+
from six import iteritems
30+
from asposecellscloud import *
31+
from asposecellscloud.models import *
32+
from asposecellscloud.requests import *
33+
from six.moves.urllib.parse import quote
34+
35+
class PostRepairRequest(object):
36+
37+
def __init__(self , file ,format =None ):
38+
self.file = file
39+
self.format = format
40+
def create_http_request(self, api_client):
41+
42+
# verify the required parameter 'file' is set
43+
if self.file is None:
44+
raise ValueError("Missing the required parameter `file` when calling `post_repair`")
45+
46+
47+
collection_formats = {}
48+
49+
path_params = {}
50+
query_params = []
51+
if self.format is not None:
52+
query_params.append(('format',self.format ))
53+
54+
header_params = {}
55+
56+
form_params = []
57+
local_var_files = {}
58+
if self.file is not None:
59+
if isinstance(self.file,dict):
60+
for filename , filecontext in self.file.items():
61+
local_var_files[filename] = filecontext
62+
else:
63+
local_var_files['File'] = self.file
64+
65+
body_params = None
66+
# HTTP header `Accept`
67+
header_params['Accept'] = api_client.\
68+
select_header_accept(['application/json'])
69+
70+
# HTTP header `Content-Type`
71+
header_params['Content-Type'] = api_client.\
72+
select_header_content_type(['multipart/form-data'])
73+
74+
# Authentication setting
75+
auth_settings = []
76+
resource_path = "/cells/repair"
77+
# path parameters
78+
if path_params:
79+
path_params = api_client.sanitize_for_serialization(path_params)
80+
path_params = api_client.parameters_to_tuples(path_params, collection_formats)
81+
for k, v in path_params:
82+
# specified safe chars, encode everything
83+
resource_path = resource_path.replace('{%s}' % k, quote(str(v), safe='/'))
84+
return {
85+
"method": "POST",
86+
"path":resource_path,
87+
"query_params": query_params,
88+
"header_params": header_params,
89+
"form_params": form_params,
90+
"files":local_var_files,
91+
"auth_settings":auth_settings,
92+
"body": body_params,
93+
"collection_formats": collection_formats,
94+
"response_type": 'FilesResult'
95+
}
96+

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from setuptools import setup, find_packages
55

66
NAME = "asposecellscloud"
7-
VERSION = "23.5.1"
7+
VERSION = "23.6"
88
# To install the library, run the following
99
#
1010
# python setup.py install

0 commit comments

Comments
 (0)