Skip to content

Commit fc5591e

Browse files
committed
Updated sources
1 parent 8feb062 commit fc5591e

File tree

7 files changed

+382
-10
lines changed

7 files changed

+382
-10
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Add following repository and dependency to your project's POM
2424
<dependency>
2525
<groupId>com.groupdocs</groupId>
2626
<artifactId>groupdocs-annotation-cloud</artifactId>
27-
<version>21.6</version>
27+
<version>22.2</version>
2828
<scope>compile</scope>
2929
</dependency>
3030
```
@@ -43,7 +43,7 @@ repositories {
4343
...
4444
dependencies {
4545
...
46-
implementation 'com.groupdocs:groupdocs-annotation-cloud:21.6'
46+
implementation 'com.groupdocs:groupdocs-annotation-cloud:22.2'
4747
}
4848
```
4949

@@ -100,7 +100,7 @@ mvn package -D maven.test.skip=true
100100

101101
Then manually install the following JARs:
102102

103-
* target/groupdocs-annotation-cloud-21.6.jar
103+
* target/groupdocs-annotation-cloud-22.2.jar
104104
* target/lib/*.jar
105105

106106
## Licensing

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>groupdocs-annotation-cloud</artifactId>
66
<packaging>jar</packaging>
77
<name>groupdocs-annotation-cloud</name>
8-
<version>21.6</version>
8+
<version>22.2</version>
99
<url>https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-java</url>
1010
<description>Java library for communicating with the GroupDocs.Annotation Cloud API</description>
1111
<scm>
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
/**
2+
* --------------------------------------------------------------------------------------------------------------------
3+
* <copyright company="Aspose Pty Ltd" file="LicenseApi.java">
4+
* Copyright (c) 2003-2021 Aspose Pty Ltd
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+
28+
package com.groupdocs.cloud.annotation.api;
29+
30+
import java.io.File;
31+
import java.io.IOException;
32+
import java.lang.reflect.Type;
33+
import java.util.ArrayList;
34+
import java.util.HashMap;
35+
import java.util.List;
36+
import java.util.Map;
37+
38+
import com.google.gson.reflect.TypeToken;
39+
import com.groupdocs.cloud.annotation.client.*;
40+
import com.groupdocs.cloud.annotation.model.*;
41+
import com.groupdocs.cloud.annotation.model.requests.*;
42+
43+
public class LicenseApi {
44+
private ApiClient apiClient;
45+
46+
/**
47+
* Initializes new instance of LicenseApi
48+
* @param appSid Application identifier (App SID)
49+
* @param appKey Application private key (App Key)
50+
*/
51+
public LicenseApi(String appSid, String appKey) {
52+
this(new Configuration(appSid, appKey));
53+
}
54+
55+
/**
56+
* Initializes new instance of LicenseApi
57+
* @param configuration Configuration The configuration
58+
*/
59+
public LicenseApi(Configuration configuration) {
60+
this.apiClient = new ApiClient(configuration);
61+
}
62+
63+
/**
64+
* Gets ApiClient
65+
*
66+
* @return ApiClient The Api client
67+
*/
68+
public ApiClient getApiClient() {
69+
return apiClient;
70+
}
71+
72+
/**
73+
* Sets ApiClient
74+
*
75+
* @param apiClient The Api client
76+
*/
77+
public void setApiClient(ApiClient apiClient) {
78+
this.apiClient = apiClient;
79+
}
80+
81+
/**
82+
* Build call for getConsumptionCredit
83+
* @param progressListener Progress listener
84+
* @param progressRequestListener Progress request listener
85+
* @return Call to execute
86+
* @throws ApiException If fail to serialize the request body object
87+
*/
88+
public com.squareup.okhttp.Call getConsumptionCreditCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
89+
Object localVarPostBody = null;
90+
91+
// create path and map variables
92+
String localVarPath = "/annotation/consumption";
93+
94+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
95+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
96+
97+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
98+
99+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
100+
101+
final String[] localVarAccepts = {
102+
"application/json"
103+
};
104+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
105+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
106+
107+
final String[] localVarContentTypes = {
108+
"application/json"
109+
};
110+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
111+
localVarHeaderParams.put("Content-Type", localVarContentType);
112+
113+
if(progressListener != null) {
114+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
115+
@Override
116+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
117+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
118+
return originalResponse.newBuilder()
119+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
120+
.build();
121+
}
122+
});
123+
}
124+
125+
String[] localVarAuthNames = new String[] { "JWT" };
126+
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
127+
}
128+
129+
@SuppressWarnings("rawtypes")
130+
private com.squareup.okhttp.Call getConsumptionCreditValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
131+
132+
133+
com.squareup.okhttp.Call call = getConsumptionCreditCall(progressListener, progressRequestListener);
134+
return call;
135+
136+
}
137+
138+
/**
139+
* Get license consumption
140+
*
141+
* @return ConsumptionResult
142+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
143+
*/
144+
public ConsumptionResult getConsumptionCredit() throws ApiException {
145+
ApiResponse<ConsumptionResult> resp = getConsumptionCreditWithHttpInfo();
146+
return resp.getData();
147+
}
148+
149+
/**
150+
* Get license consumption
151+
*
152+
* @return ApiResponse&lt;ConsumptionResult&gt;
153+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
154+
*/
155+
public ApiResponse<ConsumptionResult> getConsumptionCreditWithHttpInfo() throws ApiException {
156+
com.squareup.okhttp.Call call = getConsumptionCreditValidateBeforeCall(null, null);
157+
Type localVarReturnType = new TypeToken<ConsumptionResult>(){}.getType();
158+
return apiClient.execute(call, localVarReturnType);
159+
}
160+
161+
/**
162+
* Get license consumption (asynchronously)
163+
*
164+
* @param callback The callback to be executed when the API call finishes
165+
* @return The request call
166+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
167+
*/
168+
public com.squareup.okhttp.Call getConsumptionCreditAsync(final ApiCallback<ConsumptionResult> callback) throws ApiException {
169+
170+
ProgressResponseBody.ProgressListener progressListener = null;
171+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
172+
173+
if (callback != null) {
174+
progressListener = new ProgressResponseBody.ProgressListener() {
175+
@Override
176+
public void update(long bytesRead, long contentLength, boolean done) {
177+
callback.onDownloadProgress(bytesRead, contentLength, done);
178+
}
179+
};
180+
181+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
182+
@Override
183+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
184+
callback.onUploadProgress(bytesWritten, contentLength, done);
185+
}
186+
};
187+
}
188+
189+
com.squareup.okhttp.Call call = getConsumptionCreditValidateBeforeCall(progressListener, progressRequestListener);
190+
Type localVarReturnType = new TypeToken<ConsumptionResult>(){}.getType();
191+
apiClient.executeAsync(call, localVarReturnType, callback);
192+
return call;
193+
}
194+
}
195+

src/main/java/com/groupdocs/cloud/annotation/client/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public ApiClient(Configuration configuration) {
9797
this.json = new JSON();
9898

9999
// Set default User-Agent.
100-
setUserAgent("java-sdk/21.6");
100+
setUserAgent("java-sdk/22.2");
101101

102102
// Set connection timeout
103103
setConnectTimeout(configuration.getTimeout());

src/main/java/com/groupdocs/cloud/annotation/model/AnnotationInfo.java

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ public enum TypeEnum {
226226

227227
WATERMARK("Watermark"),
228228

229-
IMAGE("Image");
229+
IMAGE("Image"),
230+
231+
TEXTSQUIGGLY("TextSquiggly");
230232

231233
private String value;
232234

@@ -345,6 +347,9 @@ public PenStyleEnum read(final JsonReader jsonReader) throws IOException {
345347
@SerializedName("backgroundColor")
346348
private Integer backgroundColor = null;
347349

350+
@SerializedName("squigglyColor")
351+
private Integer squigglyColor = null;
352+
348353
@SerializedName("fontFamily")
349354
private String fontFamily = null;
350355

@@ -366,6 +371,9 @@ public PenStyleEnum read(final JsonReader jsonReader) throws IOException {
366371
@SerializedName("imagePath")
367372
private String imagePath = null;
368373

374+
@SerializedName("autoScale")
375+
private Boolean autoScale = null;
376+
369377
public AnnotationInfo id(Integer id) {
370378
this.id = id;
371379
return this;
@@ -760,6 +768,24 @@ public void setBackgroundColor(Integer backgroundColor) {
760768
this.backgroundColor = backgroundColor;
761769
}
762770

771+
public AnnotationInfo squigglyColor(Integer squigglyColor) {
772+
this.squigglyColor = squigglyColor;
773+
return this;
774+
}
775+
776+
/**
777+
* Gets or sets annotation color
778+
* @return squigglyColor
779+
**/
780+
@ApiModelProperty(value = "Gets or sets annotation color")
781+
public Integer getSquigglyColor() {
782+
return squigglyColor;
783+
}
784+
785+
public void setSquigglyColor(Integer squigglyColor) {
786+
this.squigglyColor = squigglyColor;
787+
}
788+
763789
public AnnotationInfo fontFamily(String fontFamily) {
764790
this.fontFamily = fontFamily;
765791
return this;
@@ -886,6 +912,24 @@ public void setImagePath(String imagePath) {
886912
this.imagePath = imagePath;
887913
}
888914

915+
public AnnotationInfo autoScale(Boolean autoScale) {
916+
this.autoScale = autoScale;
917+
return this;
918+
}
919+
920+
/**
921+
* Sets auto scale for watermark annotation
922+
* @return autoScale
923+
**/
924+
@ApiModelProperty(required = true, value = "Sets auto scale for watermark annotation")
925+
public Boolean getAutoScale() {
926+
return autoScale;
927+
}
928+
929+
public void setAutoScale(Boolean autoScale) {
930+
this.autoScale = autoScale;
931+
}
932+
889933

890934
@Override
891935
public boolean equals(java.lang.Object o) {
@@ -917,18 +961,20 @@ public boolean equals(java.lang.Object o) {
917961
Objects.equals(this.penWidth, annotationInfo.penWidth) &&
918962
Objects.equals(this.penStyle, annotationInfo.penStyle) &&
919963
Objects.equals(this.backgroundColor, annotationInfo.backgroundColor) &&
964+
Objects.equals(this.squigglyColor, annotationInfo.squigglyColor) &&
920965
Objects.equals(this.fontFamily, annotationInfo.fontFamily) &&
921966
Objects.equals(this.fontSize, annotationInfo.fontSize) &&
922967
Objects.equals(this.opacity, annotationInfo.opacity) &&
923968
Objects.equals(this.angle, annotationInfo.angle) &&
924969
Objects.equals(this.zindex, annotationInfo.zindex) &&
925970
Objects.equals(this.url, annotationInfo.url) &&
926-
Objects.equals(this.imagePath, annotationInfo.imagePath);
971+
Objects.equals(this.imagePath, annotationInfo.imagePath) &&
972+
Objects.equals(this.autoScale, annotationInfo.autoScale);
927973
}
928974

929975
@Override
930976
public int hashCode() {
931-
return Objects.hash(id, text, textToReplace, horizontalAlignment, verticalAlignment, creatorId, creatorName, creatorEmail, box, points, pageNumber, annotationPosition, svgPath, type, replies, createdOn, fontColor, penColor, penWidth, penStyle, backgroundColor, fontFamily, fontSize, opacity, angle, zindex, url, imagePath);
977+
return Objects.hash(id, text, textToReplace, horizontalAlignment, verticalAlignment, creatorId, creatorName, creatorEmail, box, points, pageNumber, annotationPosition, svgPath, type, replies, createdOn, fontColor, penColor, penWidth, penStyle, backgroundColor, squigglyColor, fontFamily, fontSize, opacity, angle, zindex, url, imagePath, autoScale);
932978
}
933979

934980

@@ -958,13 +1004,15 @@ public String toString() {
9581004
sb.append(" penWidth: ").append(toIndentedString(penWidth)).append("\n");
9591005
sb.append(" penStyle: ").append(toIndentedString(penStyle)).append("\n");
9601006
sb.append(" backgroundColor: ").append(toIndentedString(backgroundColor)).append("\n");
1007+
sb.append(" squigglyColor: ").append(toIndentedString(squigglyColor)).append("\n");
9611008
sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n");
9621009
sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n");
9631010
sb.append(" opacity: ").append(toIndentedString(opacity)).append("\n");
9641011
sb.append(" angle: ").append(toIndentedString(angle)).append("\n");
9651012
sb.append(" zindex: ").append(toIndentedString(zindex)).append("\n");
9661013
sb.append(" url: ").append(toIndentedString(url)).append("\n");
9671014
sb.append(" imagePath: ").append(toIndentedString(imagePath)).append("\n");
1015+
sb.append(" autoScale: ").append(toIndentedString(autoScale)).append("\n");
9681016
sb.append("}");
9691017
return sb.toString();
9701018
}

0 commit comments

Comments
 (0)