File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
cloudinary-core/src/main/java/com/cloudinary/metadata
cloudinary-test-common/src/main/java/com/cloudinary/test Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ public class MetadataField<T> extends JSONObject {
18
18
public static final String VALIDATION = "validation" ;
19
19
public static final String RESTRICTIONS = "restrictions" ;
20
20
public static final String DEFAULT_DISABLED = "default_disabled" ;
21
+ public static final String ALLOW_DYNAMIC_LIST_VALUES = "allow_dynamic_list_values" ;
21
22
22
23
public MetadataField (MetadataFieldType type ) {
23
24
put (TYPE , type .toString ());
@@ -148,4 +149,10 @@ public void setRestrictions(Restrictions restrictions) {
148
149
public void setDefaultDisabled (Boolean disabled ) {
149
150
put (DEFAULT_DISABLED , disabled );
150
151
}
152
+
153
+ /**
154
+ * Set the value indicating whether the dynamic list values should allow
155
+ * @param allowDynamicListValues The value to set.
156
+ */
157
+ public void setAllowDynamicListValues (Boolean allowDynamicListValues ) {put (ALLOW_DYNAMIC_LIST_VALUES , allowDynamicListValues );}
151
158
}
Original file line number Diff line number Diff line change @@ -73,6 +73,15 @@ public void testCreateMetadata() throws Exception {
73
73
assertEquals (setField .getLabel (), result .get ("label" ));
74
74
}
75
75
76
+ @ Test
77
+ public void testCreateSetMetadataWithAllowDynamicListValues () throws Exception {
78
+ SetMetadataField setField = createSetField ("testCreateMetadata_2" );
79
+ ApiResponse result = cloudinary .api ().addMetadataField (setField );
80
+ assertNotNull (result );
81
+ assertEquals (setField .getLabel (), result .get ("label" ));
82
+ assertEquals (true , result .get ("allow_dynamic_list_values" ));
83
+ }
84
+
76
85
@ Test
77
86
public void testFieldRestrictions () throws Exception {
78
87
StringMetadataField stringField = newFieldInstance ("testCreateMetadata_3" , true );
@@ -367,6 +376,7 @@ private SetMetadataField createSetField(String labelPrefix) {
367
376
String label = labelPrefix + "_" + SUFFIX ;
368
377
setField .setLabel (label );
369
378
setField .setMandatory (false );
379
+ setField .setAllowDynamicListValues (true );
370
380
setField .setValidation (new MetadataValidation .StringLength (3 , 99 ));
371
381
setField .setDefaultValue (Arrays .asList ("id2" , "id3" ));
372
382
setField .setValidation (null );
You can’t perform that action at this time.
0 commit comments