Skip to content

Commit bdd1637

Browse files
author
Victor Putrov
committed
Update to v23.9
1 parent d479e44 commit bdd1637

File tree

5 files changed

+312
-14
lines changed

5 files changed

+312
-14
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ You may want to check out Aspose free [Powerpoint to PDF](https://products.aspos
2727
**Web:** HTML/HTML5
2828
**Other:** MPEG4, SWF (export whole presentations)
2929

30+
## Enhancements in Version 23.9
31+
32+
* Added **ReplaceImage** and **ReplaceImageOnline** methods that enable replacing images in a presentation.
33+
3034
## Enhancements in Version 23.7
3135

3236
* New methods **ReplaceTextFormatting** and **ReplaceTextFormatting** allow to replace text with formatting.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ allprojects {
4141
}
4242

4343
jar {
44-
baseName 'aspose-slides-cloud-android-23.7.0'
44+
baseName 'aspose-slides-cloud-android-23.9.0'
4545
}

src/main/java/com/aspose/slides/api/SlidesApi.java

Lines changed: 290 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5751,7 +5751,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
57515751
* @param name Document name. (required)
57525752
* @param slideIndex Parent slide index. (required)
57535753
* @param slideType Slide type (master, layout or notes). (required)
5754-
* @param dto Shape DTO.
5754+
* @param dto Shape DTO. (required)
57555755
* @param shapeToClone Optional index for clone shape instead of adding a new one.
57565756
* @param position Position of the new shape in the list. Default is at the end of the list.
57575757
* @param password Document password.
@@ -5776,6 +5776,10 @@ public com.squareup.okhttp.Call createSpecialSlideShapeCall(String name, Integer
57765776
if (slideType == null) {
57775777
throw new ApiException("Missing the required parameter 'slideType' when calling createSpecialSlideShape(Async)");
57785778
}
5779+
// verify the required parameter 'dto' is set
5780+
if (dto == null) {
5781+
throw new ApiException("Missing the required parameter 'dto' when calling createSpecialSlideShape(Async)");
5782+
}
57795783
Object postBody = dto;
57805784

57815785
// create path and map variables
@@ -5827,7 +5831,7 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch
58275831
* @param name Document name. (required)
58285832
* @param slideIndex Parent slide index. (required)
58295833
* @param slideType Slide type (master, layout or notes). (required)
5830-
* @param dto Shape DTO.
5834+
* @param dto Shape DTO. (required)
58315835
* @param shapeToClone Optional index for clone shape instead of adding a new one.
58325836
* @param position Position of the new shape in the list. Default is at the end of the list.
58335837
* @param password Document password.
@@ -5853,7 +5857,7 @@ public ShapeBase createSpecialSlideShape(String name, Integer slideIndex, Specia
58535857
* @param name Document name. (required)
58545858
* @param slideIndex Parent slide index. (required)
58555859
* @param slideType Slide type (master, layout or notes). (required)
5856-
* @param dto Shape DTO.
5860+
* @param dto Shape DTO. (required)
58575861
* @param shapeToClone Optional index for clone shape instead of adding a new one.
58585862
* @param position Position of the new shape in the list. Default is at the end of the list.
58595863
* @param password Document password.
@@ -5875,7 +5879,7 @@ public ApiResponse<ShapeBase> createSpecialSlideShapeWithHttpInfo(String name, I
58755879
* @param name Document name. (required)
58765880
* @param slideIndex Parent slide index. (required)
58775881
* @param slideType Slide type (master, layout or notes). (required)
5878-
* @param dto Shape DTO.
5882+
* @param dto Shape DTO. (required)
58795883
* @param shapeToClone Optional index for clone shape instead of adding a new one.
58805884
* @param position Position of the new shape in the list. Default is at the end of the list.
58815885
* @param password Document password.
@@ -10294,7 +10298,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
1029410298
/**
1029510299
* Build call for deleteProtectionOnline
1029610300
* @param document Document data. (required)
10297-
* @param password Presentation password. (required)
10301+
* @param password Presentation password.
1029810302
* @param progressListener Progress listener
1029910303
* @param progressRequestListener Progress request listener
1030010304
* @return Call to execute
@@ -10305,10 +10309,6 @@ public com.squareup.okhttp.Call deleteProtectionOnlineCall(byte[] document, Stri
1030510309
if (document == null) {
1030610310
throw new ApiException("Missing the required parameter 'document' when calling deleteProtectionOnline(Async)");
1030710311
}
10308-
// verify the required parameter 'password' is set
10309-
if (password == null) {
10310-
throw new ApiException("Missing the required parameter 'password' when calling deleteProtectionOnline(Async)");
10311-
}
1031210312
Object postBody = null;
1031310313

1031410314
// create path and map variables
@@ -10355,7 +10355,7 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch
1035510355
* Resets all presentation protection settings.
1035610356
*
1035710357
* @param document Document data. (required)
10358-
* @param password Presentation password. (required)
10358+
* @param password Presentation password.
1035910359
* @return File
1036010360
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1036110361
*/
@@ -10373,7 +10373,7 @@ public File deleteProtectionOnline(byte[] document, String password) throws ApiE
1037310373
* Resets all presentation protection settings.
1037410374
*
1037510375
* @param document Document data. (required)
10376-
* @param password Presentation password. (required)
10376+
* @param password Presentation password.
1037710377
* @return ApiResponse&lt;File&gt;
1037810378
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1037910379
*/
@@ -10387,7 +10387,7 @@ public ApiResponse<File> deleteProtectionOnlineWithHttpInfo(byte[] document, Str
1038710387
* Resets all presentation protection settings. (asynchronously)
1038810388
*
1038910389
* @param document Document data. (required)
10390-
* @param password Presentation password. (required)
10390+
* @param password Presentation password.
1039110391
* @param callback The callback to be executed when the API call finishes
1039210392
* @return The request call
1039310393
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
@@ -29666,6 +29666,284 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
2966629666
apiClient.executeAsync(call, returnType, callback);
2966729667
return call;
2966829668
}
29669+
/**
29670+
* Build call for replaceImage
29671+
* @param name Document name. (required)
29672+
* @param imageIndex Image index. (required)
29673+
* @param image Image data.
29674+
* @param password Document password.
29675+
* @param folder Document folder.
29676+
* @param storage Document storage.
29677+
* @param progressListener Progress listener
29678+
* @param progressRequestListener Progress request listener
29679+
* @return Call to execute
29680+
* @throws ApiException If fail to serialize the request body object
29681+
*/
29682+
public com.squareup.okhttp.Call replaceImageCall(String name, Integer imageIndex, byte[] image, String password, String folder, String storage, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
29683+
// verify the required parameter 'name' is set
29684+
if (name == null) {
29685+
throw new ApiException("Missing the required parameter 'name' when calling replaceImage(Async)");
29686+
}
29687+
// verify the required parameter 'imageIndex' is set
29688+
if (imageIndex == null) {
29689+
throw new ApiException("Missing the required parameter 'imageIndex' when calling replaceImage(Async)");
29690+
}
29691+
Object postBody = null;
29692+
29693+
// create path and map variables
29694+
String methodPath = "/slides/{name}/images/{imageIndex}/replace"
29695+
.replaceAll("\\{" + "name" + "\\}", apiClient.objectToString(name)).replaceAll("\\{" + "imageIndex" + "\\}", apiClient.objectToString(imageIndex));
29696+
29697+
List<Pair> queryParams = new ArrayList<Pair>();
29698+
apiClient.addQueryParameter(queryParams, "folder", folder);
29699+
apiClient.addQueryParameter(queryParams, "storage", storage);
29700+
29701+
Map<String, String> headerParams = new HashMap<String, String>();
29702+
if (password != null)
29703+
headerParams.put("password", apiClient.parameterToString(password));
29704+
29705+
Map<String, Object> formParams = new LinkedHashMap<String, Object>();
29706+
if (image != null)
29707+
formParams.put("image", image);
29708+
29709+
final String[] accepts = {
29710+
"application/json"
29711+
};
29712+
final String accept = apiClient.selectHeaderAccept(accepts);
29713+
if (accept != null) headerParams.put("Accept", accept);
29714+
29715+
final String[] contentTypes = {
29716+
"multipart/form-data"
29717+
};
29718+
final String contentType = apiClient.selectHeaderContentType(contentTypes);
29719+
headerParams.put("Content-Type", contentType);
29720+
29721+
if(progressListener != null) {
29722+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
29723+
@Override
29724+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
29725+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
29726+
return originalResponse.newBuilder()
29727+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
29728+
.build();
29729+
}
29730+
});
29731+
}
29732+
return apiClient.buildCall(methodPath, "PUT", queryParams, postBody, headerParams, formParams, progressRequestListener);
29733+
}
29734+
29735+
/**
29736+
* Replaces image by the specified index.
29737+
*
29738+
* @param name Document name. (required)
29739+
* @param imageIndex Image index. (required)
29740+
* @param image Image data.
29741+
* @param password Document password.
29742+
* @param folder Document folder.
29743+
* @param storage Document storage.
29744+
29745+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
29746+
*/
29747+
public void replaceImage(String name, Integer imageIndex, byte[] image, String password, String folder, String storage) throws ApiException {
29748+
try {
29749+
replaceImageWithHttpInfo(name, imageIndex, image, password, folder, storage);
29750+
} catch (NeedRepeatRequestException e) {
29751+
replaceImageWithHttpInfo(name, imageIndex, image, password, folder, storage);
29752+
}
29753+
}
29754+
29755+
/**
29756+
* Replaces image by the specified index.
29757+
*
29758+
* @param name Document name. (required)
29759+
* @param imageIndex Image index. (required)
29760+
* @param image Image data.
29761+
* @param password Document password.
29762+
* @param folder Document folder.
29763+
* @param storage Document storage.
29764+
* @return ApiResponse&lt;Void&gt;
29765+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
29766+
*/
29767+
public ApiResponse<Void> replaceImageWithHttpInfo(String name, Integer imageIndex, byte[] image, String password, String folder, String storage) throws ApiException {
29768+
com.squareup.okhttp.Call call = replaceImageCall(name, imageIndex, image, password, folder, storage, null, null);
29769+
return apiClient.execute(call);
29770+
}
29771+
29772+
/**
29773+
* Replaces image by the specified index. (asynchronously)
29774+
*
29775+
* @param name Document name. (required)
29776+
* @param imageIndex Image index. (required)
29777+
* @param image Image data.
29778+
* @param password Document password.
29779+
* @param folder Document folder.
29780+
* @param storage Document storage.
29781+
* @param callback The callback to be executed when the API call finishes
29782+
* @return The request call
29783+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
29784+
*/
29785+
public com.squareup.okhttp.Call replaceImageAsync(String name, Integer imageIndex, byte[] image, String password, String folder, String storage, final ApiCallback<Void> callback) throws ApiException {
29786+
29787+
ProgressResponseBody.ProgressListener progressListener = null;
29788+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
29789+
29790+
if (callback != null) {
29791+
progressListener = new ProgressResponseBody.ProgressListener() {
29792+
@Override
29793+
public void update(long bytesRead, long contentLength, boolean done) {
29794+
callback.onDownloadProgress(bytesRead, contentLength, done);
29795+
}
29796+
};
29797+
29798+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
29799+
@Override
29800+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
29801+
callback.onUploadProgress(bytesWritten, contentLength, done);
29802+
}
29803+
};
29804+
}
29805+
29806+
com.squareup.okhttp.Call call = replaceImageCall(name, imageIndex, image, password, folder, storage, progressListener, progressRequestListener);
29807+
apiClient.executeAsync(call, callback);
29808+
return call;
29809+
}
29810+
/**
29811+
* Build call for replaceImageOnline
29812+
* @param document Document data. (required)
29813+
* @param imageIndex Image index. (required)
29814+
* @param image Image data.
29815+
* @param password Password.
29816+
* @param progressListener Progress listener
29817+
* @param progressRequestListener Progress request listener
29818+
* @return Call to execute
29819+
* @throws ApiException If fail to serialize the request body object
29820+
*/
29821+
public com.squareup.okhttp.Call replaceImageOnlineCall(byte[] document, Integer imageIndex, byte[] image, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
29822+
// verify the required parameter 'document' is set
29823+
if (document == null) {
29824+
throw new ApiException("Missing the required parameter 'document' when calling replaceImageOnline(Async)");
29825+
}
29826+
// verify the required parameter 'imageIndex' is set
29827+
if (imageIndex == null) {
29828+
throw new ApiException("Missing the required parameter 'imageIndex' when calling replaceImageOnline(Async)");
29829+
}
29830+
Object postBody = null;
29831+
29832+
// create path and map variables
29833+
String methodPath = "/slides/images/{imageIndex}/replace"
29834+
.replaceAll("\\{" + "imageIndex" + "\\}", apiClient.objectToString(imageIndex));
29835+
29836+
List<Pair> queryParams = new ArrayList<Pair>();
29837+
29838+
Map<String, String> headerParams = new HashMap<String, String>();
29839+
if (password != null)
29840+
headerParams.put("password", apiClient.parameterToString(password));
29841+
29842+
Map<String, Object> formParams = new LinkedHashMap<String, Object>();
29843+
if (document != null)
29844+
formParams.put("document", document);
29845+
if (image != null)
29846+
formParams.put("image", image);
29847+
29848+
final String[] accepts = {
29849+
"multipart/form-data"
29850+
};
29851+
final String accept = apiClient.selectHeaderAccept(accepts);
29852+
if (accept != null) headerParams.put("Accept", accept);
29853+
29854+
final String[] contentTypes = {
29855+
"multipart/form-data"
29856+
};
29857+
final String contentType = apiClient.selectHeaderContentType(contentTypes);
29858+
headerParams.put("Content-Type", contentType);
29859+
29860+
if(progressListener != null) {
29861+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
29862+
@Override
29863+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
29864+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
29865+
return originalResponse.newBuilder()
29866+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
29867+
.build();
29868+
}
29869+
});
29870+
}
29871+
return apiClient.buildCall(methodPath, "POST", queryParams, postBody, headerParams, formParams, progressRequestListener);
29872+
}
29873+
29874+
/**
29875+
* Replaces image by the specified index and returns updated document.
29876+
*
29877+
* @param document Document data. (required)
29878+
* @param imageIndex Image index. (required)
29879+
* @param image Image data.
29880+
* @param password Password.
29881+
* @return File
29882+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
29883+
*/
29884+
public File replaceImageOnline(byte[] document, Integer imageIndex, byte[] image, String password) throws ApiException {
29885+
try {
29886+
ApiResponse<File> resp = replaceImageOnlineWithHttpInfo(document, imageIndex, image, password);
29887+
return resp.getData();
29888+
} catch (NeedRepeatRequestException e) {
29889+
ApiResponse<File> resp = replaceImageOnlineWithHttpInfo(document, imageIndex, image, password);
29890+
return resp.getData();
29891+
}
29892+
}
29893+
29894+
/**
29895+
* Replaces image by the specified index and returns updated document.
29896+
*
29897+
* @param document Document data. (required)
29898+
* @param imageIndex Image index. (required)
29899+
* @param image Image data.
29900+
* @param password Password.
29901+
* @return ApiResponse&lt;File&gt;
29902+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
29903+
*/
29904+
public ApiResponse<File> replaceImageOnlineWithHttpInfo(byte[] document, Integer imageIndex, byte[] image, String password) throws ApiException {
29905+
com.squareup.okhttp.Call call = replaceImageOnlineCall(document, imageIndex, image, password, null, null);
29906+
Type returnType = new TypeToken<File>(){}.getType();
29907+
return apiClient.execute(call, returnType);
29908+
}
29909+
29910+
/**
29911+
* Replaces image by the specified index and returns updated document. (asynchronously)
29912+
*
29913+
* @param document Document data. (required)
29914+
* @param imageIndex Image index. (required)
29915+
* @param image Image data.
29916+
* @param password Password.
29917+
* @param callback The callback to be executed when the API call finishes
29918+
* @return The request call
29919+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
29920+
*/
29921+
public com.squareup.okhttp.Call replaceImageOnlineAsync(byte[] document, Integer imageIndex, byte[] image, String password, final ApiCallback<File> callback) throws ApiException {
29922+
29923+
ProgressResponseBody.ProgressListener progressListener = null;
29924+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
29925+
29926+
if (callback != null) {
29927+
progressListener = new ProgressResponseBody.ProgressListener() {
29928+
@Override
29929+
public void update(long bytesRead, long contentLength, boolean done) {
29930+
callback.onDownloadProgress(bytesRead, contentLength, done);
29931+
}
29932+
};
29933+
29934+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
29935+
@Override
29936+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
29937+
callback.onUploadProgress(bytesWritten, contentLength, done);
29938+
}
29939+
};
29940+
}
29941+
29942+
com.squareup.okhttp.Call call = replaceImageOnlineCall(document, imageIndex, image, password, progressListener, progressRequestListener);
29943+
Type returnType = new TypeToken<File>(){}.getType();
29944+
apiClient.executeAsync(call, returnType, callback);
29945+
return call;
29946+
}
2966929947
/**
2967029948
* Build call for replacePresentationText
2967129949
* @param name Document name. (required)

0 commit comments

Comments
 (0)