Skip to content

Commit 0476ad6

Browse files
authored
Add notification_url support to rename and destroy
1 parent c109e5e commit 0476ad6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

cloudinary-core/src/main/java/com/cloudinary/Uploader.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ public Map destroy(String publicId, Map options) throws IOException {
234234
params.put("type", (String) options.get("type"));
235235
params.put("public_id", publicId);
236236
params.put("invalidate", ObjectUtils.asBoolean(options.get("invalidate"), false).toString());
237+
params.put("notification_url", (String) options.get("notification_url"));
237238
return callApi("destroy", params, options, null);
238239
}
239240

@@ -249,6 +250,7 @@ public Map rename(String fromPublicId, String toPublicId, Map options) throws IO
249250
params.put("to_type", options.get("to_type"));
250251
params.put("context", ObjectUtils.asBoolean(options.get("context"), false).toString());
251252
params.put("metadata", ObjectUtils.asBoolean(options.get("metadata"), false).toString());
253+
params.put("notification_url", (String) options.get("notification_url"));
252254
return callApi("rename", params, options, null);
253255
}
254256

cloudinary-test-common/src/main/java/com/cloudinary/test/AbstractUploaderTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,4 +831,11 @@ public void testUploadFolderDecoupling() {
831831
Assert.assertEquals(true, uploadParams.get("use_asset_folder_as_public_id_prefix"));
832832
Assert.assertEquals(true, uploadParams.get("visual_search"));
833833
}
834+
835+
@Test
836+
public void testNotificationUrl() {
837+
Map options = asMap("notification_url", "https://www.test.com");
838+
Map uploadParams = Util.buildUploadParams(options);
839+
Assert.assertEquals("https://www.test.com", uploadParams.get("notification_url"));
840+
}
834841
}

0 commit comments

Comments
 (0)