public static BoxLegalHoldPolicy . Info createOngoing ( BoxAPIConnection api , String name , String description ) { URL url = ALL_LEGAL_HOLD_URL_TEMPLATE . build ( api . getBaseURL ( ) ) ; BoxJSONRequest request = new BoxJSONRequest ( api , url , "POST" ) ; JsonObject requestJSON = new JsonObject ( ) . add ( "policy_name" , name ) . add ( "is_ongoing" , true ) ; if ( description != null ) { requestJSON . add ( "description" , description ) ; } request . setBody ( requestJSON . toString ( ) ) ; BoxJSONResponse response = ( BoxJSONResponse ) request . send ( ) ; JsonObject responseJSON = JsonObject . readFrom ( response . getJSON ( ) ) ; BoxLegalHoldPolicy createdPolicy = new BoxLegalHoldPolicy ( api , responseJSON . get ( "id" ) . asString ( ) ) ; return createdPolicy . new Info ( responseJSON ) ; }
Creates a new ongoing Legal Hold Policy .