Skip to content

Commit 52d8f8f

Browse files
authored
Add config api call
1 parent bd82908 commit 52d8f8f

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ public ApiResponse usage(Map options) throws Exception {
7272
return callApi(HttpMethod.GET, uri, ObjectUtils.emptyMap(), options);
7373
}
7474

75+
public ApiResponse configuration(Map options) throws Exception {
76+
if(options == null) options = ObjectUtils.emptyMap();
77+
78+
final List<String> uri = new ArrayList<String>();
79+
uri.add("config");
80+
81+
Map params = ObjectUtils.only(options, "settings");
82+
83+
return callApi(HttpMethod.GET, uri, params, options);
84+
}
7585

7686
public ApiResponse resourceTypes(Map options) throws Exception {
7787
if (options == null) options = ObjectUtils.emptyMap();

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,13 @@ public void testRateLimits() throws Exception {
668668
Assert.assertNotEquals(0, result.apiRateLimit().getRemaining());
669669
}
670670

671+
@Test
672+
public void testConfiguration() throws Exception {
673+
ApiResponse result = cloudinary.api().configuration(new ObjectUtils().asMap("settings", true));
674+
Map settings = (Map) result.get("settings");
675+
Assert.assertNotNull(settings.get("folder_mode"));
676+
}
677+
671678
@Test
672679
public void test19Ping() throws Exception {
673680
// should support ping API call

0 commit comments

Comments
 (0)