Skip to content

Commit 896ebfe

Browse files
author
evgeny.ivanov
committed
SDK regenerated by CI server [ci skip]
1 parent 7d1e125 commit 896ebfe

File tree

9 files changed

+411
-0
lines changed

9 files changed

+411
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Python Cloud SDK wraps Aspose.Words Cloud API so you could seamlessly integrate
2020

2121
- ImlRenderingMode option introduced witch is used to determine how ink (InkML) objects are rendered
2222
- MaxCharactersPerLine option introduced which is used to specify the maximum number of characters per one line
23+
- Added new API method to get a RSA public key to encrypt document passwords
24+
- Added encryptedPassword common query option to pass an encrypted document password
2325

2426

2527
## Enhancements in Version 21.6

asposewordscloud/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
from asposewordscloud.models.protection_data_response import ProtectionDataResponse
163163
from asposewordscloud.models.protection_request import ProtectionRequest
164164
from asposewordscloud.models.ps_save_options_data import PsSaveOptionsData
165+
from asposewordscloud.models.public_key_response import PublicKeyResponse
165166
from asposewordscloud.models.range_document import RangeDocument
166167
from asposewordscloud.models.range_document_dto import RangeDocumentDto
167168
from asposewordscloud.models.range_text_response import RangeTextResponse

asposewordscloud/apis/words_api.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11372,6 +11372,74 @@ def get_paragraph_tab_stops_online_with_http_info(self, request, **kwargs): # n
1137211372
_request_timeout=params.get('_request_timeout'),
1137311373
collection_formats=http_params['collection_formats']))
1137411374

11375+
def get_public_key(self, request, **kwargs): # noqa: E501
11376+
"""Get assymetric public key. # noqa: E501
11377+
11378+
This method makes a synchronous HTTP request by default. To make an
11379+
asynchronous HTTP request, please pass is_async=True
11380+
11381+
:param is_async bool
11382+
:return: PublicKeyResponse
11383+
If the method is called asynchronously,
11384+
returns the request thread.
11385+
"""
11386+
try:
11387+
if kwargs.get('is_async'):
11388+
return self.get_public_key_with_http_info(request, **kwargs) # noqa: E501
11389+
data = self.get_public_key_with_http_info(request, **kwargs) # noqa: E501
11390+
return data
11391+
except ApiException as e:
11392+
if e.status == 401:
11393+
self.api_client.request_token()
11394+
if kwargs.get('is_async'):
11395+
return self.get_public_key_with_http_info(request, **kwargs) # noqa: E501
11396+
data = self.get_public_key_with_http_info(request, **kwargs) # noqa: E501
11397+
return data
11398+
11399+
def get_public_key_with_http_info(self, request, **kwargs): # noqa: E501
11400+
"""Get assymetric public key. # noqa: E501
11401+
11402+
This method makes a synchronous HTTP request by default. To make an
11403+
asynchronous HTTP request, please pass is_async=True
11404+
11405+
:param is_async bool
11406+
:param request GetPublicKeyRequest object with parameters
11407+
:return: PublicKeyResponse
11408+
If the method is called asynchronously,
11409+
returns the request thread.
11410+
"""
11411+
11412+
params = locals()
11413+
params['is_async'] = ''
11414+
params['_preload_content'] = True
11415+
params['_request_timeout'] = ''
11416+
for key, val in six.iteritems(params['kwargs']):
11417+
if key not in params:
11418+
raise TypeError(
11419+
"Got an unexpected keyword argument '%s'"
11420+
" to method get_public_key" % key
11421+
)
11422+
params[key] = val
11423+
del params['kwargs']
11424+
http_params = request.create_http_request(self.api_client)
11425+
11426+
# Authentication setting
11427+
auth_settings = ['JWT'] # noqa: E501
11428+
11429+
return request.deserialize_response(self.api_client, self.api_client.call_api(
11430+
http_params['path'],
11431+
http_params['method'],
11432+
http_params['query_params'],
11433+
http_params['header_params'],
11434+
body=http_params['body'],
11435+
post_params=http_params['form_params'],
11436+
response_type=http_params['response_type'], # noqa: E501
11437+
auth_settings=auth_settings,
11438+
is_async=params.get('is_async'),
11439+
_preload_content=params.get('_preload_content', True),
11440+
_request_timeout=params.get('_request_timeout'),
11441+
collection_formats=http_params['collection_formats']))
11442+
1137511443
def get_range_text(self, request, **kwargs): # noqa: E501
1137611444
"""Reads range text from the document. # noqa: E501
1137711445

asposewordscloud/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@
157157
from asposewordscloud.models.protection_data_response import ProtectionDataResponse
158158
from asposewordscloud.models.protection_request import ProtectionRequest
159159
from asposewordscloud.models.ps_save_options_data import PsSaveOptionsData
160+
from asposewordscloud.models.public_key_response import PublicKeyResponse
160161
from asposewordscloud.models.range_document import RangeDocument
161162
from asposewordscloud.models.range_document_dto import RangeDocumentDto
162163
from asposewordscloud.models.range_text_response import RangeTextResponse
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
# coding: utf-8
2+
# -----------------------------------------------------------------------------------
3+
# <copyright company="Aspose" file="public_key_response.py">
4+
# Copyright (c) 2021 Aspose.Words for 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+
import pprint
27+
import re # noqa: F401
28+
29+
import datetime
30+
import six
31+
import json
32+
33+
34+
class PublicKeyResponse(object):
35+
"""REST response for RSA public key info.
36+
"""
37+
38+
"""
39+
Attributes:
40+
swagger_types (dict): The key is attribute name
41+
and the value is attribute type.
42+
attribute_map (dict): The key is attribute name
43+
and the value is json key in definition.
44+
"""
45+
swagger_types = {
46+
'request_id': 'str',
47+
'exponent': 'str',
48+
'modulus': 'str'
49+
}
50+
51+
attribute_map = {
52+
'request_id': 'RequestId',
53+
'exponent': 'Exponent',
54+
'modulus': 'Modulus'
55+
}
56+
57+
def __init__(self, request_id=None, exponent=None, modulus=None): # noqa: E501
58+
"""PublicKeyResponse - a model defined in Swagger""" # noqa: E501
59+
60+
self._request_id = None
61+
self._exponent = None
62+
self._modulus = None
63+
self.discriminator = None
64+
65+
if request_id is not None:
66+
self.request_id = request_id
67+
if exponent is not None:
68+
self.exponent = exponent
69+
if modulus is not None:
70+
self.modulus = modulus
71+
72+
@property
73+
def request_id(self):
74+
"""Gets the request_id of this PublicKeyResponse. # noqa: E501
75+
76+
Gets or sets the request Id. # noqa: E501
77+
78+
:return: The request_id of this PublicKeyResponse. # noqa: E501
79+
:rtype: str
80+
"""
81+
return self._request_id
82+
83+
@request_id.setter
84+
def request_id(self, request_id):
85+
"""Sets the request_id of this PublicKeyResponse.
86+
87+
Gets or sets the request Id. # noqa: E501
88+
89+
:param request_id: The request_id of this PublicKeyResponse. # noqa: E501
90+
:type: str
91+
"""
92+
self._request_id = request_id
93+
94+
@property
95+
def exponent(self):
96+
"""Gets the exponent of this PublicKeyResponse. # noqa: E501
97+
98+
Gets or sets RSA key exponent as Base64 string. # noqa: E501
99+
100+
:return: The exponent of this PublicKeyResponse. # noqa: E501
101+
:rtype: str
102+
"""
103+
return self._exponent
104+
105+
@exponent.setter
106+
def exponent(self, exponent):
107+
"""Sets the exponent of this PublicKeyResponse.
108+
109+
Gets or sets RSA key exponent as Base64 string. # noqa: E501
110+
111+
:param exponent: The exponent of this PublicKeyResponse. # noqa: E501
112+
:type: str
113+
"""
114+
self._exponent = exponent
115+
116+
@property
117+
def modulus(self):
118+
"""Gets the modulus of this PublicKeyResponse. # noqa: E501
119+
120+
Gets or sets RSA key modulus as Base64 string. # noqa: E501
121+
122+
:return: The modulus of this PublicKeyResponse. # noqa: E501
123+
:rtype: str
124+
"""
125+
return self._modulus
126+
127+
@modulus.setter
128+
def modulus(self, modulus):
129+
"""Sets the modulus of this PublicKeyResponse.
130+
131+
Gets or sets RSA key modulus as Base64 string. # noqa: E501
132+
133+
:param modulus: The modulus of this PublicKeyResponse. # noqa: E501
134+
:type: str
135+
"""
136+
self._modulus = modulus
137+
138+
139+
def to_dict(self):
140+
"""Returns the model properties as a dict"""
141+
result = {}
142+
143+
for attr, _ in six.iteritems(self.swagger_types):
144+
value = getattr(self, attr)
145+
if value is None:
146+
continue
147+
if isinstance(value, list):
148+
result[self.attribute_map[attr]] = list(map(
149+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
150+
value
151+
))
152+
elif hasattr(value, "to_dict"):
153+
result[self.attribute_map[attr]] = value.to_dict()
154+
elif isinstance(value, dict):
155+
result[self.attribute_map[attr]] = dict(map(
156+
lambda item: (item[0], item[1].to_dict())
157+
if hasattr(item[1], "to_dict") else item,
158+
value.items()
159+
))
160+
elif isinstance(value, (datetime.datetime, datetime.date)):
161+
result[self.attribute_map[attr]] = value.isoformat()
162+
else:
163+
result[self.attribute_map[attr]] = value
164+
165+
return result
166+
167+
def to_json(self):
168+
"""Returns the model properties as a dict"""
169+
result = {}
170+
171+
for attr, _ in six.iteritems(self.swagger_types):
172+
value = getattr(self, attr)
173+
if isinstance(value, list):
174+
result[self.attribute_map[attr]] = list(map(
175+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
176+
value
177+
))
178+
elif hasattr(value, "to_dict"):
179+
result[self.attribute_map[attr]] = value.to_dict()
180+
elif isinstance(value, dict):
181+
result[self.attribute_map[attr]] = dict(map(
182+
lambda item: (item[0], item[1].to_dict())
183+
if hasattr(item[1], "to_dict") else item,
184+
value.items()
185+
))
186+
elif isinstance(value, (datetime.datetime, datetime.date)):
187+
result[self.attribute_map[attr]] = value.isoformat()
188+
else:
189+
result[self.attribute_map[attr]] = value
190+
191+
return json.dumps(result)
192+
193+
def to_str(self):
194+
"""Returns the string representation of the model"""
195+
return pprint.pformat(self.to_dict())
196+
197+
def __repr__(self):
198+
"""For `print` and `pprint`"""
199+
return self.to_str()
200+
201+
def __eq__(self, other):
202+
"""Returns true if both objects are equal"""
203+
if not isinstance(other, PublicKeyResponse):
204+
return False
205+
206+
return self.__dict__ == other.__dict__
207+
208+
def __ne__(self, other):
209+
"""Returns true if both objects are not equal"""
210+
return not self == other

asposewordscloud/models/requests/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
from asposewordscloud.models.requests.get_paragraphs_online_request import GetParagraphsOnlineRequest
149149
from asposewordscloud.models.requests.get_paragraph_tab_stops_request import GetParagraphTabStopsRequest
150150
from asposewordscloud.models.requests.get_paragraph_tab_stops_online_request import GetParagraphTabStopsOnlineRequest
151+
from asposewordscloud.models.requests.get_public_key_request import GetPublicKeyRequest
151152
from asposewordscloud.models.requests.get_range_text_request import GetRangeTextRequest
152153
from asposewordscloud.models.requests.get_range_text_online_request import GetRangeTextOnlineRequest
153154
from asposewordscloud.models.requests.get_run_request import GetRunRequest

0 commit comments

Comments
 (0)