public static Iterable < BoxRetentionPolicy . Info > getAll ( String name , String type , String userID , int limit , final BoxAPIConnection api , String ... fields ) { QueryStringBuilder queryString = new QueryStringBuilder ( ) ; if ( name != null ) { queryString . appendParam ( "policy_name" , name ) ; } if ( type != null ) { queryString . appendParam ( "policy_type" , type ) ; } if ( userID != null ) { queryString . appendParam ( "created_by_user_id" , userID ) ; } if ( fields . length > 0 ) { queryString . appendParam ( "fields" , fields ) ; } URL url = RETENTION_POLICIES_URL_TEMPLATE . buildWithQuery ( api . getBaseURL ( ) , queryString . toString ( ) ) ; return new BoxResourceIterable < BoxRetentionPolicy . Info > ( api , url , limit ) { @ Override protected BoxRetentionPolicy . Info factory ( JsonObject jsonObject ) { BoxRetentionPolicy policy = new BoxRetentionPolicy ( api , jsonObject . get ( "id" ) . asString ( ) ) ; return policy . new Info ( jsonObject ) ; } } ; }
Returns all the retention policies with specified filters .