Package com.bybit.api.client.service
Class BybitApiServiceGenerator
- java.lang.Object
-
- com.bybit.api.client.service.BybitApiServiceGenerator
-
public class BybitApiServiceGenerator extends Object
Generates a Bybit API implementation based on @seeBybitApiService.
-
-
Constructor Summary
Constructors Constructor Description BybitApiServiceGenerator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <S> ScreateService(Class<S> serviceClass, String baseUrl, boolean debugMode, long recvWindow, String logOption)static <S> ScreateService(Class<S> serviceClass, String apiKey, String secret, String baseUrl, boolean debugMode, long recvWindow, String logOption)Create a Bybit API service.static <T> ObjectexecuteSync(retrofit2.Call<T> call)Execute a REST call and block until the response is received.static BybitApiErrorgetBybitApiError(retrofit2.Response<?> response)Extracts and converts the response error body into an object.
-
-
-
Method Detail
-
createService
public static <S> S createService(Class<S> serviceClass, String baseUrl, boolean debugMode, long recvWindow, String logOption)
-
createService
public static <S> S createService(Class<S> serviceClass, String apiKey, String secret, String baseUrl, boolean debugMode, long recvWindow, String logOption)
Create a Bybit API service.- Parameters:
serviceClass- the type of service.apiKey- Bybit API key.secret- Bybit secret.- Returns:
- a new implementation of the API endpoints for the Bybit API service.
-
executeSync
public static <T> Object executeSync(retrofit2.Call<T> call)
Execute a REST call and block until the response is received.
-
getBybitApiError
public static BybitApiError getBybitApiError(retrofit2.Response<?> response) throws IOException, BybitApiException
Extracts and converts the response error body into an object.- Throws:
IOExceptionBybitApiException
-
-