All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cloudinary.test.MetadataTestHelper Maven / Gradle / Ivy

package com.cloudinary.test;

import com.cloudinary.Api;
import com.cloudinary.api.ApiResponse;
import com.cloudinary.metadata.MetadataField;
import com.cloudinary.metadata.MetadataValidation;
import com.cloudinary.metadata.StringMetadataField;

public class MetadataTestHelper {
    public static StringMetadataField newFieldInstance(String label) throws Exception {
        StringMetadataField field = new StringMetadataField();
        field.setLabel(label);
        field.setMandatory(true);
        field.setValidation(new MetadataValidation.StringLength(3, 9));
        field.setDefaultValue("val_test");
        return field;
    }

    public static ApiResponse addFieldToAccount(Api api, MetadataField field) throws Exception {
        ApiResponse apiResponse = api.addMetadataField(field);
        return apiResponse;
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy