fr.ouestfrance.querydsl.postgrest.PostgrestClient Maven / Gradle / Ivy
The newest version!
package fr.ouestfrance.querydsl.postgrest;
import fr.ouestfrance.querydsl.postgrest.model.BulkResponse;
import fr.ouestfrance.querydsl.postgrest.model.CountItem;
import fr.ouestfrance.querydsl.postgrest.model.RangeResponse;
import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;
/**
* Rest interface for querying postgrest
*/
public interface PostgrestClient {
/**
* Search method
*
* @param resource resource name
* @param params query params
* @param return type
* @param headers header params
* @param clazz type of return
* @return ResponseEntity containing the results
*/
RangeResponse search(String resource, Map> params,
Map> headers, Class clazz);
/**
* Save body
*
* @param resource resource name
* @param value data to save
* @param headers headers to pass
* @param return type
* @param clazz type of return
* @return list of inserted objects
*/
BulkResponse post(String resource, Map> queryParams, Object value, Map> headers, Class clazz);
/**
* Patch data
*
* @param resource resource name
* @param params criteria to apply on patch
* @param value object to patch
* @param headers headers to pass
* @param return type
* @param clazz type of return
* @return list of patched objects
*/
BulkResponse patch(String resource, Map> params, Object value, Map> headers, Class clazz);
/**
* Delete data
*
* @param resource resource name
* @param params query params
* @param headers headers to pass
* @param return type
* @param clazz type of return
* @return list of deleted objects
*/
BulkResponse delete(String resource, Map> params, Map> headers, Class clazz);
/**
* Count data
*
* @param resource resource name
* @param map query params
* @return list of count items
*/
List count(String resource, Map> map);
/**
* Call RPC
*
* @param rpcName rpc name
* @param params query params
* @param body body request to send
* @param type class of return
* @param type of return object
* @return MultiValueMap
*/
V rpc(String rpcName, Map> params, Object body, Type type);
}