public static BoxRetentionPolicyAssignment . Info createAssignmentToMetadata ( BoxAPIConnection api , String policyID , String templateID , MetadataFieldFilter ... filter ) { JsonObject assignTo = new JsonObject ( ) . add ( "type" , TYPE_METADATA ) . add ( "id" , templateID ) ; JsonArray filters = null ; if ( filter . length > 0 ) { filters = new JsonArray ( ) ; for ( MetadataFieldFilter f : filter ) { filters . add ( f . getJsonObject ( ) ) ; } } return createAssignment ( api , policyID , assignTo , filters ) ; }
Assigns a retention policy to all items with a given metadata template optionally matching on fields .