public static MetadataTemplate updateMetadataTemplate ( BoxAPIConnection api , String scope , String template , List < FieldOperation > fieldOperations ) { JsonArray array = new JsonArray ( ) ; for ( FieldOperation fieldOperation : fieldOperations ) { JsonObject jsonObject = getFieldOperationJsonObject ( fieldOperation ) ; array . add ( jsonObject ) ; } QueryStringBuilder builder = new QueryStringBuilder ( ) ; URL url = METADATA_TEMPLATE_URL_TEMPLATE . build ( api . getBaseURL ( ) , scope , template ) ; BoxJSONRequest request = new BoxJSONRequest ( api , url , "PUT" ) ; request . setBody ( array . toString ( ) ) ; BoxJSONResponse response = ( BoxJSONResponse ) request . send ( ) ; JsonObject responseJson = JsonObject . readFrom ( response . getJSON ( ) ) ; return new MetadataTemplate ( responseJson ) ; }
Updates the schema of an existing metadata template .