Skip to content

Commit 7cf9244

Browse files
committed
Add lock api and optimize portect api.
1 parent 3a65632 commit 7cf9244

17 files changed

+2904
-749
lines changed

README.md

Lines changed: 6 additions & 4 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.7)
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.8)
22

33

44
# Python SDK for Spreadsheet Processing in Cloud
@@ -21,10 +21,12 @@ 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.7
24+
## Feature & Enhancements in Version 23.8
2525

26-
- Support to repair api.
27-
- Remove GetExtractBarcodes API.
26+
Full list of issues covering all changes in this release:
27+
28+
- Support to lock API.
29+
- Optimize protect API.
2830

2931
## Read & Write Spreadsheet Formats
3032

asposecellscloud/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __init__(self, host=None, header_name=None, header_value=None, cookie=None):
8383
self.host = host
8484
self.cookie = cookie
8585
# Set default User-Agent.
86-
self.user_agent = 'Aspose.Cells.Cloud/23.6/python'
86+
self.user_agent = 'Aspose.Cells.Cloud/23.8/python'
8787

8888
@property
8989
def user_agent(self):

asposecellscloud/apis/cells_api.py

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5797,6 +5797,54 @@ def post_unlock_with_http_info(self, request, **kwargs):
57975797

57985798
# <summary>
57995799
# </summary>
5800+
# <param name="request">Request. <see cref="PostLockRequest" /></param>
5801+
def post_lock(self, request, **kwargs):
5802+
5803+
kwargs['_return_http_data_only'] = True
5804+
self.check_access_token()
5805+
if kwargs.get('callback'):
5806+
return self.post_lock_with_http_info(request,**kwargs)
5807+
else:
5808+
(data) = self.post_lock_with_http_info(request,**kwargs)
5809+
return data
5810+
5811+
def post_lock_with_http_info(self, request, **kwargs):
5812+
all_params = []
5813+
all_params.append('callback')
5814+
all_params.append('_return_http_data_only')
5815+
all_params.append('_preload_content')
5816+
all_params.append('_request_timeout')
5817+
params = locals()
5818+
for key, val in iteritems(params['kwargs']):
5819+
if key not in all_params:
5820+
raise TypeError(
5821+
"Got an unexpected keyword argument '%s'"
5822+
" to method post_lock" % key
5823+
)
5824+
params[key] = val
5825+
del params['kwargs']
5826+
5827+
http_params = request.create_http_request(self.api_client)
5828+
return self.api_client.call_api(http_params['path'], http_params['method'],
5829+
None,
5830+
http_params['query_params'],
5831+
http_params['header_params'],
5832+
body=http_params['body'],
5833+
post_params=http_params['form_params'],
5834+
files=http_params['files'],
5835+
response_type=http_params['response_type'],
5836+
auth_settings=http_params['auth_settings'],
5837+
callback=params.get('callback'),
5838+
_return_http_data_only=params.get('_return_http_data_only'),
5839+
_preload_content=params.get('_preload_content', True),
5840+
_request_timeout=params.get('_request_timeout'),
5841+
collection_formats=http_params['collection_formats'])
5842+
5843+
5844+
5845+
# <summary>
5846+
# Protect MS Excel and OpenDocument Spreadsheet by making them password protected.
5847+
# </summary>
58005848
# <param name="request">Request. <see cref="PostProtectRequest" /></param>
58015849
def post_protect(self, request, **kwargs):
58025850

@@ -5840,8 +5888,6 @@ def post_protect_with_http_info(self, request, **kwargs):
58405888
_request_timeout=params.get('_request_timeout'),
58415889
collection_formats=http_params['collection_formats'])
58425890

5843-
5844-
58455891
# <summary>
58465892
# </summary>
58475893
# <param name="request">Request. <see cref="PostSplitRequest" /></param>

asposecellscloud/models/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@
5858
from .data_sorter import DataSorter
5959
from .disc_usage import DiscUsage
6060
from .dynamic_filter import DynamicFilter
61+
from .digital_signature import DigitalSignature
62+
from .protection import Protection
63+
from .protect_workbook_requst import ProtectWorkbookRequst
64+
from .rendering_font import RenderingFont
65+
from .rendering_watermark import RenderingWatermark
6166
from .error_details import ErrorDetails
6267
from .file_info import FileInfo
6368
from .file_source import FileSource
Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
# coding: utf-8
2+
"""
3+
<copyright company="Aspose" file="DigitalSignaturepy.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+
from pprint import pformat
28+
from six import iteritems
29+
import re
30+
31+
class DigitalSignature(object):
32+
33+
"""
34+
NOTE: This class is auto generated by the swagger code generator program.
35+
Do not edit the class manually.
36+
"""
37+
38+
39+
"""
40+
Attributes:
41+
swagger_types (dict): The key is attribute name
42+
and the value is attribute type.
43+
attribute_map (dict): The key is attribute name
44+
and the value is json key in definition.
45+
"""
46+
47+
swagger_types = {
48+
'comments' : 'str',
49+
'sign_time' : 'str',
50+
'id' : 'str',
51+
'password' : 'str',
52+
'image' : 'list[int]',
53+
'provider_id' : 'str',
54+
'is_valid' : 'bool',
55+
'x_ad_es_type' : 'str'
56+
}
57+
58+
attribute_map = {
59+
'comments' : 'Comments' ,
60+
'sign_time' : 'SignTime' ,
61+
'id' : 'Id' ,
62+
'password' : 'Password' ,
63+
'image' : 'Image' ,
64+
'provider_id' : 'ProviderId' ,
65+
'is_valid' : 'IsValid' ,
66+
'x_ad_es_type' : 'XAdESType'
67+
}
68+
69+
@staticmethod
70+
def get_swagger_types():
71+
return DigitalSignature.swagger_types
72+
73+
@staticmethod
74+
def get_attribute_map():
75+
return DigitalSignature.attribute_map
76+
77+
def get_from_container(self, attr):
78+
if attr in self.container:
79+
return self.container[attr]
80+
return None
81+
82+
def __init__(self,comments=None ,sign_time=None ,id=None ,password=None ,image=None ,provider_id=None ,is_valid=None ,x_ad_es_type=None ,**kw):
83+
"""
84+
Associative dict for storing property values
85+
"""
86+
self.container = {}
87+
88+
"""
89+
DigitalSignature - a model defined in Swagger
90+
"""
91+
self.container['comments'] = None
92+
self.container['sign_time'] = None
93+
self.container['id'] = None
94+
self.container['password'] = None
95+
self.container['image'] = None
96+
self.container['provider_id'] = None
97+
self.container['is_valid'] = None
98+
self.container['x_ad_es_type'] = None
99+
params = locals()
100+
self.comments = comments
101+
if 'comments' in params:
102+
self.comments = params["comments"]
103+
104+
105+
106+
self.sign_time = sign_time
107+
if 'sign_time' in params:
108+
self.sign_time = params["sign_time"]
109+
110+
111+
112+
self.id = id
113+
if 'id' in params:
114+
self.id = params["id"]
115+
116+
117+
118+
self.password = password
119+
if 'password' in params:
120+
self.password = params["password"]
121+
122+
123+
124+
self.image = image
125+
if 'image' in params:
126+
self.image = params["image"]
127+
128+
129+
130+
self.provider_id = provider_id
131+
if 'provider_id' in params:
132+
self.provider_id = params["provider_id"]
133+
134+
135+
136+
self.is_valid = is_valid
137+
if 'is_valid' in params:
138+
self.is_valid = params["is_valid"]
139+
140+
141+
142+
self.x_ad_es_type = x_ad_es_type
143+
if 'x_ad_es_type' in params:
144+
self.x_ad_es_type = params["x_ad_es_type"]
145+
146+
147+
148+
149+
@property
150+
def comments(self):
151+
return self.container['comments']
152+
153+
@comments.setter
154+
def comments(self, comments):
155+
self.container['comments'] = comments
156+
@property
157+
def sign_time(self):
158+
return self.container['sign_time']
159+
160+
@sign_time.setter
161+
def sign_time(self, sign_time):
162+
self.container['sign_time'] = sign_time
163+
@property
164+
def id(self):
165+
return self.container['id']
166+
167+
@id.setter
168+
def id(self, id):
169+
self.container['id'] = id
170+
@property
171+
def password(self):
172+
return self.container['password']
173+
174+
@password.setter
175+
def password(self, password):
176+
self.container['password'] = password
177+
@property
178+
def image(self):
179+
return self.container['image']
180+
181+
@image.setter
182+
def image(self, image):
183+
self.container['image'] = image
184+
@property
185+
def provider_id(self):
186+
return self.container['provider_id']
187+
188+
@provider_id.setter
189+
def provider_id(self, provider_id):
190+
self.container['provider_id'] = provider_id
191+
@property
192+
def is_valid(self):
193+
return self.container['is_valid']
194+
195+
@is_valid.setter
196+
def is_valid(self, is_valid):
197+
self.container['is_valid'] = is_valid
198+
@property
199+
def x_ad_es_type(self):
200+
return self.container['x_ad_es_type']
201+
202+
@x_ad_es_type.setter
203+
def x_ad_es_type(self, x_ad_es_type):
204+
self.container['x_ad_es_type'] = x_ad_es_type
205+
206+
def to_dict(self):
207+
"""
208+
Returns the model properties as a dict
209+
"""
210+
result = {}
211+
212+
for attr, _ in iteritems(self.get_swagger_types()):
213+
value = self.get_from_container(attr)
214+
if isinstance(value, list):
215+
result[attr] = list(map(
216+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
217+
value
218+
))
219+
elif hasattr(value, "to_dict"):
220+
result[attr] = value.to_dict()
221+
elif isinstance(value, dict):
222+
result[attr] = dict(map(
223+
lambda item: (item[0], item[1].to_dict())
224+
if hasattr(item[1], "to_dict") else item,
225+
value.items()
226+
))
227+
else:
228+
result[attr] = value
229+
230+
return result
231+
232+
def to_str(self):
233+
"""
234+
Returns the string representation of the model
235+
"""
236+
return pformat(self.to_dict())
237+
238+
def __repr__(self):
239+
"""
240+
For `print` and `pprint`
241+
"""
242+
return self.to_str()
243+
244+
def __eq__(self, other):
245+
"""
246+
Returns true if both objects are equal
247+
"""
248+
if not isinstance(other, DigitalSignature):
249+
return False
250+
251+
return self.__dict__ == other.__dict__
252+
253+
def __ne__(self, other):
254+
"""
255+
Returns true if both objects are not equal
256+
"""
257+
return not self == other

0 commit comments

Comments
 (0)