com.symphony.bdk.bot.sdk.lib.restclient.RestClient Maven / Gradle / Ivy
package com.symphony.bdk.bot.sdk.lib.restclient;
import java.util.Map;
import com.symphony.bdk.bot.sdk.lib.restclient.model.RestResponse;
/**
* Interface which abstracts the underlying REST client library
*
* @author Marcus Secato
*
*/
public interface RestClient {
/**
* Perform a get request
* @param the response type
* @param url destination url
* @param clazz the return type
* @return T the rest response
*/
RestResponse getRequest(String url, Class clazz);
/**
* Perform a get request
* @param the response type
* @param url destination url
* @param headers header parameters
* @param clazz the return type
* @return T the rest response
*/
RestResponse getRequest(String url, Map headers, Class clazz);
/**
* Perform a post request
* @param the response type
* @param the body payload type
* @param url destination url
* @param body entity body
* @param clazz the return type
* @return T the rest response
*/
RestResponse postRequest(String url, U body, Class clazz);
/**
* Perform a post request
* @param the response type
* @param the body payload type
* @param url destination url
* @param body entity body
* @param headers header parameters
* @param clazz the return type
* @return T the rest response
*/
RestResponse postRequest(String url, U body, Map headers, Class clazz);
/**
* Perform a put request
* @param the response type
* @param the body payload type
* @param url destination url
* @param body entity body
* @param clazz the return type
* @return T the rest response
*/
RestResponse putRequest(String url, U body, Class clazz);
/**
* Perform a put request
* @param the response type
* @param the body payload type
* @param url destination url
* @param body entity body
* @param headers header parameters
* @param clazz the return type
* @return T the rest response
*/
RestResponse putRequest(String url, U body, Map headers, Class clazz);
/**
* Perform a delete request
* @param the response type
* @param url destination url
* @param clazz the return type
* @return T the rest response
*/
RestResponse deleteRequest(String url, Class clazz);
/**
* Perform a delete request
* @param the response type
* @param url destination url
* @param headers header parameters
* @param clazz the return type
* @return T the rest response
*/
RestResponse deleteRequest(String url, Map headers, Class clazz);
}