Skip to content

Commit 4821e33

Browse files
Merge branch 'master' into release
2 parents b755ced + c703ddf commit 4821e33

File tree

9 files changed

+821
-3
lines changed

9 files changed

+821
-3
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ This repository contains Aspose.Words Cloud SDK for Java source code. This SDK a
1313
* Watermarks and protection
1414
* Full read & write access to Document Object Model, including sections, paragraphs, text, images, tables, headers/footers and many others
1515

16+
## Enhancements in Version 24.6
17+
18+
- Added the 'TranslateNodeId' method to transalate a node id to a node path.
19+
20+
1621
## Enhancements in Version 24.5
1722

1823
- Added the support of multistorage operations. Saving a file as a result of an operation can be performed in a specific storage, when, used file path in the next format '@storage:path/to/file.doc'.
@@ -344,7 +349,7 @@ Add this dependency to your project's POM:
344349
<dependency>
345350
<groupId>com.aspose</groupId>
346351
<artifactId>aspose-words-cloud</artifactId>
347-
<version>24.5.0</version>
352+
<version>24.6.0</version>
348353
</dependency>
349354
</dependencies>
350355
```

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<artifactId>aspose-words-cloud</artifactId>
55
<packaging>jar</packaging>
66
<name>AsposeWordsCloud</name>
7-
<version>24.5.0</version>
7+
<version>24.6.0</version>
88
<url>https://www.aspose.cloud/</url>
99
<description>Aspose Words Java SDK</description>
1010
<scm>

src/main/java/com/aspose/words/cloud/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class ApiClient {
5959
private String apiVersion = "v4.0";
6060
private String baseUrl = "https://api.aspose.cloud";
6161
private String basePath = baseUrl + "/" + apiVersion;
62-
private String clientVersion = "24.5";
62+
private String clientVersion = "24.6";
6363
private boolean debugging = false;
6464
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
6565
private String tempFolderPath = null;

src/main/java/com/aspose/words/cloud/JSON.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@ public static class ModelAdapterFactory implements TypeAdapterFactory {
658658
put("TextSaveOptionsData, _", com.aspose.words.cloud.model.TextSaveOptionsData.class);
659659
put("TiffSaveOptionsData, _", com.aspose.words.cloud.model.TiffSaveOptionsData.class);
660660
put("TimeZoneInfoData, _", com.aspose.words.cloud.model.TimeZoneInfoData.class);
661+
put("TranslateNodeIdResponse, _", com.aspose.words.cloud.model.TranslateNodeIdResponse.class);
661662
put("UserInformation, _", com.aspose.words.cloud.model.UserInformation.class);
662663
put("WatermarkDataImage, _", com.aspose.words.cloud.model.WatermarkDataImage.class);
663664
put("WatermarkDataText, _", com.aspose.words.cloud.model.WatermarkDataText.class);

src/main/java/com/aspose/words/cloud/api/WordsApi.java

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21241,6 +21241,152 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
2124121241
return call;
2124221242
}
2124321243

21244+
@SuppressWarnings("rawtypes")
21245+
private com.squareup.okhttp.Call translateNodeIdValidateBeforeCall(TranslateNodeIdRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException, IOException {
21246+
return apiClient.buildCall(request.buildHttpRequest(apiClient, progressListener, progressRequestListener, true));
21247+
}
21248+
21249+
/**
21250+
* Translate a node id to a node path.
21251+
* @param request Request object
21252+
* @return TranslateNodeIdResponse
21253+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
21254+
* @throws IOException If fail to serialize the request body object
21255+
*/
21256+
public TranslateNodeIdResponse translateNodeId(TranslateNodeIdRequest request) throws ApiException, MessagingException, IOException {
21257+
try {
21258+
ApiResponse< TranslateNodeIdResponse > resp = translateNodeIdWithHttpInfo(request);
21259+
return resp.getData();
21260+
}
21261+
catch (ApiException ex) {
21262+
if (ex.getCode() == apiClient.getNotAuthCode()) {
21263+
apiClient.requestToken();
21264+
ApiResponse< TranslateNodeIdResponse > resp = translateNodeIdWithHttpInfo(request);
21265+
return resp.getData();
21266+
}
21267+
throw ex;
21268+
}
21269+
}
21270+
21271+
/**
21272+
* Translate a node id to a node path.
21273+
* @param request Request object
21274+
* @return ApiResponse< TranslateNodeIdResponse >;
21275+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
21276+
* @throws IOException If fail to serialize the request body object
21277+
*/
21278+
private ApiResponse< TranslateNodeIdResponse > translateNodeIdWithHttpInfo(TranslateNodeIdRequest request) throws ApiException, MessagingException, IOException {
21279+
com.squareup.okhttp.Call call = translateNodeIdValidateBeforeCall(request, null, null);
21280+
return apiClient.execute(call, request);
21281+
}
21282+
21283+
/**
21284+
* Translate a node id to a node path. (asynchronously)
21285+
* @param request Request object
21286+
* @param callback The callback to be executed when the API call finishes
21287+
* @return The request call
21288+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
21289+
* @throws IOException If fail to serialize the request body object
21290+
*/
21291+
public com.squareup.okhttp.Call translateNodeIdAsync(TranslateNodeIdRequest request, final ApiCallback< TranslateNodeIdResponse > callback) throws ApiException, MessagingException, IOException {
21292+
21293+
ProgressResponseBody.ProgressListener progressListener = null;
21294+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
21295+
21296+
if (callback != null) {
21297+
progressListener = new ProgressResponseBody.ProgressListener() {
21298+
@Override
21299+
public void update(long bytesRead, long contentLength, boolean done) {
21300+
callback.onDownloadProgress(bytesRead, contentLength, done);
21301+
}
21302+
};
21303+
21304+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
21305+
@Override
21306+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
21307+
callback.onUploadProgress(bytesWritten, contentLength, done);
21308+
}
21309+
};
21310+
}
21311+
21312+
com.squareup.okhttp.Call call = translateNodeIdValidateBeforeCall(request, progressListener, progressRequestListener);
21313+
apiClient.executeAsync(call, request, callback);
21314+
return call;
21315+
}
21316+
21317+
@SuppressWarnings("rawtypes")
21318+
private com.squareup.okhttp.Call translateNodeIdOnlineValidateBeforeCall(TranslateNodeIdOnlineRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException, IOException {
21319+
return apiClient.buildCall(request.buildHttpRequest(apiClient, progressListener, progressRequestListener, true));
21320+
}
21321+
21322+
/**
21323+
* Translate a node id to a node path.
21324+
* @param request Request object
21325+
* @return TranslateNodeIdResponse
21326+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
21327+
* @throws IOException If fail to serialize the request body object
21328+
*/
21329+
public TranslateNodeIdResponse translateNodeIdOnline(TranslateNodeIdOnlineRequest request) throws ApiException, MessagingException, IOException {
21330+
try {
21331+
ApiResponse< TranslateNodeIdResponse > resp = translateNodeIdOnlineWithHttpInfo(request);
21332+
return resp.getData();
21333+
}
21334+
catch (ApiException ex) {
21335+
if (ex.getCode() == apiClient.getNotAuthCode()) {
21336+
apiClient.requestToken();
21337+
ApiResponse< TranslateNodeIdResponse > resp = translateNodeIdOnlineWithHttpInfo(request);
21338+
return resp.getData();
21339+
}
21340+
throw ex;
21341+
}
21342+
}
21343+
21344+
/**
21345+
* Translate a node id to a node path.
21346+
* @param request Request object
21347+
* @return ApiResponse< TranslateNodeIdResponse >;
21348+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
21349+
* @throws IOException If fail to serialize the request body object
21350+
*/
21351+
private ApiResponse< TranslateNodeIdResponse > translateNodeIdOnlineWithHttpInfo(TranslateNodeIdOnlineRequest request) throws ApiException, MessagingException, IOException {
21352+
com.squareup.okhttp.Call call = translateNodeIdOnlineValidateBeforeCall(request, null, null);
21353+
return apiClient.execute(call, request);
21354+
}
21355+
21356+
/**
21357+
* Translate a node id to a node path. (asynchronously)
21358+
* @param request Request object
21359+
* @param callback The callback to be executed when the API call finishes
21360+
* @return The request call
21361+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
21362+
* @throws IOException If fail to serialize the request body object
21363+
*/
21364+
public com.squareup.okhttp.Call translateNodeIdOnlineAsync(TranslateNodeIdOnlineRequest request, final ApiCallback< TranslateNodeIdResponse > callback) throws ApiException, MessagingException, IOException {
21365+
21366+
ProgressResponseBody.ProgressListener progressListener = null;
21367+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
21368+
21369+
if (callback != null) {
21370+
progressListener = new ProgressResponseBody.ProgressListener() {
21371+
@Override
21372+
public void update(long bytesRead, long contentLength, boolean done) {
21373+
callback.onDownloadProgress(bytesRead, contentLength, done);
21374+
}
21375+
};
21376+
21377+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
21378+
@Override
21379+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
21380+
callback.onUploadProgress(bytesWritten, contentLength, done);
21381+
}
21382+
};
21383+
}
21384+
21385+
com.squareup.okhttp.Call call = translateNodeIdOnlineValidateBeforeCall(request, progressListener, progressRequestListener);
21386+
apiClient.executeAsync(call, request, callback);
21387+
return call;
21388+
}
21389+
2124421390
@SuppressWarnings("rawtypes")
2124521391
private com.squareup.okhttp.Call unprotectDocumentValidateBeforeCall(UnprotectDocumentRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException, IOException {
2124621392
return apiClient.buildCall(request.buildHttpRequest(apiClient, progressListener, progressRequestListener, true));
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="TranslateNodeIdResponse.java">
4+
* Copyright (c) 2024 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+
*/
27+
28+
package com.aspose.words.cloud.model;
29+
30+
import java.util.Objects;
31+
import java.util.Arrays;
32+
import java.util.ArrayList;
33+
import java.util.List;
34+
import java.io.IOException;
35+
import org.threeten.bp.OffsetDateTime;
36+
import com.aspose.words.cloud.ApiException;
37+
import com.aspose.words.cloud.model.*;
38+
import com.google.gson.TypeAdapter;
39+
import com.google.gson.annotations.JsonAdapter;
40+
import com.google.gson.annotations.SerializedName;
41+
import com.google.gson.stream.JsonReader;
42+
import com.google.gson.stream.JsonWriter;
43+
import io.swagger.annotations.ApiModel;
44+
import io.swagger.annotations.ApiModelProperty;
45+
46+
/**
47+
* The REST response with a node path.
48+
* This response is returned by the Service when handling "GET https://api.aspose.cloud/v4.0/words/Test.doc/translate/{0}" REST API requests.
49+
*/
50+
@ApiModel(description = "The REST response with a node path. This response is returned by the Service when handling \"GET https://api.aspose.cloud/v4.0/words/Test.doc/translate/{0}\" REST API requests.")
51+
public class TranslateNodeIdResponse extends WordsResponse {
52+
@SerializedName("Path")
53+
protected String path;
54+
/**
55+
* Gets or sets the node path.
56+
* @return path
57+
**/
58+
@ApiModelProperty(value = "Gets or sets the node path.")
59+
public String getPath() {
60+
return path;
61+
}
62+
63+
public TranslateNodeIdResponse path(String path) {
64+
this.path = path;
65+
return this;
66+
}
67+
68+
public void setPath(String path) {
69+
this.path = path;
70+
}
71+
72+
73+
public TranslateNodeIdResponse() {
74+
super();
75+
this.path = null;
76+
}
77+
78+
/*
79+
* Gets files content.
80+
*
81+
* @param resultFilesContent List<FileReference> instance.
82+
*/
83+
@Override
84+
public void getFilesContent(List<FileReference> resultFilesContent) {
85+
}
86+
87+
/*
88+
* Validate required properties.
89+
*
90+
* @throws ApiException If fails to validate required properties.
91+
*/
92+
@Override
93+
public void validate() throws ApiException {
94+
super.validate();
95+
}
96+
97+
@Override
98+
public boolean equals(java.lang.Object o) {
99+
if (this == o) {
100+
return true;
101+
}
102+
if (o == null || getClass() != o.getClass()) {
103+
return false;
104+
}
105+
106+
TranslateNodeIdResponse translateNodeIdResponse = (TranslateNodeIdResponse) o;
107+
return
108+
Objects.equals(this.path, translateNodeIdResponse.path) &&
109+
super.equals(o);
110+
}
111+
112+
@Override
113+
public int hashCode() {
114+
return Objects.hash(path, super.hashCode());
115+
}
116+
117+
@Override
118+
public String toString() {
119+
StringBuilder sb = new StringBuilder();
120+
sb.append("class TranslateNodeIdResponse {\n");
121+
sb.append(" requestId: ").append(toIndentedString(getRequestId())).append("\n");
122+
sb.append(" path: ").append(toIndentedString(getPath())).append("\n");
123+
sb.append("}");
124+
return sb.toString();
125+
}
126+
127+
/**
128+
* Convert the given object to string with each line indented by 4 spaces
129+
* (except the first line).
130+
*/
131+
private String toIndentedString(java.lang.Object o) {
132+
if (o == null) {
133+
return "null";
134+
}
135+
return o.toString().replace("\n", "\n ");
136+
}
137+
}

0 commit comments

Comments
 (0)