Skip to content

Commit 114fb71

Browse files
committed
Updated sources
1 parent a26453f commit 114fb71

File tree

10 files changed

+409
-11
lines changed

10 files changed

+409
-11
lines changed

groupdocs_annotation_cloud/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from groupdocs_annotation_cloud.apis.file_api import FileApi, CopyFileRequest, DeleteFileRequest, DownloadFileRequest, MoveFileRequest, UploadFileRequest
1010
from groupdocs_annotation_cloud.apis.folder_api import FolderApi, CopyFolderRequest, CreateFolderRequest, DeleteFolderRequest, GetFilesListRequest, MoveFolderRequest
1111
from groupdocs_annotation_cloud.apis.info_api import InfoApi, GetInfoRequest
12+
from groupdocs_annotation_cloud.apis.license_api import LicenseApi
1213
from groupdocs_annotation_cloud.apis.preview_api import PreviewApi, DeletePagesRequest, GetPagesRequest
1314
from groupdocs_annotation_cloud.apis.storage_api import StorageApi, GetDiscUsageRequest, GetFileVersionsRequest, ObjectExistsRequest, StorageExistsRequest
1415

@@ -22,6 +23,7 @@
2223
from groupdocs_annotation_cloud.models.annotate_options import AnnotateOptions
2324
from groupdocs_annotation_cloud.models.annotation_info import AnnotationInfo
2425
from groupdocs_annotation_cloud.models.annotation_reply_info import AnnotationReplyInfo
26+
from groupdocs_annotation_cloud.models.consumption_result import ConsumptionResult
2527
from groupdocs_annotation_cloud.models.disc_usage import DiscUsage
2628
from groupdocs_annotation_cloud.models.document_info import DocumentInfo
2729
from groupdocs_annotation_cloud.models.error import Error
@@ -47,3 +49,4 @@
4749
from groupdocs_annotation_cloud.models.file_version import FileVersion
4850
from groupdocs_annotation_cloud.models.page_image import PageImage
4951

52+

groupdocs_annotation_cloud/api_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ def __init__(self, configuration, header_name=None, header_value=None,
7474
self.configuration = configuration
7575
self.pool = None
7676
self.rest_client = rest.RESTClientObject(configuration)
77-
self.default_headers = {'x-groupdocs-client': 'python sdk', 'x-groupdocs-version': '21.6'}
77+
self.default_headers = {'x-groupdocs-client': 'python sdk', 'x-groupdocs-version': '22.2'}
7878
if header_name is not None:
7979
self.default_headers[header_name] = header_value
8080
self.cookie = cookie
8181
# Set default User-Agent.
82-
self.user_agent = 'python sdk 21.6'
82+
self.user_agent = 'python sdk 22.2'
8383

8484
def __del__(self):
8585
if self.pool is not None:

groupdocs_annotation_cloud/apis/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
from groupdocs_annotation_cloud.apis.file_api import FileApi
88
from groupdocs_annotation_cloud.apis.folder_api import FolderApi
99
from groupdocs_annotation_cloud.apis.info_api import InfoApi
10+
from groupdocs_annotation_cloud.apis.license_api import LicenseApi
1011
from groupdocs_annotation_cloud.apis.preview_api import PreviewApi
1112
from groupdocs_annotation_cloud.apis.storage_api import StorageApi
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
# coding: utf-8
2+
3+
# -----------------------------------------------------------------------------------
4+
# <copyright company="Aspose Pty Ltd">
5+
# Copyright (c) 2003-2021 Aspose Pty Ltd
6+
# </copyright>
7+
# <summary>
8+
# Permission is hereby granted, free of charge, to any person obtaining a copy
9+
# of this software and associated documentation files (the "Software"), to deal
10+
# in the Software without restriction, including without limitation the rights
11+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
# copies of the Software, and to permit persons to whom the Software is
13+
# furnished to do so, subject to the following conditions:
14+
#
15+
# The above copyright notice and this permission notice shall be included in all
16+
# copies or substantial portions of the Software.
17+
#
18+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24+
# SOFTWARE.
25+
# </summary>
26+
# -----------------------------------------------------------------------------------
27+
28+
from __future__ import absolute_import
29+
30+
import re # noqa: F401
31+
32+
# python 2 and python 3 compatibility library
33+
import six
34+
35+
from groupdocs_annotation_cloud.auth import Auth
36+
from groupdocs_annotation_cloud.api_client import ApiClient
37+
from groupdocs_annotation_cloud.api_exception import ApiException
38+
from groupdocs_annotation_cloud.configuration import Configuration
39+
40+
class LicenseApi(object):
41+
"""
42+
GroupDocs.Annotation Cloud API
43+
44+
:param configuration: API configuration
45+
"""
46+
47+
def __init__(self, configuration):
48+
api_client = ApiClient(configuration)
49+
50+
self.auth = Auth(configuration, api_client)
51+
self.api_client = api_client
52+
self.configuration = configuration
53+
54+
def close(self): # noqa: E501
55+
"""
56+
Closes thread pool. This method should be called when
57+
methods are executed asynchronously (is_async=True is passed as parameter)
58+
and this instance of LicenseApi is not going to be used any more.
59+
"""
60+
if self.api_client is not None:
61+
if(self.api_client.pool is not None):
62+
self.api_client.pool.close()
63+
self.api_client.pool.join()
64+
self.api_client.pool = None
65+
66+
@classmethod
67+
def from_keys(cls, app_sid, app_key):
68+
"""
69+
Initializes new instance of LicenseApi with API keys
70+
71+
:param app_sid Application identifier (App SID)
72+
:param app_key Application private key (App Key)
73+
"""
74+
configuration = Configuration(app_sid, app_key)
75+
return LicenseApi(configuration)
76+
77+
@classmethod
78+
def from_config(cls, configuration):
79+
"""
80+
Initializes new instance of LicenseApi with configuration options
81+
82+
:param configuration API configuration
83+
"""
84+
return LicenseApi(configuration)
85+
86+
def get_consumption_credit(self, **kwargs): # noqa: E501
87+
"""Get license consumption # noqa: E501
88+
89+
This method makes a synchronous HTTP request by default. To make an
90+
asynchronous HTTP request, please pass is_async=True
91+
92+
:param is_async bool
93+
:return: ConsumptionResult
94+
If the method is called asynchronously,
95+
returns the request thread.
96+
"""
97+
kwargs['_return_http_data_only'] = True
98+
99+
if kwargs.get('is_async'):
100+
return self._get_consumption_credit_with_http_info(**kwargs) # noqa: E501
101+
102+
(data) = self._get_consumption_credit_with_http_info(**kwargs) # noqa: E501
103+
return data
104+
105+
def _get_consumption_credit_with_http_info(self, **kwargs): # noqa: E501
106+
"""Get license consumption # noqa: E501
107+
108+
This method makes a synchronous HTTP request by default. To make an
109+
asynchronous HTTP request, please pass is_async=True
110+
111+
:param is_async bool
112+
113+
:return: ConsumptionResult
114+
If the method is called asynchronously,
115+
returns the request thread.
116+
"""
117+
params = locals()
118+
params['is_async'] = ''
119+
params['_return_http_data_only'] = False
120+
params['_preload_content'] = True
121+
params['_request_timeout'] = ''
122+
for key, val in six.iteritems(params['kwargs']):
123+
if key not in params:
124+
raise TypeError(
125+
"Got an unexpected keyword argument '%s'"
126+
" to method get_consumption_credit" % key
127+
)
128+
params[key] = val
129+
del params['kwargs']
130+
131+
collection_formats = {}
132+
path = '/annotation/consumption'
133+
path_params = {}
134+
135+
query_params = []
136+
137+
header_params = {}
138+
139+
form_params = []
140+
local_var_files = []
141+
142+
body_params = None
143+
# HTTP header `Accept`
144+
header_params['Accept'] = self.api_client.select_header_accept(
145+
['application/json']) # noqa: E501
146+
147+
# HTTP header `Content-Type`
148+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
149+
['application/json']) # noqa: E501
150+
151+
call_kwargs = {
152+
'resource_path':path,
153+
'method':'GET',
154+
'path_params':path_params,
155+
'query_params':query_params,
156+
'header_params':header_params,
157+
'body':body_params,
158+
'post_params':form_params,
159+
'files':local_var_files,
160+
'response_type':'ConsumptionResult', # noqa: E501
161+
'auth_settings':self.auth.get_auth_settings(),
162+
'is_async':params.get('is_async'),
163+
'_return_http_data_only':params.get('_return_http_data_only'),
164+
'_preload_content':params.get('_preload_content', True),
165+
'_request_timeout':params.get('_request_timeout'),
166+
'collection_formats':collection_formats
167+
}
168+
169+
return self.api_client.call_api(**call_kwargs) # noqa: E501
170+
171+
def __downcase_first_letter(self, s):
172+
if len(s) == 0:
173+
return str
174+
else:
175+
return s[0].lower() + s[1:]
176+

groupdocs_annotation_cloud/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,6 @@ def to_debug_report(self):
202202
return "Python SDK Debug Report:\n"\
203203
"OS: {env}\n"\
204204
"Python Version: {pyversion}\n"\
205-
"Version of the API: 21.6\n"\
206-
"SDK Package Version: 21.6".\
205+
"Version of the API: 22.2\n"\
206+
"SDK Package Version: 22.2".\
207207
format(env=sys.platform, pyversion=sys.version)

groupdocs_annotation_cloud/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from groupdocs_annotation_cloud.models.annotate_options import AnnotateOptions
88
from groupdocs_annotation_cloud.models.annotation_info import AnnotationInfo
99
from groupdocs_annotation_cloud.models.annotation_reply_info import AnnotationReplyInfo
10+
from groupdocs_annotation_cloud.models.consumption_result import ConsumptionResult
1011
from groupdocs_annotation_cloud.models.disc_usage import DiscUsage
1112
from groupdocs_annotation_cloud.models.document_info import DocumentInfo
1213
from groupdocs_annotation_cloud.models.error import Error

groupdocs_annotation_cloud/models/annotation_info.py

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,15 @@ class AnnotationInfo(object):
6464
'pen_width': 'int',
6565
'pen_style': 'str',
6666
'background_color': 'int',
67+
'squiggly_color': 'int',
6768
'font_family': 'str',
6869
'font_size': 'float',
6970
'opacity': 'float',
7071
'angle': 'float',
7172
'z_index': 'int',
7273
'url': 'str',
73-
'image_path': 'str'
74+
'image_path': 'str',
75+
'auto_scale': 'bool'
7476
}
7577

7678
attribute_map = {
@@ -95,16 +97,18 @@ class AnnotationInfo(object):
9597
'pen_width': 'PenWidth',
9698
'pen_style': 'PenStyle',
9799
'background_color': 'BackgroundColor',
100+
'squiggly_color': 'SquigglyColor',
98101
'font_family': 'FontFamily',
99102
'font_size': 'FontSize',
100103
'opacity': 'Opacity',
101104
'angle': 'Angle',
102105
'z_index': 'ZIndex',
103106
'url': 'Url',
104-
'image_path': 'ImagePath'
107+
'image_path': 'ImagePath',
108+
'auto_scale': 'AutoScale'
105109
}
106110

107-
def __init__(self, id=None, text=None, text_to_replace=None, horizontal_alignment=None, vertical_alignment=None, creator_id=None, creator_name=None, creator_email=None, box=None, points=None, page_number=None, annotation_position=None, svg_path=None, type=None, replies=None, created_on=None, font_color=None, pen_color=None, pen_width=None, pen_style=None, background_color=None, font_family=None, font_size=None, opacity=None, angle=None, z_index=None, url=None, image_path=None, **kwargs): # noqa: E501
111+
def __init__(self, id=None, text=None, text_to_replace=None, horizontal_alignment=None, vertical_alignment=None, creator_id=None, creator_name=None, creator_email=None, box=None, points=None, page_number=None, annotation_position=None, svg_path=None, type=None, replies=None, created_on=None, font_color=None, pen_color=None, pen_width=None, pen_style=None, background_color=None, squiggly_color=None, font_family=None, font_size=None, opacity=None, angle=None, z_index=None, url=None, image_path=None, auto_scale=None, **kwargs): # noqa: E501
108112
"""Initializes new instance of AnnotationInfo""" # noqa: E501
109113

110114
self._id = None
@@ -128,13 +132,15 @@ def __init__(self, id=None, text=None, text_to_replace=None, horizontal_alignmen
128132
self._pen_width = None
129133
self._pen_style = None
130134
self._background_color = None
135+
self._squiggly_color = None
131136
self._font_family = None
132137
self._font_size = None
133138
self._opacity = None
134139
self._angle = None
135140
self._z_index = None
136141
self._url = None
137142
self._image_path = None
143+
self._auto_scale = None
138144

139145
if id is not None:
140146
self.id = id
@@ -178,6 +184,8 @@ def __init__(self, id=None, text=None, text_to_replace=None, horizontal_alignmen
178184
self.pen_style = pen_style
179185
if background_color is not None:
180186
self.background_color = background_color
187+
if squiggly_color is not None:
188+
self.squiggly_color = squiggly_color
181189
if font_family is not None:
182190
self.font_family = font_family
183191
if font_size is not None:
@@ -192,6 +200,8 @@ def __init__(self, id=None, text=None, text_to_replace=None, horizontal_alignmen
192200
self.url = url
193201
if image_path is not None:
194202
self.image_path = image_path
203+
if auto_scale is not None:
204+
self.auto_scale = auto_scale
195205

196206
@property
197207
def id(self):
@@ -555,7 +565,7 @@ def type(self, type):
555565
"""
556566
if type is None:
557567
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
558-
allowed_values = ["None", "Area", "Arrow", "Distance", "Ellipse", "Link", "Point", "Polyline", "ResourcesRedaction", "TextField", "TextHighlight", "TextRedaction", "TextReplacement", "TextStrikeout", "TextUnderline", "Watermark", "Image"] # noqa: E501
568+
allowed_values = ["None", "Area", "Arrow", "Distance", "Ellipse", "Link", "Point", "Polyline", "ResourcesRedaction", "TextField", "TextHighlight", "TextRedaction", "TextReplacement", "TextStrikeout", "TextUnderline", "Watermark", "Image", "TextSquiggly"] # noqa: E501
559569
if not type.isdigit():
560570
if type not in allowed_values:
561571
raise ValueError(
@@ -743,6 +753,30 @@ def background_color(self, background_color):
743753
"""
744754
self._background_color = background_color
745755

756+
@property
757+
def squiggly_color(self):
758+
"""
759+
Gets the squiggly_color. # noqa: E501
760+
761+
Gets or sets annotation color # noqa: E501
762+
763+
:return: The squiggly_color. # noqa: E501
764+
:rtype: int
765+
"""
766+
return self._squiggly_color
767+
768+
@squiggly_color.setter
769+
def squiggly_color(self, squiggly_color):
770+
"""
771+
Sets the squiggly_color.
772+
773+
Gets or sets annotation color # noqa: E501
774+
775+
:param squiggly_color: The squiggly_color. # noqa: E501
776+
:type: int
777+
"""
778+
self._squiggly_color = squiggly_color
779+
746780
@property
747781
def font_family(self):
748782
"""
@@ -912,6 +946,32 @@ def image_path(self, image_path):
912946
:type: str
913947
"""
914948
self._image_path = image_path
949+
950+
@property
951+
def auto_scale(self):
952+
"""
953+
Gets the auto_scale. # noqa: E501
954+
955+
Sets auto scale for watermark annotation # noqa: E501
956+
957+
:return: The auto_scale. # noqa: E501
958+
:rtype: bool
959+
"""
960+
return self._auto_scale
961+
962+
@auto_scale.setter
963+
def auto_scale(self, auto_scale):
964+
"""
965+
Sets the auto_scale.
966+
967+
Sets auto scale for watermark annotation # noqa: E501
968+
969+
:param auto_scale: The auto_scale. # noqa: E501
970+
:type: bool
971+
"""
972+
if auto_scale is None:
973+
raise ValueError("Invalid value for `auto_scale`, must not be `None`") # noqa: E501
974+
self._auto_scale = auto_scale
915975

916976
def to_dict(self):
917977
"""Returns the model properties as a dict"""

0 commit comments

Comments
 (0)