public class ApiClient extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ApiClient.ApiException |
static class |
ApiClient.CallbackException |
static class |
ApiClient.CallbackProcessor |
static class |
ApiClient.InvalidSignatureException |
static interface |
ApiClient.TokenProvider |
| Modifier and Type | Field and Description |
|---|---|
static Optional<ProxySelector> |
ENV_VAR_PROXY_SELECTOR |
static String |
USER_AGENT |
| Constructor and Description |
|---|
ApiClient() |
ApiClient(String baseUrl) |
ApiClient(String baseUrl,
ApiClient.TokenProvider tokenProvider) |
ApiClient(String baseUrl,
okhttp3.Interceptor authInterceptor) |
ApiClient(String baseUrl,
String terminalCode,
String password) |
| Modifier and Type | Method and Description |
|---|---|
ApiClient |
addInterceptor(okhttp3.Interceptor interceptor) |
ApiClient |
addLogging(okhttp3.logging.HttpLoggingInterceptor.Level level) |
<S> S |
createService(Class<S> serviceClass) |
static okhttp3.Response |
doGet(String url) |
static <T> T |
fromJson(String json,
Class<T> callbackClass) |
static String |
getContent(okhttp3.ResponseBody responseBody) |
static IOException |
parseApiError(okhttp3.Response response) |
void |
setBaseUrl(String baseUrl) |
void |
setCallTimeout(Duration callTimeout) |
void |
setConnectTimeout(Duration connectTimeout) |
void |
setPassword(String password) |
void |
setReadTimeout(Duration readTimeout) |
void |
setTerminalCode(String terminalCode) |
static Request |
uuidRequest() |
public static final String USER_AGENT
public static final Optional<ProxySelector> ENV_VAR_PROXY_SELECTOR
public ApiClient()
public ApiClient(String baseUrl)
public ApiClient(String baseUrl, ApiClient.TokenProvider tokenProvider)
public ApiClient(String baseUrl, okhttp3.Interceptor authInterceptor)
public void setBaseUrl(String baseUrl)
public void setTerminalCode(String terminalCode)
public void setPassword(String password)
public void setConnectTimeout(Duration connectTimeout)
public void setReadTimeout(Duration readTimeout)
public void setCallTimeout(Duration callTimeout)
public <S> S createService(Class<S> serviceClass)
public ApiClient addLogging(okhttp3.logging.HttpLoggingInterceptor.Level level)
public ApiClient addInterceptor(okhttp3.Interceptor interceptor)
public static Request uuidRequest()
public static okhttp3.Response doGet(String url) throws ApiClient.ApiException
ApiClient.ApiExceptionpublic static String getContent(okhttp3.ResponseBody responseBody)
public static IOException parseApiError(okhttp3.Response response) throws IOException
IOExceptionCopyright © 2022. All rights reserved.