diff --git a/clients/c2c/CHANGELOG.md b/clients/c2c/CHANGELOG.md index f2695603..57897134 100644 --- a/clients/c2c/CHANGELOG.md +++ b/clients/c2c/CHANGELOG.md @@ -1,6 +1,30 @@ # Changelog +## 2.0.0 - 2025-12-16 + +### Changed (6) + +- Added parameter `endTimestamp` + - affected methods: + - `getC2CTradeHistory()` (`GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`) +- Added parameter `rows` + - affected methods: + - `getC2CTradeHistory()` (`GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`) +- Added parameter `startTimestamp` + - affected methods: + - `getC2CTradeHistory()` (`GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`) +- Added parameter `tradeType` + - affected methods: + - `getC2CTradeHistory()` (`GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`) +- Deleted parameter `endTime` + - affected methods: + - `getC2CTradeHistory()` (`GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`) +- Deleted parameter `startTime` + - affected methods: + - `getC2CTradeHistory()` (`GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`) + ## 1.2.1 - 2025-08-07 + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. @@ -17,4 +41,4 @@ ## 1.0.0 - 2025-04-24 -- Initial release \ No newline at end of file +- Initial release diff --git a/clients/c2c/docs/C2CApi.md b/clients/c2c/docs/C2CApi.md index 81e01836..5ac49935 100644 --- a/clients/c2c/docs/C2CApi.md +++ b/clients/c2c/docs/C2CApi.md @@ -9,11 +9,11 @@ All URIs are relative to *https://api.binance.com* # **getC2CTradeHistory** -> GetC2CTradeHistoryResponse getC2CTradeHistory(startTime, endTime, page, recvWindow) +> GetC2CTradeHistoryResponse getC2CTradeHistory(tradeType, startTimestamp, endTimestamp, page, rows, recvWindow) Get C2C Trade History (USER_DATA) -Get C2C Trade History * The max interval between startTime and endTime is 30 days. * If startTime and endTime are not sent, the recent 7 days' data will be returned. * The earliest startTime is supported on June 10, 2020 * Return up to 200 records per request. Weight: 1 +Get C2C Trade History * The max interval between startTimestamp and endTimestamp is 30 days. * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be returned. * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder Weight: 1 ### Example ```java @@ -30,12 +30,14 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); C2CApi apiInstance = new C2CApi(defaultClient); - Long startTime = 56L; // Long | - Long endTime = 56L; // Long | + String tradeType = "tradeType_example"; // String | BUY, SELL + Long startTimestamp = 56L; // Long | + Long endTimestamp = 56L; // Long | Long page = 56L; // Long | Default 1 + Long rows = 56L; // Long | default 100, max 100 Long recvWindow = 56L; // Long | try { - GetC2CTradeHistoryResponse result = apiInstance.getC2CTradeHistory(startTime, endTime, page, recvWindow); + GetC2CTradeHistoryResponse result = apiInstance.getC2CTradeHistory(tradeType, startTimestamp, endTimestamp, page, rows, recvWindow); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling C2CApi#getC2CTradeHistory"); @@ -52,9 +54,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **startTime** | **Long**| | [optional] | -| **endTime** | **Long**| | [optional] | +| **tradeType** | **String**| BUY, SELL | [optional] | +| **startTimestamp** | **Long**| | [optional] | +| **endTimestamp** | **Long**| | [optional] | | **page** | **Long**| Default 1 | [optional] | +| **rows** | **Long**| default 100, max 100 | [optional] | | **recvWindow** | **Long**| | [optional] | ### Return type diff --git a/clients/c2c/docs/rest-api/migration-guide.md b/clients/c2c/docs/rest-api/migration-guide.md index fe42fc74..677a4771 100644 --- a/clients/c2c/docs/rest-api/migration-guide.md +++ b/clients/c2c/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-c2c - 1.2.1 + 2.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-c2c - 1.2.1 + 2.0.0 ``` diff --git a/clients/c2c/pom.xml b/clients/c2c/pom.xml index 951f60a9..fe1cb4ac 100644 --- a/clients/c2c/pom.xml +++ b/clients/c2c/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-c2c c2c - 1.2.1 + 2.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.2.1 \ No newline at end of file diff --git a/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/api/C2CApi.java b/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/api/C2CApi.java index 196259d9..8b6da60a 100644 --- a/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/api/C2CApi.java +++ b/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/api/C2CApi.java @@ -42,7 +42,7 @@ public class C2CApi { private static final String USER_AGENT = String.format( - "binance-c2c/1.2.1 (Java/%s; %s; %s)", + "binance-c2c/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -82,9 +82,11 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for getC2CTradeHistory * - * @param startTime (optional) - * @param endTime (optional) + * @param tradeType BUY, SELL (optional) + * @param startTimestamp (optional) + * @param endTimestamp (optional) * @param page Default 1 (optional) + * @param rows default 100, max 100 (optional) * @param recvWindow (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -99,7 +101,13 @@ public void setCustomBaseUrl(String customBaseUrl) { * Trade History (USER_DATA) Documentation */ private okhttp3.Call getC2CTradeHistoryCall( - Long startTime, Long endTime, Long page, Long recvWindow) throws ApiException { + String tradeType, + Long startTimestamp, + Long endTimestamp, + Long page, + Long rows, + Long recvWindow) + throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -124,18 +132,28 @@ private okhttp3.Call getC2CTradeHistoryCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (startTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + if (tradeType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("tradeType", tradeType)); } - if (endTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + if (startTimestamp != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("startTimestamp", startTimestamp)); + } + + if (endTimestamp != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("endTimestamp", endTimestamp)); } if (page != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); } + if (rows != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rows", rows)); + } + if (recvWindow != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); } @@ -172,7 +190,13 @@ private okhttp3.Call getC2CTradeHistoryCall( @SuppressWarnings("rawtypes") private okhttp3.Call getC2CTradeHistoryValidateBeforeCall( - Long startTime, Long endTime, Long page, Long recvWindow) throws ApiException { + String tradeType, + Long startTimestamp, + Long endTimestamp, + Long page, + Long rows, + Long recvWindow) + throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -182,11 +206,15 @@ private okhttp3.Call getC2CTradeHistoryValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {startTime, endTime, page, recvWindow}; + Object[] parameterValues = { + tradeType, startTimestamp, endTimestamp, page, rows, recvWindow + }; Method method = this.getClass() .getMethod( "getC2CTradeHistory", + String.class, + Long.class, Long.class, Long.class, Long.class, @@ -195,7 +223,8 @@ private okhttp3.Call getC2CTradeHistoryValidateBeforeCall( executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getC2CTradeHistoryCall(startTime, endTime, page, recvWindow); + return getC2CTradeHistoryCall( + tradeType, startTimestamp, endTimestamp, page, rows, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -209,14 +238,16 @@ private okhttp3.Call getC2CTradeHistoryValidateBeforeCall( } /** - * Get C2C Trade History (USER_DATA) Get C2C Trade History * The max interval between startTime - * and endTime is 30 days. * If startTime and endTime are not sent, the recent 7 days' data - * will be returned. * The earliest startTime is supported on June 10, 2020 * Return up to 200 - * records per request. Weight: 1 + * Get C2C Trade History (USER_DATA) Get C2C Trade History * The max interval between + * startTimestamp and endTimestamp is 30 days. * If startTimestamp and endTimestamp are not + * sent, the recent 30 days' data will be returned. * You can only view data from the past 6 + * months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder Weight: 1 * - * @param startTime (optional) - * @param endTime (optional) + * @param tradeType BUY, SELL (optional) + * @param startTimestamp (optional) + * @param endTimestamp (optional) * @param page Default 1 (optional) + * @param rows default 100, max 100 (optional) * @param recvWindow (optional) * @return ApiResponse<GetC2CTradeHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -232,9 +263,16 @@ private okhttp3.Call getC2CTradeHistoryValidateBeforeCall( * Trade History (USER_DATA) Documentation */ public ApiResponse getC2CTradeHistory( - Long startTime, Long endTime, Long page, Long recvWindow) throws ApiException { + String tradeType, + Long startTimestamp, + Long endTimestamp, + Long page, + Long rows, + Long recvWindow) + throws ApiException { okhttp3.Call localVarCall = - getC2CTradeHistoryValidateBeforeCall(startTime, endTime, page, recvWindow); + getC2CTradeHistoryValidateBeforeCall( + tradeType, startTimestamp, endTimestamp, page, rows, recvWindow); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); diff --git a/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/api/C2cRestApi.java b/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/api/C2cRestApi.java index 5f6e47ac..9cc194a9 100644 --- a/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/api/C2cRestApi.java +++ b/clients/c2c/src/main/java/com/binance/connector/client/c2c/rest/api/C2cRestApi.java @@ -20,14 +20,16 @@ public C2cRestApi(ApiClient apiClient) { } /** - * Get C2C Trade History (USER_DATA) Get C2C Trade History * The max interval between startTime - * and endTime is 30 days. * If startTime and endTime are not sent, the recent 7 days' data - * will be returned. * The earliest startTime is supported on June 10, 2020 * Return up to 200 - * records per request. Weight: 1 + * Get C2C Trade History (USER_DATA) Get C2C Trade History * The max interval between + * startTimestamp and endTimestamp is 30 days. * If startTimestamp and endTimestamp are not + * sent, the recent 30 days' data will be returned. * You can only view data from the past 6 + * months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder Weight: 1 * - * @param startTime (optional) - * @param endTime (optional) + * @param tradeType BUY, SELL (optional) + * @param startTimestamp (optional) + * @param endTimestamp (optional) * @param page Default 1 (optional) + * @param rows default 100, max 100 (optional) * @param recvWindow (optional) * @return ApiResponse<GetC2CTradeHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -43,7 +45,14 @@ public C2cRestApi(ApiClient apiClient) { * Trade History (USER_DATA) Documentation */ public ApiResponse getC2CTradeHistory( - Long startTime, Long endTime, Long page, Long recvWindow) throws ApiException { - return c2CApi.getC2CTradeHistory(startTime, endTime, page, recvWindow); + String tradeType, + Long startTimestamp, + Long endTimestamp, + Long page, + Long rows, + Long recvWindow) + throws ApiException { + return c2CApi.getC2CTradeHistory( + tradeType, startTimestamp, endTimestamp, page, rows, recvWindow); } } diff --git a/clients/c2c/src/test/java/com/binance/connector/client/c2c/rest/api/C2CApiTest.java b/clients/c2c/src/test/java/com/binance/connector/client/c2c/rest/api/C2CApiTest.java index 64b070a1..1d297d3e 100644 --- a/clients/c2c/src/test/java/com/binance/connector/client/c2c/rest/api/C2CApiTest.java +++ b/clients/c2c/src/test/java/com/binance/connector/client/c2c/rest/api/C2CApiTest.java @@ -87,12 +87,14 @@ public void initApiClient() throws ApiException { */ @Test public void getC2CTradeHistoryTest() throws ApiException, CryptoException { - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; + String tradeType = "BUY"; + Long startTimestamp = 1623319461670L; + Long endTimestamp = 1641782889000L; Long page = 1L; + Long rows = 100L; Long recvWindow = 5000L; ApiResponse response = - api.getC2CTradeHistory(startTime, endTime, page, recvWindow); + api.getC2CTradeHistory(tradeType, startTimestamp, endTimestamp, page, rows, recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -105,10 +107,10 @@ public void getC2CTradeHistoryTest() throws ApiException, CryptoException { Request actualRequest = captorValue.request(); assertEquals( - "startTime=1623319461670&endTime=1641782889000&page=1&recvWindow=5000×tamp=1736393892000", + "tradeType=BUY&startTimestamp=1623319461670&endTimestamp=1641782889000&page=1&rows=100&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "d8669595398c3478db78736dbf4210642841e9920062e47dd9e504f877e947a8", + "b832525dad5bec73a86b8ad4a5bda7aaa6e4708aeb1c6f85d37ef00a5aefc693", actualRequest.url().queryParameter("signature")); assertEquals( "/sapi/v1/c2c/orderMatch/listUserOrderHistory", actualRequest.url().encodedPath()); diff --git a/clients/convert/.openapi-generator/FILES b/clients/convert/.openapi-generator/FILES new file mode 100644 index 00000000..85ab56d4 --- /dev/null +++ b/clients/convert/.openapi-generator/FILES @@ -0,0 +1,46 @@ +docs/AcceptQuoteRequest.md +docs/AcceptQuoteResponse.md +docs/CancelLimitOrderRequest.md +docs/CancelLimitOrderResponse.md +docs/GetConvertTradeHistoryResponse.md +docs/GetConvertTradeHistoryResponseListInner.md +docs/ListAllConvertPairsResponse.md +docs/ListAllConvertPairsResponseInner.md +docs/MarketDataApi.md +docs/OrderStatusResponse.md +docs/PlaceLimitOrderRequest.md +docs/PlaceLimitOrderResponse.md +docs/QueryLimitOpenOrdersResponse.md +docs/QueryLimitOpenOrdersResponseListInner.md +docs/QueryOrderQuantityPrecisionPerAssetResponse.md +docs/QueryOrderQuantityPrecisionPerAssetResponseInner.md +docs/SendQuoteRequestRequest.md +docs/SendQuoteRequestResponse.md +docs/TradeApi.md +example_rest.md +pom.xml +pom_example.xml +src/main/java/com/binance/connector/client/convert/rest/ConvertRestApiUtil.java +src/main/java/com/binance/connector/client/convert/rest/JSON.java +src/main/java/com/binance/connector/client/convert/rest/api/ConvertRestApi.java +src/main/java/com/binance/connector/client/convert/rest/api/MarketDataApi.java +src/main/java/com/binance/connector/client/convert/rest/api/TradeApi.java +src/main/java/com/binance/connector/client/convert/rest/example/MarketDataApiExample.java +src/main/java/com/binance/connector/client/convert/rest/example/TradeApiExample.java +src/main/java/com/binance/connector/client/convert/rest/model/AcceptQuoteRequest.java +src/main/java/com/binance/connector/client/convert/rest/model/AcceptQuoteResponse.java +src/main/java/com/binance/connector/client/convert/rest/model/CancelLimitOrderRequest.java +src/main/java/com/binance/connector/client/convert/rest/model/CancelLimitOrderResponse.java +src/main/java/com/binance/connector/client/convert/rest/model/GetConvertTradeHistoryResponse.java +src/main/java/com/binance/connector/client/convert/rest/model/GetConvertTradeHistoryResponseListInner.java +src/main/java/com/binance/connector/client/convert/rest/model/ListAllConvertPairsResponse.java +src/main/java/com/binance/connector/client/convert/rest/model/ListAllConvertPairsResponseInner.java +src/main/java/com/binance/connector/client/convert/rest/model/OrderStatusResponse.java +src/main/java/com/binance/connector/client/convert/rest/model/PlaceLimitOrderRequest.java +src/main/java/com/binance/connector/client/convert/rest/model/PlaceLimitOrderResponse.java +src/main/java/com/binance/connector/client/convert/rest/model/QueryLimitOpenOrdersResponse.java +src/main/java/com/binance/connector/client/convert/rest/model/QueryLimitOpenOrdersResponseListInner.java +src/main/java/com/binance/connector/client/convert/rest/model/QueryOrderQuantityPrecisionPerAssetResponse.java +src/main/java/com/binance/connector/client/convert/rest/model/QueryOrderQuantityPrecisionPerAssetResponseInner.java +src/main/java/com/binance/connector/client/convert/rest/model/SendQuoteRequestRequest.java +src/main/java/com/binance/connector/client/convert/rest/model/SendQuoteRequestResponse.java diff --git a/clients/convert/.openapi-generator/VERSION b/clients/convert/.openapi-generator/VERSION new file mode 100644 index 00000000..5f84a81d --- /dev/null +++ b/clients/convert/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.12.0 diff --git a/clients/derivatives-trading-coin-futures/CHANGELOG.md b/clients/derivatives-trading-coin-futures/CHANGELOG.md index 585d3ec2..46f71b8a 100644 --- a/clients/derivatives-trading-coin-futures/CHANGELOG.md +++ b/clients/derivatives-trading-coin-futures/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## 5.0.0 - 2025-12-16 + +### Changed (1) + +#### REST API + +- Modified parameter `batchOrders`: + - items.`orderId`: type `integer` → `string` + - items.`price`: type `number` → `string` + - items.`quantity`: type `number` → `string` + - items.`recvWindow`: type `integer` → `string` + - items.`orderId`: type `integer` → `string` + - items.`price`: type `number` → `string` + - items.`quantity`: type `number` → `string` + - items.`recvWindow`: type `integer` → `string` + - affected methods: + - `modifyMultipleOrders()` (`PUT /dapi/v1/batchOrders`) + ## 4.0.0 - 2025-10-21 ### Changed (23) diff --git a/clients/derivatives-trading-coin-futures/docs/BatchOrdersInner.md b/clients/derivatives-trading-coin-futures/docs/BatchOrdersInner.md index 189125e7..e5565a25 100644 --- a/clients/derivatives-trading-coin-futures/docs/BatchOrdersInner.md +++ b/clients/derivatives-trading-coin-futures/docs/BatchOrdersInner.md @@ -7,13 +7,13 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**orderId** | **Long** | | [optional] | +|**orderId** | **String** | | [optional] | |**origClientOrderId** | **String** | | [optional] | |**symbol** | **String** | | [optional] | |**side** | [**SideEnum**](#SideEnum) | | [optional] | -|**quantity** | **Double** | | [optional] | -|**price** | **Double** | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**quantity** | **String** | | [optional] | +|**price** | **String** | | [optional] | +|**recvWindow** | **String** | | [optional] | diff --git a/clients/derivatives-trading-coin-futures/docs/OrderTradeUpdateO.md b/clients/derivatives-trading-coin-futures/docs/OrderTradeUpdateO.md index b1bb5820..dd9e5bc4 100644 --- a/clients/derivatives-trading-coin-futures/docs/OrderTradeUpdateO.md +++ b/clients/derivatives-trading-coin-futures/docs/OrderTradeUpdateO.md @@ -41,6 +41,7 @@ |**pP** | **Boolean** | | [optional] | |**V** | **String** | | [optional] | |**pm** | **String** | | [optional] | +|**er** | **String** | | [optional] | diff --git a/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md b/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md index 5e0e7fba..4cf462e3 100644 --- a/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-coin-futures - 4.0.1 + 5.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-coin-futures - 4.0.0 + 5.0.0 ``` diff --git a/clients/derivatives-trading-coin-futures/pom.xml b/clients/derivatives-trading-coin-futures/pom.xml index a5996b5f..01f5fb8f 100644 --- a/clients/derivatives-trading-coin-futures/pom.xml +++ b/clients/derivatives-trading-coin-futures/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-coin-futures derivatives-trading-coin-futures - 4.0.1 + 5.0.0 jar diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java index 895553f5..7654bd34 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java @@ -54,7 +54,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java index c9650551..6e0ed5a3 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java @@ -69,7 +69,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java index 7e90b1c8..bdbf292e 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java @@ -42,7 +42,7 @@ public class PortfolioMarginEndpointsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java index 6769e8a5..51a757ef 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java @@ -76,7 +76,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java index acd3b559..349def3d 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java @@ -42,7 +42,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BatchOrdersInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BatchOrdersInner.java index 5ea72455..8333d50c 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BatchOrdersInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BatchOrdersInner.java @@ -23,7 +23,6 @@ import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; import jakarta.validation.constraints.*; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -42,7 +41,7 @@ public class BatchOrdersInner { @SerializedName(SERIALIZED_NAME_ORDER_ID) @jakarta.annotation.Nullable - private Long orderId; + private String orderId; public static final String SERIALIZED_NAME_ORIG_CLIENT_ORDER_ID = "origClientOrderId"; @@ -117,23 +116,23 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_QUANTITY) @jakarta.annotation.Nullable - private Double quantity; + private String quantity; public static final String SERIALIZED_NAME_PRICE = "price"; @SerializedName(SERIALIZED_NAME_PRICE) @jakarta.annotation.Nullable - private Double price; + private String price; public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private String recvWindow; public BatchOrdersInner() {} - public BatchOrdersInner orderId(@jakarta.annotation.Nullable Long orderId) { + public BatchOrdersInner orderId(@jakarta.annotation.Nullable String orderId) { this.orderId = orderId; return this; } @@ -144,11 +143,11 @@ public BatchOrdersInner orderId(@jakarta.annotation.Nullable Long orderId) { * @return orderId */ @jakarta.annotation.Nullable - public Long getOrderId() { + public String getOrderId() { return orderId; } - public void setOrderId(@jakarta.annotation.Nullable Long orderId) { + public void setOrderId(@jakarta.annotation.Nullable String orderId) { this.orderId = orderId; } @@ -210,7 +209,7 @@ public void setSide(@jakarta.annotation.Nullable SideEnum side) { this.side = side; } - public BatchOrdersInner quantity(@jakarta.annotation.Nullable Double quantity) { + public BatchOrdersInner quantity(@jakarta.annotation.Nullable String quantity) { this.quantity = quantity; return this; } @@ -221,16 +220,15 @@ public BatchOrdersInner quantity(@jakarta.annotation.Nullable Double quantity) { * @return quantity */ @jakarta.annotation.Nullable - @Valid - public Double getQuantity() { + public String getQuantity() { return quantity; } - public void setQuantity(@jakarta.annotation.Nullable Double quantity) { + public void setQuantity(@jakarta.annotation.Nullable String quantity) { this.quantity = quantity; } - public BatchOrdersInner price(@jakarta.annotation.Nullable Double price) { + public BatchOrdersInner price(@jakarta.annotation.Nullable String price) { this.price = price; return this; } @@ -241,16 +239,15 @@ public BatchOrdersInner price(@jakarta.annotation.Nullable Double price) { * @return price */ @jakarta.annotation.Nullable - @Valid - public Double getPrice() { + public String getPrice() { return price; } - public void setPrice(@jakarta.annotation.Nullable Double price) { + public void setPrice(@jakarta.annotation.Nullable String price) { this.price = price; } - public BatchOrdersInner recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public BatchOrdersInner recvWindow(@jakarta.annotation.Nullable String recvWindow) { this.recvWindow = recvWindow; return this; } @@ -261,11 +258,11 @@ public BatchOrdersInner recvWindow(@jakarta.annotation.Nullable Long recvWindow) * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + public String getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable String recvWindow) { this.recvWindow = recvWindow; } @@ -398,6 +395,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("orderId") != null && !jsonObj.get("orderId").isJsonNull()) + && !jsonObj.get("orderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("orderId").toString())); + } if ((jsonObj.get("origClientOrderId") != null && !jsonObj.get("origClientOrderId").isJsonNull()) && !jsonObj.get("origClientOrderId").isJsonPrimitive()) { @@ -427,6 +432,30 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) { SideEnum.validateJsonElement(jsonObj.get("side")); } + if ((jsonObj.get("quantity") != null && !jsonObj.get("quantity").isJsonNull()) + && !jsonObj.get("quantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quantity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("quantity").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("recvWindow") != null && !jsonObj.get("recvWindow").isJsonNull()) + && !jsonObj.get("recvWindow").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `recvWindow` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("recvWindow").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java index 5316f26e..da12e042 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java @@ -34,7 +34,7 @@ public class DerivativesTradingCoinFuturesWebSocketApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private AccountApi accountApi; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java index a6332a88..0305b36e 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java @@ -58,7 +58,7 @@ public class DerivativesTradingCoinFuturesWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/OrderTradeUpdateO.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/OrderTradeUpdateO.java index c809d02c..d5031160 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/OrderTradeUpdateO.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/model/OrderTradeUpdateO.java @@ -243,6 +243,12 @@ public class OrderTradeUpdateO extends BaseDTO { @jakarta.annotation.Nullable private String pm; + public static final String SERIALIZED_NAME_ER = "er"; + + @SerializedName(SERIALIZED_NAME_ER) + @jakarta.annotation.Nullable + private String er; + public OrderTradeUpdateO() {} public OrderTradeUpdateO sLowerCase(@jakarta.annotation.Nullable String sLowerCase) { @@ -891,6 +897,25 @@ public void setPm(@jakarta.annotation.Nullable String pm) { this.pm = pm; } + public OrderTradeUpdateO er(@jakarta.annotation.Nullable String er) { + this.er = er; + return this; + } + + /** + * Get er + * + * @return er + */ + @jakarta.annotation.Nullable + public String getEr() { + return er; + } + + public void setEr(@jakarta.annotation.Nullable String er) { + this.er = er; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -933,7 +958,8 @@ public boolean equals(Object o) { && Objects.equals(this.cr, orderTradeUpdateO.cr) && Objects.equals(this.pP, orderTradeUpdateO.pP) && Objects.equals(this.V, orderTradeUpdateO.V) - && Objects.equals(this.pm, orderTradeUpdateO.pm); + && Objects.equals(this.pm, orderTradeUpdateO.pm) + && Objects.equals(this.er, orderTradeUpdateO.er); } @Override @@ -972,7 +998,8 @@ public int hashCode() { cr, pP, V, - pm); + pm, + er); } @Override @@ -1013,6 +1040,7 @@ public String toString() { sb.append(" pP: ").append(toIndentedString(pP)).append("\n"); sb.append(" V: ").append(toIndentedString(V)).append("\n"); sb.append(" pm: ").append(toIndentedString(pm)).append("\n"); + sb.append(" er: ").append(toIndentedString(er)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1191,6 +1219,11 @@ public String toUrlQueryString() { String pmValueAsString = pmValue.toString(); valMap.put("pm", pmValueAsString); } + String erValue = getEr(); + if (erValue != null) { + String erValueAsString = erValue.toString(); + valMap.put("er", erValueAsString); + } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -1338,6 +1371,10 @@ public Map toMap() { if (pmValue != null) { valMap.put("pm", pmValue); } + Object erValue = getEr(); + if (erValue != null) { + valMap.put("er", erValue); + } valMap.put("timestamp", getTimestamp()); return valMap; @@ -1398,6 +1435,7 @@ private String toIndentedString(Object o) { openapiFields.add("pP"); openapiFields.add("V"); openapiFields.add("pm"); + openapiFields.add("er"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -1649,6 +1687,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("pm").toString())); } + if ((jsonObj.get("er") != null && !jsonObj.get("er").isJsonNull()) + && !jsonObj.get("er").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `er` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("er").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-options/CHANGELOG.md b/clients/derivatives-trading-options/CHANGELOG.md index 6d671151..8dfc07d1 100644 --- a/clients/derivatives-trading-options/CHANGELOG.md +++ b/clients/derivatives-trading-options/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## 5.0.0 - 2025-12-16 + +### Changed (2) + +#### REST API + +- Modified parameter `orders`: + - items.`isMmp`: type `boolean` → `string` + - items.`postOnly`: type `boolean` → `string` + - items.`price`: type `number` → `string` + - items.`quantity`: type `number` → `string` + - items.`reduceOnly`: type `boolean` → `string` + - items.`isMmp`: type `boolean` → `string` + - items.`postOnly`: type `boolean` → `string` + - items.`price`: type `number` → `string` + - items.`quantity`: type `number` → `string` + - items.`reduceOnly`: type `boolean` → `string` + - affected methods: + - `placeMultipleOrders()` (`POST /eapi/v1/batchOrders`) +#### WebSocket Streams + +- Modified response for `tradeStreams()` (`@trade` stream): + - `t`: type `integer` → `string` + ## 4.0.0 - 2025-10-21 ### Changed (17) diff --git a/clients/derivatives-trading-options/docs/IndexPriceTickerResponse.md b/clients/derivatives-trading-options/docs/IndexPriceTickerResponse.md new file mode 100644 index 00000000..b67143e3 --- /dev/null +++ b/clients/derivatives-trading-options/docs/IndexPriceTickerResponse.md @@ -0,0 +1,14 @@ + + +# IndexPriceTickerResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**time** | **Long** | | [optional] | +|**indexPrice** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-options/docs/MarketDataApi.md b/clients/derivatives-trading-options/docs/MarketDataApi.md index c8b9b403..a36bd5a3 100644 --- a/clients/derivatives-trading-options/docs/MarketDataApi.md +++ b/clients/derivatives-trading-options/docs/MarketDataApi.md @@ -7,6 +7,7 @@ All URIs are relative to *https://eapi.binance.com* | [**checkServerTime**](MarketDataApi.md#checkServerTime) | **GET** /eapi/v1/time | Check Server Time | | [**exchangeInformation**](MarketDataApi.md#exchangeInformation) | **GET** /eapi/v1/exchangeInfo | Exchange Information | | [**historicalExerciseRecords**](MarketDataApi.md#historicalExerciseRecords) | **GET** /eapi/v1/exerciseHistory | Historical Exercise Records | +| [**indexPriceTicker**](MarketDataApi.md#indexPriceTicker) | **GET** /eapi/v1/index | Index Price Ticker | | [**klineCandlestickData**](MarketDataApi.md#klineCandlestickData) | **GET** /eapi/v1/klines | Kline/Candlestick Data | | [**oldTradesLookup**](MarketDataApi.md#oldTradesLookup) | **GET** /eapi/v1/historicalTrades | Old Trades Lookup (MARKET_DATA) | | [**openInterest**](MarketDataApi.md#openInterest) | **GET** /eapi/v1/openInterest | Open Interest | @@ -14,7 +15,6 @@ All URIs are relative to *https://eapi.binance.com* | [**orderBook**](MarketDataApi.md#orderBook) | **GET** /eapi/v1/depth | Order Book | | [**recentBlockTradesList**](MarketDataApi.md#recentBlockTradesList) | **GET** /eapi/v1/blockTrades | Recent Block Trades List | | [**recentTradesList**](MarketDataApi.md#recentTradesList) | **GET** /eapi/v1/trades | Recent Trades List | -| [**symbolPriceTicker**](MarketDataApi.md#symbolPriceTicker) | **GET** /eapi/v1/index | Symbol Price Ticker | | [**testConnectivity**](MarketDataApi.md#testConnectivity) | **GET** /eapi/v1/ping | Test Connectivity | | [**ticker24hrPriceChangeStatistics**](MarketDataApi.md#ticker24hrPriceChangeStatistics) | **GET** /eapi/v1/ticker | 24hr Ticker Price Change Statistics | @@ -203,6 +203,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Historical Exercise Records | - | + +# **indexPriceTicker** +> IndexPriceTickerResponse indexPriceTicker(underlying) + +Index Price Ticker + +Get spot index price for option underlying. Weight: 1 + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_options.ApiClient; +import com.binance.connector.client.derivatives_trading_options.ApiException; +import com.binance.connector.client.derivatives_trading_options.Configuration; +import com.binance.connector.client.derivatives_trading_options.models.*; +import com.binance.connector.client.derivatives_trading_options.rest.api.MarketDataApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://eapi.binance.com"); + + MarketDataApi apiInstance = new MarketDataApi(defaultClient); + String underlying = "underlying_example"; // String | Option underlying, e.g BTCUSDT + try { + IndexPriceTickerResponse result = apiInstance.indexPriceTicker(underlying); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MarketDataApi#indexPriceTicker"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **underlying** | **String**| Option underlying, e.g BTCUSDT | | + +### Return type + +[**IndexPriceTickerResponse**](IndexPriceTickerResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index Price Ticker | - | + # **klineCandlestickData** > KlineCandlestickDataResponse klineCandlestickData(symbol, interval, startTime, endTime, limit) @@ -657,68 +719,6 @@ No authorization required |-------------|-------------|------------------| | **200** | Recent Trades List | - | - -# **symbolPriceTicker** -> SymbolPriceTickerResponse symbolPriceTicker(underlying) - -Symbol Price Ticker - -Get spot index price for option underlying. Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_options.ApiClient; -import com.binance.connector.client.derivatives_trading_options.ApiException; -import com.binance.connector.client.derivatives_trading_options.Configuration; -import com.binance.connector.client.derivatives_trading_options.models.*; -import com.binance.connector.client.derivatives_trading_options.rest.api.MarketDataApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://eapi.binance.com"); - - MarketDataApi apiInstance = new MarketDataApi(defaultClient); - String underlying = "underlying_example"; // String | Option underlying, e.g BTCUSDT - try { - SymbolPriceTickerResponse result = apiInstance.symbolPriceTicker(underlying); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling MarketDataApi#symbolPriceTicker"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **underlying** | **String**| Option underlying, e.g BTCUSDT | | - -### Return type - -[**SymbolPriceTickerResponse**](SymbolPriceTickerResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Symbol Price Ticker | - | - # **testConnectivity** > testConnectivity() diff --git a/clients/derivatives-trading-options/docs/OrdersInner.md b/clients/derivatives-trading-options/docs/OrdersInner.md index 178bf94e..60686485 100644 --- a/clients/derivatives-trading-options/docs/OrdersInner.md +++ b/clients/derivatives-trading-options/docs/OrdersInner.md @@ -10,14 +10,14 @@ |**symbol** | **String** | | [optional] | |**side** | [**SideEnum**](#SideEnum) | | [optional] | |**type** | [**TypeEnum**](#TypeEnum) | | [optional] | -|**quantity** | **Double** | | [optional] | -|**price** | **Double** | | [optional] | +|**quantity** | **String** | | [optional] | +|**price** | **String** | | [optional] | |**timeInForce** | [**TimeInForceEnum**](#TimeInForceEnum) | | [optional] | -|**reduceOnly** | **Boolean** | | [optional] | -|**postOnly** | **Boolean** | | [optional] | +|**reduceOnly** | **String** | | [optional] | +|**postOnly** | **String** | | [optional] | |**newOrderRespType** | [**NewOrderRespTypeEnum**](#NewOrderRespTypeEnum) | | [optional] | |**clientOrderId** | **String** | | [optional] | -|**isMmp** | **Boolean** | | [optional] | +|**isMmp** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/TradeApi.md b/clients/derivatives-trading-options/docs/TradeApi.md index be0ac209..f90f6f3e 100644 --- a/clients/derivatives-trading-options/docs/TradeApi.md +++ b/clients/derivatives-trading-options/docs/TradeApi.md @@ -224,7 +224,7 @@ No authorization required Cancel Multiple Option Orders (TRADE) -Cancel multiple orders. * At least one instance of `orderId` and `clientOrderId` must be sent. Weight: 1 +Cancel multiple orders. * At least one instance of `orderId` and `clientOrderId` must be sent. * Max 10 orders can be deleted in one request Weight: 1 ### Example ```java diff --git a/clients/derivatives-trading-options/docs/TradeStreamsResponse.md b/clients/derivatives-trading-options/docs/TradeStreamsResponse.md index c19f470e..09595ed7 100644 --- a/clients/derivatives-trading-options/docs/TradeStreamsResponse.md +++ b/clients/derivatives-trading-options/docs/TradeStreamsResponse.md @@ -10,7 +10,7 @@ |**eLowerCase** | **String** | | [optional] | |**E** | **Long** | | [optional] | |**sLowerCase** | **String** | | [optional] | -|**tLowerCase** | **Long** | | [optional] | +|**tLowerCase** | **String** | | [optional] | |**pLowerCase** | **String** | | [optional] | |**qLowerCase** | **String** | | [optional] | |**bLowerCase** | **Long** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/rest-api/migration-guide.md b/clients/derivatives-trading-options/docs/rest-api/migration-guide.md index f7057117..2248794b 100644 --- a/clients/derivatives-trading-options/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-options/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-options - 4.0.1 + 5.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-options - 4.0.0 + 5.0.0 ``` diff --git a/clients/derivatives-trading-options/example_rest.md b/clients/derivatives-trading-options/example_rest.md index e780623d..e9d5e66e 100644 --- a/clients/derivatives-trading-options/example_rest.md +++ b/clients/derivatives-trading-options/example_rest.md @@ -18,6 +18,8 @@ [GET /eapi/v1/exerciseHistory](https://developers.binance.com/docs/derivatives/option/market-data/Historical-Exercise-Records) - historicalExerciseRecords - [HistoricalExerciseRecordsExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/HistoricalExerciseRecordsExample.java#L48) +[GET /eapi/v1/index](https://developers.binance.com/docs/derivatives/option/market-data/Index-Price-Ticker) - indexPriceTicker - [IndexPriceTickerExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/IndexPriceTickerExample.java#L47) + [GET /eapi/v1/klines](https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data) - klineCandlestickData - [KlineCandlestickDataExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/KlineCandlestickDataExample.java#L48) [GET /eapi/v1/historicalTrades](https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup) - oldTradesLookup - [OldTradesLookupExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/OldTradesLookupExample.java#L47) @@ -32,8 +34,6 @@ [GET /eapi/v1/trades](https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List) - recentTradesList - [RecentTradesListExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/RecentTradesListExample.java#L47) -[GET /eapi/v1/index](https://developers.binance.com/docs/derivatives/option/market-data/Symbol-Price-Ticker) - symbolPriceTicker - [SymbolPriceTickerExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/SymbolPriceTickerExample.java#L47) - [GET /eapi/v1/ping](https://developers.binance.com/docs/derivatives/option/market-data/Test-Connectivity) - testConnectivity - [TestConnectivityExample.java:45](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/TestConnectivityExample.java#L45) [GET /eapi/v1/ticker](https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics) - ticker24hrPriceChangeStatistics - [Ticker24hrPriceChangeStatisticsExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/Ticker24hrPriceChangeStatisticsExample.java#L47) @@ -76,7 +76,7 @@ [DELETE /eapi/v1/allOpenOrders](https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol) - cancelAllOptionOrdersOnSpecificSymbol - [CancelAllOptionOrdersOnSpecificSymbolExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelAllOptionOrdersOnSpecificSymbolExample.java#L47) -[DELETE /eapi/v1/batchOrders](https://developers.binance.com/docs/derivatives/option/trade/Cancel-Multiple-Option-Orders) - cancelMultipleOptionOrders - [CancelMultipleOptionOrdersExample.java:50](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelMultipleOptionOrdersExample.java#L50) +[DELETE /eapi/v1/batchOrders](https://developers.binance.com/docs/derivatives/option/trade/Cancel-Multiple-Option-Orders) - cancelMultipleOptionOrders - [CancelMultipleOptionOrdersExample.java:51](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelMultipleOptionOrdersExample.java#L51) [DELETE /eapi/v1/order](https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order) - cancelOptionOrder - [CancelOptionOrderExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelOptionOrderExample.java#L48) diff --git a/clients/derivatives-trading-options/pom.xml b/clients/derivatives-trading-options/pom.xml index 8fde2c69..d393c7bb 100644 --- a/clients/derivatives-trading-options/pom.xml +++ b/clients/derivatives-trading-options/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-options derivatives-trading-options - 4.0.1 + 5.0.0 jar diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/JSON.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/JSON.java index 5e47675b..2d479842 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/JSON.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/JSON.java @@ -214,6 +214,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model .HistoricalExerciseRecordsResponseInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.rest.model + .IndexPriceTickerResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model .KlineCandlestickDataResponse.CustomTypeAdapterFactory()); @@ -362,9 +365,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model .StartUserDataStreamResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_options.rest.model - .SymbolPriceTickerResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model .Ticker24hrPriceChangeStatisticsResponse.CustomTypeAdapterFactory()); diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApi.java index 86d7e6a6..66b9bbca 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApi.java @@ -46,7 +46,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java index ecb5e7f8..50ddfed2 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java @@ -26,6 +26,7 @@ import com.binance.connector.client.derivatives_trading_options.rest.model.GetMarketMakerProtectionConfigResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.GetOptionTransactionHistoryDownloadLinkByIdResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.HistoricalExerciseRecordsResponse; +import com.binance.connector.client.derivatives_trading_options.rest.model.IndexPriceTickerResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.KlineCandlestickDataResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.NewBlockTradeOrderRequest; import com.binance.connector.client.derivatives_trading_options.rest.model.NewBlockTradeOrderResponse; @@ -55,7 +56,6 @@ import com.binance.connector.client.derivatives_trading_options.rest.model.SetMarketMakerProtectionConfigRequest; import com.binance.connector.client.derivatives_trading_options.rest.model.SetMarketMakerProtectionConfigResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.StartUserDataStreamResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.SymbolPriceTickerResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.Ticker24hrPriceChangeStatisticsResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.UserExerciseRecordResponse; @@ -288,6 +288,29 @@ public ApiResponse historicalExerciseRecords( return marketDataApi.historicalExerciseRecords(underlying, startTime, endTime, limit); } + /** + * Index Price Ticker Get spot index price for option underlying. Weight: 1 + * + * @param underlying Option underlying, e.g BTCUSDT (required) + * @return ApiResponse<IndexPriceTickerResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Index Price Ticker -
+ * + * @see Index + * Price Ticker Documentation + */ + public ApiResponse indexPriceTicker(String underlying) + throws ApiException { + return marketDataApi.indexPriceTicker(underlying); + } + /** * Kline/Candlestick Data Kline/candlestick bars for an option symbol. Klines are uniquely * identified by their open time. * If startTime and endTime are not sent, the most recent @@ -463,29 +486,6 @@ public ApiResponse recentTradesList(String symbol, Lon return marketDataApi.recentTradesList(symbol, limit); } - /** - * Symbol Price Ticker Get spot index price for option underlying. Weight: 1 - * - * @param underlying Option underlying, e.g BTCUSDT (required) - * @return ApiResponse<SymbolPriceTickerResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Symbol Price Ticker -
- * - * @see Symbol - * Price Ticker Documentation - */ - public ApiResponse symbolPriceTicker(String underlying) - throws ApiException { - return marketDataApi.symbolPriceTicker(underlying); - } - /** * Test Connectivity Test connectivity to the Rest API. Weight: 1 * @@ -967,7 +967,8 @@ public ApiResponse cancelAllOptionOrd /** * Cancel Multiple Option Orders (TRADE) Cancel multiple orders. * At least one instance of - * `orderId` and `clientOrderId` must be sent. Weight: 1 + * `orderId` and `clientOrderId` must be sent. * Max 10 orders can be + * deleted in one request Weight: 1 * * @param symbol Option trading pair, e.g BTC-200730-9000-C (required) * @param orderIds Order ID, e.g [4611875134427365377,4611875134427365378] (optional) diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java index cedd6f5f..543e05fe 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java @@ -22,6 +22,7 @@ import com.binance.connector.client.derivatives_trading_options.rest.model.CheckServerTimeResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.ExchangeInformationResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.HistoricalExerciseRecordsResponse; +import com.binance.connector.client.derivatives_trading_options.rest.model.IndexPriceTickerResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.KlineCandlestickDataResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OldTradesLookupResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OpenInterestResponse; @@ -29,7 +30,6 @@ import com.binance.connector.client.derivatives_trading_options.rest.model.OrderBookResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.RecentBlockTradesListResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.RecentTradesListResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.SymbolPriceTickerResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.Ticker24hrPriceChangeStatisticsResponse; import com.google.gson.reflect.TypeToken; import jakarta.validation.ConstraintViolation; @@ -53,7 +53,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -499,6 +499,137 @@ public ApiResponse historicalExerciseRecords( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for indexPriceTicker + * + * @param underlying Option underlying, e.g BTCUSDT (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Index Price Ticker -
+ * + * @see Index + * Price Ticker Documentation + */ + private okhttp3.Call indexPriceTickerCall(String underlying) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/eapi/v1/index"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (underlying != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("underlying", underlying)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call indexPriceTickerValidateBeforeCall(String underlying) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {underlying}; + Method method = this.getClass().getMethod("indexPriceTicker", String.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return indexPriceTickerCall(underlying); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Index Price Ticker Get spot index price for option underlying. Weight: 1 + * + * @param underlying Option underlying, e.g BTCUSDT (required) + * @return ApiResponse<IndexPriceTickerResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Index Price Ticker -
+ * + * @see Index + * Price Ticker Documentation + */ + public ApiResponse indexPriceTicker(@NotNull String underlying) + throws ApiException { + okhttp3.Call localVarCall = indexPriceTickerValidateBeforeCall(underlying); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for klineCandlestickData * @@ -1509,138 +1640,6 @@ public ApiResponse recentTradesList( return localVarApiClient.execute(localVarCall, localVarReturnType); } - /** - * Build call for symbolPriceTicker - * - * @param underlying Option underlying, e.g BTCUSDT (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Symbol Price Ticker -
- * - * @see Symbol - * Price Ticker Documentation - */ - private okhttp3.Call symbolPriceTickerCall(String underlying) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/eapi/v1/index"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (underlying != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("underlying", underlying)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call symbolPriceTickerValidateBeforeCall(String underlying) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {underlying}; - Method method = this.getClass().getMethod("symbolPriceTicker", String.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return symbolPriceTickerCall(underlying); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Symbol Price Ticker Get spot index price for option underlying. Weight: 1 - * - * @param underlying Option underlying, e.g BTCUSDT (required) - * @return ApiResponse<SymbolPriceTickerResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Symbol Price Ticker -
- * - * @see Symbol - * Price Ticker Documentation - */ - public ApiResponse symbolPriceTicker(@NotNull String underlying) - throws ApiException { - okhttp3.Call localVarCall = symbolPriceTickerValidateBeforeCall(underlying); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - /** * Build call for testConnectivity * diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java index 5ce88240..3cca64af 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java @@ -52,7 +52,7 @@ public class MarketMakerBlockTradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java index f3c0ae43..81ebe4c4 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java @@ -53,7 +53,7 @@ public class MarketMakerEndpointsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java index 59fbad0e..20489887 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java @@ -60,7 +60,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -707,7 +707,8 @@ private okhttp3.Call cancelMultipleOptionOrdersValidateBeforeCall( /** * Cancel Multiple Option Orders (TRADE) Cancel multiple orders. * At least one instance of - * `orderId` and `clientOrderId` must be sent. Weight: 1 + * `orderId` and `clientOrderId` must be sent. * Max 10 orders can be + * deleted in one request Weight: 1 * * @param symbol Option trading pair, e.g BTC-200730-9000-C (required) * @param orderIds Order ID, e.g [4611875134427365377,4611875134427365378] (optional) diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java index decef131..485de527 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java @@ -42,7 +42,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/IndexPriceTickerResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/IndexPriceTickerResponse.java new file mode 100644 index 00000000..6ad24824 --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/IndexPriceTickerResponse.java @@ -0,0 +1,243 @@ +/* + * Binance Derivatives Trading Options REST API + * OpenAPI Specification for the Binance Derivatives Trading Options REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_options.rest.model; + +import com.binance.connector.client.derivatives_trading_options.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** IndexPriceTickerResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class IndexPriceTickerResponse { + public static final String SERIALIZED_NAME_TIME = "time"; + + @SerializedName(SERIALIZED_NAME_TIME) + @jakarta.annotation.Nullable + private Long time; + + public static final String SERIALIZED_NAME_INDEX_PRICE = "indexPrice"; + + @SerializedName(SERIALIZED_NAME_INDEX_PRICE) + @jakarta.annotation.Nullable + private String indexPrice; + + public IndexPriceTickerResponse() {} + + public IndexPriceTickerResponse time(@jakarta.annotation.Nullable Long time) { + this.time = time; + return this; + } + + /** + * Get time + * + * @return time + */ + @jakarta.annotation.Nullable + public Long getTime() { + return time; + } + + public void setTime(@jakarta.annotation.Nullable Long time) { + this.time = time; + } + + public IndexPriceTickerResponse indexPrice(@jakarta.annotation.Nullable String indexPrice) { + this.indexPrice = indexPrice; + return this; + } + + /** + * Get indexPrice + * + * @return indexPrice + */ + @jakarta.annotation.Nullable + public String getIndexPrice() { + return indexPrice; + } + + public void setIndexPrice(@jakarta.annotation.Nullable String indexPrice) { + this.indexPrice = indexPrice; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IndexPriceTickerResponse indexPriceTickerResponse = (IndexPriceTickerResponse) o; + return Objects.equals(this.time, indexPriceTickerResponse.time) + && Objects.equals(this.indexPrice, indexPriceTickerResponse.indexPrice); + } + + @Override + public int hashCode() { + return Objects.hash(time, indexPrice); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IndexPriceTickerResponse {\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object timeValue = getTime(); + String timeValueAsString = ""; + timeValueAsString = timeValue.toString(); + sb.append("time=").append(urlEncode(timeValueAsString)).append(""); + Object indexPriceValue = getIndexPrice(); + String indexPriceValueAsString = ""; + indexPriceValueAsString = indexPriceValue.toString(); + sb.append("indexPrice=").append(urlEncode(indexPriceValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("time"); + openapiFields.add("indexPrice"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IndexPriceTickerResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IndexPriceTickerResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in IndexPriceTickerResponse is not found" + + " in the empty JSON string", + IndexPriceTickerResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("indexPrice") != null && !jsonObj.get("indexPrice").isJsonNull()) + && !jsonObj.get("indexPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `indexPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("indexPrice").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IndexPriceTickerResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IndexPriceTickerResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(IndexPriceTickerResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, IndexPriceTickerResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IndexPriceTickerResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of IndexPriceTickerResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of IndexPriceTickerResponse + * @throws IOException if the JSON string is invalid with respect to IndexPriceTickerResponse + */ + public static IndexPriceTickerResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IndexPriceTickerResponse.class); + } + + /** + * Convert an instance of IndexPriceTickerResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OrdersInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OrdersInner.java index 04ed033d..771f2388 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OrdersInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OrdersInner.java @@ -23,7 +23,6 @@ import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; import jakarta.validation.constraints.*; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -160,13 +159,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_QUANTITY) @jakarta.annotation.Nullable - private Double quantity; + private String quantity; public static final String SERIALIZED_NAME_PRICE = "price"; @SerializedName(SERIALIZED_NAME_PRICE) @jakarta.annotation.Nullable - private Double price; + private String price; /** Gets or Sets timeInForce */ @JsonAdapter(TimeInForceEnum.Adapter.class) @@ -231,13 +230,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) @jakarta.annotation.Nullable - private Boolean reduceOnly; + private String reduceOnly; public static final String SERIALIZED_NAME_POST_ONLY = "postOnly"; @SerializedName(SERIALIZED_NAME_POST_ONLY) @jakarta.annotation.Nullable - private Boolean postOnly; + private String postOnly; /** Gets or Sets newOrderRespType */ @JsonAdapter(NewOrderRespTypeEnum.Adapter.class) @@ -306,7 +305,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_IS_MMP) @jakarta.annotation.Nullable - private Boolean isMmp; + private String isMmp; public OrdersInner() {} @@ -367,7 +366,7 @@ public void setType(@jakarta.annotation.Nullable TypeEnum type) { this.type = type; } - public OrdersInner quantity(@jakarta.annotation.Nullable Double quantity) { + public OrdersInner quantity(@jakarta.annotation.Nullable String quantity) { this.quantity = quantity; return this; } @@ -378,16 +377,15 @@ public OrdersInner quantity(@jakarta.annotation.Nullable Double quantity) { * @return quantity */ @jakarta.annotation.Nullable - @Valid - public Double getQuantity() { + public String getQuantity() { return quantity; } - public void setQuantity(@jakarta.annotation.Nullable Double quantity) { + public void setQuantity(@jakarta.annotation.Nullable String quantity) { this.quantity = quantity; } - public OrdersInner price(@jakarta.annotation.Nullable Double price) { + public OrdersInner price(@jakarta.annotation.Nullable String price) { this.price = price; return this; } @@ -398,12 +396,11 @@ public OrdersInner price(@jakarta.annotation.Nullable Double price) { * @return price */ @jakarta.annotation.Nullable - @Valid - public Double getPrice() { + public String getPrice() { return price; } - public void setPrice(@jakarta.annotation.Nullable Double price) { + public void setPrice(@jakarta.annotation.Nullable String price) { this.price = price; } @@ -426,7 +423,7 @@ public void setTimeInForce(@jakarta.annotation.Nullable TimeInForceEnum timeInFo this.timeInForce = timeInForce; } - public OrdersInner reduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + public OrdersInner reduceOnly(@jakarta.annotation.Nullable String reduceOnly) { this.reduceOnly = reduceOnly; return this; } @@ -437,15 +434,15 @@ public OrdersInner reduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { * @return reduceOnly */ @jakarta.annotation.Nullable - public Boolean getReduceOnly() { + public String getReduceOnly() { return reduceOnly; } - public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + public void setReduceOnly(@jakarta.annotation.Nullable String reduceOnly) { this.reduceOnly = reduceOnly; } - public OrdersInner postOnly(@jakarta.annotation.Nullable Boolean postOnly) { + public OrdersInner postOnly(@jakarta.annotation.Nullable String postOnly) { this.postOnly = postOnly; return this; } @@ -456,11 +453,11 @@ public OrdersInner postOnly(@jakarta.annotation.Nullable Boolean postOnly) { * @return postOnly */ @jakarta.annotation.Nullable - public Boolean getPostOnly() { + public String getPostOnly() { return postOnly; } - public void setPostOnly(@jakarta.annotation.Nullable Boolean postOnly) { + public void setPostOnly(@jakarta.annotation.Nullable String postOnly) { this.postOnly = postOnly; } @@ -504,7 +501,7 @@ public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) this.clientOrderId = clientOrderId; } - public OrdersInner isMmp(@jakarta.annotation.Nullable Boolean isMmp) { + public OrdersInner isMmp(@jakarta.annotation.Nullable String isMmp) { this.isMmp = isMmp; return this; } @@ -515,11 +512,11 @@ public OrdersInner isMmp(@jakarta.annotation.Nullable Boolean isMmp) { * @return isMmp */ @jakarta.annotation.Nullable - public Boolean getIsMmp() { + public String getIsMmp() { return isMmp; } - public void setIsMmp(@jakarta.annotation.Nullable Boolean isMmp) { + public void setIsMmp(@jakarta.annotation.Nullable String isMmp) { this.isMmp = isMmp; } @@ -721,6 +718,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { TypeEnum.validateJsonElement(jsonObj.get("type")); } + if ((jsonObj.get("quantity") != null && !jsonObj.get("quantity").isJsonNull()) + && !jsonObj.get("quantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quantity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("quantity").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) && !jsonObj.get("timeInForce").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -733,6 +746,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) { TimeInForceEnum.validateJsonElement(jsonObj.get("timeInForce")); } + if ((jsonObj.get("reduceOnly") != null && !jsonObj.get("reduceOnly").isJsonNull()) + && !jsonObj.get("reduceOnly").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `reduceOnly` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("reduceOnly").toString())); + } + if ((jsonObj.get("postOnly") != null && !jsonObj.get("postOnly").isJsonNull()) + && !jsonObj.get("postOnly").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `postOnly` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("postOnly").toString())); + } if ((jsonObj.get("newOrderRespType") != null && !jsonObj.get("newOrderRespType").isJsonNull()) && !jsonObj.get("newOrderRespType").isJsonPrimitive()) { @@ -755,6 +784,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("clientOrderId").toString())); } + if ((jsonObj.get("isMmp") != null && !jsonObj.get("isMmp").isJsonNull()) + && !jsonObj.get("isMmp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `isMmp` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("isMmp").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/DerivativesTradingOptionsWebSocketStreams.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/DerivativesTradingOptionsWebSocketStreams.java index fa40575d..85b7ef91 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/DerivativesTradingOptionsWebSocketStreams.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/DerivativesTradingOptionsWebSocketStreams.java @@ -38,7 +38,7 @@ public class DerivativesTradingOptionsWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/TradeStreamsResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/TradeStreamsResponse.java index 82438395..7c7576b9 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/TradeStreamsResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/TradeStreamsResponse.java @@ -61,7 +61,7 @@ public class TradeStreamsResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_T_LOWER_CASE) @jakarta.annotation.Nullable - private Long tLowerCase; + private String tLowerCase; public static final String SERIALIZED_NAME_P_LOWER_CASE = "p"; @@ -164,7 +164,7 @@ public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { this.sLowerCase = sLowerCase; } - public TradeStreamsResponse tLowerCase(@jakarta.annotation.Nullable Long tLowerCase) { + public TradeStreamsResponse tLowerCase(@jakarta.annotation.Nullable String tLowerCase) { this.tLowerCase = tLowerCase; return this; } @@ -175,11 +175,11 @@ public TradeStreamsResponse tLowerCase(@jakarta.annotation.Nullable Long tLowerC * @return tLowerCase */ @jakarta.annotation.Nullable - public Long gettLowerCase() { + public String gettLowerCase() { return tLowerCase; } - public void settLowerCase(@jakarta.annotation.Nullable Long tLowerCase) { + public void settLowerCase(@jakarta.annotation.Nullable String tLowerCase) { this.tLowerCase = tLowerCase; } @@ -392,7 +392,7 @@ public String toUrlQueryString() { String sLowerCaseValueAsString = sLowerCaseValue.toString(); valMap.put("sLowerCase", sLowerCaseValueAsString); } - Long tLowerCaseValue = gettLowerCase(); + String tLowerCaseValue = gettLowerCase(); if (tLowerCaseValue != null) { String tLowerCaseValueAsString = tLowerCaseValue.toString(); valMap.put("tLowerCase", tLowerCaseValueAsString); @@ -575,6 +575,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("s").toString())); } + if ((jsonObj.get("t") != null && !jsonObj.get("t").isJsonNull()) + && !jsonObj.get("t").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `t` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("t").toString())); + } if ((jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) && !jsonObj.get("p").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApiTest.java b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApiTest.java index 7d21d46b..febad351 100644 --- a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApiTest.java +++ b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApiTest.java @@ -26,6 +26,7 @@ import com.binance.connector.client.derivatives_trading_options.rest.model.CheckServerTimeResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.ExchangeInformationResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.HistoricalExerciseRecordsResponse; +import com.binance.connector.client.derivatives_trading_options.rest.model.IndexPriceTickerResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.KlineCandlestickDataResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OldTradesLookupResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OpenInterestResponse; @@ -343,7 +344,7 @@ public void recentTradesListTest() throws ApiException, CryptoException { @Test public void symbolPriceTickerTest() throws ApiException, CryptoException { String underlying = ""; - ApiResponse response = api.symbolPriceTicker(underlying); + ApiResponse response = api.indexPriceTicker(underlying); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) diff --git a/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md b/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md index 1ddfa729..70fc3296 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md +++ b/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 5.0.0 - 2025-12-16 + +### Removed (2) + +#### REST API + +- `mintBfusdForPortfolioMargin()` (`POST /sapi/v1/portfolio/mint`) +- `redeemBfusdForPortfolioMargin()` (`POST /sapi/v1/portfolio/redeem`) + ## 4.0.0 - 2025-10-21 ### Changed (2) diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/AccountApi.md b/clients/derivatives-trading-portfolio-margin-pro/docs/AccountApi.md index 667a784c..f0115e65 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/docs/AccountApi.md +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/AccountApi.md @@ -13,14 +13,12 @@ All URIs are relative to *https://api.binance.com* | [**getPortfolioMarginProAccountInfo**](AccountApi.md#getPortfolioMarginProAccountInfo) | **GET** /sapi/v1/portfolio/account | Get Portfolio Margin Pro Account Info(USER_DATA) | | [**getPortfolioMarginProSpanAccountInfo**](AccountApi.md#getPortfolioMarginProSpanAccountInfo) | **GET** /sapi/v2/portfolio/account | Get Portfolio Margin Pro SPAN Account Info(USER_DATA) | | [**getTransferableEarnAssetBalanceForPortfolioMargin**](AccountApi.md#getTransferableEarnAssetBalanceForPortfolioMargin) | **GET** /sapi/v1/portfolio/earn-asset-balance | Get Transferable Earn Asset Balance for Portfolio Margin (USER_DATA) | -| [**mintBfusdForPortfolioMargin**](AccountApi.md#mintBfusdForPortfolioMargin) | **POST** /sapi/v1/portfolio/mint | Mint BFUSD for Portfolio Margin(TRADE) | | [**portfolioMarginProBankruptcyLoanRepay**](AccountApi.md#portfolioMarginProBankruptcyLoanRepay) | **POST** /sapi/v1/portfolio/repay | Portfolio Margin Pro Bankruptcy Loan Repay | | [**queryPortfolioMarginProBankruptcyLoanAmount**](AccountApi.md#queryPortfolioMarginProBankruptcyLoanAmount) | **GET** /sapi/v1/portfolio/pmLoan | Query Portfolio Margin Pro Bankruptcy Loan Amount(USER_DATA) | | [**queryPortfolioMarginProBankruptcyLoanRepayHistory**](AccountApi.md#queryPortfolioMarginProBankruptcyLoanRepayHistory) | **GET** /sapi/v1/portfolio/pmloan-history | Query Portfolio Margin Pro Bankruptcy Loan Repay History(USER_DATA) | | [**queryPortfolioMarginProNegativeBalanceInterestHistory**](AccountApi.md#queryPortfolioMarginProNegativeBalanceInterestHistory) | **GET** /sapi/v1/portfolio/interest-history | Query Portfolio Margin Pro Negative Balance Interest History(USER_DATA) | -| [**redeemBfusdForPortfolioMargin**](AccountApi.md#redeemBfusdForPortfolioMargin) | **POST** /sapi/v1/portfolio/redeem | Redeem BFUSD for Portfolio Margin(TRADE) | | [**repayFuturesNegativeBalance**](AccountApi.md#repayFuturesNegativeBalance) | **POST** /sapi/v1/portfolio/repay-futures-negative-balance | Repay futures Negative Balance(USER_DATA) | -| [**transferLdusdtForPortfolioMargin**](AccountApi.md#transferLdusdtForPortfolioMargin) | **POST** /sapi/v1/portfolio/earn-asset-transfer | Transfer LDUSDT for Portfolio Margin(TRADE) | +| [**transferLdusdtRwusdForPortfolioMargin**](AccountApi.md#transferLdusdtRwusdForPortfolioMargin) | **POST** /sapi/v1/portfolio/earn-asset-transfer | Transfer LDUSDT/RWUSD for Portfolio Margin(TRADE) | @@ -587,68 +585,6 @@ No authorization required |-------------|-------------|------------------| | **200** | Get Transferable Earn Asset Balance for Portfolio Margin | - | - -# **mintBfusdForPortfolioMargin** -> MintBfusdForPortfolioMarginResponse mintBfusdForPortfolioMargin(mintBfusdForPortfolioMarginRequest) - -Mint BFUSD for Portfolio Margin(TRADE) - -Mint BFUSD for all types of Portfolio Margin account Weight: 1500 - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.ApiClient; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.ApiException; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.Configuration; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.models.*; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.api.AccountApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - AccountApi apiInstance = new AccountApi(defaultClient); - MintBfusdForPortfolioMarginRequest mintBfusdForPortfolioMarginRequest = new MintBfusdForPortfolioMarginRequest(); // MintBfusdForPortfolioMarginRequest | - try { - MintBfusdForPortfolioMarginResponse result = apiInstance.mintBfusdForPortfolioMargin(mintBfusdForPortfolioMarginRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AccountApi#mintBfusdForPortfolioMargin"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **mintBfusdForPortfolioMarginRequest** | [**MintBfusdForPortfolioMarginRequest**](MintBfusdForPortfolioMarginRequest.md)| | | - -### Return type - -[**MintBfusdForPortfolioMarginResponse**](MintBfusdForPortfolioMarginResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Mint BFUSD for Portfolio Margin | - | - # **portfolioMarginProBankruptcyLoanRepay** > PortfolioMarginProBankruptcyLoanRepayResponse portfolioMarginProBankruptcyLoanRepay(portfolioMarginProBankruptcyLoanRepayRequest) @@ -913,68 +849,6 @@ No authorization required |-------------|-------------|------------------| | **200** | Portfolio Margin Pro Negative Balance Interest History | - | - -# **redeemBfusdForPortfolioMargin** -> RedeemBfusdForPortfolioMarginResponse redeemBfusdForPortfolioMargin(redeemBfusdForPortfolioMarginRequest) - -Redeem BFUSD for Portfolio Margin(TRADE) - -Redeem BFUSD for all types of Portfolio Margin account Weight: 1500 - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.ApiClient; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.ApiException; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.Configuration; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.models.*; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.api.AccountApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - AccountApi apiInstance = new AccountApi(defaultClient); - RedeemBfusdForPortfolioMarginRequest redeemBfusdForPortfolioMarginRequest = new RedeemBfusdForPortfolioMarginRequest(); // RedeemBfusdForPortfolioMarginRequest | - try { - RedeemBfusdForPortfolioMarginResponse result = apiInstance.redeemBfusdForPortfolioMargin(redeemBfusdForPortfolioMarginRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AccountApi#redeemBfusdForPortfolioMargin"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **redeemBfusdForPortfolioMarginRequest** | [**RedeemBfusdForPortfolioMarginRequest**](RedeemBfusdForPortfolioMarginRequest.md)| | | - -### Return type - -[**RedeemBfusdForPortfolioMarginResponse**](RedeemBfusdForPortfolioMarginResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Redeem BFUSD for Portfolio Margin | - | - # **repayFuturesNegativeBalance** > RepayFuturesNegativeBalanceResponse repayFuturesNegativeBalance(repayFuturesNegativeBalanceRequest) @@ -1037,13 +911,13 @@ No authorization required |-------------|-------------|------------------| | **200** | Repay futures Negative Balance | - | - -# **transferLdusdtForPortfolioMargin** -> TransferLdusdtForPortfolioMarginResponse transferLdusdtForPortfolioMargin(transferLdusdtForPortfolioMarginRequest) + +# **transferLdusdtRwusdForPortfolioMargin** +> TransferLdusdtRwusdForPortfolioMarginResponse transferLdusdtRwusdForPortfolioMargin(transferLdusdtRwusdForPortfolioMarginRequest) -Transfer LDUSDT for Portfolio Margin(TRADE) +Transfer LDUSDT/RWUSD for Portfolio Margin(TRADE) -Transfer LDUSDT as collateral for all types of Portfolio Margin account Weight: 1500 +Transfer LDUSDT/RWUSD as collateral for all types of Portfolio Margin account Weight: 1500 ### Example ```java @@ -1060,12 +934,12 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); AccountApi apiInstance = new AccountApi(defaultClient); - TransferLdusdtForPortfolioMarginRequest transferLdusdtForPortfolioMarginRequest = new TransferLdusdtForPortfolioMarginRequest(); // TransferLdusdtForPortfolioMarginRequest | + TransferLdusdtRwusdForPortfolioMarginRequest transferLdusdtRwusdForPortfolioMarginRequest = new TransferLdusdtRwusdForPortfolioMarginRequest(); // TransferLdusdtRwusdForPortfolioMarginRequest | try { - TransferLdusdtForPortfolioMarginResponse result = apiInstance.transferLdusdtForPortfolioMargin(transferLdusdtForPortfolioMarginRequest); + TransferLdusdtRwusdForPortfolioMarginResponse result = apiInstance.transferLdusdtRwusdForPortfolioMargin(transferLdusdtRwusdForPortfolioMarginRequest); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AccountApi#transferLdusdtForPortfolioMargin"); + System.err.println("Exception when calling AccountApi#transferLdusdtRwusdForPortfolioMargin"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -1079,11 +953,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **transferLdusdtForPortfolioMarginRequest** | [**TransferLdusdtForPortfolioMarginRequest**](TransferLdusdtForPortfolioMarginRequest.md)| | | +| **transferLdusdtRwusdForPortfolioMarginRequest** | [**TransferLdusdtRwusdForPortfolioMarginRequest**](TransferLdusdtRwusdForPortfolioMarginRequest.md)| | | ### Return type -[**TransferLdusdtForPortfolioMarginResponse**](TransferLdusdtForPortfolioMarginResponse.md) +[**TransferLdusdtRwusdForPortfolioMarginResponse**](TransferLdusdtRwusdForPortfolioMarginResponse.md) ### Authorization @@ -1097,5 +971,5 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Transfer LDUSDT for Portfolio Margin | - | +| **200** | Transfer LDUSDT/RWUSD for Portfolio Margin | - | diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/TransferLdusdtRwusdForPortfolioMarginRequest.md b/clients/derivatives-trading-portfolio-margin-pro/docs/TransferLdusdtRwusdForPortfolioMarginRequest.md new file mode 100644 index 00000000..ace75106 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/TransferLdusdtRwusdForPortfolioMarginRequest.md @@ -0,0 +1,16 @@ + + +# TransferLdusdtRwusdForPortfolioMarginRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**asset** | **String** | | | +|**transferType** | **String** | | | +|**amount** | **Double** | | | +|**recvWindow** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/TransferLdusdtRwusdForPortfolioMarginResponse.md b/clients/derivatives-trading-portfolio-margin-pro/docs/TransferLdusdtRwusdForPortfolioMarginResponse.md new file mode 100644 index 00000000..86b58864 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/TransferLdusdtRwusdForPortfolioMarginResponse.md @@ -0,0 +1,13 @@ + + +# TransferLdusdtRwusdForPortfolioMarginResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**msg** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md b/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md index 64b048aa..c2f3c045 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-portfolio-margin-pro - 4.0.1 + 5.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-portfolio-margin-pro - 4.0.0 + 5.0.0 ``` diff --git a/clients/derivatives-trading-portfolio-margin-pro/example_rest.md b/clients/derivatives-trading-portfolio-margin-pro/example_rest.md index 30998994..9e7f6067 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/example_rest.md +++ b/clients/derivatives-trading-portfolio-margin-pro/example_rest.md @@ -18,8 +18,6 @@ [GET /sapi/v1/portfolio/earn-asset-balance](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Transferable-Earn-Asset-Balance-for-Portfolio-Margin) - getTransferableEarnAssetBalanceForPortfolioMargin - [GetTransferableEarnAssetBalanceForPortfolioMarginExample.java:47](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/GetTransferableEarnAssetBalanceForPortfolioMarginExample.java#L47) -[POST /sapi/v1/portfolio/mint](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Mint-BFUSD-Portfolio-Margin) - mintBfusdForPortfolioMargin - [MintBfusdForPortfolioMarginExample.java:48](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/MintBfusdForPortfolioMarginExample.java#L48) - [POST /sapi/v1/portfolio/repay](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Classic-Portfolio-Margin-Bankruptcy-Loan-Repay) - portfolioMarginProBankruptcyLoanRepay - [PortfolioMarginProBankruptcyLoanRepayExample.java:48](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/PortfolioMarginProBankruptcyLoanRepayExample.java#L48) [GET /sapi/v1/portfolio/pmLoan](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount) - queryPortfolioMarginProBankruptcyLoanAmount - [QueryPortfolioMarginProBankruptcyLoanAmountExample.java:48](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/QueryPortfolioMarginProBankruptcyLoanAmountExample.java#L48) @@ -28,11 +26,9 @@ [GET /sapi/v1/portfolio/interest-history](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History) - queryPortfolioMarginProNegativeBalanceInterestHistory - [QueryPortfolioMarginProNegativeBalanceInterestHistoryExample.java:47](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/QueryPortfolioMarginProNegativeBalanceInterestHistoryExample.java#L47) -[POST /sapi/v1/portfolio/redeem](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Redeem-BFUSD-Portfolio-Margin) - redeemBfusdForPortfolioMargin - [RedeemBfusdForPortfolioMarginExample.java:48](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/RedeemBfusdForPortfolioMarginExample.java#L48) - [POST /sapi/v1/portfolio/repay-futures-negative-balance](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Repay-futures-Negative-Balance) - repayFuturesNegativeBalance - [RepayFuturesNegativeBalanceExample.java:48](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/RepayFuturesNegativeBalanceExample.java#L48) -[POST /sapi/v1/portfolio/earn-asset-transfer](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Transfer-LDUSDT-Portfolio-Margin) - transferLdusdtForPortfolioMargin - [TransferLdusdtForPortfolioMarginExample.java:48](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/TransferLdusdtForPortfolioMarginExample.java#L48) +[POST /sapi/v1/portfolio/earn-asset-transfer](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Transfer-LDUSDT-Portfolio-Margin) - transferLdusdtRwusdForPortfolioMargin - [TransferLdusdtRwusdForPortfolioMarginExample.java:48](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/TransferLdusdtRwusdForPortfolioMarginExample.java#L48) ## MarketData diff --git a/clients/derivatives-trading-portfolio-margin-pro/pom.xml b/clients/derivatives-trading-portfolio-margin-pro/pom.xml index d11cb677..a470cdb0 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/pom.xml +++ b/clients/derivatives-trading-portfolio-margin-pro/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-portfolio-margin-pro derivatives-trading-portfolio-margin-pro - 4.0.1 + 5.0.0 jar diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/JSON.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/JSON.java index a8faa4b1..874b974e 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/JSON.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/JSON.java @@ -162,12 +162,6 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model .GetTransferableEarnAssetBalanceForPortfolioMarginResponse .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model - .MintBfusdForPortfolioMarginRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model - .MintBfusdForPortfolioMarginResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model .PortfolioMarginCollateralRateResponse.CustomTypeAdapterFactory()); @@ -218,12 +212,6 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model .QueryPortfolioMarginProNegativeBalanceInterestHistoryResponseInner .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model - .RedeemBfusdForPortfolioMarginRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model - .RedeemBfusdForPortfolioMarginResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model .RepayFuturesNegativeBalanceRequest.CustomTypeAdapterFactory()); @@ -232,10 +220,10 @@ private static Class getClassByDiscriminator( .RepayFuturesNegativeBalanceResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model - .TransferLdusdtForPortfolioMarginRequest.CustomTypeAdapterFactory()); + .TransferLdusdtRwusdForPortfolioMarginRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model - .TransferLdusdtForPortfolioMarginResponse.CustomTypeAdapterFactory()); + .TransferLdusdtRwusdForPortfolioMarginResponse.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApi.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApi.java index b5b32445..6d70f92f 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApi.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApi.java @@ -33,19 +33,15 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginProAccountInfoResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginProSpanAccountInfoResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetTransferableEarnAssetBalanceForPortfolioMarginResponse; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.MintBfusdForPortfolioMarginRequest; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.MintBfusdForPortfolioMarginResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.PortfolioMarginProBankruptcyLoanRepayRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.PortfolioMarginProBankruptcyLoanRepayResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.QueryPortfolioMarginProBankruptcyLoanAmountResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.QueryPortfolioMarginProBankruptcyLoanRepayHistoryResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.QueryPortfolioMarginProNegativeBalanceInterestHistoryResponse; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RedeemBfusdForPortfolioMarginRequest; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RedeemBfusdForPortfolioMarginResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RepayFuturesNegativeBalanceRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RepayFuturesNegativeBalanceResponse; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtForPortfolioMarginRequest; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtForPortfolioMarginResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtRwusdForPortfolioMarginRequest; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtRwusdForPortfolioMarginResponse; import com.google.gson.reflect.TypeToken; import jakarta.validation.ConstraintViolation; import jakarta.validation.Valid; @@ -69,7 +65,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin-pro/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin-pro/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -1392,166 +1388,6 @@ private okhttp3.Call getTransferableEarnAssetBalanceForPortfolioMarginValidateBe return localVarApiClient.execute(localVarCall, localVarReturnType); } - /** - * Build call for mintBfusdForPortfolioMargin - * - * @param mintBfusdForPortfolioMarginRequest (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Mint BFUSD for Portfolio Margin -
- * - * @see Mint - * BFUSD for Portfolio Margin(TRADE) Documentation - */ - private okhttp3.Call mintBfusdForPortfolioMarginCall( - MintBfusdForPortfolioMarginRequest mintBfusdForPortfolioMarginRequest) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/portfolio/mint"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (mintBfusdForPortfolioMarginRequest.getFromAsset() != null) { - localVarFormParams.put("fromAsset", mintBfusdForPortfolioMarginRequest.getFromAsset()); - } - - if (mintBfusdForPortfolioMarginRequest.getTargetAsset() != null) { - localVarFormParams.put( - "targetAsset", mintBfusdForPortfolioMarginRequest.getTargetAsset()); - } - - if (mintBfusdForPortfolioMarginRequest.getAmount() != null) { - localVarFormParams.put( - "amount", - DecimalFormatter.getFormatter() - .format(mintBfusdForPortfolioMarginRequest.getAmount())); - } - - if (mintBfusdForPortfolioMarginRequest.getRecvWindow() != null) { - localVarFormParams.put( - "recvWindow", mintBfusdForPortfolioMarginRequest.getRecvWindow()); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call mintBfusdForPortfolioMarginValidateBeforeCall( - MintBfusdForPortfolioMarginRequest mintBfusdForPortfolioMarginRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {mintBfusdForPortfolioMarginRequest}; - Method method = - this.getClass() - .getMethod( - "mintBfusdForPortfolioMargin", - MintBfusdForPortfolioMarginRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return mintBfusdForPortfolioMarginCall(mintBfusdForPortfolioMarginRequest); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Mint BFUSD for Portfolio Margin(TRADE) Mint BFUSD for all types of Portfolio Margin account - * Weight: 1500 - * - * @param mintBfusdForPortfolioMarginRequest (required) - * @return ApiResponse<MintBfusdForPortfolioMarginResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Mint BFUSD for Portfolio Margin -
- * - * @see Mint - * BFUSD for Portfolio Margin(TRADE) Documentation - */ - public ApiResponse mintBfusdForPortfolioMargin( - @Valid @NotNull MintBfusdForPortfolioMarginRequest mintBfusdForPortfolioMarginRequest) - throws ApiException { - okhttp3.Call localVarCall = - mintBfusdForPortfolioMarginValidateBeforeCall(mintBfusdForPortfolioMarginRequest); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - /** * Build call for portfolioMarginProBankruptcyLoanRepay * @@ -2201,169 +2037,6 @@ private okhttp3.Call queryPortfolioMarginProNegativeBalanceInterestHistoryValida return localVarApiClient.execute(localVarCall, localVarReturnType); } - /** - * Build call for redeemBfusdForPortfolioMargin - * - * @param redeemBfusdForPortfolioMarginRequest (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Redeem BFUSD for Portfolio Margin -
- * - * @see Redeem - * BFUSD for Portfolio Margin(TRADE) Documentation - */ - private okhttp3.Call redeemBfusdForPortfolioMarginCall( - RedeemBfusdForPortfolioMarginRequest redeemBfusdForPortfolioMarginRequest) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/portfolio/redeem"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (redeemBfusdForPortfolioMarginRequest.getFromAsset() != null) { - localVarFormParams.put( - "fromAsset", redeemBfusdForPortfolioMarginRequest.getFromAsset()); - } - - if (redeemBfusdForPortfolioMarginRequest.getTargetAsset() != null) { - localVarFormParams.put( - "targetAsset", redeemBfusdForPortfolioMarginRequest.getTargetAsset()); - } - - if (redeemBfusdForPortfolioMarginRequest.getAmount() != null) { - localVarFormParams.put( - "amount", - DecimalFormatter.getFormatter() - .format(redeemBfusdForPortfolioMarginRequest.getAmount())); - } - - if (redeemBfusdForPortfolioMarginRequest.getRecvWindow() != null) { - localVarFormParams.put( - "recvWindow", redeemBfusdForPortfolioMarginRequest.getRecvWindow()); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call redeemBfusdForPortfolioMarginValidateBeforeCall( - RedeemBfusdForPortfolioMarginRequest redeemBfusdForPortfolioMarginRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {redeemBfusdForPortfolioMarginRequest}; - Method method = - this.getClass() - .getMethod( - "redeemBfusdForPortfolioMargin", - RedeemBfusdForPortfolioMarginRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return redeemBfusdForPortfolioMarginCall(redeemBfusdForPortfolioMarginRequest); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Redeem BFUSD for Portfolio Margin(TRADE) Redeem BFUSD for all types of Portfolio Margin - * account Weight: 1500 - * - * @param redeemBfusdForPortfolioMarginRequest (required) - * @return ApiResponse<RedeemBfusdForPortfolioMarginResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Redeem BFUSD for Portfolio Margin -
- * - * @see Redeem - * BFUSD for Portfolio Margin(TRADE) Documentation - */ - public ApiResponse redeemBfusdForPortfolioMargin( - @Valid @NotNull - RedeemBfusdForPortfolioMarginRequest redeemBfusdForPortfolioMarginRequest) - throws ApiException { - okhttp3.Call localVarCall = - redeemBfusdForPortfolioMarginValidateBeforeCall( - redeemBfusdForPortfolioMarginRequest); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - /** * Build call for repayFuturesNegativeBalance * @@ -2512,24 +2185,25 @@ public ApiResponse repayFuturesNegativeBala } /** - * Build call for transferLdusdtForPortfolioMargin + * Build call for transferLdusdtRwusdForPortfolioMargin * - * @param transferLdusdtForPortfolioMarginRequest (required) + * @param transferLdusdtRwusdForPortfolioMarginRequest (required) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Transfer LDUSDT for Portfolio Margin -
200 Transfer LDUSDT/RWUSD for Portfolio Margin -
* * @see Transfer - * LDUSDT for Portfolio Margin(TRADE) Documentation + * LDUSDT/RWUSD for Portfolio Margin(TRADE) Documentation */ - private okhttp3.Call transferLdusdtForPortfolioMarginCall( - TransferLdusdtForPortfolioMarginRequest transferLdusdtForPortfolioMarginRequest) + private okhttp3.Call transferLdusdtRwusdForPortfolioMarginCall( + TransferLdusdtRwusdForPortfolioMarginRequest + transferLdusdtRwusdForPortfolioMarginRequest) throws ApiException { String basePath = null; // Operation Servers @@ -2555,25 +2229,26 @@ private okhttp3.Call transferLdusdtForPortfolioMarginCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (transferLdusdtForPortfolioMarginRequest.getAsset() != null) { - localVarFormParams.put("asset", transferLdusdtForPortfolioMarginRequest.getAsset()); + if (transferLdusdtRwusdForPortfolioMarginRequest.getAsset() != null) { + localVarFormParams.put( + "asset", transferLdusdtRwusdForPortfolioMarginRequest.getAsset()); } - if (transferLdusdtForPortfolioMarginRequest.getTransferType() != null) { + if (transferLdusdtRwusdForPortfolioMarginRequest.getTransferType() != null) { localVarFormParams.put( - "transferType", transferLdusdtForPortfolioMarginRequest.getTransferType()); + "transferType", transferLdusdtRwusdForPortfolioMarginRequest.getTransferType()); } - if (transferLdusdtForPortfolioMarginRequest.getAmount() != null) { + if (transferLdusdtRwusdForPortfolioMarginRequest.getAmount() != null) { localVarFormParams.put( "amount", DecimalFormatter.getFormatter() - .format(transferLdusdtForPortfolioMarginRequest.getAmount())); + .format(transferLdusdtRwusdForPortfolioMarginRequest.getAmount())); } - if (transferLdusdtForPortfolioMarginRequest.getRecvWindow() != null) { + if (transferLdusdtRwusdForPortfolioMarginRequest.getRecvWindow() != null) { localVarFormParams.put( - "recvWindow", transferLdusdtForPortfolioMarginRequest.getRecvWindow()); + "recvWindow", transferLdusdtRwusdForPortfolioMarginRequest.getRecvWindow()); } final String[] localVarAccepts = {"application/json"}; @@ -2607,8 +2282,9 @@ private okhttp3.Call transferLdusdtForPortfolioMarginCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call transferLdusdtForPortfolioMarginValidateBeforeCall( - TransferLdusdtForPortfolioMarginRequest transferLdusdtForPortfolioMarginRequest) + private okhttp3.Call transferLdusdtRwusdForPortfolioMarginValidateBeforeCall( + TransferLdusdtRwusdForPortfolioMarginRequest + transferLdusdtRwusdForPortfolioMarginRequest) throws ApiException { try { Validator validator = @@ -2619,18 +2295,18 @@ private okhttp3.Call transferLdusdtForPortfolioMarginValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {transferLdusdtForPortfolioMarginRequest}; + Object[] parameterValues = {transferLdusdtRwusdForPortfolioMarginRequest}; Method method = this.getClass() .getMethod( - "transferLdusdtForPortfolioMargin", - TransferLdusdtForPortfolioMarginRequest.class); + "transferLdusdtRwusdForPortfolioMargin", + TransferLdusdtRwusdForPortfolioMarginRequest.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return transferLdusdtForPortfolioMarginCall( - transferLdusdtForPortfolioMarginRequest); + return transferLdusdtRwusdForPortfolioMarginCall( + transferLdusdtRwusdForPortfolioMarginRequest); } else { throw new ConstraintViolationException((Set) violations); } @@ -2644,33 +2320,35 @@ private okhttp3.Call transferLdusdtForPortfolioMarginValidateBeforeCall( } /** - * Transfer LDUSDT for Portfolio Margin(TRADE) Transfer LDUSDT as collateral for all types of - * Portfolio Margin account Weight: 1500 + * Transfer LDUSDT/RWUSD for Portfolio Margin(TRADE) Transfer LDUSDT/RWUSD as collateral for all + * types of Portfolio Margin account Weight: 1500 * - * @param transferLdusdtForPortfolioMarginRequest (required) - * @return ApiResponse<TransferLdusdtForPortfolioMarginResponse> + * @param transferLdusdtRwusdForPortfolioMarginRequest (required) + * @return ApiResponse<TransferLdusdtRwusdForPortfolioMarginResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Transfer LDUSDT for Portfolio Margin -
200 Transfer LDUSDT/RWUSD for Portfolio Margin -
* * @see Transfer - * LDUSDT for Portfolio Margin(TRADE) Documentation + * LDUSDT/RWUSD for Portfolio Margin(TRADE) Documentation */ - public ApiResponse transferLdusdtForPortfolioMargin( - @Valid @NotNull - TransferLdusdtForPortfolioMarginRequest transferLdusdtForPortfolioMarginRequest) - throws ApiException { + public ApiResponse + transferLdusdtRwusdForPortfolioMargin( + @Valid @NotNull + TransferLdusdtRwusdForPortfolioMarginRequest + transferLdusdtRwusdForPortfolioMarginRequest) + throws ApiException { okhttp3.Call localVarCall = - transferLdusdtForPortfolioMarginValidateBeforeCall( - transferLdusdtForPortfolioMarginRequest); + transferLdusdtRwusdForPortfolioMarginValidateBeforeCall( + transferLdusdtRwusdForPortfolioMarginRequest); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } } diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/DerivativesTradingPortfolioMarginProRestApi.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/DerivativesTradingPortfolioMarginProRestApi.java index 5dd2ebc8..e3314533 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/DerivativesTradingPortfolioMarginProRestApi.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/DerivativesTradingPortfolioMarginProRestApi.java @@ -19,8 +19,6 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginProAccountInfoResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginProSpanAccountInfoResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetTransferableEarnAssetBalanceForPortfolioMarginResponse; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.MintBfusdForPortfolioMarginRequest; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.MintBfusdForPortfolioMarginResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.PortfolioMarginCollateralRateResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.PortfolioMarginProBankruptcyLoanRepayRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.PortfolioMarginProBankruptcyLoanRepayResponse; @@ -29,12 +27,10 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.QueryPortfolioMarginProBankruptcyLoanAmountResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.QueryPortfolioMarginProBankruptcyLoanRepayHistoryResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.QueryPortfolioMarginProNegativeBalanceInterestHistoryResponse; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RedeemBfusdForPortfolioMarginRequest; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RedeemBfusdForPortfolioMarginResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RepayFuturesNegativeBalanceRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RepayFuturesNegativeBalanceResponse; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtForPortfolioMarginRequest; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtForPortfolioMarginResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtRwusdForPortfolioMarginRequest; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtRwusdForPortfolioMarginResponse; public class DerivativesTradingPortfolioMarginProRestApi { @@ -271,31 +267,6 @@ public ApiResponse getPortfolioMarginP asset, transferType, recvWindow); } - /** - * Mint BFUSD for Portfolio Margin(TRADE) Mint BFUSD for all types of Portfolio Margin account - * Weight: 1500 - * - * @param mintBfusdForPortfolioMarginRequest (required) - * @return ApiResponse<MintBfusdForPortfolioMarginResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Mint BFUSD for Portfolio Margin -
- * - * @see Mint - * BFUSD for Portfolio Margin(TRADE) Documentation - */ - public ApiResponse mintBfusdForPortfolioMargin( - MintBfusdForPortfolioMarginRequest mintBfusdForPortfolioMarginRequest) - throws ApiException { - return accountApi.mintBfusdForPortfolioMargin(mintBfusdForPortfolioMarginRequest); - } - /** * Portfolio Margin Pro Bankruptcy Loan Repay Repay Portfolio Margin Pro Bankruptcy Loan Weight: * 3000 @@ -416,31 +387,6 @@ public ApiResponse mintBfusdForPortfolioMar asset, startTime, endTime, size, recvWindow); } - /** - * Redeem BFUSD for Portfolio Margin(TRADE) Redeem BFUSD for all types of Portfolio Margin - * account Weight: 1500 - * - * @param redeemBfusdForPortfolioMarginRequest (required) - * @return ApiResponse<RedeemBfusdForPortfolioMarginResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Redeem BFUSD for Portfolio Margin -
- * - * @see Redeem - * BFUSD for Portfolio Margin(TRADE) Documentation - */ - public ApiResponse redeemBfusdForPortfolioMargin( - RedeemBfusdForPortfolioMarginRequest redeemBfusdForPortfolioMarginRequest) - throws ApiException { - return accountApi.redeemBfusdForPortfolioMargin(redeemBfusdForPortfolioMarginRequest); - } - /** * Repay futures Negative Balance(USER_DATA) Repay futures Negative Balance Weight: 1500 * @@ -466,28 +412,31 @@ public ApiResponse repayFuturesNegativeBala } /** - * Transfer LDUSDT for Portfolio Margin(TRADE) Transfer LDUSDT as collateral for all types of - * Portfolio Margin account Weight: 1500 + * Transfer LDUSDT/RWUSD for Portfolio Margin(TRADE) Transfer LDUSDT/RWUSD as collateral for all + * types of Portfolio Margin account Weight: 1500 * - * @param transferLdusdtForPortfolioMarginRequest (required) - * @return ApiResponse<TransferLdusdtForPortfolioMarginResponse> + * @param transferLdusdtRwusdForPortfolioMarginRequest (required) + * @return ApiResponse<TransferLdusdtRwusdForPortfolioMarginResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Transfer LDUSDT for Portfolio Margin -
200 Transfer LDUSDT/RWUSD for Portfolio Margin -
* * @see Transfer - * LDUSDT for Portfolio Margin(TRADE) Documentation + * LDUSDT/RWUSD for Portfolio Margin(TRADE) Documentation */ - public ApiResponse transferLdusdtForPortfolioMargin( - TransferLdusdtForPortfolioMarginRequest transferLdusdtForPortfolioMarginRequest) - throws ApiException { - return accountApi.transferLdusdtForPortfolioMargin(transferLdusdtForPortfolioMarginRequest); + public ApiResponse + transferLdusdtRwusdForPortfolioMargin( + TransferLdusdtRwusdForPortfolioMarginRequest + transferLdusdtRwusdForPortfolioMarginRequest) + throws ApiException { + return accountApi.transferLdusdtRwusdForPortfolioMargin( + transferLdusdtRwusdForPortfolioMarginRequest); } /** diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/MarketDataApi.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/MarketDataApi.java index be5c5b80..61e799ad 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/MarketDataApi.java @@ -45,7 +45,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin-pro/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin-pro/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/TransferLdusdtRwusdForPortfolioMarginRequest.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/TransferLdusdtRwusdForPortfolioMarginRequest.java new file mode 100644 index 00000000..93842cc4 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/TransferLdusdtRwusdForPortfolioMarginRequest.java @@ -0,0 +1,351 @@ +/* + * Binance Derivatives Trading Portfolio Margin Pro REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model; + +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** TransferLdusdtRwusdForPortfolioMarginRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TransferLdusdtRwusdForPortfolioMarginRequest { + public static final String SERIALIZED_NAME_ASSET = "asset"; + + @SerializedName(SERIALIZED_NAME_ASSET) + @jakarta.annotation.Nonnull + private String asset; + + public static final String SERIALIZED_NAME_TRANSFER_TYPE = "transferType"; + + @SerializedName(SERIALIZED_NAME_TRANSFER_TYPE) + @jakarta.annotation.Nonnull + private String transferType; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + + @SerializedName(SERIALIZED_NAME_AMOUNT) + @jakarta.annotation.Nonnull + private Double amount; + + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Long recvWindow; + + public TransferLdusdtRwusdForPortfolioMarginRequest() {} + + public TransferLdusdtRwusdForPortfolioMarginRequest asset( + @jakarta.annotation.Nonnull String asset) { + this.asset = asset; + return this; + } + + /** + * Get asset + * + * @return asset + */ + @jakarta.annotation.Nonnull + @NotNull + public String getAsset() { + return asset; + } + + public void setAsset(@jakarta.annotation.Nonnull String asset) { + this.asset = asset; + } + + public TransferLdusdtRwusdForPortfolioMarginRequest transferType( + @jakarta.annotation.Nonnull String transferType) { + this.transferType = transferType; + return this; + } + + /** + * Get transferType + * + * @return transferType + */ + @jakarta.annotation.Nonnull + @NotNull + public String getTransferType() { + return transferType; + } + + public void setTransferType(@jakarta.annotation.Nonnull String transferType) { + this.transferType = transferType; + } + + public TransferLdusdtRwusdForPortfolioMarginRequest amount( + @jakarta.annotation.Nonnull Double amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * + * @return amount + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Double getAmount() { + return amount; + } + + public void setAmount(@jakarta.annotation.Nonnull Double amount) { + this.amount = amount; + } + + public TransferLdusdtRwusdForPortfolioMarginRequest recvWindow( + @jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + public Long getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferLdusdtRwusdForPortfolioMarginRequest transferLdusdtRwusdForPortfolioMarginRequest = + (TransferLdusdtRwusdForPortfolioMarginRequest) o; + return Objects.equals(this.asset, transferLdusdtRwusdForPortfolioMarginRequest.asset) + && Objects.equals( + this.transferType, + transferLdusdtRwusdForPortfolioMarginRequest.transferType) + && Objects.equals(this.amount, transferLdusdtRwusdForPortfolioMarginRequest.amount) + && Objects.equals( + this.recvWindow, transferLdusdtRwusdForPortfolioMarginRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash(asset, transferType, amount, recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferLdusdtRwusdForPortfolioMarginRequest {\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); + sb.append(" transferType: ").append(toIndentedString(transferType)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object assetValue = getAsset(); + String assetValueAsString = ""; + assetValueAsString = assetValue.toString(); + sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); + Object transferTypeValue = getTransferType(); + String transferTypeValueAsString = ""; + transferTypeValueAsString = transferTypeValue.toString(); + sb.append("transferType=").append(urlEncode(transferTypeValueAsString)).append(""); + Object amountValue = getAmount(); + String amountValueAsString = ""; + amountValueAsString = amountValue.toString(); + sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); + Object recvWindowValue = getRecvWindow(); + String recvWindowValueAsString = ""; + recvWindowValueAsString = recvWindowValue.toString(); + sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("asset"); + openapiFields.add("transferType"); + openapiFields.add("amount"); + openapiFields.add("recvWindow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("asset"); + openapiRequiredFields.add("transferType"); + openapiRequiredFields.add("amount"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * TransferLdusdtRwusdForPortfolioMarginRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TransferLdusdtRwusdForPortfolioMarginRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " TransferLdusdtRwusdForPortfolioMarginRequest is not found" + + " in the empty JSON string", + TransferLdusdtRwusdForPortfolioMarginRequest.openapiRequiredFields + .toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + TransferLdusdtRwusdForPortfolioMarginRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("asset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `asset` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("asset").toString())); + } + if (!jsonObj.get("transferType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transferType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("transferType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransferLdusdtRwusdForPortfolioMarginRequest.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'TransferLdusdtRwusdForPortfolioMarginRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(TransferLdusdtRwusdForPortfolioMarginRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, TransferLdusdtRwusdForPortfolioMarginRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferLdusdtRwusdForPortfolioMarginRequest read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TransferLdusdtRwusdForPortfolioMarginRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferLdusdtRwusdForPortfolioMarginRequest + * @throws IOException if the JSON string is invalid with respect to + * TransferLdusdtRwusdForPortfolioMarginRequest + */ + public static TransferLdusdtRwusdForPortfolioMarginRequest fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, TransferLdusdtRwusdForPortfolioMarginRequest.class); + } + + /** + * Convert an instance of TransferLdusdtRwusdForPortfolioMarginRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/TransferLdusdtRwusdForPortfolioMarginResponse.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/TransferLdusdtRwusdForPortfolioMarginResponse.java new file mode 100644 index 00000000..1b125b56 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/TransferLdusdtRwusdForPortfolioMarginResponse.java @@ -0,0 +1,225 @@ +/* + * Binance Derivatives Trading Portfolio Margin Pro REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model; + +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** TransferLdusdtRwusdForPortfolioMarginResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TransferLdusdtRwusdForPortfolioMarginResponse { + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public TransferLdusdtRwusdForPortfolioMarginResponse() {} + + public TransferLdusdtRwusdForPortfolioMarginResponse msg( + @jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferLdusdtRwusdForPortfolioMarginResponse + transferLdusdtRwusdForPortfolioMarginResponse = + (TransferLdusdtRwusdForPortfolioMarginResponse) o; + return Objects.equals(this.msg, transferLdusdtRwusdForPortfolioMarginResponse.msg); + } + + @Override + public int hashCode() { + return Objects.hash(msg); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferLdusdtRwusdForPortfolioMarginResponse {\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("msg"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * TransferLdusdtRwusdForPortfolioMarginResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TransferLdusdtRwusdForPortfolioMarginResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " TransferLdusdtRwusdForPortfolioMarginResponse is not found" + + " in the empty JSON string", + TransferLdusdtRwusdForPortfolioMarginResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransferLdusdtRwusdForPortfolioMarginResponse.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'TransferLdusdtRwusdForPortfolioMarginResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(TransferLdusdtRwusdForPortfolioMarginResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, TransferLdusdtRwusdForPortfolioMarginResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferLdusdtRwusdForPortfolioMarginResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TransferLdusdtRwusdForPortfolioMarginResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferLdusdtRwusdForPortfolioMarginResponse + * @throws IOException if the JSON string is invalid with respect to + * TransferLdusdtRwusdForPortfolioMarginResponse + */ + public static TransferLdusdtRwusdForPortfolioMarginResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, TransferLdusdtRwusdForPortfolioMarginResponse.class); + } + + /** + * Convert an instance of TransferLdusdtRwusdForPortfolioMarginResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java index 4766ca26..8731ff31 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java @@ -19,7 +19,7 @@ public class DerivativesTradingPortfolioMarginProWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin-pro/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin-pro/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/test/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApiTest.java b/clients/derivatives-trading-portfolio-margin-pro/src/test/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApiTest.java index e7b7f96a..30e44cab 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/test/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApiTest.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/test/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApiTest.java @@ -355,44 +355,6 @@ public void getPortfolioMarginProSpanAccountInfoTest() throws ApiException, Cryp assertEquals("/sapi/v2/portfolio/account", actualRequest.url().encodedPath()); } - /** - * Mint BFUSD for Portfolio Margin(TRADE) - * - *

Mint BFUSD for all types of Portfolio Margin account Weight: 1500 - * - * @throws ApiException if the Api call fails - */ - @Test - public void mintBfusdForPortfolioMarginTest() throws ApiException, CryptoException { - MintBfusdForPortfolioMarginRequest mintBfusdForPortfolioMarginRequest = - new MintBfusdForPortfolioMarginRequest(); - - mintBfusdForPortfolioMarginRequest.fromAsset(""); - mintBfusdForPortfolioMarginRequest.targetAsset(""); - mintBfusdForPortfolioMarginRequest.amount(1d); - - ApiResponse response = - api.mintBfusdForPortfolioMargin(mintBfusdForPortfolioMarginRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "timestamp=1736393892000amount=1&targetAsset=&fromAsset=", - signInputCaptor.getValue()); - assertEquals( - "d714bfb2f91e65ebbaad39e62d090ec5733259dbebd895824c737a3a2585eff5", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/portfolio/mint", actualRequest.url().encodedPath()); - } - /** * Portfolio Margin Pro Bankruptcy Loan Repay * @@ -533,44 +495,6 @@ public void queryPortfolioMarginProNegativeBalanceInterestHistoryTest() assertEquals("/sapi/v1/portfolio/interest-history", actualRequest.url().encodedPath()); } - /** - * Redeem BFUSD for Portfolio Margin(TRADE) - * - *

Redeem BFUSD for all types of Portfolio Margin account Weight: 1500 - * - * @throws ApiException if the Api call fails - */ - @Test - public void redeemBfusdForPortfolioMarginTest() throws ApiException, CryptoException { - RedeemBfusdForPortfolioMarginRequest redeemBfusdForPortfolioMarginRequest = - new RedeemBfusdForPortfolioMarginRequest(); - - redeemBfusdForPortfolioMarginRequest.fromAsset(""); - redeemBfusdForPortfolioMarginRequest.targetAsset(""); - redeemBfusdForPortfolioMarginRequest.amount(1d); - - ApiResponse response = - api.redeemBfusdForPortfolioMargin(redeemBfusdForPortfolioMarginRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "timestamp=1736393892000amount=1&targetAsset=&fromAsset=", - signInputCaptor.getValue()); - assertEquals( - "d714bfb2f91e65ebbaad39e62d090ec5733259dbebd895824c737a3a2585eff5", - actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/portfolio/redeem", actualRequest.url().encodedPath()); - } - /** * Repay futures Negative Balance(USER_DATA) * diff --git a/clients/derivatives-trading-portfolio-margin/CHANGELOG.md b/clients/derivatives-trading-portfolio-margin/CHANGELOG.md index d8fc853e..2c0deca8 100644 --- a/clients/derivatives-trading-portfolio-margin/CHANGELOG.md +++ b/clients/derivatives-trading-portfolio-margin/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 4.0.0 - 2025-12-16 + +### Changed (1) + +#### WebSocket Streams + +- Modified response for `userData()` method: + - removed `M` from `Executionreport` + ## 3.0.0 - 2025-09-22 ### Changed (2) diff --git a/clients/derivatives-trading-portfolio-margin/docs/Executionreport.md b/clients/derivatives-trading-portfolio-margin/docs/Executionreport.md index fbbdce5b..2aa03c5f 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/Executionreport.md +++ b/clients/derivatives-trading-portfolio-margin/docs/Executionreport.md @@ -35,7 +35,6 @@ |**I** | **Long** | | [optional] | |**wLowerCase** | **Boolean** | | [optional] | |**mLowerCase** | **Boolean** | | [optional] | -|**M** | **Boolean** | | [optional] | |**O** | **Long** | | [optional] | |**Z** | **String** | | [optional] | |**Y** | **String** | | [optional] | diff --git a/clients/derivatives-trading-portfolio-margin/docs/UserDataStreamEventsResponse.md b/clients/derivatives-trading-portfolio-margin/docs/UserDataStreamEventsResponse.md index 3365f94f..d9b7f16f 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/UserDataStreamEventsResponse.md +++ b/clients/derivatives-trading-portfolio-margin/docs/UserDataStreamEventsResponse.md @@ -42,7 +42,6 @@ |**I** | **Long** | | [optional] | |**wLowerCase** | **Boolean** | | [optional] | |**mLowerCase** | **String** | | [optional] | -|**M** | **Boolean** | | [optional] | |**O** | [**List<OpenorderlossOInner>**](OpenorderlossOInner.md) | | [optional] | |**Z** | **String** | | [optional] | |**Y** | **String** | | [optional] | diff --git a/clients/derivatives-trading-portfolio-margin/docs/rest-api/migration-guide.md b/clients/derivatives-trading-portfolio-margin/docs/rest-api/migration-guide.md index b72414ea..38b71dd3 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-portfolio-margin/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-portfolio-margin - 3.0.1 + 4.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-portfolio-margin - 3.0.0 + 4.0.0 ``` diff --git a/clients/derivatives-trading-portfolio-margin/pom.xml b/clients/derivatives-trading-portfolio-margin/pom.xml index 26bc90a9..41415ecd 100644 --- a/clients/derivatives-trading-portfolio-margin/pom.xml +++ b/clients/derivatives-trading-portfolio-margin/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-portfolio-margin derivatives-trading-portfolio-margin - 3.0.1 + 4.0.0 jar diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/AccountApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/AccountApi.java index b3778a54..e0bf9ff3 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/AccountApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/AccountApi.java @@ -94,7 +94,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/MarketDataApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/MarketDataApi.java index d658cc27..3c257647 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/MarketDataApi.java @@ -40,7 +40,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/TradeApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/TradeApi.java index 3216e3dc..bbfa13ac 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/TradeApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/TradeApi.java @@ -112,7 +112,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/UserDataStreamsApi.java index 10dd885b..809dcdc8 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/UserDataStreamsApi.java @@ -42,7 +42,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java index 6588ca37..a50f7586 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java @@ -19,7 +19,7 @@ public class DerivativesTradingPortfolioMarginWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/3.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Executionreport.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Executionreport.java index 7491de85..0643340a 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Executionreport.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/model/Executionreport.java @@ -207,12 +207,6 @@ public class Executionreport extends BaseDTO { @jakarta.annotation.Nullable private Boolean mLowerCase; - public static final String SERIALIZED_NAME_M = "M"; - - @SerializedName(SERIALIZED_NAME_M) - @jakarta.annotation.Nullable - private Boolean M; - public static final String SERIALIZED_NAME_O = "O"; @SerializedName(SERIALIZED_NAME_O) @@ -825,25 +819,6 @@ public void setmLowerCase(@jakarta.annotation.Nullable Boolean mLowerCase) { this.mLowerCase = mLowerCase; } - public Executionreport M(@jakarta.annotation.Nullable Boolean M) { - this.M = M; - return this; - } - - /** - * Get M - * - * @return M - */ - @jakarta.annotation.Nullable - public Boolean getM() { - return M; - } - - public void setM(@jakarta.annotation.Nullable Boolean M) { - this.M = M; - } - public Executionreport O(@jakarta.annotation.Nullable Long O) { this.O = O; return this; @@ -1128,7 +1103,6 @@ public boolean equals(Object o) { && Objects.equals(this.I, executionreport.I) && Objects.equals(this.wLowerCase, executionreport.wLowerCase) && Objects.equals(this.mLowerCase, executionreport.mLowerCase) - && Objects.equals(this.M, executionreport.M) && Objects.equals(this.O, executionreport.O) && Objects.equals(this.Z, executionreport.Z) && Objects.equals(this.Y, executionreport.Y) @@ -1175,7 +1149,6 @@ public int hashCode() { I, wLowerCase, mLowerCase, - M, O, Z, Y, @@ -1223,7 +1196,6 @@ public String toString() { sb.append(" I: ").append(toIndentedString(I)).append("\n"); sb.append(" wLowerCase: ").append(toIndentedString(wLowerCase)).append("\n"); sb.append(" mLowerCase: ").append(toIndentedString(mLowerCase)).append("\n"); - sb.append(" M: ").append(toIndentedString(M)).append("\n"); sb.append(" O: ").append(toIndentedString(O)).append("\n"); sb.append(" Z: ").append(toIndentedString(Z)).append("\n"); sb.append(" Y: ").append(toIndentedString(Y)).append("\n"); @@ -1385,11 +1357,6 @@ public String toUrlQueryString() { String mLowerCaseValueAsString = mLowerCaseValue.toString(); valMap.put("mLowerCase", mLowerCaseValueAsString); } - Boolean MValue = getM(); - if (MValue != null) { - String MValueAsString = MValue.toString(); - valMap.put("M", MValueAsString); - } Long OValue = getO(); if (OValue != null) { String OValueAsString = OValue.toString(); @@ -1578,10 +1545,6 @@ public Map toMap() { if (mLowerCaseValue != null) { valMap.put("mLowerCase", mLowerCaseValue); } - Object MValue = getM(); - if (MValue != null) { - valMap.put("M", MValue); - } Object OValue = getO(); if (OValue != null) { valMap.put("O", OValue); @@ -1688,7 +1651,6 @@ private String toIndentedString(Object o) { openapiFields.add("I"); openapiFields.add("w"); openapiFields.add("m"); - openapiFields.add("M"); openapiFields.add("O"); openapiFields.add("Z"); openapiFields.add("Y"); diff --git a/clients/derivatives-trading-usds-futures/CHANGELOG.md b/clients/derivatives-trading-usds-futures/CHANGELOG.md index 011cfdd0..b5ab399d 100644 --- a/clients/derivatives-trading-usds-futures/CHANGELOG.md +++ b/clients/derivatives-trading-usds-futures/CHANGELOG.md @@ -1,5 +1,89 @@ # Changelog +## 7.0.0 - 2025-12-16 + +### Added (14) + +#### REST API + +- `adlRisk()` (`GET /fapi/v1/symbolAdlRisk`) +- `cancelAlgoOrder()` (`DELETE /fapi/v1/algoOrder`) +- `cancelAllAlgoOpenOrders()` (`DELETE /fapi/v1/algoOpenOrders`) +- `currentAllAlgoOpenOrders()` (`GET /fapi/v1/openAlgoOrders`) +- `futuresTradfiPerpsContract()` (`POST /fapi/v1/stock/contract`) +- `newAlgoOrder()` (`POST /fapi/v1/algoOrder`) +- `queryAlgoOrder()` (`GET /fapi/v1/algoOrder`) +- `queryAllAlgoOrders()` (`GET /fapi/v1/allAlgoOrders`) +- `rpiOrderBook()` (`GET /fapi/v1/rpiDepth`) +- `tradingSchedule()` (`GET /fapi/v1/tradingSchedule`) + +#### WebSocket API + +- `cancelAlgoOrder()` (`algoOrder.cancel` method) +- `newAlgoOrder()` (`algoOrder.place` method) + +#### WebSocket Streams + +- `rpiDiffBookDepthStreams()` (`@rpiDepth@500ms` stream) +- `tradingSessionStream()` (`tradingSession` stream) + +### Changed (8) + +#### REST API + +- Modified parameter `batchOrders`: + - items.`activationPrice`: type `number` → `string` + - items.`callbackRate`: type `number` → `string` + - items.`goodTillDate`: type `integer` → `string` + - items.`price`: type `number` → `string` + - items.`quantity`: type `number` → `string` + - items.`stopPrice`: type `number` → `string` + - items.`timeInForce`: enum added: `RPI` + - items.`activationPrice`: type `number` → `string` + - items.`callbackRate`: type `number` → `string` + - items.`goodTillDate`: type `integer` → `string` + - items.`price`: type `number` → `string` + - items.`quantity`: type `number` → `string` + - items.`stopPrice`: type `number` → `string` + - items.`timeInForce`: enum added: `RPI` + - affected methods: + - `placeMultipleOrders()` (`POST /fapi/v1/batchOrders`) +- Modified parameter `batchOrders`: + - items.`orderId`: type `integer` → `string` + - items.`price`: type `number` → `string` + - items.`quantity`: type `number` → `string` + - items.`recvWindow`: type `integer` → `string` + - items.`orderId`: type `integer` → `string` + - items.`price`: type `number` → `string` + - items.`quantity`: type `number` → `string` + - items.`recvWindow`: type `integer` → `string` + - affected methods: + - `modifyMultipleOrders()` (`PUT /fapi/v1/batchOrders`) +- Modified parameter `timeInForce`: + - enum added: `RPI` + - affected methods: + - `newOrder()` (`POST /fapi/v1/order`) + - `testOrder()` (`POST /fapi/v1/order/test`) +- Modified response for `userCommissionRate()` (`GET /fapi/v1/commissionRate`): + - property `rpiCommissionRate` added + +- Modified response for `oldTradesLookup()` (`GET /fapi/v1/historicalTrades`): + - items: property `isRPITrade` added + - items: item property `isRPITrade` added + +- Modified response for `recentTradesList()` (`GET /fapi/v1/trades`): + - items: property `isRPITrade` added + - items: item property `isRPITrade` added + +- Marked `symbolPriceTicker()` (`GET /fapi/v1/ticker/price`) as deprecated. + +#### WebSocket API + +- Modified parameter `timeInForce`: + - enum added: `RPI` + - affected methods: + - `newOrder()` (`order.place` method) + ## 6.0.0 - 2025-10-21 ### Changed (21) diff --git a/clients/derivatives-trading-usds-futures/docs/AdlRiskResponse.md b/clients/derivatives-trading-usds-futures/docs/AdlRiskResponse.md new file mode 100644 index 00000000..66ff841c --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/AdlRiskResponse.md @@ -0,0 +1,15 @@ + + +# AdlRiskResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | [optional] | +|**adlRisk** | **String** | | [optional] | +|**updateTime** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/AdlRiskResponse1.md b/clients/derivatives-trading-usds-futures/docs/AdlRiskResponse1.md new file mode 100644 index 00000000..5d6f303f --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/AdlRiskResponse1.md @@ -0,0 +1,15 @@ + + +# AdlRiskResponse1 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | [optional] | +|**adlRisk** | **String** | | [optional] | +|**updateTime** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/AdlRiskResponse2.md b/clients/derivatives-trading-usds-futures/docs/AdlRiskResponse2.md new file mode 100644 index 00000000..d116a7ef --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/AdlRiskResponse2.md @@ -0,0 +1,12 @@ + + +# AdlRiskResponse2 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/clients/derivatives-trading-usds-futures/docs/AdlRiskResponse2Inner.md b/clients/derivatives-trading-usds-futures/docs/AdlRiskResponse2Inner.md new file mode 100644 index 00000000..a1c09145 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/AdlRiskResponse2Inner.md @@ -0,0 +1,15 @@ + + +# AdlRiskResponse2Inner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | [optional] | +|**adlRisk** | **String** | | [optional] | +|**updateTime** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/AlgoUpdate.md b/clients/derivatives-trading-usds-futures/docs/AlgoUpdate.md new file mode 100644 index 00000000..b90b25db --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/AlgoUpdate.md @@ -0,0 +1,15 @@ + + +# AlgoUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**T** | **Long** | | [optional] | +|**E** | **Long** | | [optional] | +|**oLowerCase** | [**AlgoUpdateO**](AlgoUpdateO.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/AlgoUpdateO.md b/clients/derivatives-trading-usds-futures/docs/AlgoUpdateO.md new file mode 100644 index 00000000..63ada92b --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/AlgoUpdateO.md @@ -0,0 +1,37 @@ + + +# AlgoUpdateO + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**caid** | **String** | | [optional] | +|**aid** | **Long** | | [optional] | +|**at** | **String** | | [optional] | +|**oLowerCase** | **String** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**S** | **String** | | [optional] | +|**ps** | **String** | | [optional] | +|**fLowerCase** | **String** | | [optional] | +|**qLowerCase** | **String** | | [optional] | +|**X** | **String** | | [optional] | +|**ai** | **String** | | [optional] | +|**ap** | **String** | | [optional] | +|**aq** | **String** | | [optional] | +|**act** | **String** | | [optional] | +|**tp** | **String** | | [optional] | +|**pLowerCase** | **String** | | [optional] | +|**V** | **String** | | [optional] | +|**wt** | **String** | | [optional] | +|**pm** | **String** | | [optional] | +|**cp** | **Boolean** | | [optional] | +|**pP** | **Boolean** | | [optional] | +|**R** | **Boolean** | | [optional] | +|**tt** | **Long** | | [optional] | +|**gtd** | **Long** | | [optional] | +|**rm** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/BatchOrdersInner.md b/clients/derivatives-trading-usds-futures/docs/BatchOrdersInner.md index d0469439..0e3d188f 100644 --- a/clients/derivatives-trading-usds-futures/docs/BatchOrdersInner.md +++ b/clients/derivatives-trading-usds-futures/docs/BatchOrdersInner.md @@ -7,14 +7,14 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**orderId** | **Long** | | [optional] | +|**orderId** | **String** | | [optional] | |**origClientOrderId** | **String** | | [optional] | |**symbol** | **String** | | [optional] | |**side** | [**SideEnum**](#SideEnum) | | [optional] | -|**quantity** | **Double** | | [optional] | -|**price** | **Double** | | [optional] | +|**quantity** | **String** | | [optional] | +|**price** | **String** | | [optional] | |**priceMatch** | [**PriceMatchEnum**](#PriceMatchEnum) | | [optional] | -|**recvWindow** | **Long** | | [optional] | +|**recvWindow** | **String** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/BatchOrdersPlaceMultipleOrdersInner.md b/clients/derivatives-trading-usds-futures/docs/BatchOrdersPlaceMultipleOrdersInner.md index 18576940..4a9612bf 100644 --- a/clients/derivatives-trading-usds-futures/docs/BatchOrdersPlaceMultipleOrdersInner.md +++ b/clients/derivatives-trading-usds-futures/docs/BatchOrdersPlaceMultipleOrdersInner.md @@ -12,19 +12,19 @@ |**positionSide** | [**PositionSideEnum**](#PositionSideEnum) | | [optional] | |**type** | **String** | | [optional] | |**timeInForce** | [**TimeInForceEnum**](#TimeInForceEnum) | | [optional] | -|**quantity** | **Double** | | [optional] | +|**quantity** | **String** | | [optional] | |**reduceOnly** | **String** | | [optional] | -|**price** | **Double** | | [optional] | +|**price** | **String** | | [optional] | |**newClientOrderId** | **String** | | [optional] | -|**stopPrice** | **Double** | | [optional] | -|**activationPrice** | **Double** | | [optional] | -|**callbackRate** | **Double** | | [optional] | +|**stopPrice** | **String** | | [optional] | +|**activationPrice** | **String** | | [optional] | +|**callbackRate** | **String** | | [optional] | |**workingType** | [**WorkingTypeEnum**](#WorkingTypeEnum) | | [optional] | |**priceProtect** | **String** | | [optional] | |**newOrderRespType** | [**NewOrderRespTypeEnum**](#NewOrderRespTypeEnum) | | [optional] | |**priceMatch** | [**PriceMatchEnum**](#PriceMatchEnum) | | [optional] | |**selfTradePreventionMode** | [**SelfTradePreventionModeEnum**](#SelfTradePreventionModeEnum) | | [optional] | -|**goodTillDate** | **Long** | | [optional] | +|**goodTillDate** | **String** | | [optional] | @@ -56,6 +56,7 @@ | FOK | "FOK" | | GTX | "GTX" | | GTD | "GTD" | +| RPI | "RPI" | diff --git a/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderRequest.md b/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderRequest.md new file mode 100644 index 00000000..cd665e99 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderRequest.md @@ -0,0 +1,16 @@ + + +# CancelAlgoOrderRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | [optional] | +|**algoid** | **Long** | | [optional] | +|**clientalgoid** | **String** | | [optional] | +|**recvWindow** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderResponse.md b/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderResponse.md new file mode 100644 index 00000000..b541227e --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderResponse.md @@ -0,0 +1,16 @@ + + +# CancelAlgoOrderResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | [optional] | +|**status** | **Long** | | [optional] | +|**result** | [**CancelAlgoOrderResponseResult**](CancelAlgoOrderResponseResult.md) | | [optional] | +|**rateLimits** | [**List<CancelAlgoOrderResponseRateLimitsInner>**](CancelAlgoOrderResponseRateLimitsInner.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/CancelOrderResponseRateLimitsInner.md b/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderResponseRateLimitsInner.md similarity index 89% rename from clients/derivatives-trading-usds-futures/docs/CancelOrderResponseRateLimitsInner.md rename to clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderResponseRateLimitsInner.md index 7eab82b9..6299526e 100644 --- a/clients/derivatives-trading-usds-futures/docs/CancelOrderResponseRateLimitsInner.md +++ b/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderResponseRateLimitsInner.md @@ -1,6 +1,6 @@ -# CancelOrderResponseRateLimitsInner +# CancelAlgoOrderResponseRateLimitsInner ## Properties diff --git a/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderResponseResult.md b/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderResponseResult.md new file mode 100644 index 00000000..e7b7ed91 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderResponseResult.md @@ -0,0 +1,35 @@ + + +# CancelAlgoOrderResponseResult + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**algoId** | **Long** | | [optional] | +|**clientAlgoId** | **String** | | [optional] | +|**algoType** | **String** | | [optional] | +|**orderType** | **String** | | [optional] | +|**symbol** | **String** | | [optional] | +|**side** | **String** | | [optional] | +|**positionSide** | **String** | | [optional] | +|**timeInForce** | **String** | | [optional] | +|**quantity** | **String** | | [optional] | +|**algoStatus** | **String** | | [optional] | +|**triggerPrice** | **String** | | [optional] | +|**price** | **String** | | [optional] | +|**icebergQuantity** | **String** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | +|**workingType** | **String** | | [optional] | +|**priceMatch** | **String** | | [optional] | +|**closePosition** | **Boolean** | | [optional] | +|**priceProtect** | **Boolean** | | [optional] | +|**reduceOnly** | **Boolean** | | [optional] | +|**createTime** | **Long** | | [optional] | +|**updateTime** | **Long** | | [optional] | +|**triggerTime** | **Long** | | [optional] | +|**goodTillDate** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/CancelAllAlgoOpenOrdersResponse.md b/clients/derivatives-trading-usds-futures/docs/CancelAllAlgoOpenOrdersResponse.md new file mode 100644 index 00000000..e632936c --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/CancelAllAlgoOpenOrdersResponse.md @@ -0,0 +1,14 @@ + + +# CancelAllAlgoOpenOrdersResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Long** | | [optional] | +|**msg** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/CancelOrderResponse.md b/clients/derivatives-trading-usds-futures/docs/CancelOrderResponse.md index 04d7e2d2..d38bb813 100644 --- a/clients/derivatives-trading-usds-futures/docs/CancelOrderResponse.md +++ b/clients/derivatives-trading-usds-futures/docs/CancelOrderResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**CancelOrderResponseResult**](CancelOrderResponseResult.md) | | [optional] | -|**rateLimits** | [**List<CancelOrderResponseRateLimitsInner>**](CancelOrderResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | [**List<CancelAlgoOrderResponseRateLimitsInner>**](CancelAlgoOrderResponseRateLimitsInner.md) | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/CurrentAllAlgoOpenOrdersResponse.md b/clients/derivatives-trading-usds-futures/docs/CurrentAllAlgoOpenOrdersResponse.md new file mode 100644 index 00000000..723f9be9 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/CurrentAllAlgoOpenOrdersResponse.md @@ -0,0 +1,12 @@ + + +# CurrentAllAlgoOpenOrdersResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/clients/derivatives-trading-usds-futures/docs/CurrentAllAlgoOpenOrdersResponseInner.md b/clients/derivatives-trading-usds-futures/docs/CurrentAllAlgoOpenOrdersResponseInner.md new file mode 100644 index 00000000..9a451d24 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/CurrentAllAlgoOpenOrdersResponseInner.md @@ -0,0 +1,42 @@ + + +# CurrentAllAlgoOpenOrdersResponseInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**algoId** | **Long** | | [optional] | +|**clientAlgoId** | **String** | | [optional] | +|**algoType** | **String** | | [optional] | +|**orderType** | **String** | | [optional] | +|**symbol** | **String** | | [optional] | +|**side** | **String** | | [optional] | +|**positionSide** | **String** | | [optional] | +|**timeInForce** | **String** | | [optional] | +|**quantity** | **String** | | [optional] | +|**algoStatus** | **String** | | [optional] | +|**actualOrderId** | **String** | | [optional] | +|**actualPrice** | **String** | | [optional] | +|**triggerPrice** | **String** | | [optional] | +|**price** | **String** | | [optional] | +|**icebergQuantity** | **String** | | [optional] | +|**tpTriggerPrice** | **String** | | [optional] | +|**tpPrice** | **String** | | [optional] | +|**slTriggerPrice** | **String** | | [optional] | +|**slPrice** | **String** | | [optional] | +|**tpOrderType** | **String** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | +|**workingType** | **String** | | [optional] | +|**priceMatch** | **String** | | [optional] | +|**closePosition** | **Boolean** | | [optional] | +|**priceProtect** | **Boolean** | | [optional] | +|**reduceOnly** | **Boolean** | | [optional] | +|**createTime** | **Long** | | [optional] | +|**updateTime** | **Long** | | [optional] | +|**triggerTime** | **Long** | | [optional] | +|**goodTillDate** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/FuturesTradfiPerpsContractRequest.md b/clients/derivatives-trading-usds-futures/docs/FuturesTradfiPerpsContractRequest.md new file mode 100644 index 00000000..b4754deb --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/FuturesTradfiPerpsContractRequest.md @@ -0,0 +1,13 @@ + + +# FuturesTradfiPerpsContractRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**recvWindow** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/FuturesTradfiPerpsContractResponse.md b/clients/derivatives-trading-usds-futures/docs/FuturesTradfiPerpsContractResponse.md new file mode 100644 index 00000000..111437aa --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/FuturesTradfiPerpsContractResponse.md @@ -0,0 +1,14 @@ + + +# FuturesTradfiPerpsContractResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Long** | | [optional] | +|**msg** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/MarketDataApi.md b/clients/derivatives-trading-usds-futures/docs/MarketDataApi.md index 2d21fac6..c7c86393 100644 --- a/clients/derivatives-trading-usds-futures/docs/MarketDataApi.md +++ b/clients/derivatives-trading-usds-futures/docs/MarketDataApi.md @@ -15,7 +15,7 @@ All URIs are relative to *http://localhost* Order Book -Get current order book. Note that this request returns limited market depth. If you need to continuously monitor order book updates, please consider using Websocket Market Streams: * `<symbol>@depth<levels>` * `<symbol>@depth` You can use `depth` request together with `<symbol>@depth` streams to maintain a local order book. Weight: Adjusted based on the limit: | Limit | Weight | | ------------- | ------ | | 5, 10, 20, 50 | 2 | | 100 | 5 | | 500 | 10 | | 1000 | 20 | +Get current order book. Note that this request returns limited market depth. If you need to continuously monitor order book updates, please consider using Websocket Market Streams: * `<symbol>@depth<levels>` * `<symbol>@depth` You can use `depth` request together with `<symbol>@depth` streams to maintain a local order book. Retail Price Improvement(RPI) orders are not visible and excluded in the response message. Weight: Adjusted based on the limit: | Limit | Weight | | ------------- | ------ | | 5, 10, 20, 50 | 2 | | 100 | 5 | | 500 | 10 | | 1000 | 20 | ### Example ```java @@ -77,7 +77,7 @@ No authorization required Symbol Order Book Ticker -Best price/qty on the order book for a symbol or symbols. * If the symbol is not sent, bookTickers for all symbols will be returned in an array. * The field `X-MBX-USED-WEIGHT-1M` in response header is not accurate from this endpoint, please ignore. Weight: 2 for a single symbol; 5 when the symbol parameter is omitted +Best price/qty on the order book for a symbol or symbols. Retail Price Improvement(RPI) orders are not visible and excluded in the response message. * If the symbol is not sent, bookTickers for all symbols will be returned in an array. * The field `X-MBX-USED-WEIGHT-1M` in response header is not accurate from this endpoint, please ignore. Weight: 2 for a single symbol; 5 when the symbol parameter is omitted ### Example ```java diff --git a/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderRequest.md b/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderRequest.md new file mode 100644 index 00000000..1ba878a9 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderRequest.md @@ -0,0 +1,33 @@ + + +# NewAlgoOrderRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | [optional] | +|**algoType** | **String** | | | +|**symbol** | **String** | | | +|**side** | **Side** | | | +|**positionSide** | **PositionSide** | | [optional] | +|**type** | **String** | | | +|**timeInForce** | **TimeInForce** | | [optional] | +|**quantity** | **Double** | | [optional] | +|**price** | **Double** | | [optional] | +|**triggerPrice** | **Double** | | [optional] | +|**workingType** | **WorkingType** | | [optional] | +|**priceMatch** | **PriceMatch** | | [optional] | +|**closePosition** | **String** | | [optional] | +|**priceProtect** | **String** | | [optional] | +|**reduceOnly** | **String** | | [optional] | +|**activationPrice** | **Double** | | [optional] | +|**callbackRate** | **Double** | | [optional] | +|**clientAlgoId** | **String** | | [optional] | +|**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | +|**goodTillDate** | **Long** | | [optional] | +|**recvWindow** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderResponse.md b/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderResponse.md new file mode 100644 index 00000000..25eb6f86 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderResponse.md @@ -0,0 +1,16 @@ + + +# NewAlgoOrderResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | [optional] | +|**status** | **Long** | | [optional] | +|**result** | [**NewAlgoOrderResponseResult**](NewAlgoOrderResponseResult.md) | | [optional] | +|**rateLimits** | [**List<CancelAlgoOrderResponseRateLimitsInner>**](CancelAlgoOrderResponseRateLimitsInner.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderResponseResult.md b/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderResponseResult.md new file mode 100644 index 00000000..59d9efd1 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderResponseResult.md @@ -0,0 +1,35 @@ + + +# NewAlgoOrderResponseResult + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**algoId** | **Long** | | [optional] | +|**clientAlgoId** | **String** | | [optional] | +|**algoType** | **String** | | [optional] | +|**orderType** | **String** | | [optional] | +|**symbol** | **String** | | [optional] | +|**side** | **String** | | [optional] | +|**positionSide** | **String** | | [optional] | +|**timeInForce** | **String** | | [optional] | +|**quantity** | **String** | | [optional] | +|**algoStatus** | **String** | | [optional] | +|**triggerPrice** | **String** | | [optional] | +|**price** | **String** | | [optional] | +|**icebergQuantity** | **String** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | +|**workingType** | **String** | | [optional] | +|**priceMatch** | **String** | | [optional] | +|**closePosition** | **Boolean** | | [optional] | +|**priceProtect** | **Boolean** | | [optional] | +|**reduceOnly** | **Boolean** | | [optional] | +|**createTime** | **Long** | | [optional] | +|**updateTime** | **Long** | | [optional] | +|**triggerTime** | **Long** | | [optional] | +|**goodTillDate** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/OldTradesLookupResponseInner.md b/clients/derivatives-trading-usds-futures/docs/OldTradesLookupResponseInner.md index 80efa818..ddbabd22 100644 --- a/clients/derivatives-trading-usds-futures/docs/OldTradesLookupResponseInner.md +++ b/clients/derivatives-trading-usds-futures/docs/OldTradesLookupResponseInner.md @@ -13,6 +13,7 @@ |**quoteQty** | **String** | | [optional] | |**time** | **Long** | | [optional] | |**isBuyerMaker** | **Boolean** | | [optional] | +|**isRPITrade** | **Boolean** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/QueryAlgoOrderResponse.md b/clients/derivatives-trading-usds-futures/docs/QueryAlgoOrderResponse.md new file mode 100644 index 00000000..32fa5b15 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/QueryAlgoOrderResponse.md @@ -0,0 +1,42 @@ + + +# QueryAlgoOrderResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**algoId** | **Long** | | [optional] | +|**clientAlgoId** | **String** | | [optional] | +|**algoType** | **String** | | [optional] | +|**orderType** | **String** | | [optional] | +|**symbol** | **String** | | [optional] | +|**side** | **String** | | [optional] | +|**positionSide** | **String** | | [optional] | +|**timeInForce** | **String** | | [optional] | +|**quantity** | **String** | | [optional] | +|**algoStatus** | **String** | | [optional] | +|**actualOrderId** | **String** | | [optional] | +|**actualPrice** | **String** | | [optional] | +|**triggerPrice** | **String** | | [optional] | +|**price** | **String** | | [optional] | +|**icebergQuantity** | **String** | | [optional] | +|**tpTriggerPrice** | **String** | | [optional] | +|**tpPrice** | **String** | | [optional] | +|**slTriggerPrice** | **String** | | [optional] | +|**slPrice** | **String** | | [optional] | +|**tpOrderType** | **String** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | +|**workingType** | **String** | | [optional] | +|**priceMatch** | **String** | | [optional] | +|**closePosition** | **Boolean** | | [optional] | +|**priceProtect** | **Boolean** | | [optional] | +|**reduceOnly** | **Boolean** | | [optional] | +|**createTime** | **Long** | | [optional] | +|**updateTime** | **Long** | | [optional] | +|**triggerTime** | **Long** | | [optional] | +|**goodTillDate** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/QueryAllAlgoOrdersResponse.md b/clients/derivatives-trading-usds-futures/docs/QueryAllAlgoOrdersResponse.md new file mode 100644 index 00000000..faeb3291 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/QueryAllAlgoOrdersResponse.md @@ -0,0 +1,12 @@ + + +# QueryAllAlgoOrdersResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/clients/derivatives-trading-usds-futures/docs/QueryAllAlgoOrdersResponseInner.md b/clients/derivatives-trading-usds-futures/docs/QueryAllAlgoOrdersResponseInner.md new file mode 100644 index 00000000..eae68365 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/QueryAllAlgoOrdersResponseInner.md @@ -0,0 +1,42 @@ + + +# QueryAllAlgoOrdersResponseInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**algoId** | **Long** | | [optional] | +|**clientAlgoId** | **String** | | [optional] | +|**algoType** | **String** | | [optional] | +|**orderType** | **String** | | [optional] | +|**symbol** | **String** | | [optional] | +|**side** | **String** | | [optional] | +|**positionSide** | **String** | | [optional] | +|**timeInForce** | **String** | | [optional] | +|**quantity** | **String** | | [optional] | +|**algoStatus** | **String** | | [optional] | +|**actualOrderId** | **String** | | [optional] | +|**actualPrice** | **String** | | [optional] | +|**triggerPrice** | **String** | | [optional] | +|**price** | **String** | | [optional] | +|**icebergQuantity** | **String** | | [optional] | +|**tpTriggerPrice** | **String** | | [optional] | +|**tpPrice** | **String** | | [optional] | +|**slTriggerPrice** | **String** | | [optional] | +|**slPrice** | **String** | | [optional] | +|**tpOrderType** | **String** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | +|**workingType** | **String** | | [optional] | +|**priceMatch** | **String** | | [optional] | +|**closePosition** | **Boolean** | | [optional] | +|**priceProtect** | **Boolean** | | [optional] | +|**reduceOnly** | **Boolean** | | [optional] | +|**createTime** | **Long** | | [optional] | +|**updateTime** | **Long** | | [optional] | +|**triggerTime** | **Long** | | [optional] | +|**goodTillDate** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/RecentTradesListResponseInner.md b/clients/derivatives-trading-usds-futures/docs/RecentTradesListResponseInner.md index 38cff87e..f68aa472 100644 --- a/clients/derivatives-trading-usds-futures/docs/RecentTradesListResponseInner.md +++ b/clients/derivatives-trading-usds-futures/docs/RecentTradesListResponseInner.md @@ -13,6 +13,7 @@ |**quoteQty** | **String** | | [optional] | |**time** | **Long** | | [optional] | |**isBuyerMaker** | **Boolean** | | [optional] | +|**isRPITrade** | **Boolean** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/RpiDiffBookDepthStreamsRequest.md b/clients/derivatives-trading-usds-futures/docs/RpiDiffBookDepthStreamsRequest.md new file mode 100644 index 00000000..90429336 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/RpiDiffBookDepthStreamsRequest.md @@ -0,0 +1,14 @@ + + +# RpiDiffBookDepthStreamsRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | [optional] | +|**symbol** | **String** | | | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/RpiDiffBookDepthStreamsResponse.md b/clients/derivatives-trading-usds-futures/docs/RpiDiffBookDepthStreamsResponse.md new file mode 100644 index 00000000..8b8daf83 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/RpiDiffBookDepthStreamsResponse.md @@ -0,0 +1,21 @@ + + +# RpiDiffBookDepthStreamsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**eLowerCase** | **String** | | [optional] | +|**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**U** | **Long** | | [optional] | +|**uLowerCase** | **Long** | | [optional] | +|**pu** | **Long** | | [optional] | +|**bLowerCase** | **List<RpiDiffBookDepthStreamsResponseBItem>** | | [optional] | +|**aLowerCase** | **List<RpiDiffBookDepthStreamsResponseAItem>** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/RpiDiffBookDepthStreamsResponseAItem.md b/clients/derivatives-trading-usds-futures/docs/RpiDiffBookDepthStreamsResponseAItem.md new file mode 100644 index 00000000..75ad8c30 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/RpiDiffBookDepthStreamsResponseAItem.md @@ -0,0 +1,12 @@ + + +# RpiDiffBookDepthStreamsResponseAItem + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/clients/derivatives-trading-usds-futures/docs/RpiDiffBookDepthStreamsResponseBItem.md b/clients/derivatives-trading-usds-futures/docs/RpiDiffBookDepthStreamsResponseBItem.md new file mode 100644 index 00000000..0aaebe20 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/RpiDiffBookDepthStreamsResponseBItem.md @@ -0,0 +1,12 @@ + + +# RpiDiffBookDepthStreamsResponseBItem + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/clients/derivatives-trading-usds-futures/docs/RpiOrderBookResponse.md b/clients/derivatives-trading-usds-futures/docs/RpiOrderBookResponse.md new file mode 100644 index 00000000..e1231c82 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/RpiOrderBookResponse.md @@ -0,0 +1,17 @@ + + +# RpiOrderBookResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**lastUpdateId** | **Long** | | [optional] | +|**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**bids** | **List<RpiOrderBookResponseBidsItem>** | | [optional] | +|**asks** | **List<RpiOrderBookResponseAsksItem>** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/RpiOrderBookResponseAsksItem.md b/clients/derivatives-trading-usds-futures/docs/RpiOrderBookResponseAsksItem.md new file mode 100644 index 00000000..7d07a6d9 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/RpiOrderBookResponseAsksItem.md @@ -0,0 +1,12 @@ + + +# RpiOrderBookResponseAsksItem + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/clients/derivatives-trading-usds-futures/docs/RpiOrderBookResponseBidsItem.md b/clients/derivatives-trading-usds-futures/docs/RpiOrderBookResponseBidsItem.md new file mode 100644 index 00000000..51659ff7 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/RpiOrderBookResponseBidsItem.md @@ -0,0 +1,12 @@ + + +# RpiOrderBookResponseBidsItem + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/clients/derivatives-trading-usds-futures/docs/TimeInForce.md b/clients/derivatives-trading-usds-futures/docs/TimeInForce.md index 51104eeb..a9b7549d 100644 --- a/clients/derivatives-trading-usds-futures/docs/TimeInForce.md +++ b/clients/derivatives-trading-usds-futures/docs/TimeInForce.md @@ -15,5 +15,7 @@ * `GTD` (value: `"GTD"`) +* `RPI` (value: `"RPI"`) + diff --git a/clients/derivatives-trading-usds-futures/docs/TradeApi.md b/clients/derivatives-trading-usds-futures/docs/TradeApi.md index 9c276be8..cecdc4b0 100644 --- a/clients/derivatives-trading-usds-futures/docs/TradeApi.md +++ b/clients/derivatives-trading-usds-futures/docs/TradeApi.md @@ -4,14 +4,78 @@ All URIs are relative to *http://localhost* | Method | HTTP request | Description | |------------- | ------------- | -------------| +| [**cancelAlgoOrder**](TradeApi.md#cancelAlgoOrder) | **POST** /algoOrder.cancel | Cancel Algo Order (TRADE) | | [**cancelOrder**](TradeApi.md#cancelOrder) | **POST** /order.cancel | Cancel Order (TRADE) | | [**modifyOrder**](TradeApi.md#modifyOrder) | **POST** /order.modify | Modify Order (TRADE) | +| [**newAlgoOrder**](TradeApi.md#newAlgoOrder) | **POST** /algoOrder.place | New Algo Order(TRADE) | | [**newOrder**](TradeApi.md#newOrder) | **POST** /order.place | New Order(TRADE) | | [**positionInformation**](TradeApi.md#positionInformation) | **POST** /account.position | Position Information (USER_DATA) | | [**positionInformationV2**](TradeApi.md#positionInformationV2) | **POST** /v2/account.position | Position Information V2 (USER_DATA) | | [**queryOrder**](TradeApi.md#queryOrder) | **POST** /order.status | Query Order (USER_DATA) | + +# **cancelAlgoOrder** +> CancelAlgoOrderResponse cancelAlgoOrder(cancelAlgoOrderRequest) + +Cancel Algo Order (TRADE) + +Cancel an active algo order. * Either `algoid` or `clientalgoid` must be sent. Weight: 1 + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; +import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; +import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; +import com.binance.connector.client.derivatives_trading_usds_futures.models.*; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.api.TradeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + TradeApi apiInstance = new TradeApi(defaultClient); + CancelAlgoOrderRequest cancelAlgoOrderRequest = new CancelAlgoOrderRequest(); // CancelAlgoOrderRequest | + try { + CancelAlgoOrderResponse result = apiInstance.cancelAlgoOrder(cancelAlgoOrderRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradeApi#cancelAlgoOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **cancelAlgoOrderRequest** | [**CancelAlgoOrderRequest**](CancelAlgoOrderRequest.md)| | | + +### Return type + +[**CancelAlgoOrderResponse**](CancelAlgoOrderResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Cancel Algo Order | - | + # **cancelOrder** > CancelOrderResponse cancelOrder(cancelOrderRequest) @@ -136,6 +200,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Modify Order | - | + +# **newAlgoOrder** +> NewAlgoOrderResponse newAlgoOrder(newAlgoOrderRequest) + +New Algo Order(TRADE) + +Send in a new algo order. * Condition orders will be triggered when: * If parameter`priceProtect`is sent as true: * when price reaches the `triggerPrice` ,the difference rate between \"MARK_PRICE\" and \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the symbol * \"triggerProtect\" of a symbol can be got from `GET /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * BUY: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= `triggerPrice` * SELL: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") <= `triggerPrice` * `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`: * BUY: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after order placed <= `activationPrice`, and the latest price >= the lowest price * (1 + `callbackRate`) * SELL: the highest price after order placed >= `activationPrice`, and the latest price <= the highest price * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error code. ``{\"code\": -2021, \"msg\": \"Order would immediately trigger.\"}`` means that the parameters you send do not meet the following requirements: * BUY: `activationPrice` should be smaller than latest price. * SELL: `activationPrice` should be larger than latest price. * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with `closePosition`=`true`: * Follow the same rules for condition orders. * If triggered,**close all** current long position( if `SELL`) or current short position( if `BUY`). * Cannot be used with `quantity` paremeter * Cannot be used with `reduceOnly` parameter * In Hedge Mode,cannot be used with `BUY` orders in `LONG` position side. and cannot be used with `SELL` orders in `SHORT` position side * `selfTradePreventionMode` is only effective when `timeInForce` set to `IOC` or `GTC` or `GTD`. Weight: 0 + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; +import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; +import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; +import com.binance.connector.client.derivatives_trading_usds_futures.models.*; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.api.TradeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + TradeApi apiInstance = new TradeApi(defaultClient); + NewAlgoOrderRequest newAlgoOrderRequest = new NewAlgoOrderRequest(); // NewAlgoOrderRequest | + try { + NewAlgoOrderResponse result = apiInstance.newAlgoOrder(newAlgoOrderRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradeApi#newAlgoOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **newAlgoOrderRequest** | [**NewAlgoOrderRequest**](NewAlgoOrderRequest.md)| | | + +### Return type + +[**NewAlgoOrderResponse**](NewAlgoOrderResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | New Algo Order | - | + # **newOrder** > NewOrderResponse newOrder(newOrderRequest) diff --git a/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponse.md b/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponse.md new file mode 100644 index 00000000..56aad059 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponse.md @@ -0,0 +1,14 @@ + + +# TradingScheduleResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**updateTime** | **Long** | | [optional] | +|**marketSchedules** | [**TradingScheduleResponseMarketSchedules**](TradingScheduleResponseMarketSchedules.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponseMarketSchedules.md b/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponseMarketSchedules.md new file mode 100644 index 00000000..850be4a1 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponseMarketSchedules.md @@ -0,0 +1,14 @@ + + +# TradingScheduleResponseMarketSchedules + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**EQUITY** | [**TradingScheduleResponseMarketSchedulesEQUITY**](TradingScheduleResponseMarketSchedulesEQUITY.md) | | [optional] | +|**COMMODITY** | [**TradingScheduleResponseMarketSchedulesCOMMODITY**](TradingScheduleResponseMarketSchedulesCOMMODITY.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponseMarketSchedulesCOMMODITY.md b/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponseMarketSchedulesCOMMODITY.md new file mode 100644 index 00000000..06ee6f00 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponseMarketSchedulesCOMMODITY.md @@ -0,0 +1,13 @@ + + +# TradingScheduleResponseMarketSchedulesCOMMODITY + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sessions** | [**List<TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner>**](TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner.md b/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner.md new file mode 100644 index 00000000..dc6a34df --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner.md @@ -0,0 +1,15 @@ + + +# TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**startTime** | **Long** | | [optional] | +|**endTime** | **Long** | | [optional] | +|**type** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponseMarketSchedulesEQUITY.md b/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponseMarketSchedulesEQUITY.md new file mode 100644 index 00000000..aff939b1 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponseMarketSchedulesEQUITY.md @@ -0,0 +1,13 @@ + + +# TradingScheduleResponseMarketSchedulesEQUITY + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sessions** | [**List<TradingScheduleResponseMarketSchedulesEQUITYSessionsInner>**](TradingScheduleResponseMarketSchedulesEQUITYSessionsInner.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponseMarketSchedulesEQUITYSessionsInner.md b/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponseMarketSchedulesEQUITYSessionsInner.md new file mode 100644 index 00000000..7eec8548 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/TradingScheduleResponseMarketSchedulesEQUITYSessionsInner.md @@ -0,0 +1,15 @@ + + +# TradingScheduleResponseMarketSchedulesEQUITYSessionsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**startTime** | **Long** | | [optional] | +|**endTime** | **Long** | | [optional] | +|**type** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/TradingSessionStreamRequest.md b/clients/derivatives-trading-usds-futures/docs/TradingSessionStreamRequest.md new file mode 100644 index 00000000..1ce03f67 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/TradingSessionStreamRequest.md @@ -0,0 +1,13 @@ + + +# TradingSessionStreamRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/TradingSessionStreamResponse.md b/clients/derivatives-trading-usds-futures/docs/TradingSessionStreamResponse.md new file mode 100644 index 00000000..9c237109 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/TradingSessionStreamResponse.md @@ -0,0 +1,17 @@ + + +# TradingSessionStreamResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**eLowerCase** | **String** | | [optional] | +|**E** | **Long** | | [optional] | +|**tLowerCase** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**S** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/UserCommissionRateResponse.md b/clients/derivatives-trading-usds-futures/docs/UserCommissionRateResponse.md index 9e34492b..2c8669b9 100644 --- a/clients/derivatives-trading-usds-futures/docs/UserCommissionRateResponse.md +++ b/clients/derivatives-trading-usds-futures/docs/UserCommissionRateResponse.md @@ -10,6 +10,7 @@ |**symbol** | **String** | | [optional] | |**makerCommissionRate** | **String** | | [optional] | |**takerCommissionRate** | **String** | | [optional] | +|**rpiCommissionRate** | **String** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/UserDataStreamEventsResponse.md b/clients/derivatives-trading-usds-futures/docs/UserDataStreamEventsResponse.md index 405062fd..fcf6c8bd 100644 --- a/clients/derivatives-trading-usds-futures/docs/UserDataStreamEventsResponse.md +++ b/clients/derivatives-trading-usds-futures/docs/UserDataStreamEventsResponse.md @@ -11,12 +11,12 @@ |**T** | **Long** | | [optional] | |**ac** | [**AccountConfigUpdateAc**](AccountConfigUpdateAc.md) | | [optional] | |**ai** | [**AccountConfigUpdateAi**](AccountConfigUpdateAi.md) | | [optional] | +|**oLowerCase** | [**OrderTradeUpdateO**](OrderTradeUpdateO.md) | | [optional] | |**aLowerCase** | [**AccountUpdateA**](AccountUpdateA.md) | | [optional] | |**or** | [**ConditionalOrderTriggerRejectOr**](ConditionalOrderTriggerRejectOr.md) | | [optional] | |**gu** | [**GridUpdateGu**](GridUpdateGu.md) | | [optional] | |**cw** | **String** | | [optional] | |**pLowerCase** | **String** | | [optional] | -|**oLowerCase** | [**OrderTradeUpdateO**](OrderTradeUpdateO.md) | | [optional] | |**su** | [**StrategyUpdateSu**](StrategyUpdateSu.md) | | [optional] | |**sLowerCase** | **String** | | [optional] | |**qLowerCase** | **String** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/WebsocketMarketStreamsApi.md b/clients/derivatives-trading-usds-futures/docs/WebsocketMarketStreamsApi.md index 9846c679..9d2ee239 100644 --- a/clients/derivatives-trading-usds-futures/docs/WebsocketMarketStreamsApi.md +++ b/clients/derivatives-trading-usds-futures/docs/WebsocketMarketStreamsApi.md @@ -22,6 +22,8 @@ All URIs are relative to *http://localhost* | [**markPriceStreamForAllMarket**](WebsocketMarketStreamsApi.md#markPriceStreamForAllMarket) | **POST** /!markPrice@arr@<updateSpeed> | Mark Price Stream for All market | | [**multiAssetsModeAssetIndex**](WebsocketMarketStreamsApi.md#multiAssetsModeAssetIndex) | **POST** /!assetIndex@arr | Multi-Assets Mode Asset Index | | [**partialBookDepthStreams**](WebsocketMarketStreamsApi.md#partialBookDepthStreams) | **POST** /<symbol>@depth<levels>@<updateSpeed> | Partial Book Depth Streams | +| [**rpiDiffBookDepthStreams**](WebsocketMarketStreamsApi.md#rpiDiffBookDepthStreams) | **POST** /<symbol>@rpiDepth@500ms | RPI Diff. Book Depth Streams | +| [**tradingSessionStream**](WebsocketMarketStreamsApi.md#tradingSessionStream) | **POST** /tradingSession | Trading Session Stream | @@ -30,7 +32,7 @@ All URIs are relative to *http://localhost* Aggregate Trade Streams -The Aggregate Trade Streams push market trade information that is aggregated for fills with same price and taking side every 100 milliseconds. Only market trades will be aggregated, which means the insurance fund trades and ADL trades won't be aggregated. Update Speed: 100ms +The Aggregate Trade Streams push market trade information that is aggregated for fills with same price and taking side every 100 milliseconds. Only market trades will be aggregated, which means the insurance fund trades and ADL trades won't be aggregated. Retail Price Improvement(RPI) orders are aggregated and without special tags to be distinguished. Update Speed: 100ms ### Example ```java @@ -92,7 +94,7 @@ No authorization required All Book Tickers Stream -Pushes any update to the best bid or ask's price or quantity in real-time for all symbols. Update Speed: 5s +Pushes any update to the best bid or ask's price or quantity in real-time for all symbols. Retail Price Improvement(RPI) orders are not visible and excluded in the response message. Update Speed: 5s ### Example ```java @@ -526,7 +528,7 @@ No authorization required Diff. Book Depth Streams -Bids and asks, pushed every 250 milliseconds, 500 milliseconds, 100 milliseconds (if existing) Update Speed: 250ms, 500ms, 100ms +Bids and asks, pushed every 250 milliseconds, 500 milliseconds, 100 milliseconds (if existing) Retail Price Improvement(RPI) orders are not visible and excluded in the response message. Update Speed: 250ms, 500ms, 100ms ### Example ```java @@ -588,7 +590,7 @@ No authorization required Individual Symbol Book Ticker Streams -Pushes any update to the best bid or ask's price or quantity in real-time for a specified symbol. Update Speed: Real-time +Pushes any update to the best bid or ask's price or quantity in real-time for a specified symbol. Retail Price Improvement(RPI) orders are not visible and excluded in the response message. Update Speed: Real-time ### Example ```java @@ -960,7 +962,7 @@ No authorization required Mark Price Stream for All market -Mark price and funding rate for all symbols pushed every 3 seconds or every second. Update Speed: 3000ms or 1000ms +Mark price and funding rate for all symbols pushed every 3 seconds or every second. **Note**: This stream does not cover TradFi Perps. Update Speed: 3000ms or 1000ms ### Example ```java @@ -1084,7 +1086,7 @@ No authorization required Partial Book Depth Streams -Top **<levels\\>** bids and asks, Valid **<levels\\>** are 5, 10, or 20. Update Speed: 250ms, 500ms or 100ms +Top **<levels\\>** bids and asks, Valid **<levels\\>** are 5, 10, or 20. Retail Price Improvement(RPI) orders are not visible and excluded in the response message. Update Speed: 250ms, 500ms or 100ms ### Example ```java @@ -1140,3 +1142,127 @@ No authorization required |-------------|-------------|------------------| | **200** | Partial Book Depth Streams | - | + +# **rpiDiffBookDepthStreams** +> RpiDiffBookDepthStreamsResponse rpiDiffBookDepthStreams(rpiDiffBookDepthStreamsRequest) + +RPI Diff. Book Depth Streams + +Bids and asks including RPI orders, pushed every 500 milliseconds RPI(Retail Price Improvement) orders are included and aggreated in the response message. When the quantity of a price level to be updated is equal to 0, it means either all quotations for this price have been filled/canceled, or the quantity of crossed RPI orders for this price are hidden Update Speed: 500ms + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; +import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; +import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; +import com.binance.connector.client.derivatives_trading_usds_futures.models.*; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); + RpiDiffBookDepthStreamsRequest rpiDiffBookDepthStreamsRequest = new RpiDiffBookDepthStreamsRequest(); // RpiDiffBookDepthStreamsRequest | + try { + RpiDiffBookDepthStreamsResponse result = apiInstance.rpiDiffBookDepthStreams(rpiDiffBookDepthStreamsRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WebsocketMarketStreamsApi#rpiDiffBookDepthStreams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **rpiDiffBookDepthStreamsRequest** | [**RpiDiffBookDepthStreamsRequest**](RpiDiffBookDepthStreamsRequest.md)| | | + +### Return type + +[**RpiDiffBookDepthStreamsResponse**](RpiDiffBookDepthStreamsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | RPI Diff. Book Depth Streams | - | + + +# **tradingSessionStream** +> TradingSessionStreamResponse tradingSessionStream(tradingSessionStreamRequest) + +Trading Session Stream + +Trading session information of U.S. equity market and commodity market which updates every second. Trading session information of different markets is pushed in seperate messages. Session types of equity market include \"PRE_MARKET\", \"REGULAR\", \"AFTER_MARKET\", \"OVERNIGHT\" and \"NO_TRADING\". And session types of commodity market include \"REGULAR\" and \"NO_TRADING\". Update Speed: 1s + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; +import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; +import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; +import com.binance.connector.client.derivatives_trading_usds_futures.models.*; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); + TradingSessionStreamRequest tradingSessionStreamRequest = new TradingSessionStreamRequest(); // TradingSessionStreamRequest | + try { + TradingSessionStreamResponse result = apiInstance.tradingSessionStream(tradingSessionStreamRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WebsocketMarketStreamsApi#tradingSessionStream"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tradingSessionStreamRequest** | [**TradingSessionStreamRequest**](TradingSessionStreamRequest.md)| | | + +### Return type + +[**TradingSessionStreamResponse**](TradingSessionStreamResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Trading Session Stream | - | + diff --git a/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md b/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md index af501ac4..7a663602 100644 --- a/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-usds-futures - 6.0.1 + 7.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-usds-futures - 6.0.0 + 7.0.0 ``` diff --git a/clients/derivatives-trading-usds-futures/example_rest.md b/clients/derivatives-trading-usds-futures/example_rest.md index cc31b32d..13999e6e 100644 --- a/clients/derivatives-trading-usds-futures/example_rest.md +++ b/clients/derivatives-trading-usds-futures/example_rest.md @@ -54,13 +54,15 @@ ## MarketData +[GET /fapi/v1/symbolAdlRisk](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/ADL-Risk) - adlRisk - [AdlRiskExample.java:51](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/AdlRiskExample.java#L51) + [GET /futures/data/basis](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Basis) - basis - [BasisExample.java:50](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/BasisExample.java#L50) [GET /fapi/v1/time](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time) - checkServerTime - [CheckServerTimeExample.java:47](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/CheckServerTimeExample.java#L47) [GET /fapi/v1/indexInfo](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Composite-Index-Symbol-Information) - compositeIndexSymbolInformation - [CompositeIndexSymbolInformationExample.java:47](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/CompositeIndexSymbolInformationExample.java#L47) -[GET /fapi/v1/aggTrades](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) - compressedAggregateTradesList - [CompressedAggregateTradesListExample.java:56](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/CompressedAggregateTradesListExample.java#L56) +[GET /fapi/v1/aggTrades](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List) - compressedAggregateTradesList - [CompressedAggregateTradesListExample.java:58](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/CompressedAggregateTradesListExample.java#L58) [GET /fapi/v1/continuousKlines](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Continuous-Contract-Kline-Candlestick-Data) - continuousContractKlineCandlestickData - [ContinuousContractKlineCandlestickDataExample.java:53](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/ContinuousContractKlineCandlestickDataExample.java#L53) @@ -88,19 +90,21 @@ [GET /futures/data/openInterestHist](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics) - openInterestStatistics - [OpenInterestStatisticsExample.java:50](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/OpenInterestStatisticsExample.java#L50) -[GET /fapi/v1/depth](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book) - orderBook - [OrderBookExample.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/OrderBookExample.java#L48) +[GET /fapi/v1/depth](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book) - orderBook - [OrderBookExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/OrderBookExample.java#L49) [GET /fapi/v1/premiumIndexKlines](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-index-Kline-Data) - premiumIndexKlineData - [PremiumIndexKlineDataExample.java:51](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/PremiumIndexKlineDataExample.java#L51) [GET /futures/data/delivery-price](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Delivery-Price) - quarterlyContractSettlementPrice - [QuarterlyContractSettlementPriceExample.java:47](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/QuarterlyContractSettlementPriceExample.java#L47) -[GET /fapi/v1/constituents](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Constituents) - queryIndexPriceConstituents - [QueryIndexPriceConstituentsExample.java:47](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/QueryIndexPriceConstituentsExample.java#L47) +[GET /fapi/v1/constituents](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Constituents) - queryIndexPriceConstituents - [QueryIndexPriceConstituentsExample.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/QueryIndexPriceConstituentsExample.java#L48) [GET /fapi/v1/insuranceBalance](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Query-Insurance-Fund-Balance-Snapshot) - queryInsuranceFundBalanceSnapshot - [QueryInsuranceFundBalanceSnapshotExample.java:47](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/QueryInsuranceFundBalanceSnapshotExample.java#L47) [GET /fapi/v1/trades](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List) - recentTradesList - [RecentTradesListExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/RecentTradesListExample.java#L49) -[GET /fapi/v1/ticker/bookTicker](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) - symbolOrderBookTicker - [SymbolOrderBookTickerExample.java:50](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/SymbolOrderBookTickerExample.java#L50) +[GET /fapi/v1/rpiDepth](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book-RPI) - rpiOrderBook - [RpiOrderBookExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/RpiOrderBookExample.java#L49) + +[GET /fapi/v1/ticker/bookTicker](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker) - symbolOrderBookTicker - [SymbolOrderBookTickerExample.java:51](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/SymbolOrderBookTickerExample.java#L51) [GET /fapi/v1/ticker/price](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker) - symbolPriceTicker - [SymbolPriceTickerExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/SymbolPriceTickerExample.java#L49) @@ -116,6 +120,8 @@ [GET /futures/data/topLongShortPositionRatio](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) - topTraderLongShortRatioPositions - [TopTraderLongShortRatioPositionsExample.java:54](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/TopTraderLongShortRatioPositionsExample.java#L54) +[GET /fapi/v1/tradingSchedule](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Trading-Schedule) - tradingSchedule - [TradingScheduleExample.java:51](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/TradingScheduleExample.java#L51) + ## PortfolioMarginEndpoints [GET /fapi/v1/pmAccountInfo](https://developers.binance.com/docs/derivatives/usds-margined-futures/portfolio-margin-endpoints/Classic-Portfolio-Margin-Account-Information) - classicPortfolioMarginAccountInformation - [ClassicPortfolioMarginAccountInformationExample.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/portfoliomarginendpoints/ClassicPortfolioMarginAccountInformationExample.java#L48) @@ -128,6 +134,10 @@ [POST /fapi/v1/countdownCancelAll](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) - autoCancelAllOpenOrders - [AutoCancelAllOpenOrdersExample.java:56](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/AutoCancelAllOpenOrdersExample.java#L56) +[DELETE /fapi/v1/algoOrder](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Algo-Order) - cancelAlgoOrder - [CancelAlgoOrderExample.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CancelAlgoOrderExample.java#L48) + +[DELETE /fapi/v1/algoOpenOrders](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Algo-Open-Orders) - cancelAllAlgoOpenOrders - [CancelAllAlgoOpenOrdersExample.java:47](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CancelAllAlgoOpenOrdersExample.java#L47) + [DELETE /fapi/v1/allOpenOrders](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders) - cancelAllOpenOrders - [CancelAllOpenOrdersExample.java:47](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CancelAllOpenOrdersExample.java#L47) [DELETE /fapi/v1/batchOrders](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders) - cancelMultipleOrders - [CancelMultipleOrdersExample.java:50](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CancelMultipleOrdersExample.java#L50) @@ -142,8 +152,12 @@ [POST /fapi/v1/positionSide/dual](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode) - changePositionMode - [ChangePositionModeExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/ChangePositionModeExample.java#L49) +[GET /fapi/v1/openAlgoOrders](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Algo-Open-Orders) - currentAllAlgoOpenOrders - [CurrentAllAlgoOpenOrdersExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CurrentAllAlgoOpenOrdersExample.java#L49) + [GET /fapi/v1/openOrders](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders) - currentAllOpenOrders - [CurrentAllOpenOrdersExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CurrentAllOpenOrdersExample.java#L49) +[POST /fapi/v1/stock/contract](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Futures-TradFi-Perps-Contract) - futuresTradfiPerpsContract - [FuturesTradfiPerpsContractExample.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/FuturesTradfiPerpsContractExample.java#L48) + [GET /fapi/v1/orderAmendment](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Order-Modify-History) - getOrderModifyHistory - [GetOrderModifyHistoryExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/GetOrderModifyHistoryExample.java#L49) [GET /fapi/v1/positionMargin/history](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History) - getPositionMarginChangeHistory - [GetPositionMarginChangeHistoryExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/GetPositionMarginChangeHistoryExample.java#L49) @@ -154,6 +168,8 @@ [PUT /fapi/v1/order](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order) - modifyOrder - [ModifyOrderExample.java:60](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/ModifyOrderExample.java#L60) +[POST /fapi/v1/algoOrder](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Algo-Order) - newAlgoOrder - [NewAlgoOrderExample.java:79](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/NewAlgoOrderExample.java#L79) + [POST /fapi/v1/order](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order) - newOrder - [NewOrderExample.java:86](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/NewOrderExample.java#L86) [POST /fapi/v1/batchOrders](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders) - placeMultipleOrders - [PlaceMultipleOrdersExample.java:53](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/PlaceMultipleOrdersExample.java#L53) @@ -164,6 +180,10 @@ [GET /fapi/v3/positionRisk](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3) - positionInformationV3 - [PositionInformationV3Example.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/PositionInformationV3Example.java#L49) +[GET /fapi/v1/algoOrder](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Algo-Order) - queryAlgoOrder - [QueryAlgoOrderExample.java:51](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/QueryAlgoOrderExample.java#L51) + +[GET /fapi/v1/allAlgoOrders](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-All-Algo-Orders) - queryAllAlgoOrders - [QueryAllAlgoOrdersExample.java:52](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/QueryAllAlgoOrdersExample.java#L52) + [GET /fapi/v1/openOrder](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order) - queryCurrentOpenOrder - [QueryCurrentOpenOrderExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/QueryCurrentOpenOrderExample.java#L49) [GET /fapi/v1/order](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order) - queryOrder - [QueryOrderExample.java:51](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/QueryOrderExample.java#L51) diff --git a/clients/derivatives-trading-usds-futures/example_websocket_api.md b/clients/derivatives-trading-usds-futures/example_websocket_api.md index 2f417d78..60b0ac09 100644 --- a/clients/derivatives-trading-usds-futures/example_websocket_api.md +++ b/clients/derivatives-trading-usds-futures/example_websocket_api.md @@ -10,18 +10,22 @@ ## MarketData -[depth](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Order-Book) - orderBook - [OrderBookExample.java:53](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/OrderBookExample.java#L53) +[depth](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Order-Book) - orderBook - [OrderBookExample.java:54](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/OrderBookExample.java#L54) -[ticker.book](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Order-Book-Ticker) - symbolOrderBookTicker - [SymbolOrderBookTickerExample.java:51](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolOrderBookTickerExample.java#L51) +[ticker.book](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Order-Book-Ticker) - symbolOrderBookTicker - [SymbolOrderBookTickerExample.java:52](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolOrderBookTickerExample.java#L52) [ticker.price](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Symbol-Price-Ticker) - symbolPriceTicker - [SymbolPriceTickerExample.java:50](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolPriceTickerExample.java#L50) ## Trade +[algoOrder.cancel](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Algo-Order) - cancelAlgoOrder - [CancelAlgoOrderExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/CancelAlgoOrderExample.java#L49) + [order.cancel](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order) - cancelOrder - [CancelOrderExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/CancelOrderExample.java#L49) [order.modify](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order) - modifyOrder - [ModifyOrderExample.java:60](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/ModifyOrderExample.java#L60) +[algoOrder.place](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Algo-Order) - newAlgoOrder - [NewAlgoOrderExample.java:78](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/NewAlgoOrderExample.java#L78) + [order.place](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Order) - newOrder - [NewOrderExample.java:81](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/NewOrderExample.java#L81) [account.position](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information) - positionInformation - [PositionInformationExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationExample.java#L49) diff --git a/clients/derivatives-trading-usds-futures/example_websocket_stream.md b/clients/derivatives-trading-usds-futures/example_websocket_stream.md index 00a447ff..d874fa04 100644 --- a/clients/derivatives-trading-usds-futures/example_websocket_stream.md +++ b/clients/derivatives-trading-usds-futures/example_websocket_stream.md @@ -1,8 +1,8 @@ ## WebsocketMarketStreams -[@aggTrade](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) - aggregateTradeStreams - [AggregateTradeStreamsExample.java:46](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AggregateTradeStreamsExample.java#L46) +[@aggTrade](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams) - aggregateTradeStreams - [AggregateTradeStreamsExample.java:47](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AggregateTradeStreamsExample.java#L47) -[!bookTicker](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) - allBookTickersStream - [AllBookTickersStreamExample.java:44](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllBookTickersStreamExample.java#L44) +[!bookTicker](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream) - allBookTickersStream - [AllBookTickersStreamExample.java:45](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllBookTickersStreamExample.java#L45) [!forceOrder@arr](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams) - allMarketLiquidationOrderStreams - [AllMarketLiquidationOrderStreamsExample.java:46](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllMarketLiquidationOrderStreamsExample.java#L46) @@ -16,9 +16,9 @@ [!contractInfo](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Contract-Info-Stream) - contractInfoStream - [ContractInfoStreamExample.java:45](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/ContractInfoStreamExample.java#L45) -[@depth@](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) - diffBookDepthStreams - [DiffBookDepthStreamsExample.java:44](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/DiffBookDepthStreamsExample.java#L44) +[@depth@](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams) - diffBookDepthStreams - [DiffBookDepthStreamsExample.java:45](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/DiffBookDepthStreamsExample.java#L45) -[@bookTicker](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) - individualSymbolBookTickerStreams - [IndividualSymbolBookTickerStreamsExample.java:44](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/IndividualSymbolBookTickerStreamsExample.java#L44) +[@bookTicker](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) - individualSymbolBookTickerStreams - [IndividualSymbolBookTickerStreamsExample.java:45](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/IndividualSymbolBookTickerStreamsExample.java#L45) [@miniTicker](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream) - individualSymbolMiniTickerStream - [IndividualSymbolMiniTickerStreamExample.java:45](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/IndividualSymbolMiniTickerStreamExample.java#L45) @@ -34,5 +34,9 @@ [!assetIndex@arr](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Multi-Assets-Mode-Asset-Index) - multiAssetsModeAssetIndex - [MultiAssetsModeAssetIndexExample.java:43](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MultiAssetsModeAssetIndexExample.java#L43) -[@depth@](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) - partialBookDepthStreams - [PartialBookDepthStreamsExample.java:44](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/PartialBookDepthStreamsExample.java#L44) +[@depth@](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams) - partialBookDepthStreams - [PartialBookDepthStreamsExample.java:45](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/PartialBookDepthStreamsExample.java#L45) + +[@rpiDepth@500ms](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams-RPI) - rpiDiffBookDepthStreams - [RpiDiffBookDepthStreamsExample.java:47](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/RpiDiffBookDepthStreamsExample.java#L47) + +[tradingSession](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Trading-Session-Stream) - tradingSessionStream - [TradingSessionStreamExample.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/TradingSessionStreamExample.java#L48) diff --git a/clients/derivatives-trading-usds-futures/pom.xml b/clients/derivatives-trading-usds-futures/pom.xml index 9cf36617..b4fcc3f9 100644 --- a/clients/derivatives-trading-usds-futures/pom.xml +++ b/clients/derivatives-trading-usds-futures/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-usds-futures derivatives-trading-usds-futures - 6.0.1 + 7.0.0 jar diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java index 8f6608ce..3cf467ca 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java @@ -138,6 +138,18 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .AccountTradeListResponseInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .AdlRiskResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .AdlRiskResponse1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .AdlRiskResponse2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .AdlRiskResponse2Inner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .AllOrdersResponse.CustomTypeAdapterFactory()); @@ -168,6 +180,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .BatchOrdersPlaceMultipleOrdersInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .CancelAlgoOrderResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .CancelAllAlgoOpenOrdersResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .CancelAllOpenOrdersResponse.CustomTypeAdapterFactory()); @@ -238,6 +256,12 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .ContinuousContractKlineCandlestickDataResponseItemInner .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .CurrentAllAlgoOpenOrdersResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .CurrentAllAlgoOpenOrdersResponseInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .CurrentAllOpenOrdersResponse.CustomTypeAdapterFactory()); @@ -269,6 +293,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .FuturesAccountConfigurationResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .FuturesTradfiPerpsContractRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .FuturesTradfiPerpsContractResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .FuturesTradingQuantitativeRulesIndicatorsResponse @@ -443,6 +473,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .MultiAssetsModeAssetIndexResponse2Inner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .NewAlgoOrderRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .NewAlgoOrderResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .NewOrderRequest.CustomTypeAdapterFactory()); @@ -548,6 +584,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .QuarterlyContractSettlementPriceResponseInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .QueryAlgoOrderResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .QueryAllAlgoOrdersResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .QueryAllAlgoOrdersResponseInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .QueryCurrentOpenOrderResponse.CustomTypeAdapterFactory()); @@ -594,6 +639,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .RecentTradesListResponseInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .RpiOrderBookResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .RpiOrderBookResponseAsksItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .RpiOrderBookResponseBidsItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .SendQuoteRequestRequest.CustomTypeAdapterFactory()); @@ -684,6 +738,27 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .TopTraderLongShortRatioPositionsResponseInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .TradingScheduleResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .TradingScheduleResponseMarketSchedules.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .TradingScheduleResponseMarketSchedulesCOMMODITY + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .TradingScheduleResponseMarketSchedulesEQUITY.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .TradingScheduleResponseMarketSchedulesEQUITYSessionsInner + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .UserCommissionRateResponse.CustomTypeAdapterFactory()); diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java index c44896d7..81911ea4 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java @@ -64,7 +64,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/6.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/7.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java index 7f614208..26eb56e1 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java @@ -49,7 +49,7 @@ public class ConvertApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/6.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/7.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java index c86b61f4..a6104a6a 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java @@ -10,11 +10,14 @@ import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.AccountInformationV2Response; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.AccountInformationV3Response; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.AccountTradeListResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.AdlRiskResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.AllOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.AutoCancelAllOpenOrdersRequest; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.AutoCancelAllOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.AutoCloseType; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.BasisResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CancelAlgoOrderResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CancelAllAlgoOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CancelAllOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CancelMultipleOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CancelOrderResponse; @@ -32,11 +35,14 @@ import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CompressedAggregateTradesListResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.ContinuousContractKlineCandlestickDataResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.ContractType; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CurrentAllAlgoOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CurrentAllOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.ExchangeInformationResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesAccountBalanceV2Response; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesAccountBalanceV3Response; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesAccountConfigurationResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesTradfiPerpsContractRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesTradfiPerpsContractResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesTradingQuantitativeRulesIndicatorsResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.GetBnbBurnStatusResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.GetCurrentMultiAssetsModeResponse; @@ -67,6 +73,8 @@ import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.ModifyOrderRequest; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.ModifyOrderResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.MultiAssetsModeAssetIndexResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.NewAlgoOrderRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.NewAlgoOrderResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.NewOrderRequest; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.NewOrderResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.NotionalAndLeverageBracketsResponse; @@ -85,12 +93,15 @@ import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.PositionInformationV3Response; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.PremiumIndexKlineDataResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.QuarterlyContractSettlementPriceResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.QueryAlgoOrderResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.QueryAllAlgoOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.QueryCurrentOpenOrderResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.QueryIndexPriceConstituentsResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.QueryInsuranceFundBalanceSnapshotResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.QueryOrderResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.QueryUserRateLimitResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.RecentTradesListResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.RpiOrderBookResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.SendQuoteRequestRequest; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.SendQuoteRequestResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.StartUserDataStreamResponse; @@ -106,6 +117,7 @@ import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.ToggleBnbBurnOnFuturesTradeResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.TopTraderLongShortRatioAccountsResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.TopTraderLongShortRatioPositionsResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.TradingScheduleResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.UserCommissionRateResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.UsersForceOrdersResponse; @@ -780,6 +792,32 @@ public ApiResponse sendQuoteRequest( return convertApi.sendQuoteRequest(sendQuoteRequestRequest); } + /** + * ADL Risk Query the symbol-level ADL risk rating. The ADL risk rating measures the likelihood + * of ADL during liquidation, and the rating takes into account the insurance fund balance, + * position concentration on the symbol, order book depth, price volatility, average leverage, + * unrealized PnL, and margin utilization at the symbol level. The rating can be high, medium + * and low, and is updated every 30 minutes. Weight: 1 + * + * @param symbol (optional) + * @return ApiResponse<AdlRiskResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 ADL Risk -
+ * + * @see ADL + * Risk Documentation + */ + public ApiResponse adlRisk(String symbol) throws ApiException { + return marketDataApi.adlRisk(symbol); + } + /** * Basis Query future basis * If startTime and endTime are not sent, the most recent data is * returned. * Only the data of the latest 30 days is available. Weight: 0 @@ -866,15 +904,16 @@ public ApiResponse compositeIndexSymbol /** * Compressed/Aggregate Trades List Get compressed, aggregate market trades. Market trades that * fill in 100ms with the same price and the same taking side will have the quantity aggregated. - * * support querying futures trade histories that are not older than one year * If both - * `startTime` and `endTime` are sent, time between `startTime` - * and `endTime` must be less than 1 hour. * If `fromId`, - * `startTime`, and `endTime` are not sent, the most recent aggregate trades - * will be returned. * Only market trades will be aggregated and returned, which means the - * insurance fund trades and ADL trades won't be aggregated. * Sending both - * `startTime`/`endTime` and `fromId` might cause response - * timeout, please send either `fromId` or `startTime`/`endTime` - * Weight: 20 + * Retail Price Improvement(RPI) orders are aggregated and without special tags to be + * distinguished. * support querying futures trade histories that are not older than one year * + * If both `startTime` and `endTime` are sent, time between + * `startTime` and `endTime` must be less than 1 hour. * If + * `fromId`, `startTime`, and `endTime` are not sent, the most + * recent aggregate trades will be returned. * Only market trades will be aggregated and + * returned, which means the insurance fund trades and ADL trades won't be aggregated. * + * Sending both `startTime`/`endTime` and `fromId` might cause + * response timeout, please send either `fromId` or + * `startTime`/`endTime` Weight: 20 * * @param symbol (required) * @param fromId ID to get aggregate trades from INCLUSIVE. (optional) @@ -906,8 +945,9 @@ public ApiResponse compressedAggregateTra * Continuous Contract Kline/Candlestick Data Kline/candlestick bars for a specific contract * type. Klines are uniquely identified by their open time. * If startTime and endTime are not * sent, the most recent klines are returned. * Contract type: * PERPETUAL * CURRENT_QUARTER * - * NEXT_QUARTER Weight: based on parameter LIMIT | LIMIT | weight | | ----------- | ------ | | - * [1,100) | 1 | | [100, 500) | 2 | | [500, 1000] | 5 | | > 1000 | 10 | + * NEXT_QUARTER * TRADIFI_PERPETUAL Weight: based on parameter LIMIT | LIMIT | weight | | + * ----------- | ------ | | [1,100) | 1 | | [100, 500) | 2 | | [500, 1000] | 5 | | > 1000 | + * 10 | * * @param pair (required) * @param contractType (required) @@ -1113,7 +1153,7 @@ public ApiResponse longShortRatio( } /** - * Mark Price Mark Price and Funding Rate Weight: 1 + * Mark Price Mark Price and Funding Rate Weight: 1 with symbol, 10 without symbol * * @param symbol (optional) * @return ApiResponse<MarkPriceResponse> @@ -1274,7 +1314,8 @@ public ApiResponse openInterestStatistics( } /** - * Order Book Query symbol orderbook Weight: Adjusted based on the limit: | Limit | Weight | | + * Order Book Query symbol orderbook Retail Price Improvement(RPI) orders are not visible and + * excluded in the response message. Weight: Adjusted based on the limit: | Limit | Weight | | * ------------- | ------ | | 5, 10, 20, 50 | 2 | | 100 | 5 | | 500 | 10 | | 1000 | 20 | * * @param symbol (required) @@ -1352,7 +1393,8 @@ public ApiResponse quarterlyContractSe } /** - * Query Index Price Constituents Query index price constituents Weight: 2 + * Query Index Price Constituents Query index price constituents **Note**: Prices from + * constituents of TradFi perps will be hiden and displayed as -1. Weight: 2 * * @param symbol (required) * @return ApiResponse<QueryIndexPriceConstituentsResponse> @@ -1424,7 +1466,35 @@ public ApiResponse recentTradesList(String symbol, Lon } /** - * Symbol Order Book Ticker Best price/qty on the order book for a symbol or symbols. * If the + * RPI Order Book Query symbol orderbook with RPI orders RPI(Retail Price Improvement) orders + * are included and aggreated in the response message. Crossed price levels are hidden and + * invisible. Weight: Adjusted based on the limit: | Limit | Weight | | ------------- | ------ | + * | 1000 | 20 | + * + * @param symbol (required) + * @param limit Default 100; max 1000 (optional) + * @return ApiResponse<RpiOrderBookResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 RPI Order Book -
+ * + * @see RPI + * Order Book Documentation + */ + public ApiResponse rpiOrderBook(String symbol, Long limit) + throws ApiException { + return marketDataApi.rpiOrderBook(symbol, limit); + } + + /** + * Symbol Order Book Ticker Best price/qty on the order book for a symbol or symbols. Retail + * Price Improvement(RPI) orders are not visible and excluded in the response message. * If the * symbol is not sent, bookTickers for all symbols will be returned in an array. * The field * `X-MBX-USED-WEIGHT-1M` in response header is not accurate from this endpoint, * please ignore. Weight: 2 for a single symbol; 5 when the symbol parameter is omitted @@ -1450,9 +1520,9 @@ public ApiResponse symbolOrderBookTicker(String s } /** - * Symbol Price Ticker(Deprecated) Latest price for a symbol or symbols. * If the symbol is not - * sent, prices for all symbols will be returned in an array. Weight: 1 for a single symbol; 2 - * when the symbol parameter is omitted + * Symbol Price Ticker Latest price for a symbol or symbols. * If the symbol is not sent, prices + * for all symbols will be returned in an array. Weight: 1 for a single symbol; 2 when the + * symbol parameter is omitted * * @param symbol (optional) * @return ApiResponse<SymbolPriceTickerResponse> @@ -1465,9 +1535,10 @@ public ApiResponse symbolOrderBookTicker(String s * 200 Symbol Price Ticker - * * + * @deprecated * @see Symbol - * Price Ticker(Deprecated) Documentation + * Price Ticker Documentation */ public ApiResponse symbolPriceTicker(String symbol) throws ApiException { @@ -1654,6 +1725,31 @@ public ApiResponse topTraderLongShortR symbol, period, limit, startTime, endTime); } + /** + * Trading Schedule Trading session schedules for a one-week period starting from the day prior + * to the query time, covering both the U.S. equity and commodity markets. Equity market session + * types include \"PRE_MARKET\", \"REGULAR\", \"AFTER_MARKET\", + * \"OVERNIGHT\", and \"NO_TRADING\", while commodity market session types + * include \"REGULAR\" and \"NO_TRADING\". Weight: 5 + * + * @return ApiResponse<TradingScheduleResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Trading Schedule -
+ * + * @see Trading + * Schedule Documentation + */ + public ApiResponse tradingSchedule() throws ApiException { + return marketDataApi.tradingSchedule(); + } + /** * Classic Portfolio Margin Account Information (USER_DATA) Get Classic Portfolio Margin current * account information. * maxWithdrawAmount is for asset transfer out to the spot wallet. @@ -1789,6 +1885,56 @@ public ApiResponse autoCancelAllOpenOrders( return tradeApi.autoCancelAllOpenOrders(autoCancelAllOpenOrdersRequest); } + /** + * Cancel Algo Order (TRADE) Cancel an active algo order. * Either `algoid` or + * `clientalgoid` must be sent. Weight: 1 + * + * @param algoid (optional) + * @param clientalgoid (optional) + * @param recvWindow (optional) + * @return ApiResponse<CancelAlgoOrderResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Cancel Algo Order -
+ * + * @see Cancel + * Algo Order (TRADE) Documentation + */ + public ApiResponse cancelAlgoOrder( + Long algoid, String clientalgoid, Long recvWindow) throws ApiException { + return tradeApi.cancelAlgoOrder(algoid, clientalgoid, recvWindow); + } + + /** + * Cancel All Algo Open Orders (TRADE) Cancel All Algo Open Orders Weight: 1 + * + * @param symbol (required) + * @param recvWindow (optional) + * @return ApiResponse<CancelAllAlgoOpenOrdersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Cancel All Algo Open Orders -
+ * + * @see Cancel + * All Algo Open Orders (TRADE) Documentation + */ + public ApiResponse cancelAllAlgoOpenOrders( + String symbol, Long recvWindow) throws ApiException { + return tradeApi.cancelAllAlgoOpenOrders(symbol, recvWindow); + } + /** * Cancel All Open Orders (TRADE) Cancel All Open Orders Weight: 1 * @@ -1970,6 +2116,35 @@ public ApiResponse changePositionMode( return tradeApi.changePositionMode(changePositionModeRequest); } + /** + * Current All Algo Open Orders (USER_DATA) Get all algo open orders on a symbol. * If the + * symbol is not sent, orders for all symbols will be returned in an array. Weight: 1 for a + * single symbol; 40 when the symbol parameter is omitted Careful when accessing this with no + * symbol. + * + * @param algoType (optional) + * @param symbol (optional) + * @param algoId (optional) + * @param recvWindow (optional) + * @return ApiResponse<CurrentAllAlgoOpenOrdersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Current All Algo Open Orders -
+ * + * @see Current + * All Algo Open Orders (USER_DATA) Documentation + */ + public ApiResponse currentAllAlgoOpenOrders( + String algoType, String symbol, Long algoId, Long recvWindow) throws ApiException { + return tradeApi.currentAllAlgoOpenOrders(algoType, symbol, algoId, recvWindow); + } + /** * Current All Open Orders (USER_DATA) Get all open orders on a symbol. * If the symbol is not * sent, orders for all symbols will be returned in an array. Weight: 1 for a single symbol; 40 @@ -1996,6 +2171,30 @@ public ApiResponse currentAllOpenOrders( return tradeApi.currentAllOpenOrders(symbol, recvWindow); } + /** + * Futures TradFi Perps Contract(USER_DATA) Sign TradFi-Perps agreement contract Weight: 0 + * + * @param futuresTradfiPerpsContractRequest (required) + * @return ApiResponse<FuturesTradfiPerpsContractResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Futures TradFi Perps Contract -
+ * + * @see Futures + * TradFi Perps Contract(USER_DATA) Documentation + */ + public ApiResponse futuresTradfiPerpsContract( + FuturesTradfiPerpsContractRequest futuresTradfiPerpsContractRequest) + throws ApiException { + return tradeApi.futuresTradfiPerpsContract(futuresTradfiPerpsContractRequest); + } + /** * Get Order Modify History (USER_DATA) Get order modification history * Either * `orderId` or `origClientOrderId` must be sent, and the @@ -2156,6 +2355,59 @@ public ApiResponse modifyOrder(ModifyOrderRequest modifyOrd return tradeApi.modifyOrder(modifyOrderRequest); } + /** + * New Algo Order(TRADE) Send in a new Algo order. * Condition orders will be triggered when: * + * If parameter`priceProtect`is sent as true: * when price reaches the + * `triggerPrice` ,the difference rate between \"MARK_PRICE\" and + * \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the + * symbol * \"triggerProtect\" of a symbol can be got from `GET + * /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * BUY: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * SELL: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `triggerPrice` * `TAKE_PROFIT`, + * `TAKE_PROFIT_MARKET`: * BUY: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after + * order placed <= `activationPrice`, and the latest price >= the + * lowest price * (1 + `callbackRate`) * SELL: the highest price after order placed + * >= `activationPrice`, and the latest price <= the highest price * + * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error + * code. ``{\"code\": -2021, \"msg\": \"Order would + * immediately trigger.\"}`` means that the parameters you send do not meet the + * following requirements: * BUY: `activationPrice` should be smaller than latest + * price. * SELL: `activationPrice` should be larger than latest price. * + * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with + * `closePosition`=`true`: * Follow the same rules for condition + * orders. * If triggered,**close all** current long position( if `SELL`) or current + * short position( if `BUY`). * Cannot be used with `quantity` paremeter * + * Cannot be used with `reduceOnly` parameter * In Hedge Mode,cannot be used with + * `BUY` orders in `LONG` position side. and cannot be used with + * `SELL` orders in `SHORT` position side * + * `selfTradePreventionMode` is only effective when `timeInForce` set to + * `IOC` or `GTC` or `GTD`. Weight: 0 on IP rate + * limit(x-mbx-used-weight-1m) + * + * @param newAlgoOrderRequest (required) + * @return ApiResponse<NewAlgoOrderResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 New Algo Order -
+ * + * @see New + * Algo Order(TRADE) Documentation + */ + public ApiResponse newAlgoOrder(NewAlgoOrderRequest newAlgoOrderRequest) + throws ApiException { + return tradeApi.newAlgoOrder(newAlgoOrderRequest); + } + /** * New Order(TRADE) Send in a new order. * Order with type `STOP`, parameter * `timeInForce` can be sent ( default `GTC`). * Order with type @@ -2327,6 +2579,78 @@ public ApiResponse positionInformationV3( return tradeApi.positionInformationV3(symbol, recvWindow); } + /** + * Query Algo Order (USER_DATA) Check an algo order's status. * These orders will not be + * found: * order status is `CANCELED` or `EXPIRED` **AND** order has NO + * filled trade **AND** created time + 3 days < current time * order create time + 90 days + * < current time * Either `algoId` or `clientAlgoId` must be sent. * + * `algoId` is self-increment for each specific `symbol` Weight: 1 + * + * @param algoId (optional) + * @param clientAlgoId (optional) + * @param recvWindow (optional) + * @return ApiResponse<QueryAlgoOrderResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Algo Order -
+ * + * @see Query + * Algo Order (USER_DATA) Documentation + */ + public ApiResponse queryAlgoOrder( + Long algoId, String clientAlgoId, Long recvWindow) throws ApiException { + return tradeApi.queryAlgoOrder(algoId, clientAlgoId, recvWindow); + } + + /** + * Query All Algo Orders (USER_DATA) Get all algo orders; active, CANCELED, TRIGGERED or + * FINISHED . * These orders will not be found: * order status is `CANCELED` or + * `EXPIRED` **AND** order has NO filled trade **AND** created time + 3 days < + * current time * order create time + 90 days < current time * If `algoId` is set, + * it will get orders >= that `algoId`. Otherwise most recent orders are + * returned. * The query time period must be less then 7 days( default as the recent 7 days). + * Weight: 5 + * + * @param symbol (required) + * @param algoId (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param page (optional) + * @param limit Default 100; max 1000 (optional) + * @param recvWindow (optional) + * @return ApiResponse<QueryAllAlgoOrdersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 All Algo Orders -
+ * + * @see Query + * All Algo Orders (USER_DATA) Documentation + */ + public ApiResponse queryAllAlgoOrders( + String symbol, + Long algoId, + Long startTime, + Long endTime, + Long page, + Long limit, + Long recvWindow) + throws ApiException { + return tradeApi.queryAllAlgoOrders( + symbol, algoId, startTime, endTime, page, limit, recvWindow); + } + /** * Query Current Open Order (USER_DATA) Query open order * Either`orderId` or * `origClientOrderId` must be sent * If the queried order has been filled or diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java index 3b56a7fb..0d8915e8 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java @@ -19,6 +19,7 @@ import com.binance.connector.client.common.SystemUtil; import com.binance.connector.client.common.configuration.ClientConfiguration; import com.binance.connector.client.common.exception.ConstraintViolationException; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.AdlRiskResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.BasisResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CheckServerTimeResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CompositeIndexSymbolInformationResponse; @@ -45,6 +46,7 @@ import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.QueryIndexPriceConstituentsResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.QueryInsuranceFundBalanceSnapshotResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.RecentTradesListResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.RpiOrderBookResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.SymbolOrderBookTickerResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.SymbolPriceTickerResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.SymbolPriceTickerV2Response; @@ -52,6 +54,7 @@ import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.Ticker24hrPriceChangeStatisticsResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.TopTraderLongShortRatioAccountsResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.TopTraderLongShortRatioPositionsResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.TradingScheduleResponse; import com.google.gson.reflect.TypeToken; import jakarta.validation.ConstraintViolation; import jakarta.validation.Validation; @@ -74,7 +77,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/6.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/7.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -111,6 +114,139 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } + /** + * Build call for adlRisk + * + * @param symbol (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 ADL Risk -
+ * + * @see ADL + * Risk Documentation + */ + private okhttp3.Call adlRiskCall(String symbol) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fapi/v1/symbolAdlRisk"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (symbol != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call adlRiskValidateBeforeCall(String symbol) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {symbol}; + Method method = this.getClass().getMethod("adlRisk", String.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return adlRiskCall(symbol); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * ADL Risk Query the symbol-level ADL risk rating. The ADL risk rating measures the likelihood + * of ADL during liquidation, and the rating takes into account the insurance fund balance, + * position concentration on the symbol, order book depth, price volatility, average leverage, + * unrealized PnL, and margin utilization at the symbol level. The rating can be high, medium + * and low, and is updated every 30 minutes. Weight: 1 + * + * @param symbol (optional) + * @return ApiResponse<AdlRiskResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 ADL Risk -
+ * + * @see ADL + * Risk Documentation + */ + public ApiResponse adlRisk(String symbol) throws ApiException { + okhttp3.Call localVarCall = adlRiskValidateBeforeCall(symbol); + java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for basis * @@ -706,15 +842,16 @@ private okhttp3.Call compressedAggregateTradesListValidateBeforeCall( /** * Compressed/Aggregate Trades List Get compressed, aggregate market trades. Market trades that * fill in 100ms with the same price and the same taking side will have the quantity aggregated. - * * support querying futures trade histories that are not older than one year * If both - * `startTime` and `endTime` are sent, time between `startTime` - * and `endTime` must be less than 1 hour. * If `fromId`, - * `startTime`, and `endTime` are not sent, the most recent aggregate trades - * will be returned. * Only market trades will be aggregated and returned, which means the - * insurance fund trades and ADL trades won't be aggregated. * Sending both - * `startTime`/`endTime` and `fromId` might cause response - * timeout, please send either `fromId` or `startTime`/`endTime` - * Weight: 20 + * Retail Price Improvement(RPI) orders are aggregated and without special tags to be + * distinguished. * support querying futures trade histories that are not older than one year * + * If both `startTime` and `endTime` are sent, time between + * `startTime` and `endTime` must be less than 1 hour. * If + * `fromId`, `startTime`, and `endTime` are not sent, the most + * recent aggregate trades will be returned. * Only market trades will be aggregated and + * returned, which means the insurance fund trades and ADL trades won't be aggregated. * + * Sending both `startTime`/`endTime` and `fromId` might cause + * response timeout, please send either `fromId` or + * `startTime`/`endTime` Weight: 20 * * @param symbol (required) * @param fromId ID to get aggregate trades from INCLUSIVE. (optional) @@ -905,8 +1042,9 @@ private okhttp3.Call continuousContractKlineCandlestickDataValidateBeforeCall( * Continuous Contract Kline/Candlestick Data Kline/candlestick bars for a specific contract * type. Klines are uniquely identified by their open time. * If startTime and endTime are not * sent, the most recent klines are returned. * Contract type: * PERPETUAL * CURRENT_QUARTER * - * NEXT_QUARTER Weight: based on parameter LIMIT | LIMIT | weight | | ----------- | ------ | | - * [1,100) | 1 | | [100, 500) | 2 | | [500, 1000] | 5 | | > 1000 | 10 | + * NEXT_QUARTER * TRADIFI_PERPETUAL Weight: based on parameter LIMIT | LIMIT | weight | | + * ----------- | ------ | | [1,100) | 1 | | [100, 500) | 2 | | [500, 1000] | 5 | | > 1000 | + * 10 | * * @param pair (required) * @param contractType (required) @@ -1998,7 +2136,7 @@ private okhttp3.Call markPriceValidateBeforeCall(String symbol) throws ApiExcept } /** - * Mark Price Mark Price and Funding Rate Weight: 1 + * Mark Price Mark Price and Funding Rate Weight: 1 with symbol, 10 without symbol * * @param symbol (optional) * @return ApiResponse<MarkPriceResponse> @@ -2905,7 +3043,8 @@ private okhttp3.Call orderBookValidateBeforeCall(String symbol, Long limit) } /** - * Order Book Query symbol orderbook Weight: Adjusted based on the limit: | Limit | Weight | | + * Order Book Query symbol orderbook Retail Price Improvement(RPI) orders are not visible and + * excluded in the response message. Weight: Adjusted based on the limit: | Limit | Weight | | * ------------- | ------ | | 5, 10, 20, 50 | 2 | | 100 | 5 | | 500 | 10 | | 1000 | 20 | * * @param symbol (required) @@ -3348,7 +3487,8 @@ private okhttp3.Call queryIndexPriceConstituentsValidateBeforeCall(String symbol } /** - * Query Index Price Constituents Query index price constituents Weight: 2 + * Query Index Price Constituents Query index price constituents **Note**: Prices from + * constituents of TradFi perps will be hiden and displayed as -1. Weight: 2 * * @param symbol (required) * @return ApiResponse<QueryIndexPriceConstituentsResponse> @@ -3646,6 +3786,147 @@ public ApiResponse recentTradesList( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for rpiOrderBook + * + * @param symbol (required) + * @param limit Default 100; max 1000 (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 RPI Order Book -
+ * + * @see RPI + * Order Book Documentation + */ + private okhttp3.Call rpiOrderBookCall(String symbol, Long limit) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fapi/v1/rpiDepth"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (symbol != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call rpiOrderBookValidateBeforeCall(String symbol, Long limit) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {symbol, limit}; + Method method = this.getClass().getMethod("rpiOrderBook", String.class, Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return rpiOrderBookCall(symbol, limit); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * RPI Order Book Query symbol orderbook with RPI orders RPI(Retail Price Improvement) orders + * are included and aggreated in the response message. Crossed price levels are hidden and + * invisible. Weight: Adjusted based on the limit: | Limit | Weight | | ------------- | ------ | + * | 1000 | 20 | + * + * @param symbol (required) + * @param limit Default 100; max 1000 (optional) + * @return ApiResponse<RpiOrderBookResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 RPI Order Book -
+ * + * @see RPI + * Order Book Documentation + */ + public ApiResponse rpiOrderBook(@NotNull String symbol, Long limit) + throws ApiException { + okhttp3.Call localVarCall = rpiOrderBookValidateBeforeCall(symbol, limit); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for symbolOrderBookTicker * @@ -3753,7 +4034,8 @@ private okhttp3.Call symbolOrderBookTickerValidateBeforeCall(String symbol) } /** - * Symbol Order Book Ticker Best price/qty on the order book for a symbol or symbols. * If the + * Symbol Order Book Ticker Best price/qty on the order book for a symbol or symbols. Retail + * Price Improvement(RPI) orders are not visible and excluded in the response message. * If the * symbol is not sent, bookTickers for all symbols will be returned in an array. * The field * `X-MBX-USED-WEIGHT-1M` in response header is not accurate from this endpoint, * please ignore. Weight: 2 for a single symbol; 5 when the symbol parameter is omitted @@ -3794,10 +4076,12 @@ public ApiResponse symbolOrderBookTicker(String s * 200 Symbol Price Ticker - * * + * @deprecated * @see Symbol - * Price Ticker(Deprecated) Documentation + * Price Ticker Documentation */ + @Deprecated private okhttp3.Call symbolPriceTickerCall(String symbol) throws ApiException { String basePath = null; // Operation Servers @@ -3856,6 +4140,7 @@ private okhttp3.Call symbolPriceTickerCall(String symbol) throws ApiException { localVarAuthNames); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call symbolPriceTickerValidateBeforeCall(String symbol) throws ApiException { try { @@ -3887,9 +4172,9 @@ private okhttp3.Call symbolPriceTickerValidateBeforeCall(String symbol) throws A } /** - * Symbol Price Ticker(Deprecated) Latest price for a symbol or symbols. * If the symbol is not - * sent, prices for all symbols will be returned in an array. Weight: 1 for a single symbol; 2 - * when the symbol parameter is omitted + * Symbol Price Ticker Latest price for a symbol or symbols. * If the symbol is not sent, prices + * for all symbols will be returned in an array. Weight: 1 for a single symbol; 2 when the + * symbol parameter is omitted * * @param symbol (optional) * @return ApiResponse<SymbolPriceTickerResponse> @@ -3902,10 +4187,12 @@ private okhttp3.Call symbolPriceTickerValidateBeforeCall(String symbol) throws A * 200 Symbol Price Ticker - * * + * @deprecated * @see Symbol - * Price Ticker(Deprecated) Documentation + * Price Ticker Documentation */ + @Deprecated public ApiResponse symbolPriceTicker(String symbol) throws ApiException { okhttp3.Call localVarCall = symbolPriceTickerValidateBeforeCall(symbol); @@ -4855,4 +5142,132 @@ public ApiResponse topTraderLongShortR new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } + + /** + * Build call for tradingSchedule + * + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Trading Schedule -
+ * + * @see Trading + * Schedule Documentation + */ + private okhttp3.Call tradingScheduleCall() throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fapi/v1/tradingSchedule"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call tradingScheduleValidateBeforeCall() throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {}; + Method method = this.getClass().getMethod("tradingSchedule"); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return tradingScheduleCall(); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Trading Schedule Trading session schedules for a one-week period starting from the day prior + * to the query time, covering both the U.S. equity and commodity markets. Equity market session + * types include \"PRE_MARKET\", \"REGULAR\", \"AFTER_MARKET\", + * \"OVERNIGHT\", and \"NO_TRADING\", while commodity market session types + * include \"REGULAR\" and \"NO_TRADING\". Weight: 5 + * + * @return ApiResponse<TradingScheduleResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Trading Schedule -
+ * + * @see Trading + * Schedule Documentation + */ + public ApiResponse tradingSchedule() throws ApiException { + okhttp3.Call localVarCall = tradingScheduleValidateBeforeCall(); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } } diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java index cde8cdf5..c3393389 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java @@ -42,7 +42,7 @@ public class PortfolioMarginEndpointsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/6.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/7.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java index 981f607f..ae631f31 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java @@ -26,6 +26,8 @@ import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.AutoCancelAllOpenOrdersRequest; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.AutoCancelAllOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.AutoCloseType; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CancelAlgoOrderResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CancelAllAlgoOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CancelAllOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CancelMultipleOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CancelOrderResponse; @@ -37,7 +39,10 @@ import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.ChangeMultiAssetsModeResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.ChangePositionModeRequest; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.ChangePositionModeResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CurrentAllAlgoOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CurrentAllOpenOrdersResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesTradfiPerpsContractRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesTradfiPerpsContractResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.GetOrderModifyHistoryResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.GetPositionMarginChangeHistoryResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.ModifyIsolatedPositionMarginRequest; @@ -46,6 +51,8 @@ import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.ModifyMultipleOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.ModifyOrderRequest; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.ModifyOrderResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.NewAlgoOrderRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.NewAlgoOrderResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.NewOrderRequest; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.NewOrderResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.OrderIdList; @@ -55,6 +62,8 @@ import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.PositionAdlQuantileEstimationResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.PositionInformationV2Response; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.PositionInformationV3Response; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.QueryAlgoOrderResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.QueryAllAlgoOrdersResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.QueryCurrentOpenOrderResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.QueryOrderResponse; import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.TestOrderRequest; @@ -83,7 +92,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/6.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/7.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -674,6 +683,298 @@ public ApiResponse autoCancelAllOpenOrders( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for cancelAlgoOrder + * + * @param algoid (optional) + * @param clientalgoid (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Cancel Algo Order -
+ * + * @see Cancel + * Algo Order (TRADE) Documentation + */ + private okhttp3.Call cancelAlgoOrderCall(Long algoid, String clientalgoid, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fapi/v1/algoOrder"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (algoid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("algoid", algoid)); + } + + if (clientalgoid != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("clientalgoid", clientalgoid)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cancelAlgoOrderValidateBeforeCall( + Long algoid, String clientalgoid, Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {algoid, clientalgoid, recvWindow}; + Method method = + this.getClass() + .getMethod("cancelAlgoOrder", Long.class, String.class, Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return cancelAlgoOrderCall(algoid, clientalgoid, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Cancel Algo Order (TRADE) Cancel an active algo order. * Either `algoid` or + * `clientalgoid` must be sent. Weight: 1 + * + * @param algoid (optional) + * @param clientalgoid (optional) + * @param recvWindow (optional) + * @return ApiResponse<CancelAlgoOrderResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Cancel Algo Order -
+ * + * @see Cancel + * Algo Order (TRADE) Documentation + */ + public ApiResponse cancelAlgoOrder( + Long algoid, String clientalgoid, Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = + cancelAlgoOrderValidateBeforeCall(algoid, clientalgoid, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for cancelAllAlgoOpenOrders + * + * @param symbol (required) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Cancel All Algo Open Orders -
+ * + * @see Cancel + * All Algo Open Orders (TRADE) Documentation + */ + private okhttp3.Call cancelAllAlgoOpenOrdersCall(String symbol, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fapi/v1/algoOpenOrders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (symbol != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cancelAllAlgoOpenOrdersValidateBeforeCall(String symbol, Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {symbol, recvWindow}; + Method method = + this.getClass().getMethod("cancelAllAlgoOpenOrders", String.class, Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return cancelAllAlgoOpenOrdersCall(symbol, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Cancel All Algo Open Orders (TRADE) Cancel All Algo Open Orders Weight: 1 + * + * @param symbol (required) + * @param recvWindow (optional) + * @return ApiResponse<CancelAllAlgoOpenOrdersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Cancel All Algo Open Orders -
+ * + * @see Cancel + * All Algo Open Orders (TRADE) Documentation + */ + public ApiResponse cancelAllAlgoOpenOrders( + @NotNull String symbol, Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = cancelAllAlgoOpenOrdersValidateBeforeCall(symbol, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for cancelAllOpenOrders * @@ -1740,9 +2041,11 @@ public ApiResponse changePositionMode( } /** - * Build call for currentAllOpenOrders + * Build call for currentAllAlgoOpenOrders * + * @param algoType (optional) * @param symbol (optional) + * @param algoId (optional) * @param recvWindow (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1750,15 +2053,15 @@ public ApiResponse changePositionMode( * * * - * + * *
Response Details
Status Code Description Response Headers
200 Current All Open Orders -
200 Current All Algo Open Orders -
* * @see Current - * All Open Orders (USER_DATA) Documentation + * href="https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Algo-Open-Orders">Current + * All Algo Open Orders (USER_DATA) Documentation */ - private okhttp3.Call currentAllOpenOrdersCall(String symbol, Long recvWindow) - throws ApiException { + private okhttp3.Call currentAllAlgoOpenOrdersCall( + String algoType, String symbol, Long algoId, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -1775,7 +2078,7 @@ private okhttp3.Call currentAllOpenOrdersCall(String symbol, Long recvWindow) Object localVarPostBody = null; // create path and map variables - String localVarPath = "/fapi/v1/openOrders"; + String localVarPath = "/fapi/v1/openAlgoOrders"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1783,11 +2086,172 @@ private okhttp3.Call currentAllOpenOrdersCall(String symbol, Long recvWindow) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (algoType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("algoType", algoType)); + } + if (symbol != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); } - if (recvWindow != null) { + if (algoId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("algoId", algoId)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call currentAllAlgoOpenOrdersValidateBeforeCall( + String algoType, String symbol, Long algoId, Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {algoType, symbol, algoId, recvWindow}; + Method method = + this.getClass() + .getMethod( + "currentAllAlgoOpenOrders", + String.class, + String.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return currentAllAlgoOpenOrdersCall(algoType, symbol, algoId, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Current All Algo Open Orders (USER_DATA) Get all algo open orders on a symbol. * If the + * symbol is not sent, orders for all symbols will be returned in an array. Weight: 1 for a + * single symbol; 40 when the symbol parameter is omitted Careful when accessing this with no + * symbol. + * + * @param algoType (optional) + * @param symbol (optional) + * @param algoId (optional) + * @param recvWindow (optional) + * @return ApiResponse<CurrentAllAlgoOpenOrdersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Current All Algo Open Orders -
+ * + * @see Current + * All Algo Open Orders (USER_DATA) Documentation + */ + public ApiResponse currentAllAlgoOpenOrders( + String algoType, String symbol, Long algoId, Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = + currentAllAlgoOpenOrdersValidateBeforeCall(algoType, symbol, algoId, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for currentAllOpenOrders + * + * @param symbol (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Current All Open Orders -
+ * + * @see Current + * All Open Orders (USER_DATA) Documentation + */ + private okhttp3.Call currentAllOpenOrdersCall(String symbol, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fapi/v1/openOrders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (symbol != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); + } + + if (recvWindow != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); } @@ -1882,6 +2346,148 @@ public ApiResponse currentAllOpenOrders( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for futuresTradfiPerpsContract + * + * @param futuresTradfiPerpsContractRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Futures TradFi Perps Contract -
+ * + * @see Futures + * TradFi Perps Contract(USER_DATA) Documentation + */ + private okhttp3.Call futuresTradfiPerpsContractCall( + FuturesTradfiPerpsContractRequest futuresTradfiPerpsContractRequest) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fapi/v1/stock/contract"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (futuresTradfiPerpsContractRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", futuresTradfiPerpsContractRequest.getRecvWindow()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call futuresTradfiPerpsContractValidateBeforeCall( + FuturesTradfiPerpsContractRequest futuresTradfiPerpsContractRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {futuresTradfiPerpsContractRequest}; + Method method = + this.getClass() + .getMethod( + "futuresTradfiPerpsContract", + FuturesTradfiPerpsContractRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return futuresTradfiPerpsContractCall(futuresTradfiPerpsContractRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Futures TradFi Perps Contract(USER_DATA) Sign TradFi-Perps agreement contract Weight: 0 + * + * @param futuresTradfiPerpsContractRequest (required) + * @return ApiResponse<FuturesTradfiPerpsContractResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Futures TradFi Perps Contract -
+ * + * @see Futures + * TradFi Perps Contract(USER_DATA) Documentation + */ + public ApiResponse futuresTradfiPerpsContract( + @Valid @NotNull FuturesTradfiPerpsContractRequest futuresTradfiPerpsContractRequest) + throws ApiException { + okhttp3.Call localVarCall = + futuresTradfiPerpsContractValidateBeforeCall(futuresTradfiPerpsContractRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for getOrderModifyHistory * @@ -2768,16 +3374,268 @@ public ApiResponse modifyOrder( } /** - * Build call for newOrder + * Build call for newAlgoOrder * - * @param newOrderRequest (required) + * @param newAlgoOrderRequest (required) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details * * * - * + * + *
Response Details
Status Code Description Response Headers
200 New Order -
200 New Algo Order -
+ * + * @see New + * Algo Order(TRADE) Documentation + */ + private okhttp3.Call newAlgoOrderCall(NewAlgoOrderRequest newAlgoOrderRequest) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fapi/v1/algoOrder"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (newAlgoOrderRequest.getAlgoType() != null) { + localVarFormParams.put("algoType", newAlgoOrderRequest.getAlgoType()); + } + + if (newAlgoOrderRequest.getSymbol() != null) { + localVarFormParams.put("symbol", newAlgoOrderRequest.getSymbol()); + } + + if (newAlgoOrderRequest.getSide() != null) { + localVarFormParams.put("side", newAlgoOrderRequest.getSide()); + } + + if (newAlgoOrderRequest.getPositionSide() != null) { + localVarFormParams.put("positionSide", newAlgoOrderRequest.getPositionSide()); + } + + if (newAlgoOrderRequest.getType() != null) { + localVarFormParams.put("type", newAlgoOrderRequest.getType()); + } + + if (newAlgoOrderRequest.getTimeInForce() != null) { + localVarFormParams.put("timeInForce", newAlgoOrderRequest.getTimeInForce()); + } + + if (newAlgoOrderRequest.getQuantity() != null) { + localVarFormParams.put( + "quantity", + DecimalFormatter.getFormatter().format(newAlgoOrderRequest.getQuantity())); + } + + if (newAlgoOrderRequest.getPrice() != null) { + localVarFormParams.put( + "price", + DecimalFormatter.getFormatter().format(newAlgoOrderRequest.getPrice())); + } + + if (newAlgoOrderRequest.getTriggerPrice() != null) { + localVarFormParams.put( + "triggerPrice", + DecimalFormatter.getFormatter().format(newAlgoOrderRequest.getTriggerPrice())); + } + + if (newAlgoOrderRequest.getWorkingType() != null) { + localVarFormParams.put("workingType", newAlgoOrderRequest.getWorkingType()); + } + + if (newAlgoOrderRequest.getPriceMatch() != null) { + localVarFormParams.put("priceMatch", newAlgoOrderRequest.getPriceMatch()); + } + + if (newAlgoOrderRequest.getClosePosition() != null) { + localVarFormParams.put("closePosition", newAlgoOrderRequest.getClosePosition()); + } + + if (newAlgoOrderRequest.getPriceProtect() != null) { + localVarFormParams.put("priceProtect", newAlgoOrderRequest.getPriceProtect()); + } + + if (newAlgoOrderRequest.getReduceOnly() != null) { + localVarFormParams.put("reduceOnly", newAlgoOrderRequest.getReduceOnly()); + } + + if (newAlgoOrderRequest.getActivationPrice() != null) { + localVarFormParams.put( + "activationPrice", + DecimalFormatter.getFormatter() + .format(newAlgoOrderRequest.getActivationPrice())); + } + + if (newAlgoOrderRequest.getCallbackRate() != null) { + localVarFormParams.put( + "callbackRate", + DecimalFormatter.getFormatter().format(newAlgoOrderRequest.getCallbackRate())); + } + + if (newAlgoOrderRequest.getClientAlgoId() != null) { + localVarFormParams.put("clientAlgoId", newAlgoOrderRequest.getClientAlgoId()); + } + + if (newAlgoOrderRequest.getSelfTradePreventionMode() != null) { + localVarFormParams.put( + "selfTradePreventionMode", newAlgoOrderRequest.getSelfTradePreventionMode()); + } + + if (newAlgoOrderRequest.getGoodTillDate() != null) { + localVarFormParams.put("goodTillDate", newAlgoOrderRequest.getGoodTillDate()); + } + + if (newAlgoOrderRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", newAlgoOrderRequest.getRecvWindow()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call newAlgoOrderValidateBeforeCall(NewAlgoOrderRequest newAlgoOrderRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {newAlgoOrderRequest}; + Method method = this.getClass().getMethod("newAlgoOrder", NewAlgoOrderRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return newAlgoOrderCall(newAlgoOrderRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * New Algo Order(TRADE) Send in a new Algo order. * Condition orders will be triggered when: * + * If parameter`priceProtect`is sent as true: * when price reaches the + * `triggerPrice` ,the difference rate between \"MARK_PRICE\" and + * \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the + * symbol * \"triggerProtect\" of a symbol can be got from `GET + * /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * BUY: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * SELL: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `triggerPrice` * `TAKE_PROFIT`, + * `TAKE_PROFIT_MARKET`: * BUY: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after + * order placed <= `activationPrice`, and the latest price >= the + * lowest price * (1 + `callbackRate`) * SELL: the highest price after order placed + * >= `activationPrice`, and the latest price <= the highest price * + * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error + * code. ``{\"code\": -2021, \"msg\": \"Order would + * immediately trigger.\"}`` means that the parameters you send do not meet the + * following requirements: * BUY: `activationPrice` should be smaller than latest + * price. * SELL: `activationPrice` should be larger than latest price. * + * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with + * `closePosition`=`true`: * Follow the same rules for condition + * orders. * If triggered,**close all** current long position( if `SELL`) or current + * short position( if `BUY`). * Cannot be used with `quantity` paremeter * + * Cannot be used with `reduceOnly` parameter * In Hedge Mode,cannot be used with + * `BUY` orders in `LONG` position side. and cannot be used with + * `SELL` orders in `SHORT` position side * + * `selfTradePreventionMode` is only effective when `timeInForce` set to + * `IOC` or `GTC` or `GTD`. Weight: 0 on IP rate + * limit(x-mbx-used-weight-1m) + * + * @param newAlgoOrderRequest (required) + * @return ApiResponse<NewAlgoOrderResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 New Algo Order -
+ * + * @see New + * Algo Order(TRADE) Documentation + */ + public ApiResponse newAlgoOrder( + @Valid @NotNull NewAlgoOrderRequest newAlgoOrderRequest) throws ApiException { + okhttp3.Call localVarCall = newAlgoOrderValidateBeforeCall(newAlgoOrderRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for newOrder + * + * @param newOrderRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * *
Response Details
Status Code Description Response Headers
200 New Order -
* * @see positionInformationV3( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for queryAlgoOrder + * + * @param algoId (optional) + * @param clientAlgoId (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Algo Order -
+ * + * @see
Query + * Algo Order (USER_DATA) Documentation + */ + private okhttp3.Call queryAlgoOrderCall(Long algoId, String clientAlgoId, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fapi/v1/algoOrder"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (algoId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("algoId", algoId)); + } + + if (clientAlgoId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("clientAlgoId", clientAlgoId)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call queryAlgoOrderValidateBeforeCall( + Long algoId, String clientAlgoId, Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {algoId, clientAlgoId, recvWindow}; + Method method = + this.getClass() + .getMethod("queryAlgoOrder", Long.class, String.class, Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return queryAlgoOrderCall(algoId, clientAlgoId, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Query Algo Order (USER_DATA) Check an algo order's status. * These orders will not be + * found: * order status is `CANCELED` or `EXPIRED` **AND** order has NO + * filled trade **AND** created time + 3 days < current time * order create time + 90 days + * < current time * Either `algoId` or `clientAlgoId` must be sent. * + * `algoId` is self-increment for each specific `symbol` Weight: 1 + * + * @param algoId (optional) + * @param clientAlgoId (optional) + * @param recvWindow (optional) + * @return ApiResponse<QueryAlgoOrderResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Algo Order -
+ * + * @see Query + * Algo Order (USER_DATA) Documentation + */ + public ApiResponse queryAlgoOrder( + Long algoId, String clientAlgoId, Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = + queryAlgoOrderValidateBeforeCall(algoId, clientAlgoId, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for queryAllAlgoOrders + * + * @param symbol (required) + * @param algoId (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param page (optional) + * @param limit Default 100; max 1000 (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 All Algo Orders -
+ * + * @see Query + * All Algo Orders (USER_DATA) Documentation + */ + private okhttp3.Call queryAllAlgoOrdersCall( + String symbol, + Long algoId, + Long startTime, + Long endTime, + Long page, + Long limit, + Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fapi/v1/allAlgoOrders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (symbol != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); + } + + if (algoId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("algoId", algoId)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call queryAllAlgoOrdersValidateBeforeCall( + String symbol, + Long algoId, + Long startTime, + Long endTime, + Long page, + Long limit, + Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + symbol, algoId, startTime, endTime, page, limit, recvWindow + }; + Method method = + this.getClass() + .getMethod( + "queryAllAlgoOrders", + String.class, + Long.class, + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return queryAllAlgoOrdersCall( + symbol, algoId, startTime, endTime, page, limit, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Query All Algo Orders (USER_DATA) Get all algo orders; active, CANCELED, TRIGGERED or + * FINISHED . * These orders will not be found: * order status is `CANCELED` or + * `EXPIRED` **AND** order has NO filled trade **AND** created time + 3 days < + * current time * order create time + 90 days < current time * If `algoId` is set, + * it will get orders >= that `algoId`. Otherwise most recent orders are + * returned. * The query time period must be less then 7 days( default as the recent 7 days). + * Weight: 5 + * + * @param symbol (required) + * @param algoId (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param page (optional) + * @param limit Default 100; max 1000 (optional) + * @param recvWindow (optional) + * @return ApiResponse<QueryAllAlgoOrdersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 All Algo Orders -
+ * + * @see Query + * All Algo Orders (USER_DATA) Documentation + */ + public ApiResponse queryAllAlgoOrders( + @NotNull String symbol, + Long algoId, + Long startTime, + Long endTime, + Long page, + Long limit, + Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + queryAllAlgoOrdersValidateBeforeCall( + symbol, algoId, startTime, endTime, page, limit, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for queryCurrentOpenOrder * diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java index 24ffcf30..bc423897 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java @@ -43,7 +43,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/6.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/7.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AdlRiskResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AdlRiskResponse.java new file mode 100644 index 00000000..8417afa2 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AdlRiskResponse.java @@ -0,0 +1,291 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.common.AbstractOpenApiSchema; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.hibernate.validator.constraints.*; + +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AdlRiskResponse extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(AdlRiskResponse.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdlRiskResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdlRiskResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterAdlRiskResponse1 = + gson.getDelegateAdapter(this, TypeToken.get(AdlRiskResponse1.class)); + final TypeAdapter adapterAdlRiskResponse2 = + gson.getDelegateAdapter(this, TypeToken.get(AdlRiskResponse2.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AdlRiskResponse value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `AdlRiskResponse1` + if (value.getActualInstance() instanceof AdlRiskResponse1) { + JsonElement element = + adapterAdlRiskResponse1.toJsonTree( + (AdlRiskResponse1) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AdlRiskResponse2` + if (value.getActualInstance() instanceof AdlRiskResponse2) { + JsonElement element = + adapterAdlRiskResponse2.toJsonTree( + (AdlRiskResponse2) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " AdlRiskResponse1, AdlRiskResponse2"); + } + + @Override + public AdlRiskResponse read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize AdlRiskResponse1 + try { + // validate the JSON object to see if any exception is thrown + AdlRiskResponse1.validateJsonElement(jsonElement); + actualAdapter = adapterAdlRiskResponse1; + match++; + log.log( + Level.FINER, + "Input data matches schema 'AdlRiskResponse1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AdlRiskResponse1 failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AdlRiskResponse1'", + e); + } + // deserialize AdlRiskResponse2 + try { + // validate the JSON object to see if any exception is thrown + AdlRiskResponse2.validateJsonElement(jsonElement); + actualAdapter = adapterAdlRiskResponse2; + match++; + log.log( + Level.FINER, + "Input data matches schema 'AdlRiskResponse2'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AdlRiskResponse2 failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AdlRiskResponse2'", + e); + } + + if (match == 1) { + AdlRiskResponse ret = new AdlRiskResponse(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for AdlRiskResponse: %d classes" + + " match result, expected 1. Detailed failure" + + " message for oneOf schemas: %s. JSON: %s", + match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public AdlRiskResponse() { + super("oneOf", Boolean.FALSE); + } + + public AdlRiskResponse(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AdlRiskResponse1", AdlRiskResponse1.class); + schemas.put("AdlRiskResponse2", AdlRiskResponse2.class); + } + + @Override + public Map> getSchemas() { + return AdlRiskResponse.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: AdlRiskResponse1, AdlRiskResponse2 + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof AdlRiskResponse1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AdlRiskResponse2) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be AdlRiskResponse1, AdlRiskResponse2"); + } + + /** + * Get the actual instance, which can be the following: AdlRiskResponse1, AdlRiskResponse2 + * + * @return The actual instance (AdlRiskResponse1, AdlRiskResponse2) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AdlRiskResponse1`. If the actual instance is not + * `AdlRiskResponse1`, the ClassCastException will be thrown. + * + * @return The actual instance of `AdlRiskResponse1` + * @throws ClassCastException if the instance is not `AdlRiskResponse1` + */ + public AdlRiskResponse1 getAdlRiskResponse1() throws ClassCastException { + return (AdlRiskResponse1) super.getActualInstance(); + } + + /** + * Get the actual instance of `AdlRiskResponse2`. If the actual instance is not + * `AdlRiskResponse2`, the ClassCastException will be thrown. + * + * @return The actual instance of `AdlRiskResponse2` + * @throws ClassCastException if the instance is not `AdlRiskResponse2` + */ + public AdlRiskResponse2 getAdlRiskResponse2() throws ClassCastException { + return (AdlRiskResponse2) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AdlRiskResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with AdlRiskResponse1 + try { + AdlRiskResponse1.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for AdlRiskResponse1 failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with AdlRiskResponse2 + try { + AdlRiskResponse2.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for AdlRiskResponse2 failed with `%s`.", + e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "The JSON string is invalid for AdlRiskResponse with oneOf schemas:" + + " AdlRiskResponse1, AdlRiskResponse2. %d class(es) match the" + + " result, expected 1. Detailed failure message for oneOf schemas:" + + " %s. JSON: %s", + validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of AdlRiskResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdlRiskResponse + * @throws IOException if the JSON string is invalid with respect to AdlRiskResponse + */ + public static AdlRiskResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdlRiskResponse.class); + } + + /** + * Convert an instance of AdlRiskResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AdlRiskResponse1.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AdlRiskResponse1.java new file mode 100644 index 00000000..b0e156f0 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AdlRiskResponse1.java @@ -0,0 +1,282 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** AdlRiskResponse1 */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AdlRiskResponse1 { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_ADL_RISK = "adlRisk"; + + @SerializedName(SERIALIZED_NAME_ADL_RISK) + @jakarta.annotation.Nullable + private String adlRisk; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; + + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + @jakarta.annotation.Nullable + private Long updateTime; + + public AdlRiskResponse1() {} + + public AdlRiskResponse1 symbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nullable + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + } + + public AdlRiskResponse1 adlRisk(@jakarta.annotation.Nullable String adlRisk) { + this.adlRisk = adlRisk; + return this; + } + + /** + * Get adlRisk + * + * @return adlRisk + */ + @jakarta.annotation.Nullable + public String getAdlRisk() { + return adlRisk; + } + + public void setAdlRisk(@jakarta.annotation.Nullable String adlRisk) { + this.adlRisk = adlRisk; + } + + public AdlRiskResponse1 updateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Get updateTime + * + * @return updateTime + */ + @jakarta.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdlRiskResponse1 adlRiskResponse1 = (AdlRiskResponse1) o; + return Objects.equals(this.symbol, adlRiskResponse1.symbol) + && Objects.equals(this.adlRisk, adlRiskResponse1.adlRisk) + && Objects.equals(this.updateTime, adlRiskResponse1.updateTime); + } + + @Override + public int hashCode() { + return Objects.hash(symbol, adlRisk, updateTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdlRiskResponse1 {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" adlRisk: ").append(toIndentedString(adlRisk)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object adlRiskValue = getAdlRisk(); + String adlRiskValueAsString = ""; + adlRiskValueAsString = adlRiskValue.toString(); + sb.append("adlRisk=").append(urlEncode(adlRiskValueAsString)).append(""); + Object updateTimeValue = getUpdateTime(); + String updateTimeValueAsString = ""; + updateTimeValueAsString = updateTimeValue.toString(); + sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("symbol"); + openapiFields.add("adlRisk"); + openapiFields.add("updateTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AdlRiskResponse1 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AdlRiskResponse1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AdlRiskResponse1 is not found in the" + + " empty JSON string", + AdlRiskResponse1.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("adlRisk") != null && !jsonObj.get("adlRisk").isJsonNull()) + && !jsonObj.get("adlRisk").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `adlRisk` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("adlRisk").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdlRiskResponse1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdlRiskResponse1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AdlRiskResponse1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AdlRiskResponse1 value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdlRiskResponse1 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AdlRiskResponse1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdlRiskResponse1 + * @throws IOException if the JSON string is invalid with respect to AdlRiskResponse1 + */ + public static AdlRiskResponse1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdlRiskResponse1.class); + } + + /** + * Convert an instance of AdlRiskResponse1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AdlRiskResponse2.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AdlRiskResponse2.java new file mode 100644 index 00000000..644689cf --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AdlRiskResponse2.java @@ -0,0 +1,182 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** AdlRiskResponse2 */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AdlRiskResponse2 extends ArrayList { + public AdlRiskResponse2() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdlRiskResponse2 {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AdlRiskResponse2 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be a array type in the JSON string but got" + + " `%s`", + jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for (JsonElement element : array) { + AdlRiskResponse2Inner.validateJsonElement(element); + } + if (jsonElement == null) { + if (!AdlRiskResponse2.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AdlRiskResponse2 is not found in the" + + " empty JSON string", + AdlRiskResponse2.openapiRequiredFields.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdlRiskResponse2.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdlRiskResponse2' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AdlRiskResponse2.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AdlRiskResponse2 value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + elementAdapter.write(out, obj); + } + + @Override + public AdlRiskResponse2 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AdlRiskResponse2 given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdlRiskResponse2 + * @throws IOException if the JSON string is invalid with respect to AdlRiskResponse2 + */ + public static AdlRiskResponse2 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdlRiskResponse2.class); + } + + /** + * Convert an instance of AdlRiskResponse2 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AdlRiskResponse2Inner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AdlRiskResponse2Inner.java new file mode 100644 index 00000000..550b0ed3 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AdlRiskResponse2Inner.java @@ -0,0 +1,282 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** AdlRiskResponse2Inner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AdlRiskResponse2Inner { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_ADL_RISK = "adlRisk"; + + @SerializedName(SERIALIZED_NAME_ADL_RISK) + @jakarta.annotation.Nullable + private String adlRisk; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; + + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + @jakarta.annotation.Nullable + private Long updateTime; + + public AdlRiskResponse2Inner() {} + + public AdlRiskResponse2Inner symbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nullable + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + } + + public AdlRiskResponse2Inner adlRisk(@jakarta.annotation.Nullable String adlRisk) { + this.adlRisk = adlRisk; + return this; + } + + /** + * Get adlRisk + * + * @return adlRisk + */ + @jakarta.annotation.Nullable + public String getAdlRisk() { + return adlRisk; + } + + public void setAdlRisk(@jakarta.annotation.Nullable String adlRisk) { + this.adlRisk = adlRisk; + } + + public AdlRiskResponse2Inner updateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Get updateTime + * + * @return updateTime + */ + @jakarta.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdlRiskResponse2Inner adlRiskResponse2Inner = (AdlRiskResponse2Inner) o; + return Objects.equals(this.symbol, adlRiskResponse2Inner.symbol) + && Objects.equals(this.adlRisk, adlRiskResponse2Inner.adlRisk) + && Objects.equals(this.updateTime, adlRiskResponse2Inner.updateTime); + } + + @Override + public int hashCode() { + return Objects.hash(symbol, adlRisk, updateTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdlRiskResponse2Inner {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" adlRisk: ").append(toIndentedString(adlRisk)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object adlRiskValue = getAdlRisk(); + String adlRiskValueAsString = ""; + adlRiskValueAsString = adlRiskValue.toString(); + sb.append("adlRisk=").append(urlEncode(adlRiskValueAsString)).append(""); + Object updateTimeValue = getUpdateTime(); + String updateTimeValueAsString = ""; + updateTimeValueAsString = updateTimeValue.toString(); + sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("symbol"); + openapiFields.add("adlRisk"); + openapiFields.add("updateTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AdlRiskResponse2Inner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AdlRiskResponse2Inner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AdlRiskResponse2Inner is not found in" + + " the empty JSON string", + AdlRiskResponse2Inner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("adlRisk") != null && !jsonObj.get("adlRisk").isJsonNull()) + && !jsonObj.get("adlRisk").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `adlRisk` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("adlRisk").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdlRiskResponse2Inner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdlRiskResponse2Inner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AdlRiskResponse2Inner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AdlRiskResponse2Inner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdlRiskResponse2Inner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AdlRiskResponse2Inner given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdlRiskResponse2Inner + * @throws IOException if the JSON string is invalid with respect to AdlRiskResponse2Inner + */ + public static AdlRiskResponse2Inner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdlRiskResponse2Inner.class); + } + + /** + * Convert an instance of AdlRiskResponse2Inner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersInner.java index 3a2e2cc6..90bb13c8 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersInner.java @@ -23,7 +23,6 @@ import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; import jakarta.validation.constraints.*; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -42,7 +41,7 @@ public class BatchOrdersInner { @SerializedName(SERIALIZED_NAME_ORDER_ID) @jakarta.annotation.Nullable - private Long orderId; + private String orderId; public static final String SERIALIZED_NAME_ORIG_CLIENT_ORDER_ID = "origClientOrderId"; @@ -117,13 +116,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_QUANTITY) @jakarta.annotation.Nullable - private Double quantity; + private String quantity; public static final String SERIALIZED_NAME_PRICE = "price"; @SerializedName(SERIALIZED_NAME_PRICE) @jakarta.annotation.Nullable - private Double price; + private String price; /** Gets or Sets priceMatch */ @JsonAdapter(PriceMatchEnum.Adapter.class) @@ -200,11 +199,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @jakarta.annotation.Nullable - private Long recvWindow; + private String recvWindow; public BatchOrdersInner() {} - public BatchOrdersInner orderId(@jakarta.annotation.Nullable Long orderId) { + public BatchOrdersInner orderId(@jakarta.annotation.Nullable String orderId) { this.orderId = orderId; return this; } @@ -215,11 +214,11 @@ public BatchOrdersInner orderId(@jakarta.annotation.Nullable Long orderId) { * @return orderId */ @jakarta.annotation.Nullable - public Long getOrderId() { + public String getOrderId() { return orderId; } - public void setOrderId(@jakarta.annotation.Nullable Long orderId) { + public void setOrderId(@jakarta.annotation.Nullable String orderId) { this.orderId = orderId; } @@ -281,7 +280,7 @@ public void setSide(@jakarta.annotation.Nullable SideEnum side) { this.side = side; } - public BatchOrdersInner quantity(@jakarta.annotation.Nullable Double quantity) { + public BatchOrdersInner quantity(@jakarta.annotation.Nullable String quantity) { this.quantity = quantity; return this; } @@ -292,16 +291,15 @@ public BatchOrdersInner quantity(@jakarta.annotation.Nullable Double quantity) { * @return quantity */ @jakarta.annotation.Nullable - @Valid - public Double getQuantity() { + public String getQuantity() { return quantity; } - public void setQuantity(@jakarta.annotation.Nullable Double quantity) { + public void setQuantity(@jakarta.annotation.Nullable String quantity) { this.quantity = quantity; } - public BatchOrdersInner price(@jakarta.annotation.Nullable Double price) { + public BatchOrdersInner price(@jakarta.annotation.Nullable String price) { this.price = price; return this; } @@ -312,12 +310,11 @@ public BatchOrdersInner price(@jakarta.annotation.Nullable Double price) { * @return price */ @jakarta.annotation.Nullable - @Valid - public Double getPrice() { + public String getPrice() { return price; } - public void setPrice(@jakarta.annotation.Nullable Double price) { + public void setPrice(@jakarta.annotation.Nullable String price) { this.price = price; } @@ -340,7 +337,7 @@ public void setPriceMatch(@jakarta.annotation.Nullable PriceMatchEnum priceMatch this.priceMatch = priceMatch; } - public BatchOrdersInner recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public BatchOrdersInner recvWindow(@jakarta.annotation.Nullable String recvWindow) { this.recvWindow = recvWindow; return this; } @@ -351,11 +348,11 @@ public BatchOrdersInner recvWindow(@jakarta.annotation.Nullable Long recvWindow) * @return recvWindow */ @jakarta.annotation.Nullable - public Long getRecvWindow() { + public String getRecvWindow() { return recvWindow; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + public void setRecvWindow(@jakarta.annotation.Nullable String recvWindow) { this.recvWindow = recvWindow; } @@ -496,6 +493,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("orderId") != null && !jsonObj.get("orderId").isJsonNull()) + && !jsonObj.get("orderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("orderId").toString())); + } if ((jsonObj.get("origClientOrderId") != null && !jsonObj.get("origClientOrderId").isJsonNull()) && !jsonObj.get("origClientOrderId").isJsonPrimitive()) { @@ -525,6 +530,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) { SideEnum.validateJsonElement(jsonObj.get("side")); } + if ((jsonObj.get("quantity") != null && !jsonObj.get("quantity").isJsonNull()) + && !jsonObj.get("quantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quantity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("quantity").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } if ((jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) && !jsonObj.get("priceMatch").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -537,6 +558,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) { PriceMatchEnum.validateJsonElement(jsonObj.get("priceMatch")); } + if ((jsonObj.get("recvWindow") != null && !jsonObj.get("recvWindow").isJsonNull()) + && !jsonObj.get("recvWindow").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `recvWindow` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("recvWindow").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersPlaceMultipleOrdersInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersPlaceMultipleOrdersInner.java index 01ad6380..0defa032 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersPlaceMultipleOrdersInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersPlaceMultipleOrdersInner.java @@ -23,7 +23,6 @@ import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; import jakarta.validation.constraints.*; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -177,7 +176,9 @@ public enum TimeInForceEnum { GTX("GTX"), - GTD("GTD"); + GTD("GTD"), + + RPI("RPI"); private String value; @@ -233,7 +234,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_QUANTITY) @jakarta.annotation.Nullable - private Double quantity; + private String quantity; public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; @@ -245,7 +246,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_PRICE) @jakarta.annotation.Nullable - private Double price; + private String price; public static final String SERIALIZED_NAME_NEW_CLIENT_ORDER_ID = "newClientOrderId"; @@ -257,19 +258,19 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_STOP_PRICE) @jakarta.annotation.Nullable - private Double stopPrice; + private String stopPrice; public static final String SERIALIZED_NAME_ACTIVATION_PRICE = "activationPrice"; @SerializedName(SERIALIZED_NAME_ACTIVATION_PRICE) @jakarta.annotation.Nullable - private Double activationPrice; + private String activationPrice; public static final String SERIALIZED_NAME_CALLBACK_RATE = "callbackRate"; @SerializedName(SERIALIZED_NAME_CALLBACK_RATE) @jakarta.annotation.Nullable - private Double callbackRate; + private String callbackRate; /** Gets or Sets workingType */ @JsonAdapter(WorkingTypeEnum.Adapter.class) @@ -528,7 +529,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) @jakarta.annotation.Nullable - private Long goodTillDate; + private String goodTillDate; public BatchOrdersPlaceMultipleOrdersInner() {} @@ -630,7 +631,7 @@ public void setTimeInForce(@jakarta.annotation.Nullable TimeInForceEnum timeInFo } public BatchOrdersPlaceMultipleOrdersInner quantity( - @jakarta.annotation.Nullable Double quantity) { + @jakarta.annotation.Nullable String quantity) { this.quantity = quantity; return this; } @@ -641,12 +642,11 @@ public BatchOrdersPlaceMultipleOrdersInner quantity( * @return quantity */ @jakarta.annotation.Nullable - @Valid - public Double getQuantity() { + public String getQuantity() { return quantity; } - public void setQuantity(@jakarta.annotation.Nullable Double quantity) { + public void setQuantity(@jakarta.annotation.Nullable String quantity) { this.quantity = quantity; } @@ -670,7 +670,7 @@ public void setReduceOnly(@jakarta.annotation.Nullable String reduceOnly) { this.reduceOnly = reduceOnly; } - public BatchOrdersPlaceMultipleOrdersInner price(@jakarta.annotation.Nullable Double price) { + public BatchOrdersPlaceMultipleOrdersInner price(@jakarta.annotation.Nullable String price) { this.price = price; return this; } @@ -681,12 +681,11 @@ public BatchOrdersPlaceMultipleOrdersInner price(@jakarta.annotation.Nullable Do * @return price */ @jakarta.annotation.Nullable - @Valid - public Double getPrice() { + public String getPrice() { return price; } - public void setPrice(@jakarta.annotation.Nullable Double price) { + public void setPrice(@jakarta.annotation.Nullable String price) { this.price = price; } @@ -711,7 +710,7 @@ public void setNewClientOrderId(@jakarta.annotation.Nullable String newClientOrd } public BatchOrdersPlaceMultipleOrdersInner stopPrice( - @jakarta.annotation.Nullable Double stopPrice) { + @jakarta.annotation.Nullable String stopPrice) { this.stopPrice = stopPrice; return this; } @@ -722,17 +721,16 @@ public BatchOrdersPlaceMultipleOrdersInner stopPrice( * @return stopPrice */ @jakarta.annotation.Nullable - @Valid - public Double getStopPrice() { + public String getStopPrice() { return stopPrice; } - public void setStopPrice(@jakarta.annotation.Nullable Double stopPrice) { + public void setStopPrice(@jakarta.annotation.Nullable String stopPrice) { this.stopPrice = stopPrice; } public BatchOrdersPlaceMultipleOrdersInner activationPrice( - @jakarta.annotation.Nullable Double activationPrice) { + @jakarta.annotation.Nullable String activationPrice) { this.activationPrice = activationPrice; return this; } @@ -743,17 +741,16 @@ public BatchOrdersPlaceMultipleOrdersInner activationPrice( * @return activationPrice */ @jakarta.annotation.Nullable - @Valid - public Double getActivationPrice() { + public String getActivationPrice() { return activationPrice; } - public void setActivationPrice(@jakarta.annotation.Nullable Double activationPrice) { + public void setActivationPrice(@jakarta.annotation.Nullable String activationPrice) { this.activationPrice = activationPrice; } public BatchOrdersPlaceMultipleOrdersInner callbackRate( - @jakarta.annotation.Nullable Double callbackRate) { + @jakarta.annotation.Nullable String callbackRate) { this.callbackRate = callbackRate; return this; } @@ -764,12 +761,11 @@ public BatchOrdersPlaceMultipleOrdersInner callbackRate( * @return callbackRate */ @jakarta.annotation.Nullable - @Valid - public Double getCallbackRate() { + public String getCallbackRate() { return callbackRate; } - public void setCallbackRate(@jakarta.annotation.Nullable Double callbackRate) { + public void setCallbackRate(@jakarta.annotation.Nullable String callbackRate) { this.callbackRate = callbackRate; } @@ -876,7 +872,7 @@ public void setSelfTradePreventionMode( } public BatchOrdersPlaceMultipleOrdersInner goodTillDate( - @jakarta.annotation.Nullable Long goodTillDate) { + @jakarta.annotation.Nullable String goodTillDate) { this.goodTillDate = goodTillDate; return this; } @@ -887,11 +883,11 @@ public BatchOrdersPlaceMultipleOrdersInner goodTillDate( * @return goodTillDate */ @jakarta.annotation.Nullable - public Long getGoodTillDate() { + public String getGoodTillDate() { return goodTillDate; } - public void setGoodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { + public void setGoodTillDate(@jakarta.annotation.Nullable String goodTillDate) { this.goodTillDate = goodTillDate; } @@ -1185,6 +1181,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) { TimeInForceEnum.validateJsonElement(jsonObj.get("timeInForce")); } + if ((jsonObj.get("quantity") != null && !jsonObj.get("quantity").isJsonNull()) + && !jsonObj.get("quantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quantity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("quantity").toString())); + } if ((jsonObj.get("reduceOnly") != null && !jsonObj.get("reduceOnly").isJsonNull()) && !jsonObj.get("reduceOnly").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -1193,6 +1197,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("reduceOnly").toString())); } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } if ((jsonObj.get("newClientOrderId") != null && !jsonObj.get("newClientOrderId").isJsonNull()) && !jsonObj.get("newClientOrderId").isJsonPrimitive()) { @@ -1202,6 +1214,30 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " JSON string but got `%s`", jsonObj.get("newClientOrderId").toString())); } + if ((jsonObj.get("stopPrice") != null && !jsonObj.get("stopPrice").isJsonNull()) + && !jsonObj.get("stopPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `stopPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("stopPrice").toString())); + } + if ((jsonObj.get("activationPrice") != null && !jsonObj.get("activationPrice").isJsonNull()) + && !jsonObj.get("activationPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `activationPrice` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("activationPrice").toString())); + } + if ((jsonObj.get("callbackRate") != null && !jsonObj.get("callbackRate").isJsonNull()) + && !jsonObj.get("callbackRate").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `callbackRate` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("callbackRate").toString())); + } if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) && !jsonObj.get("workingType").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -1262,6 +1298,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti && !jsonObj.get("selfTradePreventionMode").isJsonNull()) { SelfTradePreventionModeEnum.validateJsonElement(jsonObj.get("selfTradePreventionMode")); } + if ((jsonObj.get("goodTillDate") != null && !jsonObj.get("goodTillDate").isJsonNull()) + && !jsonObj.get("goodTillDate").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `goodTillDate` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("goodTillDate").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelAlgoOrderResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelAlgoOrderResponse.java new file mode 100644 index 00000000..891bd3f1 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelAlgoOrderResponse.java @@ -0,0 +1,323 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** CancelAlgoOrderResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CancelAlgoOrderResponse { + public static final String SERIALIZED_NAME_ALGO_ID = "algoId"; + + @SerializedName(SERIALIZED_NAME_ALGO_ID) + @jakarta.annotation.Nullable + private Long algoId; + + public static final String SERIALIZED_NAME_CLIENT_ALGO_ID = "clientAlgoId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ALGO_ID) + @jakarta.annotation.Nullable + private String clientAlgoId; + + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private String code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public CancelAlgoOrderResponse() {} + + public CancelAlgoOrderResponse algoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + return this; + } + + /** + * Get algoId + * + * @return algoId + */ + @jakarta.annotation.Nullable + public Long getAlgoId() { + return algoId; + } + + public void setAlgoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + } + + public CancelAlgoOrderResponse clientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + return this; + } + + /** + * Get clientAlgoId + * + * @return clientAlgoId + */ + @jakarta.annotation.Nullable + public String getClientAlgoId() { + return clientAlgoId; + } + + public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + } + + public CancelAlgoOrderResponse code(@jakarta.annotation.Nullable String code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code + */ + @jakarta.annotation.Nullable + public String getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable String code) { + this.code = code; + } + + public CancelAlgoOrderResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelAlgoOrderResponse cancelAlgoOrderResponse = (CancelAlgoOrderResponse) o; + return Objects.equals(this.algoId, cancelAlgoOrderResponse.algoId) + && Objects.equals(this.clientAlgoId, cancelAlgoOrderResponse.clientAlgoId) + && Objects.equals(this.code, cancelAlgoOrderResponse.code) + && Objects.equals(this.msg, cancelAlgoOrderResponse.msg); + } + + @Override + public int hashCode() { + return Objects.hash(algoId, clientAlgoId, code, msg); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CancelAlgoOrderResponse {\n"); + sb.append(" algoId: ").append(toIndentedString(algoId)).append("\n"); + sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object algoIdValue = getAlgoId(); + String algoIdValueAsString = ""; + algoIdValueAsString = algoIdValue.toString(); + sb.append("algoId=").append(urlEncode(algoIdValueAsString)).append(""); + Object clientAlgoIdValue = getClientAlgoId(); + String clientAlgoIdValueAsString = ""; + clientAlgoIdValueAsString = clientAlgoIdValue.toString(); + sb.append("clientAlgoId=").append(urlEncode(clientAlgoIdValueAsString)).append(""); + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("algoId"); + openapiFields.add("clientAlgoId"); + openapiFields.add("code"); + openapiFields.add("msg"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CancelAlgoOrderResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CancelAlgoOrderResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CancelAlgoOrderResponse is not found" + + " in the empty JSON string", + CancelAlgoOrderResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("clientAlgoId") != null && !jsonObj.get("clientAlgoId").isJsonNull()) + && !jsonObj.get("clientAlgoId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientAlgoId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientAlgoId").toString())); + } + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) + && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `code` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("code").toString())); + } + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CancelAlgoOrderResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CancelAlgoOrderResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CancelAlgoOrderResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CancelAlgoOrderResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CancelAlgoOrderResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CancelAlgoOrderResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CancelAlgoOrderResponse + * @throws IOException if the JSON string is invalid with respect to CancelAlgoOrderResponse + */ + public static CancelAlgoOrderResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CancelAlgoOrderResponse.class); + } + + /** + * Convert an instance of CancelAlgoOrderResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelAllAlgoOpenOrdersResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelAllAlgoOpenOrdersResponse.java new file mode 100644 index 00000000..2d50333c --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelAllAlgoOpenOrdersResponse.java @@ -0,0 +1,248 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** CancelAllAlgoOpenOrdersResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CancelAllAlgoOpenOrdersResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Long code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public CancelAllAlgoOpenOrdersResponse() {} + + public CancelAllAlgoOpenOrdersResponse code(@jakarta.annotation.Nullable Long code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code + */ + @jakarta.annotation.Nullable + public Long getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Long code) { + this.code = code; + } + + public CancelAllAlgoOpenOrdersResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelAllAlgoOpenOrdersResponse cancelAllAlgoOpenOrdersResponse = + (CancelAllAlgoOpenOrdersResponse) o; + return Objects.equals(this.code, cancelAllAlgoOpenOrdersResponse.code) + && Objects.equals(this.msg, cancelAllAlgoOpenOrdersResponse.msg); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CancelAllAlgoOpenOrdersResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("msg"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CancelAllAlgoOpenOrdersResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CancelAllAlgoOpenOrdersResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CancelAllAlgoOpenOrdersResponse is not" + + " found in the empty JSON string", + CancelAllAlgoOpenOrdersResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CancelAllAlgoOpenOrdersResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CancelAllAlgoOpenOrdersResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CancelAllAlgoOpenOrdersResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CancelAllAlgoOpenOrdersResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CancelAllAlgoOpenOrdersResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CancelAllAlgoOpenOrdersResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CancelAllAlgoOpenOrdersResponse + * @throws IOException if the JSON string is invalid with respect to + * CancelAllAlgoOpenOrdersResponse + */ + public static CancelAllAlgoOpenOrdersResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CancelAllAlgoOpenOrdersResponse.class); + } + + /** + * Convert an instance of CancelAllAlgoOpenOrdersResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CurrentAllAlgoOpenOrdersResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CurrentAllAlgoOpenOrdersResponse.java new file mode 100644 index 00000000..6568b91c --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CurrentAllAlgoOpenOrdersResponse.java @@ -0,0 +1,188 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** CurrentAllAlgoOpenOrdersResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CurrentAllAlgoOpenOrdersResponse + extends ArrayList { + public CurrentAllAlgoOpenOrdersResponse() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CurrentAllAlgoOpenOrdersResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CurrentAllAlgoOpenOrdersResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be a array type in the JSON string but got" + + " `%s`", + jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for (JsonElement element : array) { + CurrentAllAlgoOpenOrdersResponseInner.validateJsonElement(element); + } + if (jsonElement == null) { + if (!CurrentAllAlgoOpenOrdersResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CurrentAllAlgoOpenOrdersResponse is" + + " not found in the empty JSON string", + CurrentAllAlgoOpenOrdersResponse.openapiRequiredFields.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CurrentAllAlgoOpenOrdersResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CurrentAllAlgoOpenOrdersResponse' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CurrentAllAlgoOpenOrdersResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CurrentAllAlgoOpenOrdersResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + elementAdapter.write(out, obj); + } + + @Override + public CurrentAllAlgoOpenOrdersResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CurrentAllAlgoOpenOrdersResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CurrentAllAlgoOpenOrdersResponse + * @throws IOException if the JSON string is invalid with respect to + * CurrentAllAlgoOpenOrdersResponse + */ + public static CurrentAllAlgoOpenOrdersResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CurrentAllAlgoOpenOrdersResponse.class); + } + + /** + * Convert an instance of CurrentAllAlgoOpenOrdersResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CurrentAllAlgoOpenOrdersResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CurrentAllAlgoOpenOrdersResponseInner.java new file mode 100644 index 00000000..96e2370b --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CurrentAllAlgoOpenOrdersResponseInner.java @@ -0,0 +1,1396 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** CurrentAllAlgoOpenOrdersResponseInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CurrentAllAlgoOpenOrdersResponseInner { + public static final String SERIALIZED_NAME_ALGO_ID = "algoId"; + + @SerializedName(SERIALIZED_NAME_ALGO_ID) + @jakarta.annotation.Nullable + private Long algoId; + + public static final String SERIALIZED_NAME_CLIENT_ALGO_ID = "clientAlgoId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ALGO_ID) + @jakarta.annotation.Nullable + private String clientAlgoId; + + public static final String SERIALIZED_NAME_ALGO_TYPE = "algoType"; + + @SerializedName(SERIALIZED_NAME_ALGO_TYPE) + @jakarta.annotation.Nullable + private String algoType; + + public static final String SERIALIZED_NAME_ORDER_TYPE = "orderType"; + + @SerializedName(SERIALIZED_NAME_ORDER_TYPE) + @jakarta.annotation.Nullable + private String orderType; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private String side; + + public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; + + @SerializedName(SERIALIZED_NAME_POSITION_SIDE) + @jakarta.annotation.Nullable + private String positionSide; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private String timeInForce; + + public static final String SERIALIZED_NAME_QUANTITY = "quantity"; + + @SerializedName(SERIALIZED_NAME_QUANTITY) + @jakarta.annotation.Nullable + private String quantity; + + public static final String SERIALIZED_NAME_ALGO_STATUS = "algoStatus"; + + @SerializedName(SERIALIZED_NAME_ALGO_STATUS) + @jakarta.annotation.Nullable + private String algoStatus; + + public static final String SERIALIZED_NAME_ACTUAL_ORDER_ID = "actualOrderId"; + + @SerializedName(SERIALIZED_NAME_ACTUAL_ORDER_ID) + @jakarta.annotation.Nullable + private String actualOrderId; + + public static final String SERIALIZED_NAME_ACTUAL_PRICE = "actualPrice"; + + @SerializedName(SERIALIZED_NAME_ACTUAL_PRICE) + @jakarta.annotation.Nullable + private String actualPrice; + + public static final String SERIALIZED_NAME_TRIGGER_PRICE = "triggerPrice"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String triggerPrice; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_ICEBERG_QUANTITY = "icebergQuantity"; + + @SerializedName(SERIALIZED_NAME_ICEBERG_QUANTITY) + @jakarta.annotation.Nullable + private String icebergQuantity; + + public static final String SERIALIZED_NAME_TP_TRIGGER_PRICE = "tpTriggerPrice"; + + @SerializedName(SERIALIZED_NAME_TP_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String tpTriggerPrice; + + public static final String SERIALIZED_NAME_TP_PRICE = "tpPrice"; + + @SerializedName(SERIALIZED_NAME_TP_PRICE) + @jakarta.annotation.Nullable + private String tpPrice; + + public static final String SERIALIZED_NAME_SL_TRIGGER_PRICE = "slTriggerPrice"; + + @SerializedName(SERIALIZED_NAME_SL_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String slTriggerPrice; + + public static final String SERIALIZED_NAME_SL_PRICE = "slPrice"; + + @SerializedName(SERIALIZED_NAME_SL_PRICE) + @jakarta.annotation.Nullable + private String slPrice; + + public static final String SERIALIZED_NAME_TP_ORDER_TYPE = "tpOrderType"; + + @SerializedName(SERIALIZED_NAME_TP_ORDER_TYPE) + @jakarta.annotation.Nullable + private String tpOrderType; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private String selfTradePreventionMode; + + public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nullable + private String workingType; + + public static final String SERIALIZED_NAME_PRICE_MATCH = "priceMatch"; + + @SerializedName(SERIALIZED_NAME_PRICE_MATCH) + @jakarta.annotation.Nullable + private String priceMatch; + + public static final String SERIALIZED_NAME_CLOSE_POSITION = "closePosition"; + + @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) + @jakarta.annotation.Nullable + private Boolean closePosition; + + public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; + + @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) + @jakarta.annotation.Nullable + private Boolean priceProtect; + + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; + + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @jakarta.annotation.Nullable + private Boolean reduceOnly; + + public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; + + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + @jakarta.annotation.Nullable + private Long createTime; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; + + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + @jakarta.annotation.Nullable + private Long updateTime; + + public static final String SERIALIZED_NAME_TRIGGER_TIME = "triggerTime"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_TIME) + @jakarta.annotation.Nullable + private Long triggerTime; + + public static final String SERIALIZED_NAME_GOOD_TILL_DATE = "goodTillDate"; + + @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) + @jakarta.annotation.Nullable + private Long goodTillDate; + + public CurrentAllAlgoOpenOrdersResponseInner() {} + + public CurrentAllAlgoOpenOrdersResponseInner algoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + return this; + } + + /** + * Get algoId + * + * @return algoId + */ + @jakarta.annotation.Nullable + public Long getAlgoId() { + return algoId; + } + + public void setAlgoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + } + + public CurrentAllAlgoOpenOrdersResponseInner clientAlgoId( + @jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + return this; + } + + /** + * Get clientAlgoId + * + * @return clientAlgoId + */ + @jakarta.annotation.Nullable + public String getClientAlgoId() { + return clientAlgoId; + } + + public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + } + + public CurrentAllAlgoOpenOrdersResponseInner algoType( + @jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + return this; + } + + /** + * Get algoType + * + * @return algoType + */ + @jakarta.annotation.Nullable + public String getAlgoType() { + return algoType; + } + + public void setAlgoType(@jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + } + + public CurrentAllAlgoOpenOrdersResponseInner orderType( + @jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + return this; + } + + /** + * Get orderType + * + * @return orderType + */ + @jakarta.annotation.Nullable + public String getOrderType() { + return orderType; + } + + public void setOrderType(@jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + } + + public CurrentAllAlgoOpenOrdersResponseInner symbol( + @jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nullable + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + } + + public CurrentAllAlgoOpenOrdersResponseInner side(@jakarta.annotation.Nullable String side) { + this.side = side; + return this; + } + + /** + * Get side + * + * @return side + */ + @jakarta.annotation.Nullable + public String getSide() { + return side; + } + + public void setSide(@jakarta.annotation.Nullable String side) { + this.side = side; + } + + public CurrentAllAlgoOpenOrdersResponseInner positionSide( + @jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + return this; + } + + /** + * Get positionSide + * + * @return positionSide + */ + @jakarta.annotation.Nullable + public String getPositionSide() { + return positionSide; + } + + public void setPositionSide(@jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + } + + public CurrentAllAlgoOpenOrdersResponseInner timeInForce( + @jakarta.annotation.Nullable String timeInForce) { + this.timeInForce = timeInForce; + return this; + } + + /** + * Get timeInForce + * + * @return timeInForce + */ + @jakarta.annotation.Nullable + public String getTimeInForce() { + return timeInForce; + } + + public void setTimeInForce(@jakarta.annotation.Nullable String timeInForce) { + this.timeInForce = timeInForce; + } + + public CurrentAllAlgoOpenOrdersResponseInner quantity( + @jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity + */ + @jakarta.annotation.Nullable + public String getQuantity() { + return quantity; + } + + public void setQuantity(@jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + } + + public CurrentAllAlgoOpenOrdersResponseInner algoStatus( + @jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + return this; + } + + /** + * Get algoStatus + * + * @return algoStatus + */ + @jakarta.annotation.Nullable + public String getAlgoStatus() { + return algoStatus; + } + + public void setAlgoStatus(@jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + } + + public CurrentAllAlgoOpenOrdersResponseInner actualOrderId( + @jakarta.annotation.Nullable String actualOrderId) { + this.actualOrderId = actualOrderId; + return this; + } + + /** + * Get actualOrderId + * + * @return actualOrderId + */ + @jakarta.annotation.Nullable + public String getActualOrderId() { + return actualOrderId; + } + + public void setActualOrderId(@jakarta.annotation.Nullable String actualOrderId) { + this.actualOrderId = actualOrderId; + } + + public CurrentAllAlgoOpenOrdersResponseInner actualPrice( + @jakarta.annotation.Nullable String actualPrice) { + this.actualPrice = actualPrice; + return this; + } + + /** + * Get actualPrice + * + * @return actualPrice + */ + @jakarta.annotation.Nullable + public String getActualPrice() { + return actualPrice; + } + + public void setActualPrice(@jakarta.annotation.Nullable String actualPrice) { + this.actualPrice = actualPrice; + } + + public CurrentAllAlgoOpenOrdersResponseInner triggerPrice( + @jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + return this; + } + + /** + * Get triggerPrice + * + * @return triggerPrice + */ + @jakarta.annotation.Nullable + public String getTriggerPrice() { + return triggerPrice; + } + + public void setTriggerPrice(@jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + } + + public CurrentAllAlgoOpenOrdersResponseInner price(@jakarta.annotation.Nullable String price) { + this.price = price; + return this; + } + + /** + * Get price + * + * @return price + */ + @jakarta.annotation.Nullable + public String getPrice() { + return price; + } + + public void setPrice(@jakarta.annotation.Nullable String price) { + this.price = price; + } + + public CurrentAllAlgoOpenOrdersResponseInner icebergQuantity( + @jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + return this; + } + + /** + * Get icebergQuantity + * + * @return icebergQuantity + */ + @jakarta.annotation.Nullable + public String getIcebergQuantity() { + return icebergQuantity; + } + + public void setIcebergQuantity(@jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + } + + public CurrentAllAlgoOpenOrdersResponseInner tpTriggerPrice( + @jakarta.annotation.Nullable String tpTriggerPrice) { + this.tpTriggerPrice = tpTriggerPrice; + return this; + } + + /** + * Get tpTriggerPrice + * + * @return tpTriggerPrice + */ + @jakarta.annotation.Nullable + public String getTpTriggerPrice() { + return tpTriggerPrice; + } + + public void setTpTriggerPrice(@jakarta.annotation.Nullable String tpTriggerPrice) { + this.tpTriggerPrice = tpTriggerPrice; + } + + public CurrentAllAlgoOpenOrdersResponseInner tpPrice( + @jakarta.annotation.Nullable String tpPrice) { + this.tpPrice = tpPrice; + return this; + } + + /** + * Get tpPrice + * + * @return tpPrice + */ + @jakarta.annotation.Nullable + public String getTpPrice() { + return tpPrice; + } + + public void setTpPrice(@jakarta.annotation.Nullable String tpPrice) { + this.tpPrice = tpPrice; + } + + public CurrentAllAlgoOpenOrdersResponseInner slTriggerPrice( + @jakarta.annotation.Nullable String slTriggerPrice) { + this.slTriggerPrice = slTriggerPrice; + return this; + } + + /** + * Get slTriggerPrice + * + * @return slTriggerPrice + */ + @jakarta.annotation.Nullable + public String getSlTriggerPrice() { + return slTriggerPrice; + } + + public void setSlTriggerPrice(@jakarta.annotation.Nullable String slTriggerPrice) { + this.slTriggerPrice = slTriggerPrice; + } + + public CurrentAllAlgoOpenOrdersResponseInner slPrice( + @jakarta.annotation.Nullable String slPrice) { + this.slPrice = slPrice; + return this; + } + + /** + * Get slPrice + * + * @return slPrice + */ + @jakarta.annotation.Nullable + public String getSlPrice() { + return slPrice; + } + + public void setSlPrice(@jakarta.annotation.Nullable String slPrice) { + this.slPrice = slPrice; + } + + public CurrentAllAlgoOpenOrdersResponseInner tpOrderType( + @jakarta.annotation.Nullable String tpOrderType) { + this.tpOrderType = tpOrderType; + return this; + } + + /** + * Get tpOrderType + * + * @return tpOrderType + */ + @jakarta.annotation.Nullable + public String getTpOrderType() { + return tpOrderType; + } + + public void setTpOrderType(@jakarta.annotation.Nullable String tpOrderType) { + this.tpOrderType = tpOrderType; + } + + public CurrentAllAlgoOpenOrdersResponseInner selfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + public String getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + + public CurrentAllAlgoOpenOrdersResponseInner workingType( + @jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nullable + public String getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + } + + public CurrentAllAlgoOpenOrdersResponseInner priceMatch( + @jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + return this; + } + + /** + * Get priceMatch + * + * @return priceMatch + */ + @jakarta.annotation.Nullable + public String getPriceMatch() { + return priceMatch; + } + + public void setPriceMatch(@jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + } + + public CurrentAllAlgoOpenOrdersResponseInner closePosition( + @jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + return this; + } + + /** + * Get closePosition + * + * @return closePosition + */ + @jakarta.annotation.Nullable + public Boolean getClosePosition() { + return closePosition; + } + + public void setClosePosition(@jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + } + + public CurrentAllAlgoOpenOrdersResponseInner priceProtect( + @jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + return this; + } + + /** + * Get priceProtect + * + * @return priceProtect + */ + @jakarta.annotation.Nullable + public Boolean getPriceProtect() { + return priceProtect; + } + + public void setPriceProtect(@jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + } + + public CurrentAllAlgoOpenOrdersResponseInner reduceOnly( + @jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Get reduceOnly + * + * @return reduceOnly + */ + @jakarta.annotation.Nullable + public Boolean getReduceOnly() { + return reduceOnly; + } + + public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + } + + public CurrentAllAlgoOpenOrdersResponseInner createTime( + @jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get createTime + * + * @return createTime + */ + @jakarta.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + } + + public CurrentAllAlgoOpenOrdersResponseInner updateTime( + @jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Get updateTime + * + * @return updateTime + */ + @jakarta.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + } + + public CurrentAllAlgoOpenOrdersResponseInner triggerTime( + @jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + return this; + } + + /** + * Get triggerTime + * + * @return triggerTime + */ + @jakarta.annotation.Nullable + public Long getTriggerTime() { + return triggerTime; + } + + public void setTriggerTime(@jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + } + + public CurrentAllAlgoOpenOrdersResponseInner goodTillDate( + @jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + return this; + } + + /** + * Get goodTillDate + * + * @return goodTillDate + */ + @jakarta.annotation.Nullable + public Long getGoodTillDate() { + return goodTillDate; + } + + public void setGoodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CurrentAllAlgoOpenOrdersResponseInner currentAllAlgoOpenOrdersResponseInner = + (CurrentAllAlgoOpenOrdersResponseInner) o; + return Objects.equals(this.algoId, currentAllAlgoOpenOrdersResponseInner.algoId) + && Objects.equals( + this.clientAlgoId, currentAllAlgoOpenOrdersResponseInner.clientAlgoId) + && Objects.equals(this.algoType, currentAllAlgoOpenOrdersResponseInner.algoType) + && Objects.equals(this.orderType, currentAllAlgoOpenOrdersResponseInner.orderType) + && Objects.equals(this.symbol, currentAllAlgoOpenOrdersResponseInner.symbol) + && Objects.equals(this.side, currentAllAlgoOpenOrdersResponseInner.side) + && Objects.equals( + this.positionSide, currentAllAlgoOpenOrdersResponseInner.positionSide) + && Objects.equals( + this.timeInForce, currentAllAlgoOpenOrdersResponseInner.timeInForce) + && Objects.equals(this.quantity, currentAllAlgoOpenOrdersResponseInner.quantity) + && Objects.equals(this.algoStatus, currentAllAlgoOpenOrdersResponseInner.algoStatus) + && Objects.equals( + this.actualOrderId, currentAllAlgoOpenOrdersResponseInner.actualOrderId) + && Objects.equals( + this.actualPrice, currentAllAlgoOpenOrdersResponseInner.actualPrice) + && Objects.equals( + this.triggerPrice, currentAllAlgoOpenOrdersResponseInner.triggerPrice) + && Objects.equals(this.price, currentAllAlgoOpenOrdersResponseInner.price) + && Objects.equals( + this.icebergQuantity, currentAllAlgoOpenOrdersResponseInner.icebergQuantity) + && Objects.equals( + this.tpTriggerPrice, currentAllAlgoOpenOrdersResponseInner.tpTriggerPrice) + && Objects.equals(this.tpPrice, currentAllAlgoOpenOrdersResponseInner.tpPrice) + && Objects.equals( + this.slTriggerPrice, currentAllAlgoOpenOrdersResponseInner.slTriggerPrice) + && Objects.equals(this.slPrice, currentAllAlgoOpenOrdersResponseInner.slPrice) + && Objects.equals( + this.tpOrderType, currentAllAlgoOpenOrdersResponseInner.tpOrderType) + && Objects.equals( + this.selfTradePreventionMode, + currentAllAlgoOpenOrdersResponseInner.selfTradePreventionMode) + && Objects.equals( + this.workingType, currentAllAlgoOpenOrdersResponseInner.workingType) + && Objects.equals(this.priceMatch, currentAllAlgoOpenOrdersResponseInner.priceMatch) + && Objects.equals( + this.closePosition, currentAllAlgoOpenOrdersResponseInner.closePosition) + && Objects.equals( + this.priceProtect, currentAllAlgoOpenOrdersResponseInner.priceProtect) + && Objects.equals(this.reduceOnly, currentAllAlgoOpenOrdersResponseInner.reduceOnly) + && Objects.equals(this.createTime, currentAllAlgoOpenOrdersResponseInner.createTime) + && Objects.equals(this.updateTime, currentAllAlgoOpenOrdersResponseInner.updateTime) + && Objects.equals( + this.triggerTime, currentAllAlgoOpenOrdersResponseInner.triggerTime) + && Objects.equals( + this.goodTillDate, currentAllAlgoOpenOrdersResponseInner.goodTillDate); + } + + @Override + public int hashCode() { + return Objects.hash( + algoId, + clientAlgoId, + algoType, + orderType, + symbol, + side, + positionSide, + timeInForce, + quantity, + algoStatus, + actualOrderId, + actualPrice, + triggerPrice, + price, + icebergQuantity, + tpTriggerPrice, + tpPrice, + slTriggerPrice, + slPrice, + tpOrderType, + selfTradePreventionMode, + workingType, + priceMatch, + closePosition, + priceProtect, + reduceOnly, + createTime, + updateTime, + triggerTime, + goodTillDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CurrentAllAlgoOpenOrdersResponseInner {\n"); + sb.append(" algoId: ").append(toIndentedString(algoId)).append("\n"); + sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); + sb.append(" algoType: ").append(toIndentedString(algoType)).append("\n"); + sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" algoStatus: ").append(toIndentedString(algoStatus)).append("\n"); + sb.append(" actualOrderId: ").append(toIndentedString(actualOrderId)).append("\n"); + sb.append(" actualPrice: ").append(toIndentedString(actualPrice)).append("\n"); + sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" icebergQuantity: ").append(toIndentedString(icebergQuantity)).append("\n"); + sb.append(" tpTriggerPrice: ").append(toIndentedString(tpTriggerPrice)).append("\n"); + sb.append(" tpPrice: ").append(toIndentedString(tpPrice)).append("\n"); + sb.append(" slTriggerPrice: ").append(toIndentedString(slTriggerPrice)).append("\n"); + sb.append(" slPrice: ").append(toIndentedString(slPrice)).append("\n"); + sb.append(" tpOrderType: ").append(toIndentedString(tpOrderType)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); + sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); + sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" triggerTime: ").append(toIndentedString(triggerTime)).append("\n"); + sb.append(" goodTillDate: ").append(toIndentedString(goodTillDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object algoIdValue = getAlgoId(); + String algoIdValueAsString = ""; + algoIdValueAsString = algoIdValue.toString(); + sb.append("algoId=").append(urlEncode(algoIdValueAsString)).append(""); + Object clientAlgoIdValue = getClientAlgoId(); + String clientAlgoIdValueAsString = ""; + clientAlgoIdValueAsString = clientAlgoIdValue.toString(); + sb.append("clientAlgoId=").append(urlEncode(clientAlgoIdValueAsString)).append(""); + Object algoTypeValue = getAlgoType(); + String algoTypeValueAsString = ""; + algoTypeValueAsString = algoTypeValue.toString(); + sb.append("algoType=").append(urlEncode(algoTypeValueAsString)).append(""); + Object orderTypeValue = getOrderType(); + String orderTypeValueAsString = ""; + orderTypeValueAsString = orderTypeValue.toString(); + sb.append("orderType=").append(urlEncode(orderTypeValueAsString)).append(""); + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object sideValue = getSide(); + String sideValueAsString = ""; + sideValueAsString = sideValue.toString(); + sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object positionSideValue = getPositionSide(); + String positionSideValueAsString = ""; + positionSideValueAsString = positionSideValue.toString(); + sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object quantityValue = getQuantity(); + String quantityValueAsString = ""; + quantityValueAsString = quantityValue.toString(); + sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); + Object algoStatusValue = getAlgoStatus(); + String algoStatusValueAsString = ""; + algoStatusValueAsString = algoStatusValue.toString(); + sb.append("algoStatus=").append(urlEncode(algoStatusValueAsString)).append(""); + Object actualOrderIdValue = getActualOrderId(); + String actualOrderIdValueAsString = ""; + actualOrderIdValueAsString = actualOrderIdValue.toString(); + sb.append("actualOrderId=").append(urlEncode(actualOrderIdValueAsString)).append(""); + Object actualPriceValue = getActualPrice(); + String actualPriceValueAsString = ""; + actualPriceValueAsString = actualPriceValue.toString(); + sb.append("actualPrice=").append(urlEncode(actualPriceValueAsString)).append(""); + Object triggerPriceValue = getTriggerPrice(); + String triggerPriceValueAsString = ""; + triggerPriceValueAsString = triggerPriceValue.toString(); + sb.append("triggerPrice=").append(urlEncode(triggerPriceValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object icebergQuantityValue = getIcebergQuantity(); + String icebergQuantityValueAsString = ""; + icebergQuantityValueAsString = icebergQuantityValue.toString(); + sb.append("icebergQuantity=").append(urlEncode(icebergQuantityValueAsString)).append(""); + Object tpTriggerPriceValue = getTpTriggerPrice(); + String tpTriggerPriceValueAsString = ""; + tpTriggerPriceValueAsString = tpTriggerPriceValue.toString(); + sb.append("tpTriggerPrice=").append(urlEncode(tpTriggerPriceValueAsString)).append(""); + Object tpPriceValue = getTpPrice(); + String tpPriceValueAsString = ""; + tpPriceValueAsString = tpPriceValue.toString(); + sb.append("tpPrice=").append(urlEncode(tpPriceValueAsString)).append(""); + Object slTriggerPriceValue = getSlTriggerPrice(); + String slTriggerPriceValueAsString = ""; + slTriggerPriceValueAsString = slTriggerPriceValue.toString(); + sb.append("slTriggerPrice=").append(urlEncode(slTriggerPriceValueAsString)).append(""); + Object slPriceValue = getSlPrice(); + String slPriceValueAsString = ""; + slPriceValueAsString = slPriceValue.toString(); + sb.append("slPrice=").append(urlEncode(slPriceValueAsString)).append(""); + Object tpOrderTypeValue = getTpOrderType(); + String tpOrderTypeValueAsString = ""; + tpOrderTypeValueAsString = tpOrderTypeValue.toString(); + sb.append("tpOrderType=").append(urlEncode(tpOrderTypeValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); + Object workingTypeValue = getWorkingType(); + String workingTypeValueAsString = ""; + workingTypeValueAsString = workingTypeValue.toString(); + sb.append("workingType=").append(urlEncode(workingTypeValueAsString)).append(""); + Object priceMatchValue = getPriceMatch(); + String priceMatchValueAsString = ""; + priceMatchValueAsString = priceMatchValue.toString(); + sb.append("priceMatch=").append(urlEncode(priceMatchValueAsString)).append(""); + Object closePositionValue = getClosePosition(); + String closePositionValueAsString = ""; + closePositionValueAsString = closePositionValue.toString(); + sb.append("closePosition=").append(urlEncode(closePositionValueAsString)).append(""); + Object priceProtectValue = getPriceProtect(); + String priceProtectValueAsString = ""; + priceProtectValueAsString = priceProtectValue.toString(); + sb.append("priceProtect=").append(urlEncode(priceProtectValueAsString)).append(""); + Object reduceOnlyValue = getReduceOnly(); + String reduceOnlyValueAsString = ""; + reduceOnlyValueAsString = reduceOnlyValue.toString(); + sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); + Object createTimeValue = getCreateTime(); + String createTimeValueAsString = ""; + createTimeValueAsString = createTimeValue.toString(); + sb.append("createTime=").append(urlEncode(createTimeValueAsString)).append(""); + Object updateTimeValue = getUpdateTime(); + String updateTimeValueAsString = ""; + updateTimeValueAsString = updateTimeValue.toString(); + sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).append(""); + Object triggerTimeValue = getTriggerTime(); + String triggerTimeValueAsString = ""; + triggerTimeValueAsString = triggerTimeValue.toString(); + sb.append("triggerTime=").append(urlEncode(triggerTimeValueAsString)).append(""); + Object goodTillDateValue = getGoodTillDate(); + String goodTillDateValueAsString = ""; + goodTillDateValueAsString = goodTillDateValue.toString(); + sb.append("goodTillDate=").append(urlEncode(goodTillDateValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("algoId"); + openapiFields.add("clientAlgoId"); + openapiFields.add("algoType"); + openapiFields.add("orderType"); + openapiFields.add("symbol"); + openapiFields.add("side"); + openapiFields.add("positionSide"); + openapiFields.add("timeInForce"); + openapiFields.add("quantity"); + openapiFields.add("algoStatus"); + openapiFields.add("actualOrderId"); + openapiFields.add("actualPrice"); + openapiFields.add("triggerPrice"); + openapiFields.add("price"); + openapiFields.add("icebergQuantity"); + openapiFields.add("tpTriggerPrice"); + openapiFields.add("tpPrice"); + openapiFields.add("slTriggerPrice"); + openapiFields.add("slPrice"); + openapiFields.add("tpOrderType"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("workingType"); + openapiFields.add("priceMatch"); + openapiFields.add("closePosition"); + openapiFields.add("priceProtect"); + openapiFields.add("reduceOnly"); + openapiFields.add("createTime"); + openapiFields.add("updateTime"); + openapiFields.add("triggerTime"); + openapiFields.add("goodTillDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CurrentAllAlgoOpenOrdersResponseInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CurrentAllAlgoOpenOrdersResponseInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CurrentAllAlgoOpenOrdersResponseInner" + + " is not found in the empty JSON string", + CurrentAllAlgoOpenOrdersResponseInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("clientAlgoId") != null && !jsonObj.get("clientAlgoId").isJsonNull()) + && !jsonObj.get("clientAlgoId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientAlgoId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientAlgoId").toString())); + } + if ((jsonObj.get("algoType") != null && !jsonObj.get("algoType").isJsonNull()) + && !jsonObj.get("algoType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoType").toString())); + } + if ((jsonObj.get("orderType") != null && !jsonObj.get("orderType").isJsonNull()) + && !jsonObj.get("orderType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("orderType").toString())); + } + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) + && !jsonObj.get("side").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `side` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("side").toString())); + } + if ((jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) + && !jsonObj.get("positionSide").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `positionSide` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("positionSide").toString())); + } + if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) + && !jsonObj.get("timeInForce").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timeInForce` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timeInForce").toString())); + } + if ((jsonObj.get("quantity") != null && !jsonObj.get("quantity").isJsonNull()) + && !jsonObj.get("quantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quantity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("quantity").toString())); + } + if ((jsonObj.get("algoStatus") != null && !jsonObj.get("algoStatus").isJsonNull()) + && !jsonObj.get("algoStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoStatus` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoStatus").toString())); + } + if ((jsonObj.get("actualOrderId") != null && !jsonObj.get("actualOrderId").isJsonNull()) + && !jsonObj.get("actualOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actualOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("actualOrderId").toString())); + } + if ((jsonObj.get("actualPrice") != null && !jsonObj.get("actualPrice").isJsonNull()) + && !jsonObj.get("actualPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actualPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("actualPrice").toString())); + } + if ((jsonObj.get("triggerPrice") != null && !jsonObj.get("triggerPrice").isJsonNull()) + && !jsonObj.get("triggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `triggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("triggerPrice").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("icebergQuantity") != null && !jsonObj.get("icebergQuantity").isJsonNull()) + && !jsonObj.get("icebergQuantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `icebergQuantity` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("icebergQuantity").toString())); + } + if ((jsonObj.get("tpTriggerPrice") != null && !jsonObj.get("tpTriggerPrice").isJsonNull()) + && !jsonObj.get("tpTriggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpTriggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tpTriggerPrice").toString())); + } + if ((jsonObj.get("tpPrice") != null && !jsonObj.get("tpPrice").isJsonNull()) + && !jsonObj.get("tpPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpPrice` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("tpPrice").toString())); + } + if ((jsonObj.get("slTriggerPrice") != null && !jsonObj.get("slTriggerPrice").isJsonNull()) + && !jsonObj.get("slTriggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slTriggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("slTriggerPrice").toString())); + } + if ((jsonObj.get("slPrice") != null && !jsonObj.get("slPrice").isJsonNull()) + && !jsonObj.get("slPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slPrice` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("slPrice").toString())); + } + if ((jsonObj.get("tpOrderType") != null && !jsonObj.get("tpOrderType").isJsonNull()) + && !jsonObj.get("tpOrderType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpOrderType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tpOrderType").toString())); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) + && !jsonObj.get("workingType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workingType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workingType").toString())); + } + if ((jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) + && !jsonObj.get("priceMatch").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceMatch` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceMatch").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CurrentAllAlgoOpenOrdersResponseInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CurrentAllAlgoOpenOrdersResponseInner' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CurrentAllAlgoOpenOrdersResponseInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CurrentAllAlgoOpenOrdersResponseInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CurrentAllAlgoOpenOrdersResponseInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CurrentAllAlgoOpenOrdersResponseInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of CurrentAllAlgoOpenOrdersResponseInner + * @throws IOException if the JSON string is invalid with respect to + * CurrentAllAlgoOpenOrdersResponseInner + */ + public static CurrentAllAlgoOpenOrdersResponseInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CurrentAllAlgoOpenOrdersResponseInner.class); + } + + /** + * Convert an instance of CurrentAllAlgoOpenOrdersResponseInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradfiPerpsContractRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradfiPerpsContractRequest.java new file mode 100644 index 00000000..38b63c1c --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradfiPerpsContractRequest.java @@ -0,0 +1,210 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** FuturesTradfiPerpsContractRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class FuturesTradfiPerpsContractRequest { + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Long recvWindow; + + public FuturesTradfiPerpsContractRequest() {} + + public FuturesTradfiPerpsContractRequest recvWindow( + @jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + public Long getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FuturesTradfiPerpsContractRequest futuresTradfiPerpsContractRequest = + (FuturesTradfiPerpsContractRequest) o; + return Objects.equals(this.recvWindow, futuresTradfiPerpsContractRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash(recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FuturesTradfiPerpsContractRequest {\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object recvWindowValue = getRecvWindow(); + String recvWindowValueAsString = ""; + recvWindowValueAsString = recvWindowValue.toString(); + sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("recvWindow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * FuturesTradfiPerpsContractRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FuturesTradfiPerpsContractRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in FuturesTradfiPerpsContractRequest is" + + " not found in the empty JSON string", + FuturesTradfiPerpsContractRequest.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FuturesTradfiPerpsContractRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FuturesTradfiPerpsContractRequest' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(FuturesTradfiPerpsContractRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, FuturesTradfiPerpsContractRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FuturesTradfiPerpsContractRequest read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of FuturesTradfiPerpsContractRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FuturesTradfiPerpsContractRequest + * @throws IOException if the JSON string is invalid with respect to + * FuturesTradfiPerpsContractRequest + */ + public static FuturesTradfiPerpsContractRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FuturesTradfiPerpsContractRequest.class); + } + + /** + * Convert an instance of FuturesTradfiPerpsContractRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradfiPerpsContractResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradfiPerpsContractResponse.java new file mode 100644 index 00000000..367c9917 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradfiPerpsContractResponse.java @@ -0,0 +1,250 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** FuturesTradfiPerpsContractResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class FuturesTradfiPerpsContractResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Long code; + + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) + @jakarta.annotation.Nullable + private String msg; + + public FuturesTradfiPerpsContractResponse() {} + + public FuturesTradfiPerpsContractResponse code(@jakarta.annotation.Nullable Long code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code + */ + @jakarta.annotation.Nullable + public Long getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Long code) { + this.code = code; + } + + public FuturesTradfiPerpsContractResponse msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FuturesTradfiPerpsContractResponse futuresTradfiPerpsContractResponse = + (FuturesTradfiPerpsContractResponse) o; + return Objects.equals(this.code, futuresTradfiPerpsContractResponse.code) + && Objects.equals(this.msg, futuresTradfiPerpsContractResponse.msg); + } + + @Override + public int hashCode() { + return Objects.hash(code, msg); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FuturesTradfiPerpsContractResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("msg"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * FuturesTradfiPerpsContractResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FuturesTradfiPerpsContractResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in FuturesTradfiPerpsContractResponse is" + + " not found in the empty JSON string", + FuturesTradfiPerpsContractResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FuturesTradfiPerpsContractResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FuturesTradfiPerpsContractResponse' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(FuturesTradfiPerpsContractResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, FuturesTradfiPerpsContractResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FuturesTradfiPerpsContractResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of FuturesTradfiPerpsContractResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of FuturesTradfiPerpsContractResponse + * @throws IOException if the JSON string is invalid with respect to + * FuturesTradfiPerpsContractResponse + */ + public static FuturesTradfiPerpsContractResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, FuturesTradfiPerpsContractResponse.class); + } + + /** + * Convert an instance of FuturesTradfiPerpsContractResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewAlgoOrderRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewAlgoOrderRequest.java new file mode 100644 index 00000000..61e881cd --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewAlgoOrderRequest.java @@ -0,0 +1,946 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** NewAlgoOrderRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class NewAlgoOrderRequest { + public static final String SERIALIZED_NAME_ALGO_TYPE = "algoType"; + + @SerializedName(SERIALIZED_NAME_ALGO_TYPE) + @jakarta.annotation.Nonnull + private String algoType; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nonnull + private String symbol; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nonnull + private Side side; + + public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; + + @SerializedName(SERIALIZED_NAME_POSITION_SIDE) + @jakarta.annotation.Nullable + private PositionSide positionSide; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private TimeInForce timeInForce; + + public static final String SERIALIZED_NAME_QUANTITY = "quantity"; + + @SerializedName(SERIALIZED_NAME_QUANTITY) + @jakarta.annotation.Nullable + private Double quantity; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private Double price; + + public static final String SERIALIZED_NAME_TRIGGER_PRICE = "triggerPrice"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private Double triggerPrice; + + public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nullable + private WorkingType workingType; + + public static final String SERIALIZED_NAME_PRICE_MATCH = "priceMatch"; + + @SerializedName(SERIALIZED_NAME_PRICE_MATCH) + @jakarta.annotation.Nullable + private PriceMatch priceMatch; + + public static final String SERIALIZED_NAME_CLOSE_POSITION = "closePosition"; + + @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) + @jakarta.annotation.Nullable + private String closePosition; + + public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; + + @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) + @jakarta.annotation.Nullable + private String priceProtect; + + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; + + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @jakarta.annotation.Nullable + private String reduceOnly; + + public static final String SERIALIZED_NAME_ACTIVATION_PRICE = "activationPrice"; + + @SerializedName(SERIALIZED_NAME_ACTIVATION_PRICE) + @jakarta.annotation.Nullable + private Double activationPrice; + + public static final String SERIALIZED_NAME_CALLBACK_RATE = "callbackRate"; + + @SerializedName(SERIALIZED_NAME_CALLBACK_RATE) + @jakarta.annotation.Nullable + private Double callbackRate; + + public static final String SERIALIZED_NAME_CLIENT_ALGO_ID = "clientAlgoId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ALGO_ID) + @jakarta.annotation.Nullable + private String clientAlgoId; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private SelfTradePreventionMode selfTradePreventionMode; + + public static final String SERIALIZED_NAME_GOOD_TILL_DATE = "goodTillDate"; + + @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) + @jakarta.annotation.Nullable + private Long goodTillDate; + + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Long recvWindow; + + public NewAlgoOrderRequest() {} + + public NewAlgoOrderRequest algoType(@jakarta.annotation.Nonnull String algoType) { + this.algoType = algoType; + return this; + } + + /** + * Get algoType + * + * @return algoType + */ + @jakarta.annotation.Nonnull + @NotNull + public String getAlgoType() { + return algoType; + } + + public void setAlgoType(@jakarta.annotation.Nonnull String algoType) { + this.algoType = algoType; + } + + public NewAlgoOrderRequest symbol(@jakarta.annotation.Nonnull String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nonnull + @NotNull + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nonnull String symbol) { + this.symbol = symbol; + } + + public NewAlgoOrderRequest side(@jakarta.annotation.Nonnull Side side) { + this.side = side; + return this; + } + + /** + * Get side + * + * @return side + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Side getSide() { + return side; + } + + public void setSide(@jakarta.annotation.Nonnull Side side) { + this.side = side; + } + + public NewAlgoOrderRequest positionSide( + @jakarta.annotation.Nullable PositionSide positionSide) { + this.positionSide = positionSide; + return this; + } + + /** + * Get positionSide + * + * @return positionSide + */ + @jakarta.annotation.Nullable + @Valid + public PositionSide getPositionSide() { + return positionSide; + } + + public void setPositionSide(@jakarta.annotation.Nullable PositionSide positionSide) { + this.positionSide = positionSide; + } + + public NewAlgoOrderRequest type(@jakarta.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nonnull + @NotNull + public String getType() { + return type; + } + + public void setType(@jakarta.annotation.Nonnull String type) { + this.type = type; + } + + public NewAlgoOrderRequest timeInForce(@jakarta.annotation.Nullable TimeInForce timeInForce) { + this.timeInForce = timeInForce; + return this; + } + + /** + * Get timeInForce + * + * @return timeInForce + */ + @jakarta.annotation.Nullable + @Valid + public TimeInForce getTimeInForce() { + return timeInForce; + } + + public void setTimeInForce(@jakarta.annotation.Nullable TimeInForce timeInForce) { + this.timeInForce = timeInForce; + } + + public NewAlgoOrderRequest quantity(@jakarta.annotation.Nullable Double quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity + */ + @jakarta.annotation.Nullable + @Valid + public Double getQuantity() { + return quantity; + } + + public void setQuantity(@jakarta.annotation.Nullable Double quantity) { + this.quantity = quantity; + } + + public NewAlgoOrderRequest price(@jakarta.annotation.Nullable Double price) { + this.price = price; + return this; + } + + /** + * Get price + * + * @return price + */ + @jakarta.annotation.Nullable + @Valid + public Double getPrice() { + return price; + } + + public void setPrice(@jakarta.annotation.Nullable Double price) { + this.price = price; + } + + public NewAlgoOrderRequest triggerPrice(@jakarta.annotation.Nullable Double triggerPrice) { + this.triggerPrice = triggerPrice; + return this; + } + + /** + * Get triggerPrice + * + * @return triggerPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getTriggerPrice() { + return triggerPrice; + } + + public void setTriggerPrice(@jakarta.annotation.Nullable Double triggerPrice) { + this.triggerPrice = triggerPrice; + } + + public NewAlgoOrderRequest workingType(@jakarta.annotation.Nullable WorkingType workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nullable + @Valid + public WorkingType getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nullable WorkingType workingType) { + this.workingType = workingType; + } + + public NewAlgoOrderRequest priceMatch(@jakarta.annotation.Nullable PriceMatch priceMatch) { + this.priceMatch = priceMatch; + return this; + } + + /** + * Get priceMatch + * + * @return priceMatch + */ + @jakarta.annotation.Nullable + @Valid + public PriceMatch getPriceMatch() { + return priceMatch; + } + + public void setPriceMatch(@jakarta.annotation.Nullable PriceMatch priceMatch) { + this.priceMatch = priceMatch; + } + + public NewAlgoOrderRequest closePosition(@jakarta.annotation.Nullable String closePosition) { + this.closePosition = closePosition; + return this; + } + + /** + * Get closePosition + * + * @return closePosition + */ + @jakarta.annotation.Nullable + public String getClosePosition() { + return closePosition; + } + + public void setClosePosition(@jakarta.annotation.Nullable String closePosition) { + this.closePosition = closePosition; + } + + public NewAlgoOrderRequest priceProtect(@jakarta.annotation.Nullable String priceProtect) { + this.priceProtect = priceProtect; + return this; + } + + /** + * Get priceProtect + * + * @return priceProtect + */ + @jakarta.annotation.Nullable + public String getPriceProtect() { + return priceProtect; + } + + public void setPriceProtect(@jakarta.annotation.Nullable String priceProtect) { + this.priceProtect = priceProtect; + } + + public NewAlgoOrderRequest reduceOnly(@jakarta.annotation.Nullable String reduceOnly) { + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Get reduceOnly + * + * @return reduceOnly + */ + @jakarta.annotation.Nullable + public String getReduceOnly() { + return reduceOnly; + } + + public void setReduceOnly(@jakarta.annotation.Nullable String reduceOnly) { + this.reduceOnly = reduceOnly; + } + + public NewAlgoOrderRequest activationPrice( + @jakarta.annotation.Nullable Double activationPrice) { + this.activationPrice = activationPrice; + return this; + } + + /** + * Get activationPrice + * + * @return activationPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getActivationPrice() { + return activationPrice; + } + + public void setActivationPrice(@jakarta.annotation.Nullable Double activationPrice) { + this.activationPrice = activationPrice; + } + + public NewAlgoOrderRequest callbackRate(@jakarta.annotation.Nullable Double callbackRate) { + this.callbackRate = callbackRate; + return this; + } + + /** + * Get callbackRate + * + * @return callbackRate + */ + @jakarta.annotation.Nullable + @Valid + public Double getCallbackRate() { + return callbackRate; + } + + public void setCallbackRate(@jakarta.annotation.Nullable Double callbackRate) { + this.callbackRate = callbackRate; + } + + public NewAlgoOrderRequest clientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + return this; + } + + /** + * Get clientAlgoId + * + * @return clientAlgoId + */ + @jakarta.annotation.Nullable + public String getClientAlgoId() { + return clientAlgoId; + } + + public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + } + + public NewAlgoOrderRequest selfTradePreventionMode( + @jakarta.annotation.Nullable SelfTradePreventionMode selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + @Valid + public SelfTradePreventionMode getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable SelfTradePreventionMode selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + + public NewAlgoOrderRequest goodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + return this; + } + + /** + * Get goodTillDate + * + * @return goodTillDate + */ + @jakarta.annotation.Nullable + public Long getGoodTillDate() { + return goodTillDate; + } + + public void setGoodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + } + + public NewAlgoOrderRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + public Long getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewAlgoOrderRequest newAlgoOrderRequest = (NewAlgoOrderRequest) o; + return Objects.equals(this.algoType, newAlgoOrderRequest.algoType) + && Objects.equals(this.symbol, newAlgoOrderRequest.symbol) + && Objects.equals(this.side, newAlgoOrderRequest.side) + && Objects.equals(this.positionSide, newAlgoOrderRequest.positionSide) + && Objects.equals(this.type, newAlgoOrderRequest.type) + && Objects.equals(this.timeInForce, newAlgoOrderRequest.timeInForce) + && Objects.equals(this.quantity, newAlgoOrderRequest.quantity) + && Objects.equals(this.price, newAlgoOrderRequest.price) + && Objects.equals(this.triggerPrice, newAlgoOrderRequest.triggerPrice) + && Objects.equals(this.workingType, newAlgoOrderRequest.workingType) + && Objects.equals(this.priceMatch, newAlgoOrderRequest.priceMatch) + && Objects.equals(this.closePosition, newAlgoOrderRequest.closePosition) + && Objects.equals(this.priceProtect, newAlgoOrderRequest.priceProtect) + && Objects.equals(this.reduceOnly, newAlgoOrderRequest.reduceOnly) + && Objects.equals(this.activationPrice, newAlgoOrderRequest.activationPrice) + && Objects.equals(this.callbackRate, newAlgoOrderRequest.callbackRate) + && Objects.equals(this.clientAlgoId, newAlgoOrderRequest.clientAlgoId) + && Objects.equals( + this.selfTradePreventionMode, newAlgoOrderRequest.selfTradePreventionMode) + && Objects.equals(this.goodTillDate, newAlgoOrderRequest.goodTillDate) + && Objects.equals(this.recvWindow, newAlgoOrderRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash( + algoType, + symbol, + side, + positionSide, + type, + timeInForce, + quantity, + price, + triggerPrice, + workingType, + priceMatch, + closePosition, + priceProtect, + reduceOnly, + activationPrice, + callbackRate, + clientAlgoId, + selfTradePreventionMode, + goodTillDate, + recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewAlgoOrderRequest {\n"); + sb.append(" algoType: ").append(toIndentedString(algoType)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); + sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); + sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" activationPrice: ").append(toIndentedString(activationPrice)).append("\n"); + sb.append(" callbackRate: ").append(toIndentedString(callbackRate)).append("\n"); + sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" goodTillDate: ").append(toIndentedString(goodTillDate)).append("\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object algoTypeValue = getAlgoType(); + String algoTypeValueAsString = ""; + algoTypeValueAsString = algoTypeValue.toString(); + sb.append("algoType=").append(urlEncode(algoTypeValueAsString)).append(""); + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object sideValue = getSide(); + String sideValueAsString = ""; + sideValueAsString = sideValue.toString(); + sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object positionSideValue = getPositionSide(); + String positionSideValueAsString = ""; + positionSideValueAsString = positionSideValue.toString(); + sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); + Object typeValue = getType(); + String typeValueAsString = ""; + typeValueAsString = typeValue.toString(); + sb.append("type=").append(urlEncode(typeValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object quantityValue = getQuantity(); + String quantityValueAsString = ""; + quantityValueAsString = quantityValue.toString(); + sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object triggerPriceValue = getTriggerPrice(); + String triggerPriceValueAsString = ""; + triggerPriceValueAsString = triggerPriceValue.toString(); + sb.append("triggerPrice=").append(urlEncode(triggerPriceValueAsString)).append(""); + Object workingTypeValue = getWorkingType(); + String workingTypeValueAsString = ""; + workingTypeValueAsString = workingTypeValue.toString(); + sb.append("workingType=").append(urlEncode(workingTypeValueAsString)).append(""); + Object priceMatchValue = getPriceMatch(); + String priceMatchValueAsString = ""; + priceMatchValueAsString = priceMatchValue.toString(); + sb.append("priceMatch=").append(urlEncode(priceMatchValueAsString)).append(""); + Object closePositionValue = getClosePosition(); + String closePositionValueAsString = ""; + closePositionValueAsString = closePositionValue.toString(); + sb.append("closePosition=").append(urlEncode(closePositionValueAsString)).append(""); + Object priceProtectValue = getPriceProtect(); + String priceProtectValueAsString = ""; + priceProtectValueAsString = priceProtectValue.toString(); + sb.append("priceProtect=").append(urlEncode(priceProtectValueAsString)).append(""); + Object reduceOnlyValue = getReduceOnly(); + String reduceOnlyValueAsString = ""; + reduceOnlyValueAsString = reduceOnlyValue.toString(); + sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); + Object activationPriceValue = getActivationPrice(); + String activationPriceValueAsString = ""; + activationPriceValueAsString = activationPriceValue.toString(); + sb.append("activationPrice=").append(urlEncode(activationPriceValueAsString)).append(""); + Object callbackRateValue = getCallbackRate(); + String callbackRateValueAsString = ""; + callbackRateValueAsString = callbackRateValue.toString(); + sb.append("callbackRate=").append(urlEncode(callbackRateValueAsString)).append(""); + Object clientAlgoIdValue = getClientAlgoId(); + String clientAlgoIdValueAsString = ""; + clientAlgoIdValueAsString = clientAlgoIdValue.toString(); + sb.append("clientAlgoId=").append(urlEncode(clientAlgoIdValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); + Object goodTillDateValue = getGoodTillDate(); + String goodTillDateValueAsString = ""; + goodTillDateValueAsString = goodTillDateValue.toString(); + sb.append("goodTillDate=").append(urlEncode(goodTillDateValueAsString)).append(""); + Object recvWindowValue = getRecvWindow(); + String recvWindowValueAsString = ""; + recvWindowValueAsString = recvWindowValue.toString(); + sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("algoType"); + openapiFields.add("symbol"); + openapiFields.add("side"); + openapiFields.add("positionSide"); + openapiFields.add("type"); + openapiFields.add("timeInForce"); + openapiFields.add("quantity"); + openapiFields.add("price"); + openapiFields.add("triggerPrice"); + openapiFields.add("workingType"); + openapiFields.add("priceMatch"); + openapiFields.add("closePosition"); + openapiFields.add("priceProtect"); + openapiFields.add("reduceOnly"); + openapiFields.add("activationPrice"); + openapiFields.add("callbackRate"); + openapiFields.add("clientAlgoId"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("goodTillDate"); + openapiFields.add("recvWindow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("algoType"); + openapiRequiredFields.add("symbol"); + openapiRequiredFields.add("side"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewAlgoOrderRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewAlgoOrderRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in NewAlgoOrderRequest is not found in" + + " the empty JSON string", + NewAlgoOrderRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewAlgoOrderRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("algoType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoType").toString())); + } + if (!jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + // validate the required field `side` + Side.validateJsonElement(jsonObj.get("side")); + // validate the optional field `positionSide` + if (jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) { + PositionSide.validateJsonElement(jsonObj.get("positionSide")); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + // validate the optional field `timeInForce` + if (jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) { + TimeInForce.validateJsonElement(jsonObj.get("timeInForce")); + } + // validate the optional field `workingType` + if (jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) { + WorkingType.validateJsonElement(jsonObj.get("workingType")); + } + // validate the optional field `priceMatch` + if (jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) { + PriceMatch.validateJsonElement(jsonObj.get("priceMatch")); + } + if ((jsonObj.get("closePosition") != null && !jsonObj.get("closePosition").isJsonNull()) + && !jsonObj.get("closePosition").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `closePosition` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("closePosition").toString())); + } + if ((jsonObj.get("priceProtect") != null && !jsonObj.get("priceProtect").isJsonNull()) + && !jsonObj.get("priceProtect").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceProtect` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceProtect").toString())); + } + if ((jsonObj.get("reduceOnly") != null && !jsonObj.get("reduceOnly").isJsonNull()) + && !jsonObj.get("reduceOnly").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `reduceOnly` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("reduceOnly").toString())); + } + if ((jsonObj.get("clientAlgoId") != null && !jsonObj.get("clientAlgoId").isJsonNull()) + && !jsonObj.get("clientAlgoId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientAlgoId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientAlgoId").toString())); + } + // validate the optional field `selfTradePreventionMode` + if (jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) { + SelfTradePreventionMode.validateJsonElement(jsonObj.get("selfTradePreventionMode")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewAlgoOrderRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewAlgoOrderRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NewAlgoOrderRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NewAlgoOrderRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewAlgoOrderRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NewAlgoOrderRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewAlgoOrderRequest + * @throws IOException if the JSON string is invalid with respect to NewAlgoOrderRequest + */ + public static NewAlgoOrderRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewAlgoOrderRequest.class); + } + + /** + * Convert an instance of NewAlgoOrderRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewAlgoOrderResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewAlgoOrderResponse.java new file mode 100644 index 00000000..c2f8f542 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewAlgoOrderResponse.java @@ -0,0 +1,1141 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** NewAlgoOrderResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class NewAlgoOrderResponse { + public static final String SERIALIZED_NAME_ALGO_ID = "algoId"; + + @SerializedName(SERIALIZED_NAME_ALGO_ID) + @jakarta.annotation.Nullable + private Long algoId; + + public static final String SERIALIZED_NAME_CLIENT_ALGO_ID = "clientAlgoId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ALGO_ID) + @jakarta.annotation.Nullable + private String clientAlgoId; + + public static final String SERIALIZED_NAME_ALGO_TYPE = "algoType"; + + @SerializedName(SERIALIZED_NAME_ALGO_TYPE) + @jakarta.annotation.Nullable + private String algoType; + + public static final String SERIALIZED_NAME_ORDER_TYPE = "orderType"; + + @SerializedName(SERIALIZED_NAME_ORDER_TYPE) + @jakarta.annotation.Nullable + private String orderType; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private String side; + + public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; + + @SerializedName(SERIALIZED_NAME_POSITION_SIDE) + @jakarta.annotation.Nullable + private String positionSide; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private String timeInForce; + + public static final String SERIALIZED_NAME_QUANTITY = "quantity"; + + @SerializedName(SERIALIZED_NAME_QUANTITY) + @jakarta.annotation.Nullable + private String quantity; + + public static final String SERIALIZED_NAME_ALGO_STATUS = "algoStatus"; + + @SerializedName(SERIALIZED_NAME_ALGO_STATUS) + @jakarta.annotation.Nullable + private String algoStatus; + + public static final String SERIALIZED_NAME_TRIGGER_PRICE = "triggerPrice"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String triggerPrice; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_ICEBERG_QUANTITY = "icebergQuantity"; + + @SerializedName(SERIALIZED_NAME_ICEBERG_QUANTITY) + @jakarta.annotation.Nullable + private String icebergQuantity; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private String selfTradePreventionMode; + + public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nullable + private String workingType; + + public static final String SERIALIZED_NAME_PRICE_MATCH = "priceMatch"; + + @SerializedName(SERIALIZED_NAME_PRICE_MATCH) + @jakarta.annotation.Nullable + private String priceMatch; + + public static final String SERIALIZED_NAME_CLOSE_POSITION = "closePosition"; + + @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) + @jakarta.annotation.Nullable + private Boolean closePosition; + + public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; + + @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) + @jakarta.annotation.Nullable + private Boolean priceProtect; + + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; + + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @jakarta.annotation.Nullable + private Boolean reduceOnly; + + public static final String SERIALIZED_NAME_ACTIVATE_PRICE = "activatePrice"; + + @SerializedName(SERIALIZED_NAME_ACTIVATE_PRICE) + @jakarta.annotation.Nullable + private String activatePrice; + + public static final String SERIALIZED_NAME_CALLBACK_RATE = "callbackRate"; + + @SerializedName(SERIALIZED_NAME_CALLBACK_RATE) + @jakarta.annotation.Nullable + private String callbackRate; + + public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; + + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + @jakarta.annotation.Nullable + private Long createTime; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; + + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + @jakarta.annotation.Nullable + private Long updateTime; + + public static final String SERIALIZED_NAME_TRIGGER_TIME = "triggerTime"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_TIME) + @jakarta.annotation.Nullable + private Long triggerTime; + + public static final String SERIALIZED_NAME_GOOD_TILL_DATE = "goodTillDate"; + + @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) + @jakarta.annotation.Nullable + private Long goodTillDate; + + public NewAlgoOrderResponse() {} + + public NewAlgoOrderResponse algoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + return this; + } + + /** + * Get algoId + * + * @return algoId + */ + @jakarta.annotation.Nullable + public Long getAlgoId() { + return algoId; + } + + public void setAlgoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + } + + public NewAlgoOrderResponse clientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + return this; + } + + /** + * Get clientAlgoId + * + * @return clientAlgoId + */ + @jakarta.annotation.Nullable + public String getClientAlgoId() { + return clientAlgoId; + } + + public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + } + + public NewAlgoOrderResponse algoType(@jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + return this; + } + + /** + * Get algoType + * + * @return algoType + */ + @jakarta.annotation.Nullable + public String getAlgoType() { + return algoType; + } + + public void setAlgoType(@jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + } + + public NewAlgoOrderResponse orderType(@jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + return this; + } + + /** + * Get orderType + * + * @return orderType + */ + @jakarta.annotation.Nullable + public String getOrderType() { + return orderType; + } + + public void setOrderType(@jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + } + + public NewAlgoOrderResponse symbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nullable + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + } + + public NewAlgoOrderResponse side(@jakarta.annotation.Nullable String side) { + this.side = side; + return this; + } + + /** + * Get side + * + * @return side + */ + @jakarta.annotation.Nullable + public String getSide() { + return side; + } + + public void setSide(@jakarta.annotation.Nullable String side) { + this.side = side; + } + + public NewAlgoOrderResponse positionSide(@jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + return this; + } + + /** + * Get positionSide + * + * @return positionSide + */ + @jakarta.annotation.Nullable + public String getPositionSide() { + return positionSide; + } + + public void setPositionSide(@jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + } + + public NewAlgoOrderResponse timeInForce(@jakarta.annotation.Nullable String timeInForce) { + this.timeInForce = timeInForce; + return this; + } + + /** + * Get timeInForce + * + * @return timeInForce + */ + @jakarta.annotation.Nullable + public String getTimeInForce() { + return timeInForce; + } + + public void setTimeInForce(@jakarta.annotation.Nullable String timeInForce) { + this.timeInForce = timeInForce; + } + + public NewAlgoOrderResponse quantity(@jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity + */ + @jakarta.annotation.Nullable + public String getQuantity() { + return quantity; + } + + public void setQuantity(@jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + } + + public NewAlgoOrderResponse algoStatus(@jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + return this; + } + + /** + * Get algoStatus + * + * @return algoStatus + */ + @jakarta.annotation.Nullable + public String getAlgoStatus() { + return algoStatus; + } + + public void setAlgoStatus(@jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + } + + public NewAlgoOrderResponse triggerPrice(@jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + return this; + } + + /** + * Get triggerPrice + * + * @return triggerPrice + */ + @jakarta.annotation.Nullable + public String getTriggerPrice() { + return triggerPrice; + } + + public void setTriggerPrice(@jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + } + + public NewAlgoOrderResponse price(@jakarta.annotation.Nullable String price) { + this.price = price; + return this; + } + + /** + * Get price + * + * @return price + */ + @jakarta.annotation.Nullable + public String getPrice() { + return price; + } + + public void setPrice(@jakarta.annotation.Nullable String price) { + this.price = price; + } + + public NewAlgoOrderResponse icebergQuantity( + @jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + return this; + } + + /** + * Get icebergQuantity + * + * @return icebergQuantity + */ + @jakarta.annotation.Nullable + public String getIcebergQuantity() { + return icebergQuantity; + } + + public void setIcebergQuantity(@jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + } + + public NewAlgoOrderResponse selfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + public String getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + + public NewAlgoOrderResponse workingType(@jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nullable + public String getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + } + + public NewAlgoOrderResponse priceMatch(@jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + return this; + } + + /** + * Get priceMatch + * + * @return priceMatch + */ + @jakarta.annotation.Nullable + public String getPriceMatch() { + return priceMatch; + } + + public void setPriceMatch(@jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + } + + public NewAlgoOrderResponse closePosition(@jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + return this; + } + + /** + * Get closePosition + * + * @return closePosition + */ + @jakarta.annotation.Nullable + public Boolean getClosePosition() { + return closePosition; + } + + public void setClosePosition(@jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + } + + public NewAlgoOrderResponse priceProtect(@jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + return this; + } + + /** + * Get priceProtect + * + * @return priceProtect + */ + @jakarta.annotation.Nullable + public Boolean getPriceProtect() { + return priceProtect; + } + + public void setPriceProtect(@jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + } + + public NewAlgoOrderResponse reduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Get reduceOnly + * + * @return reduceOnly + */ + @jakarta.annotation.Nullable + public Boolean getReduceOnly() { + return reduceOnly; + } + + public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + } + + public NewAlgoOrderResponse activatePrice(@jakarta.annotation.Nullable String activatePrice) { + this.activatePrice = activatePrice; + return this; + } + + /** + * Get activatePrice + * + * @return activatePrice + */ + @jakarta.annotation.Nullable + public String getActivatePrice() { + return activatePrice; + } + + public void setActivatePrice(@jakarta.annotation.Nullable String activatePrice) { + this.activatePrice = activatePrice; + } + + public NewAlgoOrderResponse callbackRate(@jakarta.annotation.Nullable String callbackRate) { + this.callbackRate = callbackRate; + return this; + } + + /** + * Get callbackRate + * + * @return callbackRate + */ + @jakarta.annotation.Nullable + public String getCallbackRate() { + return callbackRate; + } + + public void setCallbackRate(@jakarta.annotation.Nullable String callbackRate) { + this.callbackRate = callbackRate; + } + + public NewAlgoOrderResponse createTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get createTime + * + * @return createTime + */ + @jakarta.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + } + + public NewAlgoOrderResponse updateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Get updateTime + * + * @return updateTime + */ + @jakarta.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + } + + public NewAlgoOrderResponse triggerTime(@jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + return this; + } + + /** + * Get triggerTime + * + * @return triggerTime + */ + @jakarta.annotation.Nullable + public Long getTriggerTime() { + return triggerTime; + } + + public void setTriggerTime(@jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + } + + public NewAlgoOrderResponse goodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + return this; + } + + /** + * Get goodTillDate + * + * @return goodTillDate + */ + @jakarta.annotation.Nullable + public Long getGoodTillDate() { + return goodTillDate; + } + + public void setGoodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewAlgoOrderResponse newAlgoOrderResponse = (NewAlgoOrderResponse) o; + return Objects.equals(this.algoId, newAlgoOrderResponse.algoId) + && Objects.equals(this.clientAlgoId, newAlgoOrderResponse.clientAlgoId) + && Objects.equals(this.algoType, newAlgoOrderResponse.algoType) + && Objects.equals(this.orderType, newAlgoOrderResponse.orderType) + && Objects.equals(this.symbol, newAlgoOrderResponse.symbol) + && Objects.equals(this.side, newAlgoOrderResponse.side) + && Objects.equals(this.positionSide, newAlgoOrderResponse.positionSide) + && Objects.equals(this.timeInForce, newAlgoOrderResponse.timeInForce) + && Objects.equals(this.quantity, newAlgoOrderResponse.quantity) + && Objects.equals(this.algoStatus, newAlgoOrderResponse.algoStatus) + && Objects.equals(this.triggerPrice, newAlgoOrderResponse.triggerPrice) + && Objects.equals(this.price, newAlgoOrderResponse.price) + && Objects.equals(this.icebergQuantity, newAlgoOrderResponse.icebergQuantity) + && Objects.equals( + this.selfTradePreventionMode, newAlgoOrderResponse.selfTradePreventionMode) + && Objects.equals(this.workingType, newAlgoOrderResponse.workingType) + && Objects.equals(this.priceMatch, newAlgoOrderResponse.priceMatch) + && Objects.equals(this.closePosition, newAlgoOrderResponse.closePosition) + && Objects.equals(this.priceProtect, newAlgoOrderResponse.priceProtect) + && Objects.equals(this.reduceOnly, newAlgoOrderResponse.reduceOnly) + && Objects.equals(this.activatePrice, newAlgoOrderResponse.activatePrice) + && Objects.equals(this.callbackRate, newAlgoOrderResponse.callbackRate) + && Objects.equals(this.createTime, newAlgoOrderResponse.createTime) + && Objects.equals(this.updateTime, newAlgoOrderResponse.updateTime) + && Objects.equals(this.triggerTime, newAlgoOrderResponse.triggerTime) + && Objects.equals(this.goodTillDate, newAlgoOrderResponse.goodTillDate); + } + + @Override + public int hashCode() { + return Objects.hash( + algoId, + clientAlgoId, + algoType, + orderType, + symbol, + side, + positionSide, + timeInForce, + quantity, + algoStatus, + triggerPrice, + price, + icebergQuantity, + selfTradePreventionMode, + workingType, + priceMatch, + closePosition, + priceProtect, + reduceOnly, + activatePrice, + callbackRate, + createTime, + updateTime, + triggerTime, + goodTillDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewAlgoOrderResponse {\n"); + sb.append(" algoId: ").append(toIndentedString(algoId)).append("\n"); + sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); + sb.append(" algoType: ").append(toIndentedString(algoType)).append("\n"); + sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" algoStatus: ").append(toIndentedString(algoStatus)).append("\n"); + sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" icebergQuantity: ").append(toIndentedString(icebergQuantity)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); + sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); + sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" activatePrice: ").append(toIndentedString(activatePrice)).append("\n"); + sb.append(" callbackRate: ").append(toIndentedString(callbackRate)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" triggerTime: ").append(toIndentedString(triggerTime)).append("\n"); + sb.append(" goodTillDate: ").append(toIndentedString(goodTillDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object algoIdValue = getAlgoId(); + String algoIdValueAsString = ""; + algoIdValueAsString = algoIdValue.toString(); + sb.append("algoId=").append(urlEncode(algoIdValueAsString)).append(""); + Object clientAlgoIdValue = getClientAlgoId(); + String clientAlgoIdValueAsString = ""; + clientAlgoIdValueAsString = clientAlgoIdValue.toString(); + sb.append("clientAlgoId=").append(urlEncode(clientAlgoIdValueAsString)).append(""); + Object algoTypeValue = getAlgoType(); + String algoTypeValueAsString = ""; + algoTypeValueAsString = algoTypeValue.toString(); + sb.append("algoType=").append(urlEncode(algoTypeValueAsString)).append(""); + Object orderTypeValue = getOrderType(); + String orderTypeValueAsString = ""; + orderTypeValueAsString = orderTypeValue.toString(); + sb.append("orderType=").append(urlEncode(orderTypeValueAsString)).append(""); + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object sideValue = getSide(); + String sideValueAsString = ""; + sideValueAsString = sideValue.toString(); + sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object positionSideValue = getPositionSide(); + String positionSideValueAsString = ""; + positionSideValueAsString = positionSideValue.toString(); + sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object quantityValue = getQuantity(); + String quantityValueAsString = ""; + quantityValueAsString = quantityValue.toString(); + sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); + Object algoStatusValue = getAlgoStatus(); + String algoStatusValueAsString = ""; + algoStatusValueAsString = algoStatusValue.toString(); + sb.append("algoStatus=").append(urlEncode(algoStatusValueAsString)).append(""); + Object triggerPriceValue = getTriggerPrice(); + String triggerPriceValueAsString = ""; + triggerPriceValueAsString = triggerPriceValue.toString(); + sb.append("triggerPrice=").append(urlEncode(triggerPriceValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object icebergQuantityValue = getIcebergQuantity(); + String icebergQuantityValueAsString = ""; + icebergQuantityValueAsString = icebergQuantityValue.toString(); + sb.append("icebergQuantity=").append(urlEncode(icebergQuantityValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); + Object workingTypeValue = getWorkingType(); + String workingTypeValueAsString = ""; + workingTypeValueAsString = workingTypeValue.toString(); + sb.append("workingType=").append(urlEncode(workingTypeValueAsString)).append(""); + Object priceMatchValue = getPriceMatch(); + String priceMatchValueAsString = ""; + priceMatchValueAsString = priceMatchValue.toString(); + sb.append("priceMatch=").append(urlEncode(priceMatchValueAsString)).append(""); + Object closePositionValue = getClosePosition(); + String closePositionValueAsString = ""; + closePositionValueAsString = closePositionValue.toString(); + sb.append("closePosition=").append(urlEncode(closePositionValueAsString)).append(""); + Object priceProtectValue = getPriceProtect(); + String priceProtectValueAsString = ""; + priceProtectValueAsString = priceProtectValue.toString(); + sb.append("priceProtect=").append(urlEncode(priceProtectValueAsString)).append(""); + Object reduceOnlyValue = getReduceOnly(); + String reduceOnlyValueAsString = ""; + reduceOnlyValueAsString = reduceOnlyValue.toString(); + sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); + Object activatePriceValue = getActivatePrice(); + String activatePriceValueAsString = ""; + activatePriceValueAsString = activatePriceValue.toString(); + sb.append("activatePrice=").append(urlEncode(activatePriceValueAsString)).append(""); + Object callbackRateValue = getCallbackRate(); + String callbackRateValueAsString = ""; + callbackRateValueAsString = callbackRateValue.toString(); + sb.append("callbackRate=").append(urlEncode(callbackRateValueAsString)).append(""); + Object createTimeValue = getCreateTime(); + String createTimeValueAsString = ""; + createTimeValueAsString = createTimeValue.toString(); + sb.append("createTime=").append(urlEncode(createTimeValueAsString)).append(""); + Object updateTimeValue = getUpdateTime(); + String updateTimeValueAsString = ""; + updateTimeValueAsString = updateTimeValue.toString(); + sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).append(""); + Object triggerTimeValue = getTriggerTime(); + String triggerTimeValueAsString = ""; + triggerTimeValueAsString = triggerTimeValue.toString(); + sb.append("triggerTime=").append(urlEncode(triggerTimeValueAsString)).append(""); + Object goodTillDateValue = getGoodTillDate(); + String goodTillDateValueAsString = ""; + goodTillDateValueAsString = goodTillDateValue.toString(); + sb.append("goodTillDate=").append(urlEncode(goodTillDateValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("algoId"); + openapiFields.add("clientAlgoId"); + openapiFields.add("algoType"); + openapiFields.add("orderType"); + openapiFields.add("symbol"); + openapiFields.add("side"); + openapiFields.add("positionSide"); + openapiFields.add("timeInForce"); + openapiFields.add("quantity"); + openapiFields.add("algoStatus"); + openapiFields.add("triggerPrice"); + openapiFields.add("price"); + openapiFields.add("icebergQuantity"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("workingType"); + openapiFields.add("priceMatch"); + openapiFields.add("closePosition"); + openapiFields.add("priceProtect"); + openapiFields.add("reduceOnly"); + openapiFields.add("activatePrice"); + openapiFields.add("callbackRate"); + openapiFields.add("createTime"); + openapiFields.add("updateTime"); + openapiFields.add("triggerTime"); + openapiFields.add("goodTillDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewAlgoOrderResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewAlgoOrderResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in NewAlgoOrderResponse is not found in" + + " the empty JSON string", + NewAlgoOrderResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("clientAlgoId") != null && !jsonObj.get("clientAlgoId").isJsonNull()) + && !jsonObj.get("clientAlgoId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientAlgoId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientAlgoId").toString())); + } + if ((jsonObj.get("algoType") != null && !jsonObj.get("algoType").isJsonNull()) + && !jsonObj.get("algoType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoType").toString())); + } + if ((jsonObj.get("orderType") != null && !jsonObj.get("orderType").isJsonNull()) + && !jsonObj.get("orderType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("orderType").toString())); + } + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) + && !jsonObj.get("side").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `side` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("side").toString())); + } + if ((jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) + && !jsonObj.get("positionSide").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `positionSide` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("positionSide").toString())); + } + if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) + && !jsonObj.get("timeInForce").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timeInForce` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timeInForce").toString())); + } + if ((jsonObj.get("quantity") != null && !jsonObj.get("quantity").isJsonNull()) + && !jsonObj.get("quantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quantity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("quantity").toString())); + } + if ((jsonObj.get("algoStatus") != null && !jsonObj.get("algoStatus").isJsonNull()) + && !jsonObj.get("algoStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoStatus` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoStatus").toString())); + } + if ((jsonObj.get("triggerPrice") != null && !jsonObj.get("triggerPrice").isJsonNull()) + && !jsonObj.get("triggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `triggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("triggerPrice").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("icebergQuantity") != null && !jsonObj.get("icebergQuantity").isJsonNull()) + && !jsonObj.get("icebergQuantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `icebergQuantity` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("icebergQuantity").toString())); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) + && !jsonObj.get("workingType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workingType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workingType").toString())); + } + if ((jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) + && !jsonObj.get("priceMatch").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceMatch` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceMatch").toString())); + } + if ((jsonObj.get("activatePrice") != null && !jsonObj.get("activatePrice").isJsonNull()) + && !jsonObj.get("activatePrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `activatePrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("activatePrice").toString())); + } + if ((jsonObj.get("callbackRate") != null && !jsonObj.get("callbackRate").isJsonNull()) + && !jsonObj.get("callbackRate").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `callbackRate` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("callbackRate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewAlgoOrderResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewAlgoOrderResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NewAlgoOrderResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NewAlgoOrderResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewAlgoOrderResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NewAlgoOrderResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewAlgoOrderResponse + * @throws IOException if the JSON string is invalid with respect to NewAlgoOrderResponse + */ + public static NewAlgoOrderResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewAlgoOrderResponse.class); + } + + /** + * Convert an instance of NewAlgoOrderResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OldTradesLookupResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OldTradesLookupResponseInner.java index 6712af3e..3e610356 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OldTradesLookupResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OldTradesLookupResponseInner.java @@ -72,6 +72,12 @@ public class OldTradesLookupResponseInner { @jakarta.annotation.Nullable private Boolean isBuyerMaker; + public static final String SERIALIZED_NAME_IS_R_P_I_TRADE = "isRPITrade"; + + @SerializedName(SERIALIZED_NAME_IS_R_P_I_TRADE) + @jakarta.annotation.Nullable + private Boolean isRPITrade; + public OldTradesLookupResponseInner() {} public OldTradesLookupResponseInner id(@jakarta.annotation.Nullable Long id) { @@ -189,6 +195,26 @@ public void setIsBuyerMaker(@jakarta.annotation.Nullable Boolean isBuyerMaker) { this.isBuyerMaker = isBuyerMaker; } + public OldTradesLookupResponseInner isRPITrade( + @jakarta.annotation.Nullable Boolean isRPITrade) { + this.isRPITrade = isRPITrade; + return this; + } + + /** + * Get isRPITrade + * + * @return isRPITrade + */ + @jakarta.annotation.Nullable + public Boolean getIsRPITrade() { + return isRPITrade; + } + + public void setIsRPITrade(@jakarta.annotation.Nullable Boolean isRPITrade) { + this.isRPITrade = isRPITrade; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -204,12 +230,13 @@ public boolean equals(Object o) { && Objects.equals(this.qty, oldTradesLookupResponseInner.qty) && Objects.equals(this.quoteQty, oldTradesLookupResponseInner.quoteQty) && Objects.equals(this.time, oldTradesLookupResponseInner.time) - && Objects.equals(this.isBuyerMaker, oldTradesLookupResponseInner.isBuyerMaker); + && Objects.equals(this.isBuyerMaker, oldTradesLookupResponseInner.isBuyerMaker) + && Objects.equals(this.isRPITrade, oldTradesLookupResponseInner.isRPITrade); } @Override public int hashCode() { - return Objects.hash(id, price, qty, quoteQty, time, isBuyerMaker); + return Objects.hash(id, price, qty, quoteQty, time, isBuyerMaker, isRPITrade); } @Override @@ -222,6 +249,7 @@ public String toString() { sb.append(" quoteQty: ").append(toIndentedString(quoteQty)).append("\n"); sb.append(" time: ").append(toIndentedString(time)).append("\n"); sb.append(" isBuyerMaker: ").append(toIndentedString(isBuyerMaker)).append("\n"); + sb.append(" isRPITrade: ").append(toIndentedString(isRPITrade)).append("\n"); sb.append("}"); return sb.toString(); } @@ -253,6 +281,10 @@ public String toUrlQueryString() { String isBuyerMakerValueAsString = ""; isBuyerMakerValueAsString = isBuyerMakerValue.toString(); sb.append("isBuyerMaker=").append(urlEncode(isBuyerMakerValueAsString)).append(""); + Object isRPITradeValue = getIsRPITrade(); + String isRPITradeValueAsString = ""; + isRPITradeValueAsString = isRPITradeValue.toString(); + sb.append("isRPITrade=").append(urlEncode(isRPITradeValueAsString)).append(""); return sb.toString(); } @@ -287,6 +319,7 @@ private String toIndentedString(Object o) { openapiFields.add("quoteQty"); openapiFields.add("time"); openapiFields.add("isBuyerMaker"); + openapiFields.add("isRPITrade"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryAlgoOrderResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryAlgoOrderResponse.java new file mode 100644 index 00000000..f8efd862 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryAlgoOrderResponse.java @@ -0,0 +1,1350 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** QueryAlgoOrderResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class QueryAlgoOrderResponse { + public static final String SERIALIZED_NAME_ALGO_ID = "algoId"; + + @SerializedName(SERIALIZED_NAME_ALGO_ID) + @jakarta.annotation.Nullable + private Long algoId; + + public static final String SERIALIZED_NAME_CLIENT_ALGO_ID = "clientAlgoId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ALGO_ID) + @jakarta.annotation.Nullable + private String clientAlgoId; + + public static final String SERIALIZED_NAME_ALGO_TYPE = "algoType"; + + @SerializedName(SERIALIZED_NAME_ALGO_TYPE) + @jakarta.annotation.Nullable + private String algoType; + + public static final String SERIALIZED_NAME_ORDER_TYPE = "orderType"; + + @SerializedName(SERIALIZED_NAME_ORDER_TYPE) + @jakarta.annotation.Nullable + private String orderType; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private String side; + + public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; + + @SerializedName(SERIALIZED_NAME_POSITION_SIDE) + @jakarta.annotation.Nullable + private String positionSide; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private String timeInForce; + + public static final String SERIALIZED_NAME_QUANTITY = "quantity"; + + @SerializedName(SERIALIZED_NAME_QUANTITY) + @jakarta.annotation.Nullable + private String quantity; + + public static final String SERIALIZED_NAME_ALGO_STATUS = "algoStatus"; + + @SerializedName(SERIALIZED_NAME_ALGO_STATUS) + @jakarta.annotation.Nullable + private String algoStatus; + + public static final String SERIALIZED_NAME_ACTUAL_ORDER_ID = "actualOrderId"; + + @SerializedName(SERIALIZED_NAME_ACTUAL_ORDER_ID) + @jakarta.annotation.Nullable + private String actualOrderId; + + public static final String SERIALIZED_NAME_ACTUAL_PRICE = "actualPrice"; + + @SerializedName(SERIALIZED_NAME_ACTUAL_PRICE) + @jakarta.annotation.Nullable + private String actualPrice; + + public static final String SERIALIZED_NAME_TRIGGER_PRICE = "triggerPrice"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String triggerPrice; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_ICEBERG_QUANTITY = "icebergQuantity"; + + @SerializedName(SERIALIZED_NAME_ICEBERG_QUANTITY) + @jakarta.annotation.Nullable + private String icebergQuantity; + + public static final String SERIALIZED_NAME_TP_TRIGGER_PRICE = "tpTriggerPrice"; + + @SerializedName(SERIALIZED_NAME_TP_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String tpTriggerPrice; + + public static final String SERIALIZED_NAME_TP_PRICE = "tpPrice"; + + @SerializedName(SERIALIZED_NAME_TP_PRICE) + @jakarta.annotation.Nullable + private String tpPrice; + + public static final String SERIALIZED_NAME_SL_TRIGGER_PRICE = "slTriggerPrice"; + + @SerializedName(SERIALIZED_NAME_SL_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String slTriggerPrice; + + public static final String SERIALIZED_NAME_SL_PRICE = "slPrice"; + + @SerializedName(SERIALIZED_NAME_SL_PRICE) + @jakarta.annotation.Nullable + private String slPrice; + + public static final String SERIALIZED_NAME_TP_ORDER_TYPE = "tpOrderType"; + + @SerializedName(SERIALIZED_NAME_TP_ORDER_TYPE) + @jakarta.annotation.Nullable + private String tpOrderType; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private String selfTradePreventionMode; + + public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nullable + private String workingType; + + public static final String SERIALIZED_NAME_PRICE_MATCH = "priceMatch"; + + @SerializedName(SERIALIZED_NAME_PRICE_MATCH) + @jakarta.annotation.Nullable + private String priceMatch; + + public static final String SERIALIZED_NAME_CLOSE_POSITION = "closePosition"; + + @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) + @jakarta.annotation.Nullable + private Boolean closePosition; + + public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; + + @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) + @jakarta.annotation.Nullable + private Boolean priceProtect; + + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; + + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @jakarta.annotation.Nullable + private Boolean reduceOnly; + + public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; + + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + @jakarta.annotation.Nullable + private Long createTime; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; + + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + @jakarta.annotation.Nullable + private Long updateTime; + + public static final String SERIALIZED_NAME_TRIGGER_TIME = "triggerTime"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_TIME) + @jakarta.annotation.Nullable + private Long triggerTime; + + public static final String SERIALIZED_NAME_GOOD_TILL_DATE = "goodTillDate"; + + @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) + @jakarta.annotation.Nullable + private Long goodTillDate; + + public QueryAlgoOrderResponse() {} + + public QueryAlgoOrderResponse algoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + return this; + } + + /** + * Get algoId + * + * @return algoId + */ + @jakarta.annotation.Nullable + public Long getAlgoId() { + return algoId; + } + + public void setAlgoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + } + + public QueryAlgoOrderResponse clientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + return this; + } + + /** + * Get clientAlgoId + * + * @return clientAlgoId + */ + @jakarta.annotation.Nullable + public String getClientAlgoId() { + return clientAlgoId; + } + + public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + } + + public QueryAlgoOrderResponse algoType(@jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + return this; + } + + /** + * Get algoType + * + * @return algoType + */ + @jakarta.annotation.Nullable + public String getAlgoType() { + return algoType; + } + + public void setAlgoType(@jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + } + + public QueryAlgoOrderResponse orderType(@jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + return this; + } + + /** + * Get orderType + * + * @return orderType + */ + @jakarta.annotation.Nullable + public String getOrderType() { + return orderType; + } + + public void setOrderType(@jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + } + + public QueryAlgoOrderResponse symbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nullable + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + } + + public QueryAlgoOrderResponse side(@jakarta.annotation.Nullable String side) { + this.side = side; + return this; + } + + /** + * Get side + * + * @return side + */ + @jakarta.annotation.Nullable + public String getSide() { + return side; + } + + public void setSide(@jakarta.annotation.Nullable String side) { + this.side = side; + } + + public QueryAlgoOrderResponse positionSide(@jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + return this; + } + + /** + * Get positionSide + * + * @return positionSide + */ + @jakarta.annotation.Nullable + public String getPositionSide() { + return positionSide; + } + + public void setPositionSide(@jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + } + + public QueryAlgoOrderResponse timeInForce(@jakarta.annotation.Nullable String timeInForce) { + this.timeInForce = timeInForce; + return this; + } + + /** + * Get timeInForce + * + * @return timeInForce + */ + @jakarta.annotation.Nullable + public String getTimeInForce() { + return timeInForce; + } + + public void setTimeInForce(@jakarta.annotation.Nullable String timeInForce) { + this.timeInForce = timeInForce; + } + + public QueryAlgoOrderResponse quantity(@jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity + */ + @jakarta.annotation.Nullable + public String getQuantity() { + return quantity; + } + + public void setQuantity(@jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + } + + public QueryAlgoOrderResponse algoStatus(@jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + return this; + } + + /** + * Get algoStatus + * + * @return algoStatus + */ + @jakarta.annotation.Nullable + public String getAlgoStatus() { + return algoStatus; + } + + public void setAlgoStatus(@jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + } + + public QueryAlgoOrderResponse actualOrderId(@jakarta.annotation.Nullable String actualOrderId) { + this.actualOrderId = actualOrderId; + return this; + } + + /** + * Get actualOrderId + * + * @return actualOrderId + */ + @jakarta.annotation.Nullable + public String getActualOrderId() { + return actualOrderId; + } + + public void setActualOrderId(@jakarta.annotation.Nullable String actualOrderId) { + this.actualOrderId = actualOrderId; + } + + public QueryAlgoOrderResponse actualPrice(@jakarta.annotation.Nullable String actualPrice) { + this.actualPrice = actualPrice; + return this; + } + + /** + * Get actualPrice + * + * @return actualPrice + */ + @jakarta.annotation.Nullable + public String getActualPrice() { + return actualPrice; + } + + public void setActualPrice(@jakarta.annotation.Nullable String actualPrice) { + this.actualPrice = actualPrice; + } + + public QueryAlgoOrderResponse triggerPrice(@jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + return this; + } + + /** + * Get triggerPrice + * + * @return triggerPrice + */ + @jakarta.annotation.Nullable + public String getTriggerPrice() { + return triggerPrice; + } + + public void setTriggerPrice(@jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + } + + public QueryAlgoOrderResponse price(@jakarta.annotation.Nullable String price) { + this.price = price; + return this; + } + + /** + * Get price + * + * @return price + */ + @jakarta.annotation.Nullable + public String getPrice() { + return price; + } + + public void setPrice(@jakarta.annotation.Nullable String price) { + this.price = price; + } + + public QueryAlgoOrderResponse icebergQuantity( + @jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + return this; + } + + /** + * Get icebergQuantity + * + * @return icebergQuantity + */ + @jakarta.annotation.Nullable + public String getIcebergQuantity() { + return icebergQuantity; + } + + public void setIcebergQuantity(@jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + } + + public QueryAlgoOrderResponse tpTriggerPrice( + @jakarta.annotation.Nullable String tpTriggerPrice) { + this.tpTriggerPrice = tpTriggerPrice; + return this; + } + + /** + * Get tpTriggerPrice + * + * @return tpTriggerPrice + */ + @jakarta.annotation.Nullable + public String getTpTriggerPrice() { + return tpTriggerPrice; + } + + public void setTpTriggerPrice(@jakarta.annotation.Nullable String tpTriggerPrice) { + this.tpTriggerPrice = tpTriggerPrice; + } + + public QueryAlgoOrderResponse tpPrice(@jakarta.annotation.Nullable String tpPrice) { + this.tpPrice = tpPrice; + return this; + } + + /** + * Get tpPrice + * + * @return tpPrice + */ + @jakarta.annotation.Nullable + public String getTpPrice() { + return tpPrice; + } + + public void setTpPrice(@jakarta.annotation.Nullable String tpPrice) { + this.tpPrice = tpPrice; + } + + public QueryAlgoOrderResponse slTriggerPrice( + @jakarta.annotation.Nullable String slTriggerPrice) { + this.slTriggerPrice = slTriggerPrice; + return this; + } + + /** + * Get slTriggerPrice + * + * @return slTriggerPrice + */ + @jakarta.annotation.Nullable + public String getSlTriggerPrice() { + return slTriggerPrice; + } + + public void setSlTriggerPrice(@jakarta.annotation.Nullable String slTriggerPrice) { + this.slTriggerPrice = slTriggerPrice; + } + + public QueryAlgoOrderResponse slPrice(@jakarta.annotation.Nullable String slPrice) { + this.slPrice = slPrice; + return this; + } + + /** + * Get slPrice + * + * @return slPrice + */ + @jakarta.annotation.Nullable + public String getSlPrice() { + return slPrice; + } + + public void setSlPrice(@jakarta.annotation.Nullable String slPrice) { + this.slPrice = slPrice; + } + + public QueryAlgoOrderResponse tpOrderType(@jakarta.annotation.Nullable String tpOrderType) { + this.tpOrderType = tpOrderType; + return this; + } + + /** + * Get tpOrderType + * + * @return tpOrderType + */ + @jakarta.annotation.Nullable + public String getTpOrderType() { + return tpOrderType; + } + + public void setTpOrderType(@jakarta.annotation.Nullable String tpOrderType) { + this.tpOrderType = tpOrderType; + } + + public QueryAlgoOrderResponse selfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + public String getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + + public QueryAlgoOrderResponse workingType(@jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nullable + public String getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + } + + public QueryAlgoOrderResponse priceMatch(@jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + return this; + } + + /** + * Get priceMatch + * + * @return priceMatch + */ + @jakarta.annotation.Nullable + public String getPriceMatch() { + return priceMatch; + } + + public void setPriceMatch(@jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + } + + public QueryAlgoOrderResponse closePosition( + @jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + return this; + } + + /** + * Get closePosition + * + * @return closePosition + */ + @jakarta.annotation.Nullable + public Boolean getClosePosition() { + return closePosition; + } + + public void setClosePosition(@jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + } + + public QueryAlgoOrderResponse priceProtect(@jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + return this; + } + + /** + * Get priceProtect + * + * @return priceProtect + */ + @jakarta.annotation.Nullable + public Boolean getPriceProtect() { + return priceProtect; + } + + public void setPriceProtect(@jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + } + + public QueryAlgoOrderResponse reduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Get reduceOnly + * + * @return reduceOnly + */ + @jakarta.annotation.Nullable + public Boolean getReduceOnly() { + return reduceOnly; + } + + public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + } + + public QueryAlgoOrderResponse createTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get createTime + * + * @return createTime + */ + @jakarta.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + } + + public QueryAlgoOrderResponse updateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Get updateTime + * + * @return updateTime + */ + @jakarta.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + } + + public QueryAlgoOrderResponse triggerTime(@jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + return this; + } + + /** + * Get triggerTime + * + * @return triggerTime + */ + @jakarta.annotation.Nullable + public Long getTriggerTime() { + return triggerTime; + } + + public void setTriggerTime(@jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + } + + public QueryAlgoOrderResponse goodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + return this; + } + + /** + * Get goodTillDate + * + * @return goodTillDate + */ + @jakarta.annotation.Nullable + public Long getGoodTillDate() { + return goodTillDate; + } + + public void setGoodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryAlgoOrderResponse queryAlgoOrderResponse = (QueryAlgoOrderResponse) o; + return Objects.equals(this.algoId, queryAlgoOrderResponse.algoId) + && Objects.equals(this.clientAlgoId, queryAlgoOrderResponse.clientAlgoId) + && Objects.equals(this.algoType, queryAlgoOrderResponse.algoType) + && Objects.equals(this.orderType, queryAlgoOrderResponse.orderType) + && Objects.equals(this.symbol, queryAlgoOrderResponse.symbol) + && Objects.equals(this.side, queryAlgoOrderResponse.side) + && Objects.equals(this.positionSide, queryAlgoOrderResponse.positionSide) + && Objects.equals(this.timeInForce, queryAlgoOrderResponse.timeInForce) + && Objects.equals(this.quantity, queryAlgoOrderResponse.quantity) + && Objects.equals(this.algoStatus, queryAlgoOrderResponse.algoStatus) + && Objects.equals(this.actualOrderId, queryAlgoOrderResponse.actualOrderId) + && Objects.equals(this.actualPrice, queryAlgoOrderResponse.actualPrice) + && Objects.equals(this.triggerPrice, queryAlgoOrderResponse.triggerPrice) + && Objects.equals(this.price, queryAlgoOrderResponse.price) + && Objects.equals(this.icebergQuantity, queryAlgoOrderResponse.icebergQuantity) + && Objects.equals(this.tpTriggerPrice, queryAlgoOrderResponse.tpTriggerPrice) + && Objects.equals(this.tpPrice, queryAlgoOrderResponse.tpPrice) + && Objects.equals(this.slTriggerPrice, queryAlgoOrderResponse.slTriggerPrice) + && Objects.equals(this.slPrice, queryAlgoOrderResponse.slPrice) + && Objects.equals(this.tpOrderType, queryAlgoOrderResponse.tpOrderType) + && Objects.equals( + this.selfTradePreventionMode, + queryAlgoOrderResponse.selfTradePreventionMode) + && Objects.equals(this.workingType, queryAlgoOrderResponse.workingType) + && Objects.equals(this.priceMatch, queryAlgoOrderResponse.priceMatch) + && Objects.equals(this.closePosition, queryAlgoOrderResponse.closePosition) + && Objects.equals(this.priceProtect, queryAlgoOrderResponse.priceProtect) + && Objects.equals(this.reduceOnly, queryAlgoOrderResponse.reduceOnly) + && Objects.equals(this.createTime, queryAlgoOrderResponse.createTime) + && Objects.equals(this.updateTime, queryAlgoOrderResponse.updateTime) + && Objects.equals(this.triggerTime, queryAlgoOrderResponse.triggerTime) + && Objects.equals(this.goodTillDate, queryAlgoOrderResponse.goodTillDate); + } + + @Override + public int hashCode() { + return Objects.hash( + algoId, + clientAlgoId, + algoType, + orderType, + symbol, + side, + positionSide, + timeInForce, + quantity, + algoStatus, + actualOrderId, + actualPrice, + triggerPrice, + price, + icebergQuantity, + tpTriggerPrice, + tpPrice, + slTriggerPrice, + slPrice, + tpOrderType, + selfTradePreventionMode, + workingType, + priceMatch, + closePosition, + priceProtect, + reduceOnly, + createTime, + updateTime, + triggerTime, + goodTillDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryAlgoOrderResponse {\n"); + sb.append(" algoId: ").append(toIndentedString(algoId)).append("\n"); + sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); + sb.append(" algoType: ").append(toIndentedString(algoType)).append("\n"); + sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" algoStatus: ").append(toIndentedString(algoStatus)).append("\n"); + sb.append(" actualOrderId: ").append(toIndentedString(actualOrderId)).append("\n"); + sb.append(" actualPrice: ").append(toIndentedString(actualPrice)).append("\n"); + sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" icebergQuantity: ").append(toIndentedString(icebergQuantity)).append("\n"); + sb.append(" tpTriggerPrice: ").append(toIndentedString(tpTriggerPrice)).append("\n"); + sb.append(" tpPrice: ").append(toIndentedString(tpPrice)).append("\n"); + sb.append(" slTriggerPrice: ").append(toIndentedString(slTriggerPrice)).append("\n"); + sb.append(" slPrice: ").append(toIndentedString(slPrice)).append("\n"); + sb.append(" tpOrderType: ").append(toIndentedString(tpOrderType)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); + sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); + sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" triggerTime: ").append(toIndentedString(triggerTime)).append("\n"); + sb.append(" goodTillDate: ").append(toIndentedString(goodTillDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object algoIdValue = getAlgoId(); + String algoIdValueAsString = ""; + algoIdValueAsString = algoIdValue.toString(); + sb.append("algoId=").append(urlEncode(algoIdValueAsString)).append(""); + Object clientAlgoIdValue = getClientAlgoId(); + String clientAlgoIdValueAsString = ""; + clientAlgoIdValueAsString = clientAlgoIdValue.toString(); + sb.append("clientAlgoId=").append(urlEncode(clientAlgoIdValueAsString)).append(""); + Object algoTypeValue = getAlgoType(); + String algoTypeValueAsString = ""; + algoTypeValueAsString = algoTypeValue.toString(); + sb.append("algoType=").append(urlEncode(algoTypeValueAsString)).append(""); + Object orderTypeValue = getOrderType(); + String orderTypeValueAsString = ""; + orderTypeValueAsString = orderTypeValue.toString(); + sb.append("orderType=").append(urlEncode(orderTypeValueAsString)).append(""); + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object sideValue = getSide(); + String sideValueAsString = ""; + sideValueAsString = sideValue.toString(); + sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object positionSideValue = getPositionSide(); + String positionSideValueAsString = ""; + positionSideValueAsString = positionSideValue.toString(); + sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object quantityValue = getQuantity(); + String quantityValueAsString = ""; + quantityValueAsString = quantityValue.toString(); + sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); + Object algoStatusValue = getAlgoStatus(); + String algoStatusValueAsString = ""; + algoStatusValueAsString = algoStatusValue.toString(); + sb.append("algoStatus=").append(urlEncode(algoStatusValueAsString)).append(""); + Object actualOrderIdValue = getActualOrderId(); + String actualOrderIdValueAsString = ""; + actualOrderIdValueAsString = actualOrderIdValue.toString(); + sb.append("actualOrderId=").append(urlEncode(actualOrderIdValueAsString)).append(""); + Object actualPriceValue = getActualPrice(); + String actualPriceValueAsString = ""; + actualPriceValueAsString = actualPriceValue.toString(); + sb.append("actualPrice=").append(urlEncode(actualPriceValueAsString)).append(""); + Object triggerPriceValue = getTriggerPrice(); + String triggerPriceValueAsString = ""; + triggerPriceValueAsString = triggerPriceValue.toString(); + sb.append("triggerPrice=").append(urlEncode(triggerPriceValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object icebergQuantityValue = getIcebergQuantity(); + String icebergQuantityValueAsString = ""; + icebergQuantityValueAsString = icebergQuantityValue.toString(); + sb.append("icebergQuantity=").append(urlEncode(icebergQuantityValueAsString)).append(""); + Object tpTriggerPriceValue = getTpTriggerPrice(); + String tpTriggerPriceValueAsString = ""; + tpTriggerPriceValueAsString = tpTriggerPriceValue.toString(); + sb.append("tpTriggerPrice=").append(urlEncode(tpTriggerPriceValueAsString)).append(""); + Object tpPriceValue = getTpPrice(); + String tpPriceValueAsString = ""; + tpPriceValueAsString = tpPriceValue.toString(); + sb.append("tpPrice=").append(urlEncode(tpPriceValueAsString)).append(""); + Object slTriggerPriceValue = getSlTriggerPrice(); + String slTriggerPriceValueAsString = ""; + slTriggerPriceValueAsString = slTriggerPriceValue.toString(); + sb.append("slTriggerPrice=").append(urlEncode(slTriggerPriceValueAsString)).append(""); + Object slPriceValue = getSlPrice(); + String slPriceValueAsString = ""; + slPriceValueAsString = slPriceValue.toString(); + sb.append("slPrice=").append(urlEncode(slPriceValueAsString)).append(""); + Object tpOrderTypeValue = getTpOrderType(); + String tpOrderTypeValueAsString = ""; + tpOrderTypeValueAsString = tpOrderTypeValue.toString(); + sb.append("tpOrderType=").append(urlEncode(tpOrderTypeValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); + Object workingTypeValue = getWorkingType(); + String workingTypeValueAsString = ""; + workingTypeValueAsString = workingTypeValue.toString(); + sb.append("workingType=").append(urlEncode(workingTypeValueAsString)).append(""); + Object priceMatchValue = getPriceMatch(); + String priceMatchValueAsString = ""; + priceMatchValueAsString = priceMatchValue.toString(); + sb.append("priceMatch=").append(urlEncode(priceMatchValueAsString)).append(""); + Object closePositionValue = getClosePosition(); + String closePositionValueAsString = ""; + closePositionValueAsString = closePositionValue.toString(); + sb.append("closePosition=").append(urlEncode(closePositionValueAsString)).append(""); + Object priceProtectValue = getPriceProtect(); + String priceProtectValueAsString = ""; + priceProtectValueAsString = priceProtectValue.toString(); + sb.append("priceProtect=").append(urlEncode(priceProtectValueAsString)).append(""); + Object reduceOnlyValue = getReduceOnly(); + String reduceOnlyValueAsString = ""; + reduceOnlyValueAsString = reduceOnlyValue.toString(); + sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); + Object createTimeValue = getCreateTime(); + String createTimeValueAsString = ""; + createTimeValueAsString = createTimeValue.toString(); + sb.append("createTime=").append(urlEncode(createTimeValueAsString)).append(""); + Object updateTimeValue = getUpdateTime(); + String updateTimeValueAsString = ""; + updateTimeValueAsString = updateTimeValue.toString(); + sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).append(""); + Object triggerTimeValue = getTriggerTime(); + String triggerTimeValueAsString = ""; + triggerTimeValueAsString = triggerTimeValue.toString(); + sb.append("triggerTime=").append(urlEncode(triggerTimeValueAsString)).append(""); + Object goodTillDateValue = getGoodTillDate(); + String goodTillDateValueAsString = ""; + goodTillDateValueAsString = goodTillDateValue.toString(); + sb.append("goodTillDate=").append(urlEncode(goodTillDateValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("algoId"); + openapiFields.add("clientAlgoId"); + openapiFields.add("algoType"); + openapiFields.add("orderType"); + openapiFields.add("symbol"); + openapiFields.add("side"); + openapiFields.add("positionSide"); + openapiFields.add("timeInForce"); + openapiFields.add("quantity"); + openapiFields.add("algoStatus"); + openapiFields.add("actualOrderId"); + openapiFields.add("actualPrice"); + openapiFields.add("triggerPrice"); + openapiFields.add("price"); + openapiFields.add("icebergQuantity"); + openapiFields.add("tpTriggerPrice"); + openapiFields.add("tpPrice"); + openapiFields.add("slTriggerPrice"); + openapiFields.add("slPrice"); + openapiFields.add("tpOrderType"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("workingType"); + openapiFields.add("priceMatch"); + openapiFields.add("closePosition"); + openapiFields.add("priceProtect"); + openapiFields.add("reduceOnly"); + openapiFields.add("createTime"); + openapiFields.add("updateTime"); + openapiFields.add("triggerTime"); + openapiFields.add("goodTillDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to QueryAlgoOrderResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QueryAlgoOrderResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in QueryAlgoOrderResponse is not found in" + + " the empty JSON string", + QueryAlgoOrderResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("clientAlgoId") != null && !jsonObj.get("clientAlgoId").isJsonNull()) + && !jsonObj.get("clientAlgoId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientAlgoId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientAlgoId").toString())); + } + if ((jsonObj.get("algoType") != null && !jsonObj.get("algoType").isJsonNull()) + && !jsonObj.get("algoType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoType").toString())); + } + if ((jsonObj.get("orderType") != null && !jsonObj.get("orderType").isJsonNull()) + && !jsonObj.get("orderType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("orderType").toString())); + } + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) + && !jsonObj.get("side").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `side` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("side").toString())); + } + if ((jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) + && !jsonObj.get("positionSide").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `positionSide` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("positionSide").toString())); + } + if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) + && !jsonObj.get("timeInForce").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timeInForce` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timeInForce").toString())); + } + if ((jsonObj.get("quantity") != null && !jsonObj.get("quantity").isJsonNull()) + && !jsonObj.get("quantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quantity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("quantity").toString())); + } + if ((jsonObj.get("algoStatus") != null && !jsonObj.get("algoStatus").isJsonNull()) + && !jsonObj.get("algoStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoStatus` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoStatus").toString())); + } + if ((jsonObj.get("actualOrderId") != null && !jsonObj.get("actualOrderId").isJsonNull()) + && !jsonObj.get("actualOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actualOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("actualOrderId").toString())); + } + if ((jsonObj.get("actualPrice") != null && !jsonObj.get("actualPrice").isJsonNull()) + && !jsonObj.get("actualPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actualPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("actualPrice").toString())); + } + if ((jsonObj.get("triggerPrice") != null && !jsonObj.get("triggerPrice").isJsonNull()) + && !jsonObj.get("triggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `triggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("triggerPrice").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("icebergQuantity") != null && !jsonObj.get("icebergQuantity").isJsonNull()) + && !jsonObj.get("icebergQuantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `icebergQuantity` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("icebergQuantity").toString())); + } + if ((jsonObj.get("tpTriggerPrice") != null && !jsonObj.get("tpTriggerPrice").isJsonNull()) + && !jsonObj.get("tpTriggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpTriggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tpTriggerPrice").toString())); + } + if ((jsonObj.get("tpPrice") != null && !jsonObj.get("tpPrice").isJsonNull()) + && !jsonObj.get("tpPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpPrice` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("tpPrice").toString())); + } + if ((jsonObj.get("slTriggerPrice") != null && !jsonObj.get("slTriggerPrice").isJsonNull()) + && !jsonObj.get("slTriggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slTriggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("slTriggerPrice").toString())); + } + if ((jsonObj.get("slPrice") != null && !jsonObj.get("slPrice").isJsonNull()) + && !jsonObj.get("slPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slPrice` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("slPrice").toString())); + } + if ((jsonObj.get("tpOrderType") != null && !jsonObj.get("tpOrderType").isJsonNull()) + && !jsonObj.get("tpOrderType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpOrderType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tpOrderType").toString())); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) + && !jsonObj.get("workingType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workingType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workingType").toString())); + } + if ((jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) + && !jsonObj.get("priceMatch").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceMatch` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceMatch").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryAlgoOrderResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryAlgoOrderResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(QueryAlgoOrderResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, QueryAlgoOrderResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QueryAlgoOrderResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of QueryAlgoOrderResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryAlgoOrderResponse + * @throws IOException if the JSON string is invalid with respect to QueryAlgoOrderResponse + */ + public static QueryAlgoOrderResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QueryAlgoOrderResponse.class); + } + + /** + * Convert an instance of QueryAlgoOrderResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryAllAlgoOrdersResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryAllAlgoOrdersResponse.java new file mode 100644 index 00000000..3c2572b1 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryAllAlgoOrdersResponse.java @@ -0,0 +1,183 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** QueryAllAlgoOrdersResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class QueryAllAlgoOrdersResponse extends ArrayList { + public QueryAllAlgoOrdersResponse() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryAllAlgoOrdersResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to QueryAllAlgoOrdersResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be a array type in the JSON string but got" + + " `%s`", + jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for (JsonElement element : array) { + QueryAllAlgoOrdersResponseInner.validateJsonElement(element); + } + if (jsonElement == null) { + if (!QueryAllAlgoOrdersResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in QueryAllAlgoOrdersResponse is not" + + " found in the empty JSON string", + QueryAllAlgoOrdersResponse.openapiRequiredFields.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryAllAlgoOrdersResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryAllAlgoOrdersResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(QueryAllAlgoOrdersResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, QueryAllAlgoOrdersResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + elementAdapter.write(out, obj); + } + + @Override + public QueryAllAlgoOrdersResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of QueryAllAlgoOrdersResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryAllAlgoOrdersResponse + * @throws IOException if the JSON string is invalid with respect to QueryAllAlgoOrdersResponse + */ + public static QueryAllAlgoOrdersResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QueryAllAlgoOrdersResponse.class); + } + + /** + * Convert an instance of QueryAllAlgoOrdersResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryAllAlgoOrdersResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryAllAlgoOrdersResponseInner.java new file mode 100644 index 00000000..ef8b5ce1 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryAllAlgoOrdersResponseInner.java @@ -0,0 +1,1376 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** QueryAllAlgoOrdersResponseInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class QueryAllAlgoOrdersResponseInner { + public static final String SERIALIZED_NAME_ALGO_ID = "algoId"; + + @SerializedName(SERIALIZED_NAME_ALGO_ID) + @jakarta.annotation.Nullable + private Long algoId; + + public static final String SERIALIZED_NAME_CLIENT_ALGO_ID = "clientAlgoId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ALGO_ID) + @jakarta.annotation.Nullable + private String clientAlgoId; + + public static final String SERIALIZED_NAME_ALGO_TYPE = "algoType"; + + @SerializedName(SERIALIZED_NAME_ALGO_TYPE) + @jakarta.annotation.Nullable + private String algoType; + + public static final String SERIALIZED_NAME_ORDER_TYPE = "orderType"; + + @SerializedName(SERIALIZED_NAME_ORDER_TYPE) + @jakarta.annotation.Nullable + private String orderType; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private String side; + + public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; + + @SerializedName(SERIALIZED_NAME_POSITION_SIDE) + @jakarta.annotation.Nullable + private String positionSide; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private String timeInForce; + + public static final String SERIALIZED_NAME_QUANTITY = "quantity"; + + @SerializedName(SERIALIZED_NAME_QUANTITY) + @jakarta.annotation.Nullable + private String quantity; + + public static final String SERIALIZED_NAME_ALGO_STATUS = "algoStatus"; + + @SerializedName(SERIALIZED_NAME_ALGO_STATUS) + @jakarta.annotation.Nullable + private String algoStatus; + + public static final String SERIALIZED_NAME_ACTUAL_ORDER_ID = "actualOrderId"; + + @SerializedName(SERIALIZED_NAME_ACTUAL_ORDER_ID) + @jakarta.annotation.Nullable + private String actualOrderId; + + public static final String SERIALIZED_NAME_ACTUAL_PRICE = "actualPrice"; + + @SerializedName(SERIALIZED_NAME_ACTUAL_PRICE) + @jakarta.annotation.Nullable + private String actualPrice; + + public static final String SERIALIZED_NAME_TRIGGER_PRICE = "triggerPrice"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String triggerPrice; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_ICEBERG_QUANTITY = "icebergQuantity"; + + @SerializedName(SERIALIZED_NAME_ICEBERG_QUANTITY) + @jakarta.annotation.Nullable + private String icebergQuantity; + + public static final String SERIALIZED_NAME_TP_TRIGGER_PRICE = "tpTriggerPrice"; + + @SerializedName(SERIALIZED_NAME_TP_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String tpTriggerPrice; + + public static final String SERIALIZED_NAME_TP_PRICE = "tpPrice"; + + @SerializedName(SERIALIZED_NAME_TP_PRICE) + @jakarta.annotation.Nullable + private String tpPrice; + + public static final String SERIALIZED_NAME_SL_TRIGGER_PRICE = "slTriggerPrice"; + + @SerializedName(SERIALIZED_NAME_SL_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String slTriggerPrice; + + public static final String SERIALIZED_NAME_SL_PRICE = "slPrice"; + + @SerializedName(SERIALIZED_NAME_SL_PRICE) + @jakarta.annotation.Nullable + private String slPrice; + + public static final String SERIALIZED_NAME_TP_ORDER_TYPE = "tpOrderType"; + + @SerializedName(SERIALIZED_NAME_TP_ORDER_TYPE) + @jakarta.annotation.Nullable + private String tpOrderType; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private String selfTradePreventionMode; + + public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nullable + private String workingType; + + public static final String SERIALIZED_NAME_PRICE_MATCH = "priceMatch"; + + @SerializedName(SERIALIZED_NAME_PRICE_MATCH) + @jakarta.annotation.Nullable + private String priceMatch; + + public static final String SERIALIZED_NAME_CLOSE_POSITION = "closePosition"; + + @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) + @jakarta.annotation.Nullable + private Boolean closePosition; + + public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; + + @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) + @jakarta.annotation.Nullable + private Boolean priceProtect; + + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; + + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @jakarta.annotation.Nullable + private Boolean reduceOnly; + + public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; + + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + @jakarta.annotation.Nullable + private Long createTime; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; + + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + @jakarta.annotation.Nullable + private Long updateTime; + + public static final String SERIALIZED_NAME_TRIGGER_TIME = "triggerTime"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_TIME) + @jakarta.annotation.Nullable + private Long triggerTime; + + public static final String SERIALIZED_NAME_GOOD_TILL_DATE = "goodTillDate"; + + @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) + @jakarta.annotation.Nullable + private Long goodTillDate; + + public QueryAllAlgoOrdersResponseInner() {} + + public QueryAllAlgoOrdersResponseInner algoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + return this; + } + + /** + * Get algoId + * + * @return algoId + */ + @jakarta.annotation.Nullable + public Long getAlgoId() { + return algoId; + } + + public void setAlgoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + } + + public QueryAllAlgoOrdersResponseInner clientAlgoId( + @jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + return this; + } + + /** + * Get clientAlgoId + * + * @return clientAlgoId + */ + @jakarta.annotation.Nullable + public String getClientAlgoId() { + return clientAlgoId; + } + + public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + } + + public QueryAllAlgoOrdersResponseInner algoType(@jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + return this; + } + + /** + * Get algoType + * + * @return algoType + */ + @jakarta.annotation.Nullable + public String getAlgoType() { + return algoType; + } + + public void setAlgoType(@jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + } + + public QueryAllAlgoOrdersResponseInner orderType( + @jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + return this; + } + + /** + * Get orderType + * + * @return orderType + */ + @jakarta.annotation.Nullable + public String getOrderType() { + return orderType; + } + + public void setOrderType(@jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + } + + public QueryAllAlgoOrdersResponseInner symbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nullable + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + } + + public QueryAllAlgoOrdersResponseInner side(@jakarta.annotation.Nullable String side) { + this.side = side; + return this; + } + + /** + * Get side + * + * @return side + */ + @jakarta.annotation.Nullable + public String getSide() { + return side; + } + + public void setSide(@jakarta.annotation.Nullable String side) { + this.side = side; + } + + public QueryAllAlgoOrdersResponseInner positionSide( + @jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + return this; + } + + /** + * Get positionSide + * + * @return positionSide + */ + @jakarta.annotation.Nullable + public String getPositionSide() { + return positionSide; + } + + public void setPositionSide(@jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + } + + public QueryAllAlgoOrdersResponseInner timeInForce( + @jakarta.annotation.Nullable String timeInForce) { + this.timeInForce = timeInForce; + return this; + } + + /** + * Get timeInForce + * + * @return timeInForce + */ + @jakarta.annotation.Nullable + public String getTimeInForce() { + return timeInForce; + } + + public void setTimeInForce(@jakarta.annotation.Nullable String timeInForce) { + this.timeInForce = timeInForce; + } + + public QueryAllAlgoOrdersResponseInner quantity(@jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity + */ + @jakarta.annotation.Nullable + public String getQuantity() { + return quantity; + } + + public void setQuantity(@jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + } + + public QueryAllAlgoOrdersResponseInner algoStatus( + @jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + return this; + } + + /** + * Get algoStatus + * + * @return algoStatus + */ + @jakarta.annotation.Nullable + public String getAlgoStatus() { + return algoStatus; + } + + public void setAlgoStatus(@jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + } + + public QueryAllAlgoOrdersResponseInner actualOrderId( + @jakarta.annotation.Nullable String actualOrderId) { + this.actualOrderId = actualOrderId; + return this; + } + + /** + * Get actualOrderId + * + * @return actualOrderId + */ + @jakarta.annotation.Nullable + public String getActualOrderId() { + return actualOrderId; + } + + public void setActualOrderId(@jakarta.annotation.Nullable String actualOrderId) { + this.actualOrderId = actualOrderId; + } + + public QueryAllAlgoOrdersResponseInner actualPrice( + @jakarta.annotation.Nullable String actualPrice) { + this.actualPrice = actualPrice; + return this; + } + + /** + * Get actualPrice + * + * @return actualPrice + */ + @jakarta.annotation.Nullable + public String getActualPrice() { + return actualPrice; + } + + public void setActualPrice(@jakarta.annotation.Nullable String actualPrice) { + this.actualPrice = actualPrice; + } + + public QueryAllAlgoOrdersResponseInner triggerPrice( + @jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + return this; + } + + /** + * Get triggerPrice + * + * @return triggerPrice + */ + @jakarta.annotation.Nullable + public String getTriggerPrice() { + return triggerPrice; + } + + public void setTriggerPrice(@jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + } + + public QueryAllAlgoOrdersResponseInner price(@jakarta.annotation.Nullable String price) { + this.price = price; + return this; + } + + /** + * Get price + * + * @return price + */ + @jakarta.annotation.Nullable + public String getPrice() { + return price; + } + + public void setPrice(@jakarta.annotation.Nullable String price) { + this.price = price; + } + + public QueryAllAlgoOrdersResponseInner icebergQuantity( + @jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + return this; + } + + /** + * Get icebergQuantity + * + * @return icebergQuantity + */ + @jakarta.annotation.Nullable + public String getIcebergQuantity() { + return icebergQuantity; + } + + public void setIcebergQuantity(@jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + } + + public QueryAllAlgoOrdersResponseInner tpTriggerPrice( + @jakarta.annotation.Nullable String tpTriggerPrice) { + this.tpTriggerPrice = tpTriggerPrice; + return this; + } + + /** + * Get tpTriggerPrice + * + * @return tpTriggerPrice + */ + @jakarta.annotation.Nullable + public String getTpTriggerPrice() { + return tpTriggerPrice; + } + + public void setTpTriggerPrice(@jakarta.annotation.Nullable String tpTriggerPrice) { + this.tpTriggerPrice = tpTriggerPrice; + } + + public QueryAllAlgoOrdersResponseInner tpPrice(@jakarta.annotation.Nullable String tpPrice) { + this.tpPrice = tpPrice; + return this; + } + + /** + * Get tpPrice + * + * @return tpPrice + */ + @jakarta.annotation.Nullable + public String getTpPrice() { + return tpPrice; + } + + public void setTpPrice(@jakarta.annotation.Nullable String tpPrice) { + this.tpPrice = tpPrice; + } + + public QueryAllAlgoOrdersResponseInner slTriggerPrice( + @jakarta.annotation.Nullable String slTriggerPrice) { + this.slTriggerPrice = slTriggerPrice; + return this; + } + + /** + * Get slTriggerPrice + * + * @return slTriggerPrice + */ + @jakarta.annotation.Nullable + public String getSlTriggerPrice() { + return slTriggerPrice; + } + + public void setSlTriggerPrice(@jakarta.annotation.Nullable String slTriggerPrice) { + this.slTriggerPrice = slTriggerPrice; + } + + public QueryAllAlgoOrdersResponseInner slPrice(@jakarta.annotation.Nullable String slPrice) { + this.slPrice = slPrice; + return this; + } + + /** + * Get slPrice + * + * @return slPrice + */ + @jakarta.annotation.Nullable + public String getSlPrice() { + return slPrice; + } + + public void setSlPrice(@jakarta.annotation.Nullable String slPrice) { + this.slPrice = slPrice; + } + + public QueryAllAlgoOrdersResponseInner tpOrderType( + @jakarta.annotation.Nullable String tpOrderType) { + this.tpOrderType = tpOrderType; + return this; + } + + /** + * Get tpOrderType + * + * @return tpOrderType + */ + @jakarta.annotation.Nullable + public String getTpOrderType() { + return tpOrderType; + } + + public void setTpOrderType(@jakarta.annotation.Nullable String tpOrderType) { + this.tpOrderType = tpOrderType; + } + + public QueryAllAlgoOrdersResponseInner selfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + public String getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + + public QueryAllAlgoOrdersResponseInner workingType( + @jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nullable + public String getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + } + + public QueryAllAlgoOrdersResponseInner priceMatch( + @jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + return this; + } + + /** + * Get priceMatch + * + * @return priceMatch + */ + @jakarta.annotation.Nullable + public String getPriceMatch() { + return priceMatch; + } + + public void setPriceMatch(@jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + } + + public QueryAllAlgoOrdersResponseInner closePosition( + @jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + return this; + } + + /** + * Get closePosition + * + * @return closePosition + */ + @jakarta.annotation.Nullable + public Boolean getClosePosition() { + return closePosition; + } + + public void setClosePosition(@jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + } + + public QueryAllAlgoOrdersResponseInner priceProtect( + @jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + return this; + } + + /** + * Get priceProtect + * + * @return priceProtect + */ + @jakarta.annotation.Nullable + public Boolean getPriceProtect() { + return priceProtect; + } + + public void setPriceProtect(@jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + } + + public QueryAllAlgoOrdersResponseInner reduceOnly( + @jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Get reduceOnly + * + * @return reduceOnly + */ + @jakarta.annotation.Nullable + public Boolean getReduceOnly() { + return reduceOnly; + } + + public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + } + + public QueryAllAlgoOrdersResponseInner createTime( + @jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get createTime + * + * @return createTime + */ + @jakarta.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + } + + public QueryAllAlgoOrdersResponseInner updateTime( + @jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Get updateTime + * + * @return updateTime + */ + @jakarta.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + } + + public QueryAllAlgoOrdersResponseInner triggerTime( + @jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + return this; + } + + /** + * Get triggerTime + * + * @return triggerTime + */ + @jakarta.annotation.Nullable + public Long getTriggerTime() { + return triggerTime; + } + + public void setTriggerTime(@jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + } + + public QueryAllAlgoOrdersResponseInner goodTillDate( + @jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + return this; + } + + /** + * Get goodTillDate + * + * @return goodTillDate + */ + @jakarta.annotation.Nullable + public Long getGoodTillDate() { + return goodTillDate; + } + + public void setGoodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryAllAlgoOrdersResponseInner queryAllAlgoOrdersResponseInner = + (QueryAllAlgoOrdersResponseInner) o; + return Objects.equals(this.algoId, queryAllAlgoOrdersResponseInner.algoId) + && Objects.equals(this.clientAlgoId, queryAllAlgoOrdersResponseInner.clientAlgoId) + && Objects.equals(this.algoType, queryAllAlgoOrdersResponseInner.algoType) + && Objects.equals(this.orderType, queryAllAlgoOrdersResponseInner.orderType) + && Objects.equals(this.symbol, queryAllAlgoOrdersResponseInner.symbol) + && Objects.equals(this.side, queryAllAlgoOrdersResponseInner.side) + && Objects.equals(this.positionSide, queryAllAlgoOrdersResponseInner.positionSide) + && Objects.equals(this.timeInForce, queryAllAlgoOrdersResponseInner.timeInForce) + && Objects.equals(this.quantity, queryAllAlgoOrdersResponseInner.quantity) + && Objects.equals(this.algoStatus, queryAllAlgoOrdersResponseInner.algoStatus) + && Objects.equals(this.actualOrderId, queryAllAlgoOrdersResponseInner.actualOrderId) + && Objects.equals(this.actualPrice, queryAllAlgoOrdersResponseInner.actualPrice) + && Objects.equals(this.triggerPrice, queryAllAlgoOrdersResponseInner.triggerPrice) + && Objects.equals(this.price, queryAllAlgoOrdersResponseInner.price) + && Objects.equals( + this.icebergQuantity, queryAllAlgoOrdersResponseInner.icebergQuantity) + && Objects.equals( + this.tpTriggerPrice, queryAllAlgoOrdersResponseInner.tpTriggerPrice) + && Objects.equals(this.tpPrice, queryAllAlgoOrdersResponseInner.tpPrice) + && Objects.equals( + this.slTriggerPrice, queryAllAlgoOrdersResponseInner.slTriggerPrice) + && Objects.equals(this.slPrice, queryAllAlgoOrdersResponseInner.slPrice) + && Objects.equals(this.tpOrderType, queryAllAlgoOrdersResponseInner.tpOrderType) + && Objects.equals( + this.selfTradePreventionMode, + queryAllAlgoOrdersResponseInner.selfTradePreventionMode) + && Objects.equals(this.workingType, queryAllAlgoOrdersResponseInner.workingType) + && Objects.equals(this.priceMatch, queryAllAlgoOrdersResponseInner.priceMatch) + && Objects.equals(this.closePosition, queryAllAlgoOrdersResponseInner.closePosition) + && Objects.equals(this.priceProtect, queryAllAlgoOrdersResponseInner.priceProtect) + && Objects.equals(this.reduceOnly, queryAllAlgoOrdersResponseInner.reduceOnly) + && Objects.equals(this.createTime, queryAllAlgoOrdersResponseInner.createTime) + && Objects.equals(this.updateTime, queryAllAlgoOrdersResponseInner.updateTime) + && Objects.equals(this.triggerTime, queryAllAlgoOrdersResponseInner.triggerTime) + && Objects.equals(this.goodTillDate, queryAllAlgoOrdersResponseInner.goodTillDate); + } + + @Override + public int hashCode() { + return Objects.hash( + algoId, + clientAlgoId, + algoType, + orderType, + symbol, + side, + positionSide, + timeInForce, + quantity, + algoStatus, + actualOrderId, + actualPrice, + triggerPrice, + price, + icebergQuantity, + tpTriggerPrice, + tpPrice, + slTriggerPrice, + slPrice, + tpOrderType, + selfTradePreventionMode, + workingType, + priceMatch, + closePosition, + priceProtect, + reduceOnly, + createTime, + updateTime, + triggerTime, + goodTillDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryAllAlgoOrdersResponseInner {\n"); + sb.append(" algoId: ").append(toIndentedString(algoId)).append("\n"); + sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); + sb.append(" algoType: ").append(toIndentedString(algoType)).append("\n"); + sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" algoStatus: ").append(toIndentedString(algoStatus)).append("\n"); + sb.append(" actualOrderId: ").append(toIndentedString(actualOrderId)).append("\n"); + sb.append(" actualPrice: ").append(toIndentedString(actualPrice)).append("\n"); + sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" icebergQuantity: ").append(toIndentedString(icebergQuantity)).append("\n"); + sb.append(" tpTriggerPrice: ").append(toIndentedString(tpTriggerPrice)).append("\n"); + sb.append(" tpPrice: ").append(toIndentedString(tpPrice)).append("\n"); + sb.append(" slTriggerPrice: ").append(toIndentedString(slTriggerPrice)).append("\n"); + sb.append(" slPrice: ").append(toIndentedString(slPrice)).append("\n"); + sb.append(" tpOrderType: ").append(toIndentedString(tpOrderType)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); + sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); + sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" triggerTime: ").append(toIndentedString(triggerTime)).append("\n"); + sb.append(" goodTillDate: ").append(toIndentedString(goodTillDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object algoIdValue = getAlgoId(); + String algoIdValueAsString = ""; + algoIdValueAsString = algoIdValue.toString(); + sb.append("algoId=").append(urlEncode(algoIdValueAsString)).append(""); + Object clientAlgoIdValue = getClientAlgoId(); + String clientAlgoIdValueAsString = ""; + clientAlgoIdValueAsString = clientAlgoIdValue.toString(); + sb.append("clientAlgoId=").append(urlEncode(clientAlgoIdValueAsString)).append(""); + Object algoTypeValue = getAlgoType(); + String algoTypeValueAsString = ""; + algoTypeValueAsString = algoTypeValue.toString(); + sb.append("algoType=").append(urlEncode(algoTypeValueAsString)).append(""); + Object orderTypeValue = getOrderType(); + String orderTypeValueAsString = ""; + orderTypeValueAsString = orderTypeValue.toString(); + sb.append("orderType=").append(urlEncode(orderTypeValueAsString)).append(""); + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object sideValue = getSide(); + String sideValueAsString = ""; + sideValueAsString = sideValue.toString(); + sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object positionSideValue = getPositionSide(); + String positionSideValueAsString = ""; + positionSideValueAsString = positionSideValue.toString(); + sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object quantityValue = getQuantity(); + String quantityValueAsString = ""; + quantityValueAsString = quantityValue.toString(); + sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); + Object algoStatusValue = getAlgoStatus(); + String algoStatusValueAsString = ""; + algoStatusValueAsString = algoStatusValue.toString(); + sb.append("algoStatus=").append(urlEncode(algoStatusValueAsString)).append(""); + Object actualOrderIdValue = getActualOrderId(); + String actualOrderIdValueAsString = ""; + actualOrderIdValueAsString = actualOrderIdValue.toString(); + sb.append("actualOrderId=").append(urlEncode(actualOrderIdValueAsString)).append(""); + Object actualPriceValue = getActualPrice(); + String actualPriceValueAsString = ""; + actualPriceValueAsString = actualPriceValue.toString(); + sb.append("actualPrice=").append(urlEncode(actualPriceValueAsString)).append(""); + Object triggerPriceValue = getTriggerPrice(); + String triggerPriceValueAsString = ""; + triggerPriceValueAsString = triggerPriceValue.toString(); + sb.append("triggerPrice=").append(urlEncode(triggerPriceValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object icebergQuantityValue = getIcebergQuantity(); + String icebergQuantityValueAsString = ""; + icebergQuantityValueAsString = icebergQuantityValue.toString(); + sb.append("icebergQuantity=").append(urlEncode(icebergQuantityValueAsString)).append(""); + Object tpTriggerPriceValue = getTpTriggerPrice(); + String tpTriggerPriceValueAsString = ""; + tpTriggerPriceValueAsString = tpTriggerPriceValue.toString(); + sb.append("tpTriggerPrice=").append(urlEncode(tpTriggerPriceValueAsString)).append(""); + Object tpPriceValue = getTpPrice(); + String tpPriceValueAsString = ""; + tpPriceValueAsString = tpPriceValue.toString(); + sb.append("tpPrice=").append(urlEncode(tpPriceValueAsString)).append(""); + Object slTriggerPriceValue = getSlTriggerPrice(); + String slTriggerPriceValueAsString = ""; + slTriggerPriceValueAsString = slTriggerPriceValue.toString(); + sb.append("slTriggerPrice=").append(urlEncode(slTriggerPriceValueAsString)).append(""); + Object slPriceValue = getSlPrice(); + String slPriceValueAsString = ""; + slPriceValueAsString = slPriceValue.toString(); + sb.append("slPrice=").append(urlEncode(slPriceValueAsString)).append(""); + Object tpOrderTypeValue = getTpOrderType(); + String tpOrderTypeValueAsString = ""; + tpOrderTypeValueAsString = tpOrderTypeValue.toString(); + sb.append("tpOrderType=").append(urlEncode(tpOrderTypeValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); + Object workingTypeValue = getWorkingType(); + String workingTypeValueAsString = ""; + workingTypeValueAsString = workingTypeValue.toString(); + sb.append("workingType=").append(urlEncode(workingTypeValueAsString)).append(""); + Object priceMatchValue = getPriceMatch(); + String priceMatchValueAsString = ""; + priceMatchValueAsString = priceMatchValue.toString(); + sb.append("priceMatch=").append(urlEncode(priceMatchValueAsString)).append(""); + Object closePositionValue = getClosePosition(); + String closePositionValueAsString = ""; + closePositionValueAsString = closePositionValue.toString(); + sb.append("closePosition=").append(urlEncode(closePositionValueAsString)).append(""); + Object priceProtectValue = getPriceProtect(); + String priceProtectValueAsString = ""; + priceProtectValueAsString = priceProtectValue.toString(); + sb.append("priceProtect=").append(urlEncode(priceProtectValueAsString)).append(""); + Object reduceOnlyValue = getReduceOnly(); + String reduceOnlyValueAsString = ""; + reduceOnlyValueAsString = reduceOnlyValue.toString(); + sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); + Object createTimeValue = getCreateTime(); + String createTimeValueAsString = ""; + createTimeValueAsString = createTimeValue.toString(); + sb.append("createTime=").append(urlEncode(createTimeValueAsString)).append(""); + Object updateTimeValue = getUpdateTime(); + String updateTimeValueAsString = ""; + updateTimeValueAsString = updateTimeValue.toString(); + sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).append(""); + Object triggerTimeValue = getTriggerTime(); + String triggerTimeValueAsString = ""; + triggerTimeValueAsString = triggerTimeValue.toString(); + sb.append("triggerTime=").append(urlEncode(triggerTimeValueAsString)).append(""); + Object goodTillDateValue = getGoodTillDate(); + String goodTillDateValueAsString = ""; + goodTillDateValueAsString = goodTillDateValue.toString(); + sb.append("goodTillDate=").append(urlEncode(goodTillDateValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("algoId"); + openapiFields.add("clientAlgoId"); + openapiFields.add("algoType"); + openapiFields.add("orderType"); + openapiFields.add("symbol"); + openapiFields.add("side"); + openapiFields.add("positionSide"); + openapiFields.add("timeInForce"); + openapiFields.add("quantity"); + openapiFields.add("algoStatus"); + openapiFields.add("actualOrderId"); + openapiFields.add("actualPrice"); + openapiFields.add("triggerPrice"); + openapiFields.add("price"); + openapiFields.add("icebergQuantity"); + openapiFields.add("tpTriggerPrice"); + openapiFields.add("tpPrice"); + openapiFields.add("slTriggerPrice"); + openapiFields.add("slPrice"); + openapiFields.add("tpOrderType"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("workingType"); + openapiFields.add("priceMatch"); + openapiFields.add("closePosition"); + openapiFields.add("priceProtect"); + openapiFields.add("reduceOnly"); + openapiFields.add("createTime"); + openapiFields.add("updateTime"); + openapiFields.add("triggerTime"); + openapiFields.add("goodTillDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * QueryAllAlgoOrdersResponseInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QueryAllAlgoOrdersResponseInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in QueryAllAlgoOrdersResponseInner is not" + + " found in the empty JSON string", + QueryAllAlgoOrdersResponseInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("clientAlgoId") != null && !jsonObj.get("clientAlgoId").isJsonNull()) + && !jsonObj.get("clientAlgoId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientAlgoId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientAlgoId").toString())); + } + if ((jsonObj.get("algoType") != null && !jsonObj.get("algoType").isJsonNull()) + && !jsonObj.get("algoType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoType").toString())); + } + if ((jsonObj.get("orderType") != null && !jsonObj.get("orderType").isJsonNull()) + && !jsonObj.get("orderType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("orderType").toString())); + } + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) + && !jsonObj.get("side").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `side` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("side").toString())); + } + if ((jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) + && !jsonObj.get("positionSide").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `positionSide` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("positionSide").toString())); + } + if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) + && !jsonObj.get("timeInForce").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timeInForce` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timeInForce").toString())); + } + if ((jsonObj.get("quantity") != null && !jsonObj.get("quantity").isJsonNull()) + && !jsonObj.get("quantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quantity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("quantity").toString())); + } + if ((jsonObj.get("algoStatus") != null && !jsonObj.get("algoStatus").isJsonNull()) + && !jsonObj.get("algoStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoStatus` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoStatus").toString())); + } + if ((jsonObj.get("actualOrderId") != null && !jsonObj.get("actualOrderId").isJsonNull()) + && !jsonObj.get("actualOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actualOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("actualOrderId").toString())); + } + if ((jsonObj.get("actualPrice") != null && !jsonObj.get("actualPrice").isJsonNull()) + && !jsonObj.get("actualPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actualPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("actualPrice").toString())); + } + if ((jsonObj.get("triggerPrice") != null && !jsonObj.get("triggerPrice").isJsonNull()) + && !jsonObj.get("triggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `triggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("triggerPrice").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("icebergQuantity") != null && !jsonObj.get("icebergQuantity").isJsonNull()) + && !jsonObj.get("icebergQuantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `icebergQuantity` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("icebergQuantity").toString())); + } + if ((jsonObj.get("tpTriggerPrice") != null && !jsonObj.get("tpTriggerPrice").isJsonNull()) + && !jsonObj.get("tpTriggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpTriggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tpTriggerPrice").toString())); + } + if ((jsonObj.get("tpPrice") != null && !jsonObj.get("tpPrice").isJsonNull()) + && !jsonObj.get("tpPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpPrice` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("tpPrice").toString())); + } + if ((jsonObj.get("slTriggerPrice") != null && !jsonObj.get("slTriggerPrice").isJsonNull()) + && !jsonObj.get("slTriggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slTriggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("slTriggerPrice").toString())); + } + if ((jsonObj.get("slPrice") != null && !jsonObj.get("slPrice").isJsonNull()) + && !jsonObj.get("slPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slPrice` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("slPrice").toString())); + } + if ((jsonObj.get("tpOrderType") != null && !jsonObj.get("tpOrderType").isJsonNull()) + && !jsonObj.get("tpOrderType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tpOrderType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tpOrderType").toString())); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) + && !jsonObj.get("workingType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workingType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workingType").toString())); + } + if ((jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) + && !jsonObj.get("priceMatch").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceMatch` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceMatch").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryAllAlgoOrdersResponseInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryAllAlgoOrdersResponseInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(QueryAllAlgoOrdersResponseInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, QueryAllAlgoOrdersResponseInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QueryAllAlgoOrdersResponseInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of QueryAllAlgoOrdersResponseInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryAllAlgoOrdersResponseInner + * @throws IOException if the JSON string is invalid with respect to + * QueryAllAlgoOrdersResponseInner + */ + public static QueryAllAlgoOrdersResponseInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QueryAllAlgoOrdersResponseInner.class); + } + + /** + * Convert an instance of QueryAllAlgoOrdersResponseInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RecentTradesListResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RecentTradesListResponseInner.java index 504ca3a2..fdc3b457 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RecentTradesListResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RecentTradesListResponseInner.java @@ -72,6 +72,12 @@ public class RecentTradesListResponseInner { @jakarta.annotation.Nullable private Boolean isBuyerMaker; + public static final String SERIALIZED_NAME_IS_R_P_I_TRADE = "isRPITrade"; + + @SerializedName(SERIALIZED_NAME_IS_R_P_I_TRADE) + @jakarta.annotation.Nullable + private Boolean isRPITrade; + public RecentTradesListResponseInner() {} public RecentTradesListResponseInner id(@jakarta.annotation.Nullable Long id) { @@ -189,6 +195,26 @@ public void setIsBuyerMaker(@jakarta.annotation.Nullable Boolean isBuyerMaker) { this.isBuyerMaker = isBuyerMaker; } + public RecentTradesListResponseInner isRPITrade( + @jakarta.annotation.Nullable Boolean isRPITrade) { + this.isRPITrade = isRPITrade; + return this; + } + + /** + * Get isRPITrade + * + * @return isRPITrade + */ + @jakarta.annotation.Nullable + public Boolean getIsRPITrade() { + return isRPITrade; + } + + public void setIsRPITrade(@jakarta.annotation.Nullable Boolean isRPITrade) { + this.isRPITrade = isRPITrade; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -204,12 +230,13 @@ public boolean equals(Object o) { && Objects.equals(this.qty, recentTradesListResponseInner.qty) && Objects.equals(this.quoteQty, recentTradesListResponseInner.quoteQty) && Objects.equals(this.time, recentTradesListResponseInner.time) - && Objects.equals(this.isBuyerMaker, recentTradesListResponseInner.isBuyerMaker); + && Objects.equals(this.isBuyerMaker, recentTradesListResponseInner.isBuyerMaker) + && Objects.equals(this.isRPITrade, recentTradesListResponseInner.isRPITrade); } @Override public int hashCode() { - return Objects.hash(id, price, qty, quoteQty, time, isBuyerMaker); + return Objects.hash(id, price, qty, quoteQty, time, isBuyerMaker, isRPITrade); } @Override @@ -222,6 +249,7 @@ public String toString() { sb.append(" quoteQty: ").append(toIndentedString(quoteQty)).append("\n"); sb.append(" time: ").append(toIndentedString(time)).append("\n"); sb.append(" isBuyerMaker: ").append(toIndentedString(isBuyerMaker)).append("\n"); + sb.append(" isRPITrade: ").append(toIndentedString(isRPITrade)).append("\n"); sb.append("}"); return sb.toString(); } @@ -253,6 +281,10 @@ public String toUrlQueryString() { String isBuyerMakerValueAsString = ""; isBuyerMakerValueAsString = isBuyerMakerValue.toString(); sb.append("isBuyerMaker=").append(urlEncode(isBuyerMakerValueAsString)).append(""); + Object isRPITradeValue = getIsRPITrade(); + String isRPITradeValueAsString = ""; + isRPITradeValueAsString = isRPITradeValue.toString(); + sb.append("isRPITrade=").append(urlEncode(isRPITradeValueAsString)).append(""); return sb.toString(); } @@ -287,6 +319,7 @@ private String toIndentedString(Object o) { openapiFields.add("quoteQty"); openapiFields.add("time"); openapiFields.add("isBuyerMaker"); + openapiFields.add("isRPITrade"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RpiOrderBookResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RpiOrderBookResponse.java new file mode 100644 index 00000000..3dd7b184 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RpiOrderBookResponse.java @@ -0,0 +1,381 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** RpiOrderBookResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RpiOrderBookResponse { + public static final String SERIALIZED_NAME_LAST_UPDATE_ID = "lastUpdateId"; + + @SerializedName(SERIALIZED_NAME_LAST_UPDATE_ID) + @jakarta.annotation.Nullable + private Long lastUpdateId; + + public static final String SERIALIZED_NAME_E = "E"; + + @SerializedName(SERIALIZED_NAME_E) + @jakarta.annotation.Nullable + private Long E; + + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public static final String SERIALIZED_NAME_BIDS = "bids"; + + @SerializedName(SERIALIZED_NAME_BIDS) + @jakarta.annotation.Nullable + private List bids; + + public static final String SERIALIZED_NAME_ASKS = "asks"; + + @SerializedName(SERIALIZED_NAME_ASKS) + @jakarta.annotation.Nullable + private List asks; + + public RpiOrderBookResponse() {} + + public RpiOrderBookResponse lastUpdateId(@jakarta.annotation.Nullable Long lastUpdateId) { + this.lastUpdateId = lastUpdateId; + return this; + } + + /** + * Get lastUpdateId + * + * @return lastUpdateId + */ + @jakarta.annotation.Nullable + public Long getLastUpdateId() { + return lastUpdateId; + } + + public void setLastUpdateId(@jakarta.annotation.Nullable Long lastUpdateId) { + this.lastUpdateId = lastUpdateId; + } + + public RpiOrderBookResponse E(@jakarta.annotation.Nullable Long E) { + this.E = E; + return this; + } + + /** + * Get E + * + * @return E + */ + @jakarta.annotation.Nullable + public Long getE() { + return E; + } + + public void setE(@jakarta.annotation.Nullable Long E) { + this.E = E; + } + + public RpiOrderBookResponse T(@jakarta.annotation.Nullable Long T) { + this.T = T; + return this; + } + + /** + * Get T + * + * @return T + */ + @jakarta.annotation.Nullable + public Long getT() { + return T; + } + + public void setT(@jakarta.annotation.Nullable Long T) { + this.T = T; + } + + public RpiOrderBookResponse bids( + @jakarta.annotation.Nullable List bids) { + this.bids = bids; + return this; + } + + public RpiOrderBookResponse addBidsItem(RpiOrderBookResponseBidsItem bidsItem) { + if (this.bids == null) { + this.bids = new ArrayList<>(); + } + this.bids.add(bidsItem); + return this; + } + + /** + * Get bids + * + * @return bids + */ + @jakarta.annotation.Nullable + @Valid + public List getBids() { + return bids; + } + + public void setBids(@jakarta.annotation.Nullable List bids) { + this.bids = bids; + } + + public RpiOrderBookResponse asks( + @jakarta.annotation.Nullable List asks) { + this.asks = asks; + return this; + } + + public RpiOrderBookResponse addAsksItem(RpiOrderBookResponseAsksItem asksItem) { + if (this.asks == null) { + this.asks = new ArrayList<>(); + } + this.asks.add(asksItem); + return this; + } + + /** + * Get asks + * + * @return asks + */ + @jakarta.annotation.Nullable + @Valid + public List getAsks() { + return asks; + } + + public void setAsks(@jakarta.annotation.Nullable List asks) { + this.asks = asks; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RpiOrderBookResponse rpiOrderBookResponse = (RpiOrderBookResponse) o; + return Objects.equals(this.lastUpdateId, rpiOrderBookResponse.lastUpdateId) + && Objects.equals(this.E, rpiOrderBookResponse.E) + && Objects.equals(this.T, rpiOrderBookResponse.T) + && Objects.equals(this.bids, rpiOrderBookResponse.bids) + && Objects.equals(this.asks, rpiOrderBookResponse.asks); + } + + @Override + public int hashCode() { + return Objects.hash(lastUpdateId, E, T, bids, asks); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RpiOrderBookResponse {\n"); + sb.append(" lastUpdateId: ").append(toIndentedString(lastUpdateId)).append("\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" bids: ").append(toIndentedString(bids)).append("\n"); + sb.append(" asks: ").append(toIndentedString(asks)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object lastUpdateIdValue = getLastUpdateId(); + String lastUpdateIdValueAsString = ""; + lastUpdateIdValueAsString = lastUpdateIdValue.toString(); + sb.append("lastUpdateId=").append(urlEncode(lastUpdateIdValueAsString)).append(""); + Object EValue = getE(); + String EValueAsString = ""; + EValueAsString = EValue.toString(); + sb.append("E=").append(urlEncode(EValueAsString)).append(""); + Object TValue = getT(); + String TValueAsString = ""; + TValueAsString = TValue.toString(); + sb.append("T=").append(urlEncode(TValueAsString)).append(""); + Object bidsValue = getBids(); + String bidsValueAsString = ""; + bidsValueAsString = + (String) + ((Collection) bidsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("bids=").append(urlEncode(bidsValueAsString)).append(""); + Object asksValue = getAsks(); + String asksValueAsString = ""; + asksValueAsString = + (String) + ((Collection) asksValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("asks=").append(urlEncode(asksValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("lastUpdateId"); + openapiFields.add("E"); + openapiFields.add("T"); + openapiFields.add("bids"); + openapiFields.add("asks"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RpiOrderBookResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RpiOrderBookResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RpiOrderBookResponse is not found in" + + " the empty JSON string", + RpiOrderBookResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("bids") != null + && !jsonObj.get("bids").isJsonNull() + && !jsonObj.get("bids").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bids` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("bids").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("asks") != null + && !jsonObj.get("asks").isJsonNull() + && !jsonObj.get("asks").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `asks` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("asks").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RpiOrderBookResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RpiOrderBookResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RpiOrderBookResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RpiOrderBookResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RpiOrderBookResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RpiOrderBookResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RpiOrderBookResponse + * @throws IOException if the JSON string is invalid with respect to RpiOrderBookResponse + */ + public static RpiOrderBookResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RpiOrderBookResponse.class); + } + + /** + * Convert an instance of RpiOrderBookResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RpiOrderBookResponseAsksItem.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RpiOrderBookResponseAsksItem.java new file mode 100644 index 00000000..6f278f84 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RpiOrderBookResponseAsksItem.java @@ -0,0 +1,192 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** RpiOrderBookResponseAsksItem */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RpiOrderBookResponseAsksItem extends ArrayList { + public RpiOrderBookResponseAsksItem() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RpiOrderBookResponseAsksItem {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * RpiOrderBookResponseAsksItem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be a array type in the JSON string but got" + + " `%s`", + jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for (JsonElement element : array) { + if (!element.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException( + String.format( + "Expected array items to be of type String in the JSON string but" + + " got `%s`", + jsonElement.toString())); + } + } + if (jsonElement == null) { + if (!RpiOrderBookResponseAsksItem.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RpiOrderBookResponseAsksItem is not" + + " found in the empty JSON string", + RpiOrderBookResponseAsksItem.openapiRequiredFields.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RpiOrderBookResponseAsksItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RpiOrderBookResponseAsksItem' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RpiOrderBookResponseAsksItem.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RpiOrderBookResponseAsksItem value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + elementAdapter.write(out, obj); + } + + @Override + public RpiOrderBookResponseAsksItem read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RpiOrderBookResponseAsksItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of RpiOrderBookResponseAsksItem + * @throws IOException if the JSON string is invalid with respect to + * RpiOrderBookResponseAsksItem + */ + public static RpiOrderBookResponseAsksItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RpiOrderBookResponseAsksItem.class); + } + + /** + * Convert an instance of RpiOrderBookResponseAsksItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RpiOrderBookResponseBidsItem.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RpiOrderBookResponseBidsItem.java new file mode 100644 index 00000000..12cb9bc4 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RpiOrderBookResponseBidsItem.java @@ -0,0 +1,192 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** RpiOrderBookResponseBidsItem */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RpiOrderBookResponseBidsItem extends ArrayList { + public RpiOrderBookResponseBidsItem() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RpiOrderBookResponseBidsItem {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * RpiOrderBookResponseBidsItem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be a array type in the JSON string but got" + + " `%s`", + jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for (JsonElement element : array) { + if (!element.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException( + String.format( + "Expected array items to be of type String in the JSON string but" + + " got `%s`", + jsonElement.toString())); + } + } + if (jsonElement == null) { + if (!RpiOrderBookResponseBidsItem.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RpiOrderBookResponseBidsItem is not" + + " found in the empty JSON string", + RpiOrderBookResponseBidsItem.openapiRequiredFields.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RpiOrderBookResponseBidsItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RpiOrderBookResponseBidsItem' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RpiOrderBookResponseBidsItem.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RpiOrderBookResponseBidsItem value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + elementAdapter.write(out, obj); + } + + @Override + public RpiOrderBookResponseBidsItem read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RpiOrderBookResponseBidsItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of RpiOrderBookResponseBidsItem + * @throws IOException if the JSON string is invalid with respect to + * RpiOrderBookResponseBidsItem + */ + public static RpiOrderBookResponseBidsItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RpiOrderBookResponseBidsItem.class); + } + + /** + * Convert an instance of RpiOrderBookResponseBidsItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TimeInForce.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TimeInForce.java index a8e3a900..d6110d05 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TimeInForce.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TimeInForce.java @@ -32,7 +32,9 @@ public enum TimeInForce { GTX("GTX"), - GTD("GTD"); + GTD("GTD"), + + RPI("RPI"); private String value; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponse.java new file mode 100644 index 00000000..419198c7 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponse.java @@ -0,0 +1,245 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** TradingScheduleResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TradingScheduleResponse { + public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; + + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + @jakarta.annotation.Nullable + private Long updateTime; + + public static final String SERIALIZED_NAME_MARKET_SCHEDULES = "marketSchedules"; + + @SerializedName(SERIALIZED_NAME_MARKET_SCHEDULES) + @jakarta.annotation.Nullable + private TradingScheduleResponseMarketSchedules marketSchedules; + + public TradingScheduleResponse() {} + + public TradingScheduleResponse updateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Get updateTime + * + * @return updateTime + */ + @jakarta.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + } + + public TradingScheduleResponse marketSchedules( + @jakarta.annotation.Nullable TradingScheduleResponseMarketSchedules marketSchedules) { + this.marketSchedules = marketSchedules; + return this; + } + + /** + * Get marketSchedules + * + * @return marketSchedules + */ + @jakarta.annotation.Nullable + @Valid + public TradingScheduleResponseMarketSchedules getMarketSchedules() { + return marketSchedules; + } + + public void setMarketSchedules( + @jakarta.annotation.Nullable TradingScheduleResponseMarketSchedules marketSchedules) { + this.marketSchedules = marketSchedules; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TradingScheduleResponse tradingScheduleResponse = (TradingScheduleResponse) o; + return Objects.equals(this.updateTime, tradingScheduleResponse.updateTime) + && Objects.equals(this.marketSchedules, tradingScheduleResponse.marketSchedules); + } + + @Override + public int hashCode() { + return Objects.hash(updateTime, marketSchedules); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TradingScheduleResponse {\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" marketSchedules: ").append(toIndentedString(marketSchedules)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object updateTimeValue = getUpdateTime(); + String updateTimeValueAsString = ""; + updateTimeValueAsString = updateTimeValue.toString(); + sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).append(""); + Object marketSchedulesValue = getMarketSchedules(); + String marketSchedulesValueAsString = ""; + marketSchedulesValueAsString = marketSchedulesValue.toString(); + sb.append("marketSchedules=").append(urlEncode(marketSchedulesValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("updateTime"); + openapiFields.add("marketSchedules"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TradingScheduleResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TradingScheduleResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in TradingScheduleResponse is not found" + + " in the empty JSON string", + TradingScheduleResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `marketSchedules` + if (jsonObj.get("marketSchedules") != null + && !jsonObj.get("marketSchedules").isJsonNull()) { + TradingScheduleResponseMarketSchedules.validateJsonElement( + jsonObj.get("marketSchedules")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TradingScheduleResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TradingScheduleResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(TradingScheduleResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TradingScheduleResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TradingScheduleResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TradingScheduleResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TradingScheduleResponse + * @throws IOException if the JSON string is invalid with respect to TradingScheduleResponse + */ + public static TradingScheduleResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TradingScheduleResponse.class); + } + + /** + * Convert an instance of TradingScheduleResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponseMarketSchedules.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponseMarketSchedules.java new file mode 100644 index 00000000..80821e58 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponseMarketSchedules.java @@ -0,0 +1,261 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** TradingScheduleResponseMarketSchedules */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TradingScheduleResponseMarketSchedules { + public static final String SERIALIZED_NAME_E_Q_U_I_T_Y = "EQUITY"; + + @SerializedName(SERIALIZED_NAME_E_Q_U_I_T_Y) + @jakarta.annotation.Nullable + private TradingScheduleResponseMarketSchedulesEQUITY EQUITY; + + public static final String SERIALIZED_NAME_C_O_M_M_O_D_I_T_Y = "COMMODITY"; + + @SerializedName(SERIALIZED_NAME_C_O_M_M_O_D_I_T_Y) + @jakarta.annotation.Nullable + private TradingScheduleResponseMarketSchedulesCOMMODITY COMMODITY; + + public TradingScheduleResponseMarketSchedules() {} + + public TradingScheduleResponseMarketSchedules EQUITY( + @jakarta.annotation.Nullable TradingScheduleResponseMarketSchedulesEQUITY EQUITY) { + this.EQUITY = EQUITY; + return this; + } + + /** + * Get EQUITY + * + * @return EQUITY + */ + @jakarta.annotation.Nullable + @Valid + public TradingScheduleResponseMarketSchedulesEQUITY getEQUITY() { + return EQUITY; + } + + public void setEQUITY( + @jakarta.annotation.Nullable TradingScheduleResponseMarketSchedulesEQUITY EQUITY) { + this.EQUITY = EQUITY; + } + + public TradingScheduleResponseMarketSchedules COMMODITY( + @jakarta.annotation.Nullable + TradingScheduleResponseMarketSchedulesCOMMODITY COMMODITY) { + this.COMMODITY = COMMODITY; + return this; + } + + /** + * Get COMMODITY + * + * @return COMMODITY + */ + @jakarta.annotation.Nullable + @Valid + public TradingScheduleResponseMarketSchedulesCOMMODITY getCOMMODITY() { + return COMMODITY; + } + + public void setCOMMODITY( + @jakarta.annotation.Nullable + TradingScheduleResponseMarketSchedulesCOMMODITY COMMODITY) { + this.COMMODITY = COMMODITY; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TradingScheduleResponseMarketSchedules tradingScheduleResponseMarketSchedules = + (TradingScheduleResponseMarketSchedules) o; + return Objects.equals(this.EQUITY, tradingScheduleResponseMarketSchedules.EQUITY) + && Objects.equals(this.COMMODITY, tradingScheduleResponseMarketSchedules.COMMODITY); + } + + @Override + public int hashCode() { + return Objects.hash(EQUITY, COMMODITY); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TradingScheduleResponseMarketSchedules {\n"); + sb.append(" EQUITY: ").append(toIndentedString(EQUITY)).append("\n"); + sb.append(" COMMODITY: ").append(toIndentedString(COMMODITY)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object EQUITYValue = getEQUITY(); + String EQUITYValueAsString = ""; + EQUITYValueAsString = EQUITYValue.toString(); + sb.append("EQUITY=").append(urlEncode(EQUITYValueAsString)).append(""); + Object COMMODITYValue = getCOMMODITY(); + String COMMODITYValueAsString = ""; + COMMODITYValueAsString = COMMODITYValue.toString(); + sb.append("COMMODITY=").append(urlEncode(COMMODITYValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("EQUITY"); + openapiFields.add("COMMODITY"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * TradingScheduleResponseMarketSchedules + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TradingScheduleResponseMarketSchedules.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in TradingScheduleResponseMarketSchedules" + + " is not found in the empty JSON string", + TradingScheduleResponseMarketSchedules.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `EQUITY` + if (jsonObj.get("EQUITY") != null && !jsonObj.get("EQUITY").isJsonNull()) { + TradingScheduleResponseMarketSchedulesEQUITY.validateJsonElement(jsonObj.get("EQUITY")); + } + // validate the optional field `COMMODITY` + if (jsonObj.get("COMMODITY") != null && !jsonObj.get("COMMODITY").isJsonNull()) { + TradingScheduleResponseMarketSchedulesCOMMODITY.validateJsonElement( + jsonObj.get("COMMODITY")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TradingScheduleResponseMarketSchedules.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TradingScheduleResponseMarketSchedules' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(TradingScheduleResponseMarketSchedules.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, TradingScheduleResponseMarketSchedules value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TradingScheduleResponseMarketSchedules read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TradingScheduleResponseMarketSchedules given an JSON string + * + * @param jsonString JSON string + * @return An instance of TradingScheduleResponseMarketSchedules + * @throws IOException if the JSON string is invalid with respect to + * TradingScheduleResponseMarketSchedules + */ + public static TradingScheduleResponseMarketSchedules fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, TradingScheduleResponseMarketSchedules.class); + } + + /** + * Convert an instance of TradingScheduleResponseMarketSchedules to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponseMarketSchedulesCOMMODITY.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponseMarketSchedulesCOMMODITY.java new file mode 100644 index 00000000..66144340 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponseMarketSchedulesCOMMODITY.java @@ -0,0 +1,264 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** TradingScheduleResponseMarketSchedulesCOMMODITY */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TradingScheduleResponseMarketSchedulesCOMMODITY { + public static final String SERIALIZED_NAME_SESSIONS = "sessions"; + + @SerializedName(SERIALIZED_NAME_SESSIONS) + @jakarta.annotation.Nullable + private List<@Valid TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner> sessions; + + public TradingScheduleResponseMarketSchedulesCOMMODITY() {} + + public TradingScheduleResponseMarketSchedulesCOMMODITY sessions( + @jakarta.annotation.Nullable + List<@Valid TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner> + sessions) { + this.sessions = sessions; + return this; + } + + public TradingScheduleResponseMarketSchedulesCOMMODITY addSessionsItem( + TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner sessionsItem) { + if (this.sessions == null) { + this.sessions = new ArrayList<>(); + } + this.sessions.add(sessionsItem); + return this; + } + + /** + * Get sessions + * + * @return sessions + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner> getSessions() { + return sessions; + } + + public void setSessions( + @jakarta.annotation.Nullable + List<@Valid TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner> + sessions) { + this.sessions = sessions; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TradingScheduleResponseMarketSchedulesCOMMODITY + tradingScheduleResponseMarketSchedulesCOMMODITY = + (TradingScheduleResponseMarketSchedulesCOMMODITY) o; + return Objects.equals( + this.sessions, tradingScheduleResponseMarketSchedulesCOMMODITY.sessions); + } + + @Override + public int hashCode() { + return Objects.hash(sessions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TradingScheduleResponseMarketSchedulesCOMMODITY {\n"); + sb.append(" sessions: ").append(toIndentedString(sessions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object sessionsValue = getSessions(); + String sessionsValueAsString = ""; + sessionsValueAsString = + (String) + ((Collection) sessionsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("sessions=").append(urlEncode(sessionsValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * TradingScheduleResponseMarketSchedulesCOMMODITY + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TradingScheduleResponseMarketSchedulesCOMMODITY.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " TradingScheduleResponseMarketSchedulesCOMMODITY is not" + + " found in the empty JSON string", + TradingScheduleResponseMarketSchedulesCOMMODITY + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("sessions") != null && !jsonObj.get("sessions").isJsonNull()) { + JsonArray jsonArraysessions = jsonObj.getAsJsonArray("sessions"); + if (jsonArraysessions != null) { + // ensure the json data is an array + if (!jsonObj.get("sessions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sessions` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("sessions").toString())); + } + + // validate the optional field `sessions` (array) + for (int i = 0; i < jsonArraysessions.size(); i++) { + TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner + .validateJsonElement(jsonArraysessions.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TradingScheduleResponseMarketSchedulesCOMMODITY.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'TradingScheduleResponseMarketSchedulesCOMMODITY' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(TradingScheduleResponseMarketSchedulesCOMMODITY.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + TradingScheduleResponseMarketSchedulesCOMMODITY value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TradingScheduleResponseMarketSchedulesCOMMODITY read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TradingScheduleResponseMarketSchedulesCOMMODITY given an JSON string + * + * @param jsonString JSON string + * @return An instance of TradingScheduleResponseMarketSchedulesCOMMODITY + * @throws IOException if the JSON string is invalid with respect to + * TradingScheduleResponseMarketSchedulesCOMMODITY + */ + public static TradingScheduleResponseMarketSchedulesCOMMODITY fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, TradingScheduleResponseMarketSchedulesCOMMODITY.class); + } + + /** + * Convert an instance of TradingScheduleResponseMarketSchedulesCOMMODITY to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner.java new file mode 100644 index 00000000..34a532cb --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner.java @@ -0,0 +1,308 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner { + public static final String SERIALIZED_NAME_START_TIME = "startTime"; + + @SerializedName(SERIALIZED_NAME_START_TIME) + @jakarta.annotation.Nullable + private Long startTime; + + public static final String SERIALIZED_NAME_END_TIME = "endTime"; + + @SerializedName(SERIALIZED_NAME_END_TIME) + @jakarta.annotation.Nullable + private Long endTime; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nullable + private String type; + + public TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner() {} + + public TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner startTime( + @jakarta.annotation.Nullable Long startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get startTime + * + * @return startTime + */ + @jakarta.annotation.Nullable + public Long getStartTime() { + return startTime; + } + + public void setStartTime(@jakarta.annotation.Nullable Long startTime) { + this.startTime = startTime; + } + + public TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner endTime( + @jakarta.annotation.Nullable Long endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get endTime + * + * @return endTime + */ + @jakarta.annotation.Nullable + public Long getEndTime() { + return endTime; + } + + public void setEndTime(@jakarta.annotation.Nullable Long endTime) { + this.endTime = endTime; + } + + public TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner type( + @jakarta.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@jakarta.annotation.Nullable String type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner + tradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner = + (TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner) o; + return Objects.equals( + this.startTime, + tradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner.startTime) + && Objects.equals( + this.endTime, + tradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner.endTime) + && Objects.equals( + this.type, + tradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner.type); + } + + @Override + public int hashCode() { + return Objects.hash(startTime, endTime, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner {\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object startTimeValue = getStartTime(); + String startTimeValueAsString = ""; + startTimeValueAsString = startTimeValue.toString(); + sb.append("startTime=").append(urlEncode(startTimeValueAsString)).append(""); + Object endTimeValue = getEndTime(); + String endTimeValueAsString = ""; + endTimeValueAsString = endTimeValue.toString(); + sb.append("endTime=").append(urlEncode(endTimeValueAsString)).append(""); + Object typeValue = getType(); + String typeValueAsString = ""; + typeValueAsString = typeValue.toString(); + sb.append("type=").append(urlEncode(typeValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("startTime"); + openapiFields.add("endTime"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner" + + " is not found in the empty JSON string", + TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) + && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner.class + .isAssignableFrom(type.getRawType())) { + return null; // this class only serializes + // 'TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner + .class)); + + return (TypeAdapter) + new TypeAdapter< + TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner>() { + @Override + public void write( + JsonWriter out, + TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner given an + * JSON string + * + * @param jsonString JSON string + * @return An instance of TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner + * @throws IOException if the JSON string is invalid with respect to + * TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner + */ + public static TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner fromJson( + String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner.class); + } + + /** + * Convert an instance of TradingScheduleResponseMarketSchedulesCOMMODITYSessionsInner to an + * JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponseMarketSchedulesEQUITY.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponseMarketSchedulesEQUITY.java new file mode 100644 index 00000000..311a6afa --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponseMarketSchedulesEQUITY.java @@ -0,0 +1,260 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** TradingScheduleResponseMarketSchedulesEQUITY */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TradingScheduleResponseMarketSchedulesEQUITY { + public static final String SERIALIZED_NAME_SESSIONS = "sessions"; + + @SerializedName(SERIALIZED_NAME_SESSIONS) + @jakarta.annotation.Nullable + private List<@Valid TradingScheduleResponseMarketSchedulesEQUITYSessionsInner> sessions; + + public TradingScheduleResponseMarketSchedulesEQUITY() {} + + public TradingScheduleResponseMarketSchedulesEQUITY sessions( + @jakarta.annotation.Nullable + List<@Valid TradingScheduleResponseMarketSchedulesEQUITYSessionsInner> + sessions) { + this.sessions = sessions; + return this; + } + + public TradingScheduleResponseMarketSchedulesEQUITY addSessionsItem( + TradingScheduleResponseMarketSchedulesEQUITYSessionsInner sessionsItem) { + if (this.sessions == null) { + this.sessions = new ArrayList<>(); + } + this.sessions.add(sessionsItem); + return this; + } + + /** + * Get sessions + * + * @return sessions + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid TradingScheduleResponseMarketSchedulesEQUITYSessionsInner> getSessions() { + return sessions; + } + + public void setSessions( + @jakarta.annotation.Nullable + List<@Valid TradingScheduleResponseMarketSchedulesEQUITYSessionsInner> + sessions) { + this.sessions = sessions; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TradingScheduleResponseMarketSchedulesEQUITY tradingScheduleResponseMarketSchedulesEQUITY = + (TradingScheduleResponseMarketSchedulesEQUITY) o; + return Objects.equals(this.sessions, tradingScheduleResponseMarketSchedulesEQUITY.sessions); + } + + @Override + public int hashCode() { + return Objects.hash(sessions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TradingScheduleResponseMarketSchedulesEQUITY {\n"); + sb.append(" sessions: ").append(toIndentedString(sessions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object sessionsValue = getSessions(); + String sessionsValueAsString = ""; + sessionsValueAsString = + (String) + ((Collection) sessionsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("sessions=").append(urlEncode(sessionsValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * TradingScheduleResponseMarketSchedulesEQUITY + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TradingScheduleResponseMarketSchedulesEQUITY.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " TradingScheduleResponseMarketSchedulesEQUITY is not found" + + " in the empty JSON string", + TradingScheduleResponseMarketSchedulesEQUITY.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("sessions") != null && !jsonObj.get("sessions").isJsonNull()) { + JsonArray jsonArraysessions = jsonObj.getAsJsonArray("sessions"); + if (jsonArraysessions != null) { + // ensure the json data is an array + if (!jsonObj.get("sessions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sessions` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("sessions").toString())); + } + + // validate the optional field `sessions` (array) + for (int i = 0; i < jsonArraysessions.size(); i++) { + TradingScheduleResponseMarketSchedulesEQUITYSessionsInner.validateJsonElement( + jsonArraysessions.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TradingScheduleResponseMarketSchedulesEQUITY.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'TradingScheduleResponseMarketSchedulesEQUITY' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(TradingScheduleResponseMarketSchedulesEQUITY.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, TradingScheduleResponseMarketSchedulesEQUITY value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TradingScheduleResponseMarketSchedulesEQUITY read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TradingScheduleResponseMarketSchedulesEQUITY given an JSON string + * + * @param jsonString JSON string + * @return An instance of TradingScheduleResponseMarketSchedulesEQUITY + * @throws IOException if the JSON string is invalid with respect to + * TradingScheduleResponseMarketSchedulesEQUITY + */ + public static TradingScheduleResponseMarketSchedulesEQUITY fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, TradingScheduleResponseMarketSchedulesEQUITY.class); + } + + /** + * Convert an instance of TradingScheduleResponseMarketSchedulesEQUITY to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponseMarketSchedulesEQUITYSessionsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponseMarketSchedulesEQUITYSessionsInner.java new file mode 100644 index 00000000..199e7a7d --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TradingScheduleResponseMarketSchedulesEQUITYSessionsInner.java @@ -0,0 +1,306 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** TradingScheduleResponseMarketSchedulesEQUITYSessionsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TradingScheduleResponseMarketSchedulesEQUITYSessionsInner { + public static final String SERIALIZED_NAME_START_TIME = "startTime"; + + @SerializedName(SERIALIZED_NAME_START_TIME) + @jakarta.annotation.Nullable + private Long startTime; + + public static final String SERIALIZED_NAME_END_TIME = "endTime"; + + @SerializedName(SERIALIZED_NAME_END_TIME) + @jakarta.annotation.Nullable + private Long endTime; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nullable + private String type; + + public TradingScheduleResponseMarketSchedulesEQUITYSessionsInner() {} + + public TradingScheduleResponseMarketSchedulesEQUITYSessionsInner startTime( + @jakarta.annotation.Nullable Long startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get startTime + * + * @return startTime + */ + @jakarta.annotation.Nullable + public Long getStartTime() { + return startTime; + } + + public void setStartTime(@jakarta.annotation.Nullable Long startTime) { + this.startTime = startTime; + } + + public TradingScheduleResponseMarketSchedulesEQUITYSessionsInner endTime( + @jakarta.annotation.Nullable Long endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get endTime + * + * @return endTime + */ + @jakarta.annotation.Nullable + public Long getEndTime() { + return endTime; + } + + public void setEndTime(@jakarta.annotation.Nullable Long endTime) { + this.endTime = endTime; + } + + public TradingScheduleResponseMarketSchedulesEQUITYSessionsInner type( + @jakarta.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@jakarta.annotation.Nullable String type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TradingScheduleResponseMarketSchedulesEQUITYSessionsInner + tradingScheduleResponseMarketSchedulesEQUITYSessionsInner = + (TradingScheduleResponseMarketSchedulesEQUITYSessionsInner) o; + return Objects.equals( + this.startTime, + tradingScheduleResponseMarketSchedulesEQUITYSessionsInner.startTime) + && Objects.equals( + this.endTime, + tradingScheduleResponseMarketSchedulesEQUITYSessionsInner.endTime) + && Objects.equals( + this.type, tradingScheduleResponseMarketSchedulesEQUITYSessionsInner.type); + } + + @Override + public int hashCode() { + return Objects.hash(startTime, endTime, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TradingScheduleResponseMarketSchedulesEQUITYSessionsInner {\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object startTimeValue = getStartTime(); + String startTimeValueAsString = ""; + startTimeValueAsString = startTimeValue.toString(); + sb.append("startTime=").append(urlEncode(startTimeValueAsString)).append(""); + Object endTimeValue = getEndTime(); + String endTimeValueAsString = ""; + endTimeValueAsString = endTimeValue.toString(); + sb.append("endTime=").append(urlEncode(endTimeValueAsString)).append(""); + Object typeValue = getType(); + String typeValueAsString = ""; + typeValueAsString = typeValue.toString(); + sb.append("type=").append(urlEncode(typeValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("startTime"); + openapiFields.add("endTime"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * TradingScheduleResponseMarketSchedulesEQUITYSessionsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TradingScheduleResponseMarketSchedulesEQUITYSessionsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " TradingScheduleResponseMarketSchedulesEQUITYSessionsInner" + + " is not found in the empty JSON string", + TradingScheduleResponseMarketSchedulesEQUITYSessionsInner + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) + && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TradingScheduleResponseMarketSchedulesEQUITYSessionsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'TradingScheduleResponseMarketSchedulesEQUITYSessionsInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + TradingScheduleResponseMarketSchedulesEQUITYSessionsInner + .class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + TradingScheduleResponseMarketSchedulesEQUITYSessionsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TradingScheduleResponseMarketSchedulesEQUITYSessionsInner read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TradingScheduleResponseMarketSchedulesEQUITYSessionsInner given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of TradingScheduleResponseMarketSchedulesEQUITYSessionsInner + * @throws IOException if the JSON string is invalid with respect to + * TradingScheduleResponseMarketSchedulesEQUITYSessionsInner + */ + public static TradingScheduleResponseMarketSchedulesEQUITYSessionsInner fromJson( + String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + TradingScheduleResponseMarketSchedulesEQUITYSessionsInner.class); + } + + /** + * Convert an instance of TradingScheduleResponseMarketSchedulesEQUITYSessionsInner to an JSON + * string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/UserCommissionRateResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/UserCommissionRateResponse.java index 033a0e36..b5855d77 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/UserCommissionRateResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/UserCommissionRateResponse.java @@ -54,6 +54,12 @@ public class UserCommissionRateResponse { @jakarta.annotation.Nullable private String takerCommissionRate; + public static final String SERIALIZED_NAME_RPI_COMMISSION_RATE = "rpiCommissionRate"; + + @SerializedName(SERIALIZED_NAME_RPI_COMMISSION_RATE) + @jakarta.annotation.Nullable + private String rpiCommissionRate; + public UserCommissionRateResponse() {} public UserCommissionRateResponse symbol(@jakarta.annotation.Nullable String symbol) { @@ -115,6 +121,26 @@ public void setTakerCommissionRate(@jakarta.annotation.Nullable String takerComm this.takerCommissionRate = takerCommissionRate; } + public UserCommissionRateResponse rpiCommissionRate( + @jakarta.annotation.Nullable String rpiCommissionRate) { + this.rpiCommissionRate = rpiCommissionRate; + return this; + } + + /** + * Get rpiCommissionRate + * + * @return rpiCommissionRate + */ + @jakarta.annotation.Nullable + public String getRpiCommissionRate() { + return rpiCommissionRate; + } + + public void setRpiCommissionRate(@jakarta.annotation.Nullable String rpiCommissionRate) { + this.rpiCommissionRate = rpiCommissionRate; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -128,12 +154,14 @@ public boolean equals(Object o) { && Objects.equals( this.makerCommissionRate, userCommissionRateResponse.makerCommissionRate) && Objects.equals( - this.takerCommissionRate, userCommissionRateResponse.takerCommissionRate); + this.takerCommissionRate, userCommissionRateResponse.takerCommissionRate) + && Objects.equals( + this.rpiCommissionRate, userCommissionRateResponse.rpiCommissionRate); } @Override public int hashCode() { - return Objects.hash(symbol, makerCommissionRate, takerCommissionRate); + return Objects.hash(symbol, makerCommissionRate, takerCommissionRate, rpiCommissionRate); } @Override @@ -147,6 +175,7 @@ public String toString() { sb.append(" takerCommissionRate: ") .append(toIndentedString(takerCommissionRate)) .append("\n"); + sb.append(" rpiCommissionRate: ").append(toIndentedString(rpiCommissionRate)).append("\n"); sb.append("}"); return sb.toString(); } @@ -170,6 +199,12 @@ public String toUrlQueryString() { sb.append("takerCommissionRate=") .append(urlEncode(takerCommissionRateValueAsString)) .append(""); + Object rpiCommissionRateValue = getRpiCommissionRate(); + String rpiCommissionRateValueAsString = ""; + rpiCommissionRateValueAsString = rpiCommissionRateValue.toString(); + sb.append("rpiCommissionRate=") + .append(urlEncode(rpiCommissionRateValueAsString)) + .append(""); return sb.toString(); } @@ -201,6 +236,7 @@ private String toIndentedString(Object o) { openapiFields.add("symbol"); openapiFields.add("makerCommissionRate"); openapiFields.add("takerCommissionRate"); + openapiFields.add("rpiCommissionRate"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -250,6 +286,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " JSON string but got `%s`", jsonObj.get("takerCommissionRate").toString())); } + if ((jsonObj.get("rpiCommissionRate") != null + && !jsonObj.get("rpiCommissionRate").isJsonNull()) + && !jsonObj.get("rpiCommissionRate").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rpiCommissionRate` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("rpiCommissionRate").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/JSON.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/JSON.java index 7e0a4a44..66ef220a 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/JSON.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/JSON.java @@ -148,13 +148,22 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.api - .model.CancelOrderRequest.CustomTypeAdapterFactory()); + .model.CancelAlgoOrderRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.api - .model.CancelOrderResponse.CustomTypeAdapterFactory()); + .model.CancelAlgoOrderResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.api + .model.CancelAlgoOrderResponseRateLimitsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.api + .model.CancelAlgoOrderResponseResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.api + .model.CancelOrderRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.api - .model.CancelOrderResponseRateLimitsInner.CustomTypeAdapterFactory()); + .model.CancelOrderResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.api .model.CancelOrderResponseResult.CustomTypeAdapterFactory()); @@ -201,6 +210,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.api .model.ModifyOrderResponseResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.api + .model.NewAlgoOrderRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.api + .model.NewAlgoOrderResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.api + .model.NewAlgoOrderResponseResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.api .model.NewOrderRequest.CustomTypeAdapterFactory()); diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java index 2cd72c31..3ab82197 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java @@ -11,6 +11,8 @@ import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.AccountInformationResponse; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.AccountInformationV2Request; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.AccountInformationV2Response; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.CancelAlgoOrderRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.CancelAlgoOrderResponse; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.CancelOrderRequest; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.CancelOrderResponse; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.CloseUserDataStreamRequest; @@ -23,6 +25,8 @@ import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.KeepaliveUserDataStreamResponse; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.ModifyOrderRequest; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.ModifyOrderResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.NewAlgoOrderRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.NewAlgoOrderResponse; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.NewOrderRequest; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.NewOrderResponse; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.OrderBookRequest; @@ -46,7 +50,7 @@ public class DerivativesTradingUsdsFuturesWebSocketApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/6.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/7.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private AccountApi accountApi; @@ -113,6 +117,11 @@ public CompletableFuture symbolPriceTicker( return marketDataApi.symbolPriceTicker(symbolPriceTickerRequest); } + public CompletableFuture cancelAlgoOrder( + CancelAlgoOrderRequest cancelAlgoOrderRequest) throws ApiException { + return tradeApi.cancelAlgoOrder(cancelAlgoOrderRequest); + } + public CompletableFuture cancelOrder(CancelOrderRequest cancelOrderRequest) throws ApiException { return tradeApi.cancelOrder(cancelOrderRequest); @@ -123,6 +132,11 @@ public CompletableFuture modifyOrder(ModifyOrderRequest mod return tradeApi.modifyOrder(modifyOrderRequest); } + public CompletableFuture newAlgoOrder( + NewAlgoOrderRequest newAlgoOrderRequest) throws ApiException { + return tradeApi.newAlgoOrder(newAlgoOrderRequest); + } + public CompletableFuture newOrder(NewOrderRequest newOrderRequest) throws ApiException { return tradeApi.newOrder(newOrderRequest); diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/MarketDataApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/MarketDataApi.java index ff913c7f..b8cb57ca 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/MarketDataApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/MarketDataApi.java @@ -45,7 +45,8 @@ public MarketDataApi(ConnectionInterface connection) { * you need to continuously monitor order book updates, please consider using Websocket Market * Streams: * `<symbol>@depth<levels>` * `<symbol>@depth` * You can use `depth` request together with `<symbol>@depth` streams - * to maintain a local order book. Weight: Adjusted based on the limit: | Limit | Weight | | + * to maintain a local order book. Retail Price Improvement(RPI) orders are not visible and + * excluded in the response message. Weight: Adjusted based on the limit: | Limit | Weight | | * ------------- | ------ | | 5, 10, 20, 50 | 2 | | 100 | 5 | | 500 | 10 | | 1000 | 20 | * * @param orderBookRequest (required) @@ -108,7 +109,8 @@ private void orderBookValidateBeforeCall(OrderBookRequest orderBookRequest) } /** - * Symbol Order Book Ticker Best price/qty on the order book for a symbol or symbols. * If the + * Symbol Order Book Ticker Best price/qty on the order book for a symbol or symbols. Retail + * Price Improvement(RPI) orders are not visible and excluded in the response message. * If the * symbol is not sent, bookTickers for all symbols will be returned in an array. * The field * `X-MBX-USED-WEIGHT-1M` in response header is not accurate from this endpoint, * please ignore. Weight: 2 for a single symbol; 5 when the symbol parameter is omitted diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApi.java index 095d02df..bf1389dd 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApi.java @@ -16,10 +16,14 @@ import com.binance.connector.client.common.exception.ConstraintViolationException; import com.binance.connector.client.common.websocket.adapter.ConnectionInterface; import com.binance.connector.client.common.websocket.dtos.ApiRequestWrapperDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.CancelAlgoOrderRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.CancelAlgoOrderResponse; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.CancelOrderRequest; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.CancelOrderResponse; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.ModifyOrderRequest; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.ModifyOrderResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.NewAlgoOrderRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.NewAlgoOrderResponse; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.NewOrderRequest; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.NewOrderResponse; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.PositionInformationRequest; @@ -46,6 +50,68 @@ public TradeApi(ConnectionInterface connection) { this.connection = connection; } + /** + * Cancel Algo Order (TRADE) Cancel an active algo order. * Either `algoid` or + * `clientalgoid` must be sent. Weight: 1 + * + * @param cancelAlgoOrderRequest (required) + * @return CancelAlgoOrderResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Cancel Algo Order -
+ * + * @see Cancel + * Algo Order (TRADE) Documentation + */ + public CompletableFuture cancelAlgoOrder( + CancelAlgoOrderRequest cancelAlgoOrderRequest) throws ApiException { + cancelAlgoOrderValidateBeforeCall(cancelAlgoOrderRequest); + String methodName = "/algoOrder.cancel".substring(1); + ApiRequestWrapperDTO build = + new ApiRequestWrapperDTO.Builder() + .id(getRequestID()) + .method(methodName) + .params(cancelAlgoOrderRequest) + .responseType(CancelAlgoOrderResponse.class) + .build(); + + try { + connection.send(build); + } catch (InterruptedException e) { + throw new ApiException(e); + } + return build.getResponseCallback(); + } + + @SuppressWarnings("rawtypes") + private void cancelAlgoOrderValidateBeforeCall(CancelAlgoOrderRequest cancelAlgoOrderRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(cancelAlgoOrderRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + /** * Cancel Order (TRADE) Cancel an active order. * Either `orderId` or * `origClientOrderId` must be sent. Weight: 1 @@ -181,6 +247,96 @@ private void modifyOrderValidateBeforeCall(ModifyOrderRequest modifyOrderRequest } } + /** + * New Algo Order(TRADE) Send in a new algo order. * Condition orders will be triggered when: * + * If parameter`priceProtect`is sent as true: * when price reaches the + * `triggerPrice` ,the difference rate between \"MARK_PRICE\" and + * \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the + * symbol * \"triggerProtect\" of a symbol can be got from `GET + * /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * BUY: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * SELL: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `triggerPrice` * `TAKE_PROFIT`, + * `TAKE_PROFIT_MARKET`: * BUY: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after + * order placed <= `activationPrice`, and the latest price >= the + * lowest price * (1 + `callbackRate`) * SELL: the highest price after order placed + * >= `activationPrice`, and the latest price <= the highest price * + * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error + * code. ``{\"code\": -2021, \"msg\": \"Order would + * immediately trigger.\"}`` means that the parameters you send do not meet the + * following requirements: * BUY: `activationPrice` should be smaller than latest + * price. * SELL: `activationPrice` should be larger than latest price. * + * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with + * `closePosition`=`true`: * Follow the same rules for condition + * orders. * If triggered,**close all** current long position( if `SELL`) or current + * short position( if `BUY`). * Cannot be used with `quantity` paremeter * + * Cannot be used with `reduceOnly` parameter * In Hedge Mode,cannot be used with + * `BUY` orders in `LONG` position side. and cannot be used with + * `SELL` orders in `SHORT` position side * + * `selfTradePreventionMode` is only effective when `timeInForce` set to + * `IOC` or `GTC` or `GTD`. Weight: 0 + * + * @param newAlgoOrderRequest (required) + * @return NewAlgoOrderResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 New Algo Order -
+ * + * @see New + * Algo Order(TRADE) Documentation + */ + public CompletableFuture newAlgoOrder( + NewAlgoOrderRequest newAlgoOrderRequest) throws ApiException { + newAlgoOrderValidateBeforeCall(newAlgoOrderRequest); + String methodName = "/algoOrder.place".substring(1); + ApiRequestWrapperDTO build = + new ApiRequestWrapperDTO.Builder() + .id(getRequestID()) + .method(methodName) + .params(newAlgoOrderRequest) + .responseType(NewAlgoOrderResponse.class) + .build(); + + try { + connection.send(build); + } catch (InterruptedException e) { + throw new ApiException(e); + } + return build.getResponseCallback(); + } + + @SuppressWarnings("rawtypes") + private void newAlgoOrderValidateBeforeCall(NewAlgoOrderRequest newAlgoOrderRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(newAlgoOrderRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + /** * New Order(TRADE) Send in a new order. * Order with type `STOP`, parameter * `timeInForce` can be sent ( default `GTC`). * Order with type diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderRequest.java new file mode 100644 index 00000000..a9352e6a --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderRequest.java @@ -0,0 +1,359 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** CancelAlgoOrderRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CancelAlgoOrderRequest extends BaseDTO { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @jakarta.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_ALGOID = "algoid"; + + @SerializedName(SERIALIZED_NAME_ALGOID) + @jakarta.annotation.Nullable + private Long algoid; + + public static final String SERIALIZED_NAME_CLIENTALGOID = "clientalgoid"; + + @SerializedName(SERIALIZED_NAME_CLIENTALGOID) + @jakarta.annotation.Nullable + private String clientalgoid; + + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Long recvWindow; + + public CancelAlgoOrderRequest() {} + + public CancelAlgoOrderRequest id(@jakarta.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @jakarta.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@jakarta.annotation.Nullable String id) { + this.id = id; + } + + public CancelAlgoOrderRequest algoid(@jakarta.annotation.Nullable Long algoid) { + this.algoid = algoid; + return this; + } + + /** + * Get algoid + * + * @return algoid + */ + @jakarta.annotation.Nullable + public Long getAlgoid() { + return algoid; + } + + public void setAlgoid(@jakarta.annotation.Nullable Long algoid) { + this.algoid = algoid; + } + + public CancelAlgoOrderRequest clientalgoid(@jakarta.annotation.Nullable String clientalgoid) { + this.clientalgoid = clientalgoid; + return this; + } + + /** + * Get clientalgoid + * + * @return clientalgoid + */ + @jakarta.annotation.Nullable + public String getClientalgoid() { + return clientalgoid; + } + + public void setClientalgoid(@jakarta.annotation.Nullable String clientalgoid) { + this.clientalgoid = clientalgoid; + } + + public CancelAlgoOrderRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + public Long getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelAlgoOrderRequest cancelAlgoOrderRequest = (CancelAlgoOrderRequest) o; + return Objects.equals(this.id, cancelAlgoOrderRequest.id) + && Objects.equals(this.algoid, cancelAlgoOrderRequest.algoid) + && Objects.equals(this.clientalgoid, cancelAlgoOrderRequest.clientalgoid) + && Objects.equals(this.recvWindow, cancelAlgoOrderRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash(id, algoid, clientalgoid, recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CancelAlgoOrderRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" algoid: ").append(toIndentedString(algoid)).append("\n"); + sb.append(" clientalgoid: ").append(toIndentedString(clientalgoid)).append("\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String idValue = getId(); + if (idValue != null) { + String idValueAsString = idValue.toString(); + valMap.put("id", idValueAsString); + } + Long algoidValue = getAlgoid(); + if (algoidValue != null) { + String algoidValueAsString = algoidValue.toString(); + valMap.put("algoid", algoidValueAsString); + } + String clientalgoidValue = getClientalgoid(); + if (clientalgoidValue != null) { + String clientalgoidValueAsString = clientalgoidValue.toString(); + valMap.put("clientalgoid", clientalgoidValueAsString); + } + Long recvWindowValue = getRecvWindow(); + if (recvWindowValue != null) { + String recvWindowValueAsString = recvWindowValue.toString(); + valMap.put("recvWindow", recvWindowValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object idValue = getId(); + if (idValue != null) { + valMap.put("id", idValue); + } + Object algoidValue = getAlgoid(); + if (algoidValue != null) { + valMap.put("algoid", algoidValue); + } + Object clientalgoidValue = getClientalgoid(); + if (clientalgoidValue != null) { + valMap.put("clientalgoid", clientalgoidValue); + } + Object recvWindowValue = getRecvWindow(); + if (recvWindowValue != null) { + valMap.put("recvWindow", recvWindowValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("algoid"); + openapiFields.add("clientalgoid"); + openapiFields.add("recvWindow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CancelAlgoOrderRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CancelAlgoOrderRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CancelAlgoOrderRequest is not found in" + + " the empty JSON string", + CancelAlgoOrderRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CancelAlgoOrderRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CancelAlgoOrderRequest` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("clientalgoid") != null && !jsonObj.get("clientalgoid").isJsonNull()) + && !jsonObj.get("clientalgoid").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientalgoid` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientalgoid").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CancelAlgoOrderRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CancelAlgoOrderRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CancelAlgoOrderRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CancelAlgoOrderRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CancelAlgoOrderRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CancelAlgoOrderRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CancelAlgoOrderRequest + * @throws IOException if the JSON string is invalid with respect to CancelAlgoOrderRequest + */ + public static CancelAlgoOrderRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CancelAlgoOrderRequest.class); + } + + /** + * Convert an instance of CancelAlgoOrderRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderResponse.java new file mode 100644 index 00000000..86b1f647 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderResponse.java @@ -0,0 +1,396 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** CancelAlgoOrderResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CancelAlgoOrderResponse extends BaseDTO { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @jakarta.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private Long status; + + public static final String SERIALIZED_NAME_RESULT = "result"; + + @SerializedName(SERIALIZED_NAME_RESULT) + @jakarta.annotation.Nullable + private CancelAlgoOrderResponseResult result; + + public static final String SERIALIZED_NAME_RATE_LIMITS = "rateLimits"; + + @SerializedName(SERIALIZED_NAME_RATE_LIMITS) + @jakarta.annotation.Nullable + private List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimits; + + public CancelAlgoOrderResponse() {} + + public CancelAlgoOrderResponse id(@jakarta.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @jakarta.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@jakarta.annotation.Nullable String id) { + this.id = id; + } + + public CancelAlgoOrderResponse status(@jakarta.annotation.Nullable Long status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @jakarta.annotation.Nullable + public Long getStatus() { + return status; + } + + public void setStatus(@jakarta.annotation.Nullable Long status) { + this.status = status; + } + + public CancelAlgoOrderResponse result( + @jakarta.annotation.Nullable CancelAlgoOrderResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * + * @return result + */ + @jakarta.annotation.Nullable + @Valid + public CancelAlgoOrderResponseResult getResult() { + return result; + } + + public void setResult(@jakarta.annotation.Nullable CancelAlgoOrderResponseResult result) { + this.result = result; + } + + public CancelAlgoOrderResponse rateLimits( + @jakarta.annotation.Nullable + List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimits) { + this.rateLimits = rateLimits; + return this; + } + + public CancelAlgoOrderResponse addRateLimitsItem( + CancelAlgoOrderResponseRateLimitsInner rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + + /** + * Get rateLimits + * + * @return rateLimits + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid CancelAlgoOrderResponseRateLimitsInner> getRateLimits() { + return rateLimits; + } + + public void setRateLimits( + @jakarta.annotation.Nullable + List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimits) { + this.rateLimits = rateLimits; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelAlgoOrderResponse cancelAlgoOrderResponse = (CancelAlgoOrderResponse) o; + return Objects.equals(this.id, cancelAlgoOrderResponse.id) + && Objects.equals(this.status, cancelAlgoOrderResponse.status) + && Objects.equals(this.result, cancelAlgoOrderResponse.result) + && Objects.equals(this.rateLimits, cancelAlgoOrderResponse.rateLimits); + } + + @Override + public int hashCode() { + return Objects.hash(id, status, result, rateLimits); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CancelAlgoOrderResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append(" rateLimits: ").append(toIndentedString(rateLimits)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String idValue = getId(); + if (idValue != null) { + String idValueAsString = idValue.toString(); + valMap.put("id", idValueAsString); + } + Long statusValue = getStatus(); + if (statusValue != null) { + String statusValueAsString = statusValue.toString(); + valMap.put("status", statusValueAsString); + } + CancelAlgoOrderResponseResult resultValue = getResult(); + if (resultValue != null) { + String resultValueAsString = JSON.getGson().toJson(resultValue); + valMap.put("result", resultValueAsString); + } + List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + if (rateLimitsValue != null) { + String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); + valMap.put("rateLimits", rateLimitsValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object idValue = getId(); + if (idValue != null) { + valMap.put("id", idValue); + } + Object statusValue = getStatus(); + if (statusValue != null) { + valMap.put("status", statusValue); + } + Object resultValue = getResult(); + if (resultValue != null) { + valMap.put("result", resultValue); + } + Object rateLimitsValue = getRateLimits(); + if (rateLimitsValue != null) { + valMap.put("rateLimits", rateLimitsValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("status"); + openapiFields.add("result"); + openapiFields.add("rateLimits"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CancelAlgoOrderResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CancelAlgoOrderResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CancelAlgoOrderResponse is not found" + + " in the empty JSON string", + CancelAlgoOrderResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CancelAlgoOrderResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CancelAlgoOrderResponse` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + // validate the optional field `result` + if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { + CancelAlgoOrderResponseResult.validateJsonElement(jsonObj.get("result")); + } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + CancelAlgoOrderResponseRateLimitsInner.validateJsonElement( + jsonArrayrateLimits.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CancelAlgoOrderResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CancelAlgoOrderResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CancelAlgoOrderResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CancelAlgoOrderResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CancelAlgoOrderResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CancelAlgoOrderResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CancelAlgoOrderResponse + * @throws IOException if the JSON string is invalid with respect to CancelAlgoOrderResponse + */ + public static CancelAlgoOrderResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CancelAlgoOrderResponse.class); + } + + /** + * Convert an instance of CancelAlgoOrderResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelOrderResponseRateLimitsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderResponseRateLimitsInner.java similarity index 80% rename from clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelOrderResponseRateLimitsInner.java rename to clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderResponseRateLimitsInner.java index c68e661a..25ec8401 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelOrderResponseRateLimitsInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderResponseRateLimitsInner.java @@ -34,11 +34,11 @@ import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; -/** CancelOrderResponseRateLimitsInner */ +/** CancelAlgoOrderResponseRateLimitsInner */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class CancelOrderResponseRateLimitsInner extends BaseDTO { +public class CancelAlgoOrderResponseRateLimitsInner extends BaseDTO { public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) @@ -69,9 +69,9 @@ public class CancelOrderResponseRateLimitsInner extends BaseDTO { @jakarta.annotation.Nullable private Long count; - public CancelOrderResponseRateLimitsInner() {} + public CancelAlgoOrderResponseRateLimitsInner() {} - public CancelOrderResponseRateLimitsInner rateLimitType( + public CancelAlgoOrderResponseRateLimitsInner rateLimitType( @jakarta.annotation.Nullable String rateLimitType) { this.rateLimitType = rateLimitType; return this; @@ -91,7 +91,7 @@ public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) this.rateLimitType = rateLimitType; } - public CancelOrderResponseRateLimitsInner interval( + public CancelAlgoOrderResponseRateLimitsInner interval( @jakarta.annotation.Nullable String interval) { this.interval = interval; return this; @@ -111,7 +111,7 @@ public void setInterval(@jakarta.annotation.Nullable String interval) { this.interval = interval; } - public CancelOrderResponseRateLimitsInner intervalNum( + public CancelAlgoOrderResponseRateLimitsInner intervalNum( @jakarta.annotation.Nullable Long intervalNum) { this.intervalNum = intervalNum; return this; @@ -131,7 +131,7 @@ public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { this.intervalNum = intervalNum; } - public CancelOrderResponseRateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { + public CancelAlgoOrderResponseRateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { this.limit = limit; return this; } @@ -150,7 +150,7 @@ public void setLimit(@jakarta.annotation.Nullable Long limit) { this.limit = limit; } - public CancelOrderResponseRateLimitsInner count(@jakarta.annotation.Nullable Long count) { + public CancelAlgoOrderResponseRateLimitsInner count(@jakarta.annotation.Nullable Long count) { this.count = count; return this; } @@ -177,13 +177,15 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - CancelOrderResponseRateLimitsInner cancelOrderResponseRateLimitsInner = - (CancelOrderResponseRateLimitsInner) o; - return Objects.equals(this.rateLimitType, cancelOrderResponseRateLimitsInner.rateLimitType) - && Objects.equals(this.interval, cancelOrderResponseRateLimitsInner.interval) - && Objects.equals(this.intervalNum, cancelOrderResponseRateLimitsInner.intervalNum) - && Objects.equals(this.limit, cancelOrderResponseRateLimitsInner.limit) - && Objects.equals(this.count, cancelOrderResponseRateLimitsInner.count); + CancelAlgoOrderResponseRateLimitsInner cancelAlgoOrderResponseRateLimitsInner = + (CancelAlgoOrderResponseRateLimitsInner) o; + return Objects.equals( + this.rateLimitType, cancelAlgoOrderResponseRateLimitsInner.rateLimitType) + && Objects.equals(this.interval, cancelAlgoOrderResponseRateLimitsInner.interval) + && Objects.equals( + this.intervalNum, cancelAlgoOrderResponseRateLimitsInner.intervalNum) + && Objects.equals(this.limit, cancelAlgoOrderResponseRateLimitsInner.limit) + && Objects.equals(this.count, cancelAlgoOrderResponseRateLimitsInner.count); } @Override @@ -194,7 +196,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class CancelOrderResponseRateLimitsInner {\n"); + sb.append("class CancelAlgoOrderResponseRateLimitsInner {\n"); sb.append(" rateLimitType: ").append(toIndentedString(rateLimitType)).append("\n"); sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); sb.append(" intervalNum: ").append(toIndentedString(intervalNum)).append("\n"); @@ -305,17 +307,17 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * CancelOrderResponseRateLimitsInner + * CancelAlgoOrderResponseRateLimitsInner */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!CancelOrderResponseRateLimitsInner.openapiRequiredFields + if (!CancelAlgoOrderResponseRateLimitsInner.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in CancelOrderResponseRateLimitsInner is" - + " not found in the empty JSON string", - CancelOrderResponseRateLimitsInner.openapiRequiredFields + "The required field(s) %s in CancelAlgoOrderResponseRateLimitsInner" + + " is not found in the empty JSON string", + CancelAlgoOrderResponseRateLimitsInner.openapiRequiredFields .toString())); } } @@ -323,11 +325,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!CancelOrderResponseRateLimitsInner.openapiFields.contains(entry.getKey())) { + if (!CancelAlgoOrderResponseRateLimitsInner.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `CancelOrderResponseRateLimitsInner` properties. JSON: %s", + + " `CancelAlgoOrderResponseRateLimitsInner` properties. JSON:" + + " %s", entry.getKey(), jsonElement.toString())); } } @@ -354,26 +357,27 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!CancelOrderResponseRateLimitsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CancelOrderResponseRateLimitsInner' and - // its subtypes + if (!CancelAlgoOrderResponseRateLimitsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CancelAlgoOrderResponseRateLimitsInner' + // and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = + final TypeAdapter thisAdapter = gson.getDelegateAdapter( - this, TypeToken.get(CancelOrderResponseRateLimitsInner.class)); + this, TypeToken.get(CancelAlgoOrderResponseRateLimitsInner.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, CancelOrderResponseRateLimitsInner value) + public void write( + JsonWriter out, CancelAlgoOrderResponseRateLimitsInner value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public CancelOrderResponseRateLimitsInner read(JsonReader in) + public CancelAlgoOrderResponseRateLimitsInner read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); @@ -384,20 +388,20 @@ public CancelOrderResponseRateLimitsInner read(JsonReader in) } /** - * Create an instance of CancelOrderResponseRateLimitsInner given an JSON string + * Create an instance of CancelAlgoOrderResponseRateLimitsInner given an JSON string * * @param jsonString JSON string - * @return An instance of CancelOrderResponseRateLimitsInner + * @return An instance of CancelAlgoOrderResponseRateLimitsInner * @throws IOException if the JSON string is invalid with respect to - * CancelOrderResponseRateLimitsInner + * CancelAlgoOrderResponseRateLimitsInner */ - public static CancelOrderResponseRateLimitsInner fromJson(String jsonString) + public static CancelAlgoOrderResponseRateLimitsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CancelOrderResponseRateLimitsInner.class); + return JSON.getGson().fromJson(jsonString, CancelAlgoOrderResponseRateLimitsInner.class); } /** - * Convert an instance of CancelOrderResponseRateLimitsInner to an JSON string + * Convert an instance of CancelAlgoOrderResponseRateLimitsInner to an JSON string * * @return JSON string */ diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderResponseResult.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderResponseResult.java new file mode 100644 index 00000000..9314c231 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderResponseResult.java @@ -0,0 +1,1217 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** CancelAlgoOrderResponseResult */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CancelAlgoOrderResponseResult extends BaseDTO { + public static final String SERIALIZED_NAME_ALGO_ID = "algoId"; + + @SerializedName(SERIALIZED_NAME_ALGO_ID) + @jakarta.annotation.Nullable + private Long algoId; + + public static final String SERIALIZED_NAME_CLIENT_ALGO_ID = "clientAlgoId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ALGO_ID) + @jakarta.annotation.Nullable + private String clientAlgoId; + + public static final String SERIALIZED_NAME_ALGO_TYPE = "algoType"; + + @SerializedName(SERIALIZED_NAME_ALGO_TYPE) + @jakarta.annotation.Nullable + private String algoType; + + public static final String SERIALIZED_NAME_ORDER_TYPE = "orderType"; + + @SerializedName(SERIALIZED_NAME_ORDER_TYPE) + @jakarta.annotation.Nullable + private String orderType; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private String side; + + public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; + + @SerializedName(SERIALIZED_NAME_POSITION_SIDE) + @jakarta.annotation.Nullable + private String positionSide; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private String timeInForce; + + public static final String SERIALIZED_NAME_QUANTITY = "quantity"; + + @SerializedName(SERIALIZED_NAME_QUANTITY) + @jakarta.annotation.Nullable + private String quantity; + + public static final String SERIALIZED_NAME_ALGO_STATUS = "algoStatus"; + + @SerializedName(SERIALIZED_NAME_ALGO_STATUS) + @jakarta.annotation.Nullable + private String algoStatus; + + public static final String SERIALIZED_NAME_TRIGGER_PRICE = "triggerPrice"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String triggerPrice; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_ICEBERG_QUANTITY = "icebergQuantity"; + + @SerializedName(SERIALIZED_NAME_ICEBERG_QUANTITY) + @jakarta.annotation.Nullable + private String icebergQuantity; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private String selfTradePreventionMode; + + public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nullable + private String workingType; + + public static final String SERIALIZED_NAME_PRICE_MATCH = "priceMatch"; + + @SerializedName(SERIALIZED_NAME_PRICE_MATCH) + @jakarta.annotation.Nullable + private String priceMatch; + + public static final String SERIALIZED_NAME_CLOSE_POSITION = "closePosition"; + + @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) + @jakarta.annotation.Nullable + private Boolean closePosition; + + public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; + + @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) + @jakarta.annotation.Nullable + private Boolean priceProtect; + + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; + + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @jakarta.annotation.Nullable + private Boolean reduceOnly; + + public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; + + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + @jakarta.annotation.Nullable + private Long createTime; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; + + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + @jakarta.annotation.Nullable + private Long updateTime; + + public static final String SERIALIZED_NAME_TRIGGER_TIME = "triggerTime"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_TIME) + @jakarta.annotation.Nullable + private Long triggerTime; + + public static final String SERIALIZED_NAME_GOOD_TILL_DATE = "goodTillDate"; + + @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) + @jakarta.annotation.Nullable + private Long goodTillDate; + + public CancelAlgoOrderResponseResult() {} + + public CancelAlgoOrderResponseResult algoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + return this; + } + + /** + * Get algoId + * + * @return algoId + */ + @jakarta.annotation.Nullable + public Long getAlgoId() { + return algoId; + } + + public void setAlgoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + } + + public CancelAlgoOrderResponseResult clientAlgoId( + @jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + return this; + } + + /** + * Get clientAlgoId + * + * @return clientAlgoId + */ + @jakarta.annotation.Nullable + public String getClientAlgoId() { + return clientAlgoId; + } + + public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + } + + public CancelAlgoOrderResponseResult algoType(@jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + return this; + } + + /** + * Get algoType + * + * @return algoType + */ + @jakarta.annotation.Nullable + public String getAlgoType() { + return algoType; + } + + public void setAlgoType(@jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + } + + public CancelAlgoOrderResponseResult orderType(@jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + return this; + } + + /** + * Get orderType + * + * @return orderType + */ + @jakarta.annotation.Nullable + public String getOrderType() { + return orderType; + } + + public void setOrderType(@jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + } + + public CancelAlgoOrderResponseResult symbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nullable + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + } + + public CancelAlgoOrderResponseResult side(@jakarta.annotation.Nullable String side) { + this.side = side; + return this; + } + + /** + * Get side + * + * @return side + */ + @jakarta.annotation.Nullable + public String getSide() { + return side; + } + + public void setSide(@jakarta.annotation.Nullable String side) { + this.side = side; + } + + public CancelAlgoOrderResponseResult positionSide( + @jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + return this; + } + + /** + * Get positionSide + * + * @return positionSide + */ + @jakarta.annotation.Nullable + public String getPositionSide() { + return positionSide; + } + + public void setPositionSide(@jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + } + + public CancelAlgoOrderResponseResult timeInForce( + @jakarta.annotation.Nullable String timeInForce) { + this.timeInForce = timeInForce; + return this; + } + + /** + * Get timeInForce + * + * @return timeInForce + */ + @jakarta.annotation.Nullable + public String getTimeInForce() { + return timeInForce; + } + + public void setTimeInForce(@jakarta.annotation.Nullable String timeInForce) { + this.timeInForce = timeInForce; + } + + public CancelAlgoOrderResponseResult quantity(@jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity + */ + @jakarta.annotation.Nullable + public String getQuantity() { + return quantity; + } + + public void setQuantity(@jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + } + + public CancelAlgoOrderResponseResult algoStatus( + @jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + return this; + } + + /** + * Get algoStatus + * + * @return algoStatus + */ + @jakarta.annotation.Nullable + public String getAlgoStatus() { + return algoStatus; + } + + public void setAlgoStatus(@jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + } + + public CancelAlgoOrderResponseResult triggerPrice( + @jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + return this; + } + + /** + * Get triggerPrice + * + * @return triggerPrice + */ + @jakarta.annotation.Nullable + public String getTriggerPrice() { + return triggerPrice; + } + + public void setTriggerPrice(@jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + } + + public CancelAlgoOrderResponseResult price(@jakarta.annotation.Nullable String price) { + this.price = price; + return this; + } + + /** + * Get price + * + * @return price + */ + @jakarta.annotation.Nullable + public String getPrice() { + return price; + } + + public void setPrice(@jakarta.annotation.Nullable String price) { + this.price = price; + } + + public CancelAlgoOrderResponseResult icebergQuantity( + @jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + return this; + } + + /** + * Get icebergQuantity + * + * @return icebergQuantity + */ + @jakarta.annotation.Nullable + public String getIcebergQuantity() { + return icebergQuantity; + } + + public void setIcebergQuantity(@jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + } + + public CancelAlgoOrderResponseResult selfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + public String getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + + public CancelAlgoOrderResponseResult workingType( + @jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nullable + public String getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + } + + public CancelAlgoOrderResponseResult priceMatch( + @jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + return this; + } + + /** + * Get priceMatch + * + * @return priceMatch + */ + @jakarta.annotation.Nullable + public String getPriceMatch() { + return priceMatch; + } + + public void setPriceMatch(@jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + } + + public CancelAlgoOrderResponseResult closePosition( + @jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + return this; + } + + /** + * Get closePosition + * + * @return closePosition + */ + @jakarta.annotation.Nullable + public Boolean getClosePosition() { + return closePosition; + } + + public void setClosePosition(@jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + } + + public CancelAlgoOrderResponseResult priceProtect( + @jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + return this; + } + + /** + * Get priceProtect + * + * @return priceProtect + */ + @jakarta.annotation.Nullable + public Boolean getPriceProtect() { + return priceProtect; + } + + public void setPriceProtect(@jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + } + + public CancelAlgoOrderResponseResult reduceOnly( + @jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Get reduceOnly + * + * @return reduceOnly + */ + @jakarta.annotation.Nullable + public Boolean getReduceOnly() { + return reduceOnly; + } + + public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + } + + public CancelAlgoOrderResponseResult createTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get createTime + * + * @return createTime + */ + @jakarta.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + } + + public CancelAlgoOrderResponseResult updateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Get updateTime + * + * @return updateTime + */ + @jakarta.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + } + + public CancelAlgoOrderResponseResult triggerTime( + @jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + return this; + } + + /** + * Get triggerTime + * + * @return triggerTime + */ + @jakarta.annotation.Nullable + public Long getTriggerTime() { + return triggerTime; + } + + public void setTriggerTime(@jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + } + + public CancelAlgoOrderResponseResult goodTillDate( + @jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + return this; + } + + /** + * Get goodTillDate + * + * @return goodTillDate + */ + @jakarta.annotation.Nullable + public Long getGoodTillDate() { + return goodTillDate; + } + + public void setGoodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelAlgoOrderResponseResult cancelAlgoOrderResponseResult = + (CancelAlgoOrderResponseResult) o; + return Objects.equals(this.algoId, cancelAlgoOrderResponseResult.algoId) + && Objects.equals(this.clientAlgoId, cancelAlgoOrderResponseResult.clientAlgoId) + && Objects.equals(this.algoType, cancelAlgoOrderResponseResult.algoType) + && Objects.equals(this.orderType, cancelAlgoOrderResponseResult.orderType) + && Objects.equals(this.symbol, cancelAlgoOrderResponseResult.symbol) + && Objects.equals(this.side, cancelAlgoOrderResponseResult.side) + && Objects.equals(this.positionSide, cancelAlgoOrderResponseResult.positionSide) + && Objects.equals(this.timeInForce, cancelAlgoOrderResponseResult.timeInForce) + && Objects.equals(this.quantity, cancelAlgoOrderResponseResult.quantity) + && Objects.equals(this.algoStatus, cancelAlgoOrderResponseResult.algoStatus) + && Objects.equals(this.triggerPrice, cancelAlgoOrderResponseResult.triggerPrice) + && Objects.equals(this.price, cancelAlgoOrderResponseResult.price) + && Objects.equals( + this.icebergQuantity, cancelAlgoOrderResponseResult.icebergQuantity) + && Objects.equals( + this.selfTradePreventionMode, + cancelAlgoOrderResponseResult.selfTradePreventionMode) + && Objects.equals(this.workingType, cancelAlgoOrderResponseResult.workingType) + && Objects.equals(this.priceMatch, cancelAlgoOrderResponseResult.priceMatch) + && Objects.equals(this.closePosition, cancelAlgoOrderResponseResult.closePosition) + && Objects.equals(this.priceProtect, cancelAlgoOrderResponseResult.priceProtect) + && Objects.equals(this.reduceOnly, cancelAlgoOrderResponseResult.reduceOnly) + && Objects.equals(this.createTime, cancelAlgoOrderResponseResult.createTime) + && Objects.equals(this.updateTime, cancelAlgoOrderResponseResult.updateTime) + && Objects.equals(this.triggerTime, cancelAlgoOrderResponseResult.triggerTime) + && Objects.equals(this.goodTillDate, cancelAlgoOrderResponseResult.goodTillDate); + } + + @Override + public int hashCode() { + return Objects.hash( + algoId, + clientAlgoId, + algoType, + orderType, + symbol, + side, + positionSide, + timeInForce, + quantity, + algoStatus, + triggerPrice, + price, + icebergQuantity, + selfTradePreventionMode, + workingType, + priceMatch, + closePosition, + priceProtect, + reduceOnly, + createTime, + updateTime, + triggerTime, + goodTillDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CancelAlgoOrderResponseResult {\n"); + sb.append(" algoId: ").append(toIndentedString(algoId)).append("\n"); + sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); + sb.append(" algoType: ").append(toIndentedString(algoType)).append("\n"); + sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" algoStatus: ").append(toIndentedString(algoStatus)).append("\n"); + sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" icebergQuantity: ").append(toIndentedString(icebergQuantity)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); + sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); + sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" triggerTime: ").append(toIndentedString(triggerTime)).append("\n"); + sb.append(" goodTillDate: ").append(toIndentedString(goodTillDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long algoIdValue = getAlgoId(); + if (algoIdValue != null) { + String algoIdValueAsString = algoIdValue.toString(); + valMap.put("algoId", algoIdValueAsString); + } + String clientAlgoIdValue = getClientAlgoId(); + if (clientAlgoIdValue != null) { + String clientAlgoIdValueAsString = clientAlgoIdValue.toString(); + valMap.put("clientAlgoId", clientAlgoIdValueAsString); + } + String algoTypeValue = getAlgoType(); + if (algoTypeValue != null) { + String algoTypeValueAsString = algoTypeValue.toString(); + valMap.put("algoType", algoTypeValueAsString); + } + String orderTypeValue = getOrderType(); + if (orderTypeValue != null) { + String orderTypeValueAsString = orderTypeValue.toString(); + valMap.put("orderType", orderTypeValueAsString); + } + String symbolValue = getSymbol(); + if (symbolValue != null) { + String symbolValueAsString = symbolValue.toString(); + valMap.put("symbol", symbolValueAsString); + } + String sideValue = getSide(); + if (sideValue != null) { + String sideValueAsString = sideValue.toString(); + valMap.put("side", sideValueAsString); + } + String positionSideValue = getPositionSide(); + if (positionSideValue != null) { + String positionSideValueAsString = positionSideValue.toString(); + valMap.put("positionSide", positionSideValueAsString); + } + String timeInForceValue = getTimeInForce(); + if (timeInForceValue != null) { + String timeInForceValueAsString = timeInForceValue.toString(); + valMap.put("timeInForce", timeInForceValueAsString); + } + String quantityValue = getQuantity(); + if (quantityValue != null) { + String quantityValueAsString = quantityValue.toString(); + valMap.put("quantity", quantityValueAsString); + } + String algoStatusValue = getAlgoStatus(); + if (algoStatusValue != null) { + String algoStatusValueAsString = algoStatusValue.toString(); + valMap.put("algoStatus", algoStatusValueAsString); + } + String triggerPriceValue = getTriggerPrice(); + if (triggerPriceValue != null) { + String triggerPriceValueAsString = triggerPriceValue.toString(); + valMap.put("triggerPrice", triggerPriceValueAsString); + } + String priceValue = getPrice(); + if (priceValue != null) { + String priceValueAsString = priceValue.toString(); + valMap.put("price", priceValueAsString); + } + String icebergQuantityValue = getIcebergQuantity(); + if (icebergQuantityValue != null) { + String icebergQuantityValueAsString = icebergQuantityValue.toString(); + valMap.put("icebergQuantity", icebergQuantityValueAsString); + } + String selfTradePreventionModeValue = getSelfTradePreventionMode(); + if (selfTradePreventionModeValue != null) { + String selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + valMap.put("selfTradePreventionMode", selfTradePreventionModeValueAsString); + } + String workingTypeValue = getWorkingType(); + if (workingTypeValue != null) { + String workingTypeValueAsString = workingTypeValue.toString(); + valMap.put("workingType", workingTypeValueAsString); + } + String priceMatchValue = getPriceMatch(); + if (priceMatchValue != null) { + String priceMatchValueAsString = priceMatchValue.toString(); + valMap.put("priceMatch", priceMatchValueAsString); + } + Boolean closePositionValue = getClosePosition(); + if (closePositionValue != null) { + String closePositionValueAsString = closePositionValue.toString(); + valMap.put("closePosition", closePositionValueAsString); + } + Boolean priceProtectValue = getPriceProtect(); + if (priceProtectValue != null) { + String priceProtectValueAsString = priceProtectValue.toString(); + valMap.put("priceProtect", priceProtectValueAsString); + } + Boolean reduceOnlyValue = getReduceOnly(); + if (reduceOnlyValue != null) { + String reduceOnlyValueAsString = reduceOnlyValue.toString(); + valMap.put("reduceOnly", reduceOnlyValueAsString); + } + Long createTimeValue = getCreateTime(); + if (createTimeValue != null) { + String createTimeValueAsString = createTimeValue.toString(); + valMap.put("createTime", createTimeValueAsString); + } + Long updateTimeValue = getUpdateTime(); + if (updateTimeValue != null) { + String updateTimeValueAsString = updateTimeValue.toString(); + valMap.put("updateTime", updateTimeValueAsString); + } + Long triggerTimeValue = getTriggerTime(); + if (triggerTimeValue != null) { + String triggerTimeValueAsString = triggerTimeValue.toString(); + valMap.put("triggerTime", triggerTimeValueAsString); + } + Long goodTillDateValue = getGoodTillDate(); + if (goodTillDateValue != null) { + String goodTillDateValueAsString = goodTillDateValue.toString(); + valMap.put("goodTillDate", goodTillDateValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object algoIdValue = getAlgoId(); + if (algoIdValue != null) { + valMap.put("algoId", algoIdValue); + } + Object clientAlgoIdValue = getClientAlgoId(); + if (clientAlgoIdValue != null) { + valMap.put("clientAlgoId", clientAlgoIdValue); + } + Object algoTypeValue = getAlgoType(); + if (algoTypeValue != null) { + valMap.put("algoType", algoTypeValue); + } + Object orderTypeValue = getOrderType(); + if (orderTypeValue != null) { + valMap.put("orderType", orderTypeValue); + } + Object symbolValue = getSymbol(); + if (symbolValue != null) { + valMap.put("symbol", symbolValue); + } + Object sideValue = getSide(); + if (sideValue != null) { + valMap.put("side", sideValue); + } + Object positionSideValue = getPositionSide(); + if (positionSideValue != null) { + valMap.put("positionSide", positionSideValue); + } + Object timeInForceValue = getTimeInForce(); + if (timeInForceValue != null) { + valMap.put("timeInForce", timeInForceValue); + } + Object quantityValue = getQuantity(); + if (quantityValue != null) { + valMap.put("quantity", quantityValue); + } + Object algoStatusValue = getAlgoStatus(); + if (algoStatusValue != null) { + valMap.put("algoStatus", algoStatusValue); + } + Object triggerPriceValue = getTriggerPrice(); + if (triggerPriceValue != null) { + valMap.put("triggerPrice", triggerPriceValue); + } + Object priceValue = getPrice(); + if (priceValue != null) { + valMap.put("price", priceValue); + } + Object icebergQuantityValue = getIcebergQuantity(); + if (icebergQuantityValue != null) { + valMap.put("icebergQuantity", icebergQuantityValue); + } + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + if (selfTradePreventionModeValue != null) { + valMap.put("selfTradePreventionMode", selfTradePreventionModeValue); + } + Object workingTypeValue = getWorkingType(); + if (workingTypeValue != null) { + valMap.put("workingType", workingTypeValue); + } + Object priceMatchValue = getPriceMatch(); + if (priceMatchValue != null) { + valMap.put("priceMatch", priceMatchValue); + } + Object closePositionValue = getClosePosition(); + if (closePositionValue != null) { + valMap.put("closePosition", closePositionValue); + } + Object priceProtectValue = getPriceProtect(); + if (priceProtectValue != null) { + valMap.put("priceProtect", priceProtectValue); + } + Object reduceOnlyValue = getReduceOnly(); + if (reduceOnlyValue != null) { + valMap.put("reduceOnly", reduceOnlyValue); + } + Object createTimeValue = getCreateTime(); + if (createTimeValue != null) { + valMap.put("createTime", createTimeValue); + } + Object updateTimeValue = getUpdateTime(); + if (updateTimeValue != null) { + valMap.put("updateTime", updateTimeValue); + } + Object triggerTimeValue = getTriggerTime(); + if (triggerTimeValue != null) { + valMap.put("triggerTime", triggerTimeValue); + } + Object goodTillDateValue = getGoodTillDate(); + if (goodTillDateValue != null) { + valMap.put("goodTillDate", goodTillDateValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("algoId"); + openapiFields.add("clientAlgoId"); + openapiFields.add("algoType"); + openapiFields.add("orderType"); + openapiFields.add("symbol"); + openapiFields.add("side"); + openapiFields.add("positionSide"); + openapiFields.add("timeInForce"); + openapiFields.add("quantity"); + openapiFields.add("algoStatus"); + openapiFields.add("triggerPrice"); + openapiFields.add("price"); + openapiFields.add("icebergQuantity"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("workingType"); + openapiFields.add("priceMatch"); + openapiFields.add("closePosition"); + openapiFields.add("priceProtect"); + openapiFields.add("reduceOnly"); + openapiFields.add("createTime"); + openapiFields.add("updateTime"); + openapiFields.add("triggerTime"); + openapiFields.add("goodTillDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CancelAlgoOrderResponseResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CancelAlgoOrderResponseResult.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CancelAlgoOrderResponseResult is not" + + " found in the empty JSON string", + CancelAlgoOrderResponseResult.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CancelAlgoOrderResponseResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CancelAlgoOrderResponseResult` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("clientAlgoId") != null && !jsonObj.get("clientAlgoId").isJsonNull()) + && !jsonObj.get("clientAlgoId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientAlgoId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientAlgoId").toString())); + } + if ((jsonObj.get("algoType") != null && !jsonObj.get("algoType").isJsonNull()) + && !jsonObj.get("algoType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoType").toString())); + } + if ((jsonObj.get("orderType") != null && !jsonObj.get("orderType").isJsonNull()) + && !jsonObj.get("orderType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("orderType").toString())); + } + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) + && !jsonObj.get("side").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `side` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("side").toString())); + } + if ((jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) + && !jsonObj.get("positionSide").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `positionSide` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("positionSide").toString())); + } + if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) + && !jsonObj.get("timeInForce").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timeInForce` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timeInForce").toString())); + } + if ((jsonObj.get("quantity") != null && !jsonObj.get("quantity").isJsonNull()) + && !jsonObj.get("quantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quantity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("quantity").toString())); + } + if ((jsonObj.get("algoStatus") != null && !jsonObj.get("algoStatus").isJsonNull()) + && !jsonObj.get("algoStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoStatus` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoStatus").toString())); + } + if ((jsonObj.get("triggerPrice") != null && !jsonObj.get("triggerPrice").isJsonNull()) + && !jsonObj.get("triggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `triggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("triggerPrice").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("icebergQuantity") != null && !jsonObj.get("icebergQuantity").isJsonNull()) + && !jsonObj.get("icebergQuantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `icebergQuantity` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("icebergQuantity").toString())); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) + && !jsonObj.get("workingType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workingType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workingType").toString())); + } + if ((jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) + && !jsonObj.get("priceMatch").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceMatch` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceMatch").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CancelAlgoOrderResponseResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CancelAlgoOrderResponseResult' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CancelAlgoOrderResponseResult.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CancelAlgoOrderResponseResult value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CancelAlgoOrderResponseResult read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CancelAlgoOrderResponseResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of CancelAlgoOrderResponseResult + * @throws IOException if the JSON string is invalid with respect to + * CancelAlgoOrderResponseResult + */ + public static CancelAlgoOrderResponseResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CancelAlgoOrderResponseResult.class); + } + + /** + * Convert an instance of CancelAlgoOrderResponseResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelOrderResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelOrderResponse.java index c4fa5d74..c3aa53ca 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelOrderResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelOrderResponse.java @@ -65,7 +65,7 @@ public class CancelOrderResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid CancelOrderResponseRateLimitsInner> rateLimits; + private List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimits; public CancelOrderResponse() {} @@ -130,13 +130,13 @@ public void setResult(@jakarta.annotation.Nullable CancelOrderResponseResult res public CancelOrderResponse rateLimits( @jakarta.annotation.Nullable - List<@Valid CancelOrderResponseRateLimitsInner> rateLimits) { + List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimits) { this.rateLimits = rateLimits; return this; } public CancelOrderResponse addRateLimitsItem( - CancelOrderResponseRateLimitsInner rateLimitsItem) { + CancelAlgoOrderResponseRateLimitsInner rateLimitsItem) { if (this.rateLimits == null) { this.rateLimits = new ArrayList<>(); } @@ -151,13 +151,13 @@ public CancelOrderResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid CancelOrderResponseRateLimitsInner> getRateLimits() { + public List<@Valid CancelAlgoOrderResponseRateLimitsInner> getRateLimits() { return rateLimits; } public void setRateLimits( @jakarta.annotation.Nullable - List<@Valid CancelOrderResponseRateLimitsInner> rateLimits) { + List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimits) { this.rateLimits = rateLimits; } @@ -212,7 +212,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid CancelOrderResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -335,7 +335,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `rateLimits` (array) for (int i = 0; i < jsonArrayrateLimits.size(); i++) { - CancelOrderResponseRateLimitsInner.validateJsonElement( + CancelAlgoOrderResponseRateLimitsInner.validateJsonElement( jsonArrayrateLimits.get(i)); } ; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/NewAlgoOrderRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/NewAlgoOrderRequest.java new file mode 100644 index 00000000..28e485b9 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/NewAlgoOrderRequest.java @@ -0,0 +1,1119 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model; + +import com.binance.connector.client.common.DecimalFormatter; +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** NewAlgoOrderRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class NewAlgoOrderRequest extends BaseDTO { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @jakarta.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_ALGO_TYPE = "algoType"; + + @SerializedName(SERIALIZED_NAME_ALGO_TYPE) + @jakarta.annotation.Nonnull + private String algoType; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nonnull + private String symbol; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nonnull + private Side side; + + public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; + + @SerializedName(SERIALIZED_NAME_POSITION_SIDE) + @jakarta.annotation.Nullable + private PositionSide positionSide; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private TimeInForce timeInForce; + + public static final String SERIALIZED_NAME_QUANTITY = "quantity"; + + @SerializedName(SERIALIZED_NAME_QUANTITY) + @jakarta.annotation.Nullable + private Double quantity; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private Double price; + + public static final String SERIALIZED_NAME_TRIGGER_PRICE = "triggerPrice"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private Double triggerPrice; + + public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nullable + private WorkingType workingType; + + public static final String SERIALIZED_NAME_PRICE_MATCH = "priceMatch"; + + @SerializedName(SERIALIZED_NAME_PRICE_MATCH) + @jakarta.annotation.Nullable + private PriceMatch priceMatch; + + public static final String SERIALIZED_NAME_CLOSE_POSITION = "closePosition"; + + @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) + @jakarta.annotation.Nullable + private String closePosition; + + public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; + + @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) + @jakarta.annotation.Nullable + private String priceProtect; + + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; + + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @jakarta.annotation.Nullable + private String reduceOnly; + + public static final String SERIALIZED_NAME_ACTIVATION_PRICE = "activationPrice"; + + @SerializedName(SERIALIZED_NAME_ACTIVATION_PRICE) + @jakarta.annotation.Nullable + private Double activationPrice; + + public static final String SERIALIZED_NAME_CALLBACK_RATE = "callbackRate"; + + @SerializedName(SERIALIZED_NAME_CALLBACK_RATE) + @jakarta.annotation.Nullable + private Double callbackRate; + + public static final String SERIALIZED_NAME_CLIENT_ALGO_ID = "clientAlgoId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ALGO_ID) + @jakarta.annotation.Nullable + private String clientAlgoId; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private SelfTradePreventionMode selfTradePreventionMode; + + public static final String SERIALIZED_NAME_GOOD_TILL_DATE = "goodTillDate"; + + @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) + @jakarta.annotation.Nullable + private Long goodTillDate; + + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Long recvWindow; + + public NewAlgoOrderRequest() {} + + public NewAlgoOrderRequest id(@jakarta.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @jakarta.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@jakarta.annotation.Nullable String id) { + this.id = id; + } + + public NewAlgoOrderRequest algoType(@jakarta.annotation.Nonnull String algoType) { + this.algoType = algoType; + return this; + } + + /** + * Get algoType + * + * @return algoType + */ + @jakarta.annotation.Nonnull + @NotNull + public String getAlgoType() { + return algoType; + } + + public void setAlgoType(@jakarta.annotation.Nonnull String algoType) { + this.algoType = algoType; + } + + public NewAlgoOrderRequest symbol(@jakarta.annotation.Nonnull String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nonnull + @NotNull + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nonnull String symbol) { + this.symbol = symbol; + } + + public NewAlgoOrderRequest side(@jakarta.annotation.Nonnull Side side) { + this.side = side; + return this; + } + + /** + * Get side + * + * @return side + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Side getSide() { + return side; + } + + public void setSide(@jakarta.annotation.Nonnull Side side) { + this.side = side; + } + + public NewAlgoOrderRequest positionSide( + @jakarta.annotation.Nullable PositionSide positionSide) { + this.positionSide = positionSide; + return this; + } + + /** + * Get positionSide + * + * @return positionSide + */ + @jakarta.annotation.Nullable + @Valid + public PositionSide getPositionSide() { + return positionSide; + } + + public void setPositionSide(@jakarta.annotation.Nullable PositionSide positionSide) { + this.positionSide = positionSide; + } + + public NewAlgoOrderRequest type(@jakarta.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nonnull + @NotNull + public String getType() { + return type; + } + + public void setType(@jakarta.annotation.Nonnull String type) { + this.type = type; + } + + public NewAlgoOrderRequest timeInForce(@jakarta.annotation.Nullable TimeInForce timeInForce) { + this.timeInForce = timeInForce; + return this; + } + + /** + * Get timeInForce + * + * @return timeInForce + */ + @jakarta.annotation.Nullable + @Valid + public TimeInForce getTimeInForce() { + return timeInForce; + } + + public void setTimeInForce(@jakarta.annotation.Nullable TimeInForce timeInForce) { + this.timeInForce = timeInForce; + } + + public NewAlgoOrderRequest quantity(@jakarta.annotation.Nullable Double quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity + */ + @jakarta.annotation.Nullable + @Valid + public Double getQuantity() { + return quantity; + } + + public void setQuantity(@jakarta.annotation.Nullable Double quantity) { + this.quantity = quantity; + } + + public NewAlgoOrderRequest price(@jakarta.annotation.Nullable Double price) { + this.price = price; + return this; + } + + /** + * Get price + * + * @return price + */ + @jakarta.annotation.Nullable + @Valid + public Double getPrice() { + return price; + } + + public void setPrice(@jakarta.annotation.Nullable Double price) { + this.price = price; + } + + public NewAlgoOrderRequest triggerPrice(@jakarta.annotation.Nullable Double triggerPrice) { + this.triggerPrice = triggerPrice; + return this; + } + + /** + * Get triggerPrice + * + * @return triggerPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getTriggerPrice() { + return triggerPrice; + } + + public void setTriggerPrice(@jakarta.annotation.Nullable Double triggerPrice) { + this.triggerPrice = triggerPrice; + } + + public NewAlgoOrderRequest workingType(@jakarta.annotation.Nullable WorkingType workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nullable + @Valid + public WorkingType getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nullable WorkingType workingType) { + this.workingType = workingType; + } + + public NewAlgoOrderRequest priceMatch(@jakarta.annotation.Nullable PriceMatch priceMatch) { + this.priceMatch = priceMatch; + return this; + } + + /** + * Get priceMatch + * + * @return priceMatch + */ + @jakarta.annotation.Nullable + @Valid + public PriceMatch getPriceMatch() { + return priceMatch; + } + + public void setPriceMatch(@jakarta.annotation.Nullable PriceMatch priceMatch) { + this.priceMatch = priceMatch; + } + + public NewAlgoOrderRequest closePosition(@jakarta.annotation.Nullable String closePosition) { + this.closePosition = closePosition; + return this; + } + + /** + * Get closePosition + * + * @return closePosition + */ + @jakarta.annotation.Nullable + public String getClosePosition() { + return closePosition; + } + + public void setClosePosition(@jakarta.annotation.Nullable String closePosition) { + this.closePosition = closePosition; + } + + public NewAlgoOrderRequest priceProtect(@jakarta.annotation.Nullable String priceProtect) { + this.priceProtect = priceProtect; + return this; + } + + /** + * Get priceProtect + * + * @return priceProtect + */ + @jakarta.annotation.Nullable + public String getPriceProtect() { + return priceProtect; + } + + public void setPriceProtect(@jakarta.annotation.Nullable String priceProtect) { + this.priceProtect = priceProtect; + } + + public NewAlgoOrderRequest reduceOnly(@jakarta.annotation.Nullable String reduceOnly) { + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Get reduceOnly + * + * @return reduceOnly + */ + @jakarta.annotation.Nullable + public String getReduceOnly() { + return reduceOnly; + } + + public void setReduceOnly(@jakarta.annotation.Nullable String reduceOnly) { + this.reduceOnly = reduceOnly; + } + + public NewAlgoOrderRequest activationPrice( + @jakarta.annotation.Nullable Double activationPrice) { + this.activationPrice = activationPrice; + return this; + } + + /** + * Get activationPrice + * + * @return activationPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getActivationPrice() { + return activationPrice; + } + + public void setActivationPrice(@jakarta.annotation.Nullable Double activationPrice) { + this.activationPrice = activationPrice; + } + + public NewAlgoOrderRequest callbackRate(@jakarta.annotation.Nullable Double callbackRate) { + this.callbackRate = callbackRate; + return this; + } + + /** + * Get callbackRate + * + * @return callbackRate + */ + @jakarta.annotation.Nullable + @Valid + public Double getCallbackRate() { + return callbackRate; + } + + public void setCallbackRate(@jakarta.annotation.Nullable Double callbackRate) { + this.callbackRate = callbackRate; + } + + public NewAlgoOrderRequest clientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + return this; + } + + /** + * Get clientAlgoId + * + * @return clientAlgoId + */ + @jakarta.annotation.Nullable + public String getClientAlgoId() { + return clientAlgoId; + } + + public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + } + + public NewAlgoOrderRequest selfTradePreventionMode( + @jakarta.annotation.Nullable SelfTradePreventionMode selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + @Valid + public SelfTradePreventionMode getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable SelfTradePreventionMode selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + + public NewAlgoOrderRequest goodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + return this; + } + + /** + * Get goodTillDate + * + * @return goodTillDate + */ + @jakarta.annotation.Nullable + public Long getGoodTillDate() { + return goodTillDate; + } + + public void setGoodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + } + + public NewAlgoOrderRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + public Long getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewAlgoOrderRequest newAlgoOrderRequest = (NewAlgoOrderRequest) o; + return Objects.equals(this.id, newAlgoOrderRequest.id) + && Objects.equals(this.algoType, newAlgoOrderRequest.algoType) + && Objects.equals(this.symbol, newAlgoOrderRequest.symbol) + && Objects.equals(this.side, newAlgoOrderRequest.side) + && Objects.equals(this.positionSide, newAlgoOrderRequest.positionSide) + && Objects.equals(this.type, newAlgoOrderRequest.type) + && Objects.equals(this.timeInForce, newAlgoOrderRequest.timeInForce) + && Objects.equals(this.quantity, newAlgoOrderRequest.quantity) + && Objects.equals(this.price, newAlgoOrderRequest.price) + && Objects.equals(this.triggerPrice, newAlgoOrderRequest.triggerPrice) + && Objects.equals(this.workingType, newAlgoOrderRequest.workingType) + && Objects.equals(this.priceMatch, newAlgoOrderRequest.priceMatch) + && Objects.equals(this.closePosition, newAlgoOrderRequest.closePosition) + && Objects.equals(this.priceProtect, newAlgoOrderRequest.priceProtect) + && Objects.equals(this.reduceOnly, newAlgoOrderRequest.reduceOnly) + && Objects.equals(this.activationPrice, newAlgoOrderRequest.activationPrice) + && Objects.equals(this.callbackRate, newAlgoOrderRequest.callbackRate) + && Objects.equals(this.clientAlgoId, newAlgoOrderRequest.clientAlgoId) + && Objects.equals( + this.selfTradePreventionMode, newAlgoOrderRequest.selfTradePreventionMode) + && Objects.equals(this.goodTillDate, newAlgoOrderRequest.goodTillDate) + && Objects.equals(this.recvWindow, newAlgoOrderRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + algoType, + symbol, + side, + positionSide, + type, + timeInForce, + quantity, + price, + triggerPrice, + workingType, + priceMatch, + closePosition, + priceProtect, + reduceOnly, + activationPrice, + callbackRate, + clientAlgoId, + selfTradePreventionMode, + goodTillDate, + recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewAlgoOrderRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" algoType: ").append(toIndentedString(algoType)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); + sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); + sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" activationPrice: ").append(toIndentedString(activationPrice)).append("\n"); + sb.append(" callbackRate: ").append(toIndentedString(callbackRate)).append("\n"); + sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" goodTillDate: ").append(toIndentedString(goodTillDate)).append("\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String idValue = getId(); + if (idValue != null) { + String idValueAsString = idValue.toString(); + valMap.put("id", idValueAsString); + } + String algoTypeValue = getAlgoType(); + if (algoTypeValue != null) { + String algoTypeValueAsString = algoTypeValue.toString(); + valMap.put("algoType", algoTypeValueAsString); + } + String symbolValue = getSymbol(); + if (symbolValue != null) { + String symbolValueAsString = symbolValue.toString(); + valMap.put("symbol", symbolValueAsString); + } + Side sideValue = getSide(); + if (sideValue != null) { + String sideValueAsString = sideValue.toString(); + valMap.put("side", sideValueAsString); + } + PositionSide positionSideValue = getPositionSide(); + if (positionSideValue != null) { + String positionSideValueAsString = positionSideValue.toString(); + valMap.put("positionSide", positionSideValueAsString); + } + String typeValue = getType(); + if (typeValue != null) { + String typeValueAsString = typeValue.toString(); + valMap.put("type", typeValueAsString); + } + TimeInForce timeInForceValue = getTimeInForce(); + if (timeInForceValue != null) { + String timeInForceValueAsString = timeInForceValue.toString(); + valMap.put("timeInForce", timeInForceValueAsString); + } + Double quantityValue = getQuantity(); + if (quantityValue != null) { + String quantityValueAsString = DecimalFormatter.getFormatter().format(quantityValue); + valMap.put("quantity", quantityValueAsString); + } + Double priceValue = getPrice(); + if (priceValue != null) { + String priceValueAsString = DecimalFormatter.getFormatter().format(priceValue); + valMap.put("price", priceValueAsString); + } + Double triggerPriceValue = getTriggerPrice(); + if (triggerPriceValue != null) { + String triggerPriceValueAsString = + DecimalFormatter.getFormatter().format(triggerPriceValue); + valMap.put("triggerPrice", triggerPriceValueAsString); + } + WorkingType workingTypeValue = getWorkingType(); + if (workingTypeValue != null) { + String workingTypeValueAsString = workingTypeValue.toString(); + valMap.put("workingType", workingTypeValueAsString); + } + PriceMatch priceMatchValue = getPriceMatch(); + if (priceMatchValue != null) { + String priceMatchValueAsString = priceMatchValue.toString(); + valMap.put("priceMatch", priceMatchValueAsString); + } + String closePositionValue = getClosePosition(); + if (closePositionValue != null) { + String closePositionValueAsString = closePositionValue.toString(); + valMap.put("closePosition", closePositionValueAsString); + } + String priceProtectValue = getPriceProtect(); + if (priceProtectValue != null) { + String priceProtectValueAsString = priceProtectValue.toString(); + valMap.put("priceProtect", priceProtectValueAsString); + } + String reduceOnlyValue = getReduceOnly(); + if (reduceOnlyValue != null) { + String reduceOnlyValueAsString = reduceOnlyValue.toString(); + valMap.put("reduceOnly", reduceOnlyValueAsString); + } + Double activationPriceValue = getActivationPrice(); + if (activationPriceValue != null) { + String activationPriceValueAsString = + DecimalFormatter.getFormatter().format(activationPriceValue); + valMap.put("activationPrice", activationPriceValueAsString); + } + Double callbackRateValue = getCallbackRate(); + if (callbackRateValue != null) { + String callbackRateValueAsString = + DecimalFormatter.getFormatter().format(callbackRateValue); + valMap.put("callbackRate", callbackRateValueAsString); + } + String clientAlgoIdValue = getClientAlgoId(); + if (clientAlgoIdValue != null) { + String clientAlgoIdValueAsString = clientAlgoIdValue.toString(); + valMap.put("clientAlgoId", clientAlgoIdValueAsString); + } + SelfTradePreventionMode selfTradePreventionModeValue = getSelfTradePreventionMode(); + if (selfTradePreventionModeValue != null) { + String selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + valMap.put("selfTradePreventionMode", selfTradePreventionModeValueAsString); + } + Long goodTillDateValue = getGoodTillDate(); + if (goodTillDateValue != null) { + String goodTillDateValueAsString = goodTillDateValue.toString(); + valMap.put("goodTillDate", goodTillDateValueAsString); + } + Long recvWindowValue = getRecvWindow(); + if (recvWindowValue != null) { + String recvWindowValueAsString = recvWindowValue.toString(); + valMap.put("recvWindow", recvWindowValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object idValue = getId(); + if (idValue != null) { + valMap.put("id", idValue); + } + Object algoTypeValue = getAlgoType(); + if (algoTypeValue != null) { + valMap.put("algoType", algoTypeValue); + } + Object symbolValue = getSymbol(); + if (symbolValue != null) { + valMap.put("symbol", symbolValue); + } + Object sideValue = getSide(); + if (sideValue != null) { + valMap.put("side", sideValue); + } + Object positionSideValue = getPositionSide(); + if (positionSideValue != null) { + valMap.put("positionSide", positionSideValue); + } + Object typeValue = getType(); + if (typeValue != null) { + valMap.put("type", typeValue); + } + Object timeInForceValue = getTimeInForce(); + if (timeInForceValue != null) { + valMap.put("timeInForce", timeInForceValue); + } + Object quantityValue = getQuantity(); + if (quantityValue != null) { + valMap.put("quantity", quantityValue); + } + Object priceValue = getPrice(); + if (priceValue != null) { + valMap.put("price", priceValue); + } + Object triggerPriceValue = getTriggerPrice(); + if (triggerPriceValue != null) { + valMap.put("triggerPrice", triggerPriceValue); + } + Object workingTypeValue = getWorkingType(); + if (workingTypeValue != null) { + valMap.put("workingType", workingTypeValue); + } + Object priceMatchValue = getPriceMatch(); + if (priceMatchValue != null) { + valMap.put("priceMatch", priceMatchValue); + } + Object closePositionValue = getClosePosition(); + if (closePositionValue != null) { + valMap.put("closePosition", closePositionValue); + } + Object priceProtectValue = getPriceProtect(); + if (priceProtectValue != null) { + valMap.put("priceProtect", priceProtectValue); + } + Object reduceOnlyValue = getReduceOnly(); + if (reduceOnlyValue != null) { + valMap.put("reduceOnly", reduceOnlyValue); + } + Object activationPriceValue = getActivationPrice(); + if (activationPriceValue != null) { + valMap.put("activationPrice", activationPriceValue); + } + Object callbackRateValue = getCallbackRate(); + if (callbackRateValue != null) { + valMap.put("callbackRate", callbackRateValue); + } + Object clientAlgoIdValue = getClientAlgoId(); + if (clientAlgoIdValue != null) { + valMap.put("clientAlgoId", clientAlgoIdValue); + } + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + if (selfTradePreventionModeValue != null) { + valMap.put("selfTradePreventionMode", selfTradePreventionModeValue); + } + Object goodTillDateValue = getGoodTillDate(); + if (goodTillDateValue != null) { + valMap.put("goodTillDate", goodTillDateValue); + } + Object recvWindowValue = getRecvWindow(); + if (recvWindowValue != null) { + valMap.put("recvWindow", recvWindowValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("algoType"); + openapiFields.add("symbol"); + openapiFields.add("side"); + openapiFields.add("positionSide"); + openapiFields.add("type"); + openapiFields.add("timeInForce"); + openapiFields.add("quantity"); + openapiFields.add("price"); + openapiFields.add("triggerPrice"); + openapiFields.add("workingType"); + openapiFields.add("priceMatch"); + openapiFields.add("closePosition"); + openapiFields.add("priceProtect"); + openapiFields.add("reduceOnly"); + openapiFields.add("activationPrice"); + openapiFields.add("callbackRate"); + openapiFields.add("clientAlgoId"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("goodTillDate"); + openapiFields.add("recvWindow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("algoType"); + openapiRequiredFields.add("symbol"); + openapiRequiredFields.add("side"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewAlgoOrderRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewAlgoOrderRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in NewAlgoOrderRequest is not found in" + + " the empty JSON string", + NewAlgoOrderRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewAlgoOrderRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `NewAlgoOrderRequest` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewAlgoOrderRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("algoType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoType").toString())); + } + if (!jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + // validate the required field `side` + Side.validateJsonElement(jsonObj.get("side")); + // validate the optional field `positionSide` + if (jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) { + PositionSide.validateJsonElement(jsonObj.get("positionSide")); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + // validate the optional field `timeInForce` + if (jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) { + TimeInForce.validateJsonElement(jsonObj.get("timeInForce")); + } + // validate the optional field `workingType` + if (jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) { + WorkingType.validateJsonElement(jsonObj.get("workingType")); + } + // validate the optional field `priceMatch` + if (jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) { + PriceMatch.validateJsonElement(jsonObj.get("priceMatch")); + } + if ((jsonObj.get("closePosition") != null && !jsonObj.get("closePosition").isJsonNull()) + && !jsonObj.get("closePosition").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `closePosition` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("closePosition").toString())); + } + if ((jsonObj.get("priceProtect") != null && !jsonObj.get("priceProtect").isJsonNull()) + && !jsonObj.get("priceProtect").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceProtect` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceProtect").toString())); + } + if ((jsonObj.get("reduceOnly") != null && !jsonObj.get("reduceOnly").isJsonNull()) + && !jsonObj.get("reduceOnly").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `reduceOnly` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("reduceOnly").toString())); + } + if ((jsonObj.get("clientAlgoId") != null && !jsonObj.get("clientAlgoId").isJsonNull()) + && !jsonObj.get("clientAlgoId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientAlgoId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientAlgoId").toString())); + } + // validate the optional field `selfTradePreventionMode` + if (jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) { + SelfTradePreventionMode.validateJsonElement(jsonObj.get("selfTradePreventionMode")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewAlgoOrderRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewAlgoOrderRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NewAlgoOrderRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NewAlgoOrderRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewAlgoOrderRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NewAlgoOrderRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewAlgoOrderRequest + * @throws IOException if the JSON string is invalid with respect to NewAlgoOrderRequest + */ + public static NewAlgoOrderRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewAlgoOrderRequest.class); + } + + /** + * Convert an instance of NewAlgoOrderRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/NewAlgoOrderResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/NewAlgoOrderResponse.java new file mode 100644 index 00000000..9efe6ab5 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/NewAlgoOrderResponse.java @@ -0,0 +1,395 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** NewAlgoOrderResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class NewAlgoOrderResponse extends BaseDTO { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @jakarta.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private Long status; + + public static final String SERIALIZED_NAME_RESULT = "result"; + + @SerializedName(SERIALIZED_NAME_RESULT) + @jakarta.annotation.Nullable + private NewAlgoOrderResponseResult result; + + public static final String SERIALIZED_NAME_RATE_LIMITS = "rateLimits"; + + @SerializedName(SERIALIZED_NAME_RATE_LIMITS) + @jakarta.annotation.Nullable + private List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimits; + + public NewAlgoOrderResponse() {} + + public NewAlgoOrderResponse id(@jakarta.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @jakarta.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@jakarta.annotation.Nullable String id) { + this.id = id; + } + + public NewAlgoOrderResponse status(@jakarta.annotation.Nullable Long status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @jakarta.annotation.Nullable + public Long getStatus() { + return status; + } + + public void setStatus(@jakarta.annotation.Nullable Long status) { + this.status = status; + } + + public NewAlgoOrderResponse result( + @jakarta.annotation.Nullable NewAlgoOrderResponseResult result) { + this.result = result; + return this; + } + + /** + * Get result + * + * @return result + */ + @jakarta.annotation.Nullable + @Valid + public NewAlgoOrderResponseResult getResult() { + return result; + } + + public void setResult(@jakarta.annotation.Nullable NewAlgoOrderResponseResult result) { + this.result = result; + } + + public NewAlgoOrderResponse rateLimits( + @jakarta.annotation.Nullable + List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimits) { + this.rateLimits = rateLimits; + return this; + } + + public NewAlgoOrderResponse addRateLimitsItem( + CancelAlgoOrderResponseRateLimitsInner rateLimitsItem) { + if (this.rateLimits == null) { + this.rateLimits = new ArrayList<>(); + } + this.rateLimits.add(rateLimitsItem); + return this; + } + + /** + * Get rateLimits + * + * @return rateLimits + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid CancelAlgoOrderResponseRateLimitsInner> getRateLimits() { + return rateLimits; + } + + public void setRateLimits( + @jakarta.annotation.Nullable + List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimits) { + this.rateLimits = rateLimits; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewAlgoOrderResponse newAlgoOrderResponse = (NewAlgoOrderResponse) o; + return Objects.equals(this.id, newAlgoOrderResponse.id) + && Objects.equals(this.status, newAlgoOrderResponse.status) + && Objects.equals(this.result, newAlgoOrderResponse.result) + && Objects.equals(this.rateLimits, newAlgoOrderResponse.rateLimits); + } + + @Override + public int hashCode() { + return Objects.hash(id, status, result, rateLimits); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewAlgoOrderResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append(" rateLimits: ").append(toIndentedString(rateLimits)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String idValue = getId(); + if (idValue != null) { + String idValueAsString = idValue.toString(); + valMap.put("id", idValueAsString); + } + Long statusValue = getStatus(); + if (statusValue != null) { + String statusValueAsString = statusValue.toString(); + valMap.put("status", statusValueAsString); + } + NewAlgoOrderResponseResult resultValue = getResult(); + if (resultValue != null) { + String resultValueAsString = JSON.getGson().toJson(resultValue); + valMap.put("result", resultValueAsString); + } + List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + if (rateLimitsValue != null) { + String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); + valMap.put("rateLimits", rateLimitsValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object idValue = getId(); + if (idValue != null) { + valMap.put("id", idValue); + } + Object statusValue = getStatus(); + if (statusValue != null) { + valMap.put("status", statusValue); + } + Object resultValue = getResult(); + if (resultValue != null) { + valMap.put("result", resultValue); + } + Object rateLimitsValue = getRateLimits(); + if (rateLimitsValue != null) { + valMap.put("rateLimits", rateLimitsValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("status"); + openapiFields.add("result"); + openapiFields.add("rateLimits"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewAlgoOrderResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewAlgoOrderResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in NewAlgoOrderResponse is not found in" + + " the empty JSON string", + NewAlgoOrderResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewAlgoOrderResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `NewAlgoOrderResponse` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + // validate the optional field `result` + if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { + NewAlgoOrderResponseResult.validateJsonElement(jsonObj.get("result")); + } + if (jsonObj.get("rateLimits") != null && !jsonObj.get("rateLimits").isJsonNull()) { + JsonArray jsonArrayrateLimits = jsonObj.getAsJsonArray("rateLimits"); + if (jsonArrayrateLimits != null) { + // ensure the json data is an array + if (!jsonObj.get("rateLimits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimits` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimits").toString())); + } + + // validate the optional field `rateLimits` (array) + for (int i = 0; i < jsonArrayrateLimits.size(); i++) { + CancelAlgoOrderResponseRateLimitsInner.validateJsonElement( + jsonArrayrateLimits.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewAlgoOrderResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewAlgoOrderResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NewAlgoOrderResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NewAlgoOrderResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewAlgoOrderResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NewAlgoOrderResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewAlgoOrderResponse + * @throws IOException if the JSON string is invalid with respect to NewAlgoOrderResponse + */ + public static NewAlgoOrderResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewAlgoOrderResponse.class); + } + + /** + * Convert an instance of NewAlgoOrderResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/NewAlgoOrderResponseResult.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/NewAlgoOrderResponseResult.java new file mode 100644 index 00000000..1dbbd557 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/NewAlgoOrderResponseResult.java @@ -0,0 +1,1204 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** NewAlgoOrderResponseResult */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class NewAlgoOrderResponseResult extends BaseDTO { + public static final String SERIALIZED_NAME_ALGO_ID = "algoId"; + + @SerializedName(SERIALIZED_NAME_ALGO_ID) + @jakarta.annotation.Nullable + private Long algoId; + + public static final String SERIALIZED_NAME_CLIENT_ALGO_ID = "clientAlgoId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ALGO_ID) + @jakarta.annotation.Nullable + private String clientAlgoId; + + public static final String SERIALIZED_NAME_ALGO_TYPE = "algoType"; + + @SerializedName(SERIALIZED_NAME_ALGO_TYPE) + @jakarta.annotation.Nullable + private String algoType; + + public static final String SERIALIZED_NAME_ORDER_TYPE = "orderType"; + + @SerializedName(SERIALIZED_NAME_ORDER_TYPE) + @jakarta.annotation.Nullable + private String orderType; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private String side; + + public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; + + @SerializedName(SERIALIZED_NAME_POSITION_SIDE) + @jakarta.annotation.Nullable + private String positionSide; + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private String timeInForce; + + public static final String SERIALIZED_NAME_QUANTITY = "quantity"; + + @SerializedName(SERIALIZED_NAME_QUANTITY) + @jakarta.annotation.Nullable + private String quantity; + + public static final String SERIALIZED_NAME_ALGO_STATUS = "algoStatus"; + + @SerializedName(SERIALIZED_NAME_ALGO_STATUS) + @jakarta.annotation.Nullable + private String algoStatus; + + public static final String SERIALIZED_NAME_TRIGGER_PRICE = "triggerPrice"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_PRICE) + @jakarta.annotation.Nullable + private String triggerPrice; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_ICEBERG_QUANTITY = "icebergQuantity"; + + @SerializedName(SERIALIZED_NAME_ICEBERG_QUANTITY) + @jakarta.annotation.Nullable + private String icebergQuantity; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private String selfTradePreventionMode; + + public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; + + @SerializedName(SERIALIZED_NAME_WORKING_TYPE) + @jakarta.annotation.Nullable + private String workingType; + + public static final String SERIALIZED_NAME_PRICE_MATCH = "priceMatch"; + + @SerializedName(SERIALIZED_NAME_PRICE_MATCH) + @jakarta.annotation.Nullable + private String priceMatch; + + public static final String SERIALIZED_NAME_CLOSE_POSITION = "closePosition"; + + @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) + @jakarta.annotation.Nullable + private Boolean closePosition; + + public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; + + @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) + @jakarta.annotation.Nullable + private Boolean priceProtect; + + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; + + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @jakarta.annotation.Nullable + private Boolean reduceOnly; + + public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; + + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + @jakarta.annotation.Nullable + private Long createTime; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; + + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + @jakarta.annotation.Nullable + private Long updateTime; + + public static final String SERIALIZED_NAME_TRIGGER_TIME = "triggerTime"; + + @SerializedName(SERIALIZED_NAME_TRIGGER_TIME) + @jakarta.annotation.Nullable + private Long triggerTime; + + public static final String SERIALIZED_NAME_GOOD_TILL_DATE = "goodTillDate"; + + @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) + @jakarta.annotation.Nullable + private Long goodTillDate; + + public NewAlgoOrderResponseResult() {} + + public NewAlgoOrderResponseResult algoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + return this; + } + + /** + * Get algoId + * + * @return algoId + */ + @jakarta.annotation.Nullable + public Long getAlgoId() { + return algoId; + } + + public void setAlgoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; + } + + public NewAlgoOrderResponseResult clientAlgoId( + @jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + return this; + } + + /** + * Get clientAlgoId + * + * @return clientAlgoId + */ + @jakarta.annotation.Nullable + public String getClientAlgoId() { + return clientAlgoId; + } + + public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; + } + + public NewAlgoOrderResponseResult algoType(@jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + return this; + } + + /** + * Get algoType + * + * @return algoType + */ + @jakarta.annotation.Nullable + public String getAlgoType() { + return algoType; + } + + public void setAlgoType(@jakarta.annotation.Nullable String algoType) { + this.algoType = algoType; + } + + public NewAlgoOrderResponseResult orderType(@jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + return this; + } + + /** + * Get orderType + * + * @return orderType + */ + @jakarta.annotation.Nullable + public String getOrderType() { + return orderType; + } + + public void setOrderType(@jakarta.annotation.Nullable String orderType) { + this.orderType = orderType; + } + + public NewAlgoOrderResponseResult symbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nullable + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nullable String symbol) { + this.symbol = symbol; + } + + public NewAlgoOrderResponseResult side(@jakarta.annotation.Nullable String side) { + this.side = side; + return this; + } + + /** + * Get side + * + * @return side + */ + @jakarta.annotation.Nullable + public String getSide() { + return side; + } + + public void setSide(@jakarta.annotation.Nullable String side) { + this.side = side; + } + + public NewAlgoOrderResponseResult positionSide( + @jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + return this; + } + + /** + * Get positionSide + * + * @return positionSide + */ + @jakarta.annotation.Nullable + public String getPositionSide() { + return positionSide; + } + + public void setPositionSide(@jakarta.annotation.Nullable String positionSide) { + this.positionSide = positionSide; + } + + public NewAlgoOrderResponseResult timeInForce(@jakarta.annotation.Nullable String timeInForce) { + this.timeInForce = timeInForce; + return this; + } + + /** + * Get timeInForce + * + * @return timeInForce + */ + @jakarta.annotation.Nullable + public String getTimeInForce() { + return timeInForce; + } + + public void setTimeInForce(@jakarta.annotation.Nullable String timeInForce) { + this.timeInForce = timeInForce; + } + + public NewAlgoOrderResponseResult quantity(@jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity + */ + @jakarta.annotation.Nullable + public String getQuantity() { + return quantity; + } + + public void setQuantity(@jakarta.annotation.Nullable String quantity) { + this.quantity = quantity; + } + + public NewAlgoOrderResponseResult algoStatus(@jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + return this; + } + + /** + * Get algoStatus + * + * @return algoStatus + */ + @jakarta.annotation.Nullable + public String getAlgoStatus() { + return algoStatus; + } + + public void setAlgoStatus(@jakarta.annotation.Nullable String algoStatus) { + this.algoStatus = algoStatus; + } + + public NewAlgoOrderResponseResult triggerPrice( + @jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + return this; + } + + /** + * Get triggerPrice + * + * @return triggerPrice + */ + @jakarta.annotation.Nullable + public String getTriggerPrice() { + return triggerPrice; + } + + public void setTriggerPrice(@jakarta.annotation.Nullable String triggerPrice) { + this.triggerPrice = triggerPrice; + } + + public NewAlgoOrderResponseResult price(@jakarta.annotation.Nullable String price) { + this.price = price; + return this; + } + + /** + * Get price + * + * @return price + */ + @jakarta.annotation.Nullable + public String getPrice() { + return price; + } + + public void setPrice(@jakarta.annotation.Nullable String price) { + this.price = price; + } + + public NewAlgoOrderResponseResult icebergQuantity( + @jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + return this; + } + + /** + * Get icebergQuantity + * + * @return icebergQuantity + */ + @jakarta.annotation.Nullable + public String getIcebergQuantity() { + return icebergQuantity; + } + + public void setIcebergQuantity(@jakarta.annotation.Nullable String icebergQuantity) { + this.icebergQuantity = icebergQuantity; + } + + public NewAlgoOrderResponseResult selfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + public String getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable String selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + + public NewAlgoOrderResponseResult workingType(@jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + return this; + } + + /** + * Get workingType + * + * @return workingType + */ + @jakarta.annotation.Nullable + public String getWorkingType() { + return workingType; + } + + public void setWorkingType(@jakarta.annotation.Nullable String workingType) { + this.workingType = workingType; + } + + public NewAlgoOrderResponseResult priceMatch(@jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + return this; + } + + /** + * Get priceMatch + * + * @return priceMatch + */ + @jakarta.annotation.Nullable + public String getPriceMatch() { + return priceMatch; + } + + public void setPriceMatch(@jakarta.annotation.Nullable String priceMatch) { + this.priceMatch = priceMatch; + } + + public NewAlgoOrderResponseResult closePosition( + @jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + return this; + } + + /** + * Get closePosition + * + * @return closePosition + */ + @jakarta.annotation.Nullable + public Boolean getClosePosition() { + return closePosition; + } + + public void setClosePosition(@jakarta.annotation.Nullable Boolean closePosition) { + this.closePosition = closePosition; + } + + public NewAlgoOrderResponseResult priceProtect( + @jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + return this; + } + + /** + * Get priceProtect + * + * @return priceProtect + */ + @jakarta.annotation.Nullable + public Boolean getPriceProtect() { + return priceProtect; + } + + public void setPriceProtect(@jakarta.annotation.Nullable Boolean priceProtect) { + this.priceProtect = priceProtect; + } + + public NewAlgoOrderResponseResult reduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Get reduceOnly + * + * @return reduceOnly + */ + @jakarta.annotation.Nullable + public Boolean getReduceOnly() { + return reduceOnly; + } + + public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + } + + public NewAlgoOrderResponseResult createTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get createTime + * + * @return createTime + */ + @jakarta.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + } + + public NewAlgoOrderResponseResult updateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Get updateTime + * + * @return updateTime + */ + @jakarta.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + } + + public NewAlgoOrderResponseResult triggerTime(@jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + return this; + } + + /** + * Get triggerTime + * + * @return triggerTime + */ + @jakarta.annotation.Nullable + public Long getTriggerTime() { + return triggerTime; + } + + public void setTriggerTime(@jakarta.annotation.Nullable Long triggerTime) { + this.triggerTime = triggerTime; + } + + public NewAlgoOrderResponseResult goodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + return this; + } + + /** + * Get goodTillDate + * + * @return goodTillDate + */ + @jakarta.annotation.Nullable + public Long getGoodTillDate() { + return goodTillDate; + } + + public void setGoodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { + this.goodTillDate = goodTillDate; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewAlgoOrderResponseResult newAlgoOrderResponseResult = (NewAlgoOrderResponseResult) o; + return Objects.equals(this.algoId, newAlgoOrderResponseResult.algoId) + && Objects.equals(this.clientAlgoId, newAlgoOrderResponseResult.clientAlgoId) + && Objects.equals(this.algoType, newAlgoOrderResponseResult.algoType) + && Objects.equals(this.orderType, newAlgoOrderResponseResult.orderType) + && Objects.equals(this.symbol, newAlgoOrderResponseResult.symbol) + && Objects.equals(this.side, newAlgoOrderResponseResult.side) + && Objects.equals(this.positionSide, newAlgoOrderResponseResult.positionSide) + && Objects.equals(this.timeInForce, newAlgoOrderResponseResult.timeInForce) + && Objects.equals(this.quantity, newAlgoOrderResponseResult.quantity) + && Objects.equals(this.algoStatus, newAlgoOrderResponseResult.algoStatus) + && Objects.equals(this.triggerPrice, newAlgoOrderResponseResult.triggerPrice) + && Objects.equals(this.price, newAlgoOrderResponseResult.price) + && Objects.equals(this.icebergQuantity, newAlgoOrderResponseResult.icebergQuantity) + && Objects.equals( + this.selfTradePreventionMode, + newAlgoOrderResponseResult.selfTradePreventionMode) + && Objects.equals(this.workingType, newAlgoOrderResponseResult.workingType) + && Objects.equals(this.priceMatch, newAlgoOrderResponseResult.priceMatch) + && Objects.equals(this.closePosition, newAlgoOrderResponseResult.closePosition) + && Objects.equals(this.priceProtect, newAlgoOrderResponseResult.priceProtect) + && Objects.equals(this.reduceOnly, newAlgoOrderResponseResult.reduceOnly) + && Objects.equals(this.createTime, newAlgoOrderResponseResult.createTime) + && Objects.equals(this.updateTime, newAlgoOrderResponseResult.updateTime) + && Objects.equals(this.triggerTime, newAlgoOrderResponseResult.triggerTime) + && Objects.equals(this.goodTillDate, newAlgoOrderResponseResult.goodTillDate); + } + + @Override + public int hashCode() { + return Objects.hash( + algoId, + clientAlgoId, + algoType, + orderType, + symbol, + side, + positionSide, + timeInForce, + quantity, + algoStatus, + triggerPrice, + price, + icebergQuantity, + selfTradePreventionMode, + workingType, + priceMatch, + closePosition, + priceProtect, + reduceOnly, + createTime, + updateTime, + triggerTime, + goodTillDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewAlgoOrderResponseResult {\n"); + sb.append(" algoId: ").append(toIndentedString(algoId)).append("\n"); + sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); + sb.append(" algoType: ").append(toIndentedString(algoType)).append("\n"); + sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" algoStatus: ").append(toIndentedString(algoStatus)).append("\n"); + sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" icebergQuantity: ").append(toIndentedString(icebergQuantity)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); + sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); + sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); + sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" triggerTime: ").append(toIndentedString(triggerTime)).append("\n"); + sb.append(" goodTillDate: ").append(toIndentedString(goodTillDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long algoIdValue = getAlgoId(); + if (algoIdValue != null) { + String algoIdValueAsString = algoIdValue.toString(); + valMap.put("algoId", algoIdValueAsString); + } + String clientAlgoIdValue = getClientAlgoId(); + if (clientAlgoIdValue != null) { + String clientAlgoIdValueAsString = clientAlgoIdValue.toString(); + valMap.put("clientAlgoId", clientAlgoIdValueAsString); + } + String algoTypeValue = getAlgoType(); + if (algoTypeValue != null) { + String algoTypeValueAsString = algoTypeValue.toString(); + valMap.put("algoType", algoTypeValueAsString); + } + String orderTypeValue = getOrderType(); + if (orderTypeValue != null) { + String orderTypeValueAsString = orderTypeValue.toString(); + valMap.put("orderType", orderTypeValueAsString); + } + String symbolValue = getSymbol(); + if (symbolValue != null) { + String symbolValueAsString = symbolValue.toString(); + valMap.put("symbol", symbolValueAsString); + } + String sideValue = getSide(); + if (sideValue != null) { + String sideValueAsString = sideValue.toString(); + valMap.put("side", sideValueAsString); + } + String positionSideValue = getPositionSide(); + if (positionSideValue != null) { + String positionSideValueAsString = positionSideValue.toString(); + valMap.put("positionSide", positionSideValueAsString); + } + String timeInForceValue = getTimeInForce(); + if (timeInForceValue != null) { + String timeInForceValueAsString = timeInForceValue.toString(); + valMap.put("timeInForce", timeInForceValueAsString); + } + String quantityValue = getQuantity(); + if (quantityValue != null) { + String quantityValueAsString = quantityValue.toString(); + valMap.put("quantity", quantityValueAsString); + } + String algoStatusValue = getAlgoStatus(); + if (algoStatusValue != null) { + String algoStatusValueAsString = algoStatusValue.toString(); + valMap.put("algoStatus", algoStatusValueAsString); + } + String triggerPriceValue = getTriggerPrice(); + if (triggerPriceValue != null) { + String triggerPriceValueAsString = triggerPriceValue.toString(); + valMap.put("triggerPrice", triggerPriceValueAsString); + } + String priceValue = getPrice(); + if (priceValue != null) { + String priceValueAsString = priceValue.toString(); + valMap.put("price", priceValueAsString); + } + String icebergQuantityValue = getIcebergQuantity(); + if (icebergQuantityValue != null) { + String icebergQuantityValueAsString = icebergQuantityValue.toString(); + valMap.put("icebergQuantity", icebergQuantityValueAsString); + } + String selfTradePreventionModeValue = getSelfTradePreventionMode(); + if (selfTradePreventionModeValue != null) { + String selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + valMap.put("selfTradePreventionMode", selfTradePreventionModeValueAsString); + } + String workingTypeValue = getWorkingType(); + if (workingTypeValue != null) { + String workingTypeValueAsString = workingTypeValue.toString(); + valMap.put("workingType", workingTypeValueAsString); + } + String priceMatchValue = getPriceMatch(); + if (priceMatchValue != null) { + String priceMatchValueAsString = priceMatchValue.toString(); + valMap.put("priceMatch", priceMatchValueAsString); + } + Boolean closePositionValue = getClosePosition(); + if (closePositionValue != null) { + String closePositionValueAsString = closePositionValue.toString(); + valMap.put("closePosition", closePositionValueAsString); + } + Boolean priceProtectValue = getPriceProtect(); + if (priceProtectValue != null) { + String priceProtectValueAsString = priceProtectValue.toString(); + valMap.put("priceProtect", priceProtectValueAsString); + } + Boolean reduceOnlyValue = getReduceOnly(); + if (reduceOnlyValue != null) { + String reduceOnlyValueAsString = reduceOnlyValue.toString(); + valMap.put("reduceOnly", reduceOnlyValueAsString); + } + Long createTimeValue = getCreateTime(); + if (createTimeValue != null) { + String createTimeValueAsString = createTimeValue.toString(); + valMap.put("createTime", createTimeValueAsString); + } + Long updateTimeValue = getUpdateTime(); + if (updateTimeValue != null) { + String updateTimeValueAsString = updateTimeValue.toString(); + valMap.put("updateTime", updateTimeValueAsString); + } + Long triggerTimeValue = getTriggerTime(); + if (triggerTimeValue != null) { + String triggerTimeValueAsString = triggerTimeValue.toString(); + valMap.put("triggerTime", triggerTimeValueAsString); + } + Long goodTillDateValue = getGoodTillDate(); + if (goodTillDateValue != null) { + String goodTillDateValueAsString = goodTillDateValue.toString(); + valMap.put("goodTillDate", goodTillDateValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object algoIdValue = getAlgoId(); + if (algoIdValue != null) { + valMap.put("algoId", algoIdValue); + } + Object clientAlgoIdValue = getClientAlgoId(); + if (clientAlgoIdValue != null) { + valMap.put("clientAlgoId", clientAlgoIdValue); + } + Object algoTypeValue = getAlgoType(); + if (algoTypeValue != null) { + valMap.put("algoType", algoTypeValue); + } + Object orderTypeValue = getOrderType(); + if (orderTypeValue != null) { + valMap.put("orderType", orderTypeValue); + } + Object symbolValue = getSymbol(); + if (symbolValue != null) { + valMap.put("symbol", symbolValue); + } + Object sideValue = getSide(); + if (sideValue != null) { + valMap.put("side", sideValue); + } + Object positionSideValue = getPositionSide(); + if (positionSideValue != null) { + valMap.put("positionSide", positionSideValue); + } + Object timeInForceValue = getTimeInForce(); + if (timeInForceValue != null) { + valMap.put("timeInForce", timeInForceValue); + } + Object quantityValue = getQuantity(); + if (quantityValue != null) { + valMap.put("quantity", quantityValue); + } + Object algoStatusValue = getAlgoStatus(); + if (algoStatusValue != null) { + valMap.put("algoStatus", algoStatusValue); + } + Object triggerPriceValue = getTriggerPrice(); + if (triggerPriceValue != null) { + valMap.put("triggerPrice", triggerPriceValue); + } + Object priceValue = getPrice(); + if (priceValue != null) { + valMap.put("price", priceValue); + } + Object icebergQuantityValue = getIcebergQuantity(); + if (icebergQuantityValue != null) { + valMap.put("icebergQuantity", icebergQuantityValue); + } + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + if (selfTradePreventionModeValue != null) { + valMap.put("selfTradePreventionMode", selfTradePreventionModeValue); + } + Object workingTypeValue = getWorkingType(); + if (workingTypeValue != null) { + valMap.put("workingType", workingTypeValue); + } + Object priceMatchValue = getPriceMatch(); + if (priceMatchValue != null) { + valMap.put("priceMatch", priceMatchValue); + } + Object closePositionValue = getClosePosition(); + if (closePositionValue != null) { + valMap.put("closePosition", closePositionValue); + } + Object priceProtectValue = getPriceProtect(); + if (priceProtectValue != null) { + valMap.put("priceProtect", priceProtectValue); + } + Object reduceOnlyValue = getReduceOnly(); + if (reduceOnlyValue != null) { + valMap.put("reduceOnly", reduceOnlyValue); + } + Object createTimeValue = getCreateTime(); + if (createTimeValue != null) { + valMap.put("createTime", createTimeValue); + } + Object updateTimeValue = getUpdateTime(); + if (updateTimeValue != null) { + valMap.put("updateTime", updateTimeValue); + } + Object triggerTimeValue = getTriggerTime(); + if (triggerTimeValue != null) { + valMap.put("triggerTime", triggerTimeValue); + } + Object goodTillDateValue = getGoodTillDate(); + if (goodTillDateValue != null) { + valMap.put("goodTillDate", goodTillDateValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("algoId"); + openapiFields.add("clientAlgoId"); + openapiFields.add("algoType"); + openapiFields.add("orderType"); + openapiFields.add("symbol"); + openapiFields.add("side"); + openapiFields.add("positionSide"); + openapiFields.add("timeInForce"); + openapiFields.add("quantity"); + openapiFields.add("algoStatus"); + openapiFields.add("triggerPrice"); + openapiFields.add("price"); + openapiFields.add("icebergQuantity"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("workingType"); + openapiFields.add("priceMatch"); + openapiFields.add("closePosition"); + openapiFields.add("priceProtect"); + openapiFields.add("reduceOnly"); + openapiFields.add("createTime"); + openapiFields.add("updateTime"); + openapiFields.add("triggerTime"); + openapiFields.add("goodTillDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewAlgoOrderResponseResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewAlgoOrderResponseResult.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in NewAlgoOrderResponseResult is not" + + " found in the empty JSON string", + NewAlgoOrderResponseResult.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewAlgoOrderResponseResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `NewAlgoOrderResponseResult` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("clientAlgoId") != null && !jsonObj.get("clientAlgoId").isJsonNull()) + && !jsonObj.get("clientAlgoId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientAlgoId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientAlgoId").toString())); + } + if ((jsonObj.get("algoType") != null && !jsonObj.get("algoType").isJsonNull()) + && !jsonObj.get("algoType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoType").toString())); + } + if ((jsonObj.get("orderType") != null && !jsonObj.get("orderType").isJsonNull()) + && !jsonObj.get("orderType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("orderType").toString())); + } + if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) + && !jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) + && !jsonObj.get("side").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `side` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("side").toString())); + } + if ((jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) + && !jsonObj.get("positionSide").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `positionSide` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("positionSide").toString())); + } + if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) + && !jsonObj.get("timeInForce").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timeInForce` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timeInForce").toString())); + } + if ((jsonObj.get("quantity") != null && !jsonObj.get("quantity").isJsonNull()) + && !jsonObj.get("quantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quantity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("quantity").toString())); + } + if ((jsonObj.get("algoStatus") != null && !jsonObj.get("algoStatus").isJsonNull()) + && !jsonObj.get("algoStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `algoStatus` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("algoStatus").toString())); + } + if ((jsonObj.get("triggerPrice") != null && !jsonObj.get("triggerPrice").isJsonNull()) + && !jsonObj.get("triggerPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `triggerPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("triggerPrice").toString())); + } + if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) + && !jsonObj.get("price").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `price` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("price").toString())); + } + if ((jsonObj.get("icebergQuantity") != null && !jsonObj.get("icebergQuantity").isJsonNull()) + && !jsonObj.get("icebergQuantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `icebergQuantity` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("icebergQuantity").toString())); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) + && !jsonObj.get("workingType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workingType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workingType").toString())); + } + if ((jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) + && !jsonObj.get("priceMatch").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `priceMatch` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("priceMatch").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewAlgoOrderResponseResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewAlgoOrderResponseResult' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(NewAlgoOrderResponseResult.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, NewAlgoOrderResponseResult value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewAlgoOrderResponseResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of NewAlgoOrderResponseResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewAlgoOrderResponseResult + * @throws IOException if the JSON string is invalid with respect to NewAlgoOrderResponseResult + */ + public static NewAlgoOrderResponseResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewAlgoOrderResponseResult.class); + } + + /** + * Convert an instance of NewAlgoOrderResponseResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/TimeInForce.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/TimeInForce.java index 6c6ecf9b..2d66c00a 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/TimeInForce.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/TimeInForce.java @@ -32,7 +32,9 @@ public enum TimeInForce { GTX("GTX"), - GTD("GTD"); + GTD("GTD"), + + RPI("RPI"); private String value; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/JSON.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/JSON.java index 0f18f8c9..1b8de9ef 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/JSON.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/JSON.java @@ -89,6 +89,11 @@ public static GsonBuilder createGson() { com.binance.connector.client .derivatives_trading_usds_futures.websocket .stream.model.AccountUpdate.class); + classByDiscriminatorValue.put( + "ALGO_UPDATE", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.AlgoUpdate.class); classByDiscriminatorValue.put( "CONDITIONAL_ORDER_TRIGGER_REJECT", com.binance.connector.client @@ -135,6 +140,11 @@ public static GsonBuilder createGson() { com.binance.connector.client .derivatives_trading_usds_futures.websocket .stream.model.AccountUpdate.class); + classByDiscriminatorValue.put( + "algoUpdate", + com.binance.connector.client + .derivatives_trading_usds_futures.websocket + .stream.model.AlgoUpdate.class); classByDiscriminatorValue.put( "conditionalOrderTriggerReject", com.binance.connector.client @@ -258,6 +268,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream .model.AggregateTradeStreamsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.AlgoUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.AlgoUpdateO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream .model.AllBookTickersStreamRequest.CustomTypeAdapterFactory()); @@ -434,6 +450,18 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream .model.PartialBookDepthStreamsResponseBItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.RpiDiffBookDepthStreamsRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.RpiDiffBookDepthStreamsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.RpiDiffBookDepthStreamsResponseAItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.RpiDiffBookDepthStreamsResponseBItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream .model.StrategyUpdate.CustomTypeAdapterFactory()); @@ -443,6 +471,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream .model.TradeLite.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.TradingSessionStreamRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream + .model.TradingSessionStreamResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream .model.UserDataStreamEventsResponse.CustomTypeAdapterFactory()); diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java index 7df4bfea..919ad336 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java @@ -46,6 +46,10 @@ import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MultiAssetsModeAssetIndexResponse; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.PartialBookDepthStreamsRequest; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.PartialBookDepthStreamsResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.RpiDiffBookDepthStreamsRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.RpiDiffBookDepthStreamsResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.TradingSessionStreamRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.TradingSessionStreamResponse; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.UserDataStreamEventsResponse; import com.google.gson.reflect.TypeToken; import java.util.Collections; @@ -56,7 +60,7 @@ public class DerivativesTradingUsdsFuturesWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/6.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/7.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; @@ -199,6 +203,16 @@ public StreamBlockingQueueWrapper partialBookDe return websocketMarketStreamsApi.partialBookDepthStreams(partialBookDepthStreamsRequest); } + public StreamBlockingQueueWrapper rpiDiffBookDepthStreams( + RpiDiffBookDepthStreamsRequest rpiDiffBookDepthStreamsRequest) throws ApiException { + return websocketMarketStreamsApi.rpiDiffBookDepthStreams(rpiDiffBookDepthStreamsRequest); + } + + public StreamBlockingQueueWrapper tradingSessionStream( + TradingSessionStreamRequest tradingSessionStreamRequest) throws ApiException { + return websocketMarketStreamsApi.tradingSessionStream(tradingSessionStreamRequest); + } + /** * Subscribes to the user data WebSocket stream using the provided listen key. * diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApi.java index 806d6f32..22461bbb 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApi.java @@ -54,6 +54,10 @@ import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MultiAssetsModeAssetIndexResponse; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.PartialBookDepthStreamsRequest; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.PartialBookDepthStreamsResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.RpiDiffBookDepthStreamsRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.RpiDiffBookDepthStreamsResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.TradingSessionStreamRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.TradingSessionStreamResponse; import com.google.gson.reflect.TypeToken; import jakarta.validation.ConstraintViolation; import jakarta.validation.Validation; @@ -78,7 +82,8 @@ public WebsocketMarketStreamsApi(StreamConnectionInterface connection) { * Aggregate Trade Streams The Aggregate Trade Streams push market trade information that is * aggregated for fills with same price and taking side every 100 milliseconds. Only market * trades will be aggregated, which means the insurance fund trades and ADL trades won't be - * aggregated. Update Speed: 100ms + * aggregated. Retail Price Improvement(RPI) orders are aggregated and without special tags to + * be distinguished. Update Speed: 100ms * * @param aggregateTradeStreamsRequest (required) * @return AggregateTradeStreamsResponse @@ -162,7 +167,8 @@ private void aggregateTradeStreamsValidateBeforeCall( /** * All Book Tickers Stream Pushes any update to the best bid or ask's price or quantity in - * real-time for all symbols. Update Speed: 5s + * real-time for all symbols. Retail Price Improvement(RPI) orders are not visible and excluded + * in the response message. Update Speed: 5s * * @param allBookTickersStreamRequest (required) * @return AllBookTickersStreamResponse @@ -786,7 +792,8 @@ private void contractInfoStreamValidateBeforeCall( /** * Diff. Book Depth Streams Bids and asks, pushed every 250 milliseconds, 500 milliseconds, 100 - * milliseconds (if existing) Update Speed: 250ms, 500ms, 100ms + * milliseconds (if existing) Retail Price Improvement(RPI) orders are not visible and excluded + * in the response message. Update Speed: 250ms, 500ms, 100ms * * @param diffBookDepthStreamsRequest (required) * @return DiffBookDepthStreamsResponse @@ -875,7 +882,8 @@ private void diffBookDepthStreamsValidateBeforeCall( /** * Individual Symbol Book Ticker Streams Pushes any update to the best bid or ask's price or - * quantity in real-time for a specified symbol. Update Speed: Real-time + * quantity in real-time for a specified symbol. Retail Price Improvement(RPI) orders are not + * visible and excluded in the response message. Update Speed: Real-time * * @param individualSymbolBookTickerStreamsRequest (required) * @return IndividualSymbolBookTickerStreamsResponse @@ -1419,7 +1427,8 @@ private void markPriceStreamValidateBeforeCall(MarkPriceStreamRequest markPriceS /** * Mark Price Stream for All market Mark price and funding rate for all symbols pushed every 3 - * seconds or every second. Update Speed: 3000ms or 1000ms + * seconds or every second. **Note**: This stream does not cover TradFi Perps. Update Speed: + * 3000ms or 1000ms * * @param markPriceStreamForAllMarketRequest (required) * @return MarkPriceStreamForAllMarketResponse @@ -1589,7 +1598,8 @@ private void multiAssetsModeAssetIndexValidateBeforeCall( /** * Partial Book Depth Streams Top **<levels\\>** bids and asks, Valid **<levels\\>** - * are 5, 10, or 20. Update Speed: 250ms, 500ms or 100ms + * are 5, 10, or 20. Retail Price Improvement(RPI) orders are not visible and excluded in the + * response message. Update Speed: 250ms, 500ms or 100ms * * @param partialBookDepthStreamsRequest (required) * @return PartialBookDepthStreamsResponse @@ -1682,6 +1692,177 @@ private void partialBookDepthStreamsValidateBeforeCall( } } + /** + * RPI Diff. Book Depth Streams Bids and asks including RPI orders, pushed every 500 + * milliseconds RPI(Retail Price Improvement) orders are included and aggreated in the response + * message. When the quantity of a price level to be updated is equal to 0, it means either all + * quotations for this price have been filled/canceled, or the quantity of crossed RPI orders + * for this price are hidden Update Speed: 500ms + * + * @param rpiDiffBookDepthStreamsRequest (required) + * @return RpiDiffBookDepthStreamsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 RPI Diff. Book Depth Streams -
+ * + * @see RPI + * Diff. Book Depth Streams Documentation + */ + public StreamBlockingQueueWrapper rpiDiffBookDepthStreams( + RpiDiffBookDepthStreamsRequest rpiDiffBookDepthStreamsRequest) throws ApiException { + StreamBlockingQueue queue = + rpiDiffBookDepthStreamsRaw(rpiDiffBookDepthStreamsRequest); + + TypeToken typeToken = + new TypeToken() {}; + + return new StreamBlockingQueueWrapper<>(queue, typeToken); + } + + public StreamBlockingQueue rpiDiffBookDepthStreamsRaw( + RpiDiffBookDepthStreamsRequest rpiDiffBookDepthStreamsRequest) throws ApiException { + rpiDiffBookDepthStreamsValidateBeforeCall(rpiDiffBookDepthStreamsRequest); + + String methodName = + "/@rpiDepth@500ms" + .substring(1) + .replace( + "", + rpiDiffBookDepthStreamsRequest.getId() != null + ? rpiDiffBookDepthStreamsRequest.getId().toString() + : "") + .replace( + "", + rpiDiffBookDepthStreamsRequest.getSymbol() != null + ? rpiDiffBookDepthStreamsRequest.getSymbol().toString() + : ""); + if ("@".equals(methodName.substring(methodName.length() - 1))) { + methodName = methodName.substring(0, methodName.length() - 1); + } + + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(methodName)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + return queuesMap.get(methodName); + } + + @SuppressWarnings("rawtypes") + private void rpiDiffBookDepthStreamsValidateBeforeCall( + RpiDiffBookDepthStreamsRequest rpiDiffBookDepthStreamsRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(rpiDiffBookDepthStreamsRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Trading Session Stream Trading session information of U.S. equity market and commodity market + * which updates every second. Trading session information of different markets is pushed in + * seperate messages. Session types of equity market include \"PRE_MARKET\", + * \"REGULAR\", \"AFTER_MARKET\", \"OVERNIGHT\" and + * \"NO_TRADING\". And session types of commodity market include \"REGULAR\" + * and \"NO_TRADING\". Update Speed: 1s + * + * @param tradingSessionStreamRequest (required) + * @return TradingSessionStreamResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Trading Session Stream -
+ * + * @see Trading + * Session Stream Documentation + */ + public StreamBlockingQueueWrapper tradingSessionStream( + TradingSessionStreamRequest tradingSessionStreamRequest) throws ApiException { + StreamBlockingQueue queue = tradingSessionStreamRaw(tradingSessionStreamRequest); + + TypeToken typeToken = + new TypeToken() {}; + + return new StreamBlockingQueueWrapper<>(queue, typeToken); + } + + public StreamBlockingQueue tradingSessionStreamRaw( + TradingSessionStreamRequest tradingSessionStreamRequest) throws ApiException { + tradingSessionStreamValidateBeforeCall(tradingSessionStreamRequest); + + String methodName = + "/tradingSession" + .substring(1) + .replace( + "", + tradingSessionStreamRequest.getId() != null + ? tradingSessionStreamRequest.getId().toString() + : ""); + if ("@".equals(methodName.substring(methodName.length() - 1))) { + methodName = methodName.substring(0, methodName.length() - 1); + } + + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(methodName)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + return queuesMap.get(methodName); + } + + @SuppressWarnings("rawtypes") + private void tradingSessionStreamValidateBeforeCall( + TradingSessionStreamRequest tradingSessionStreamRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(tradingSessionStreamRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + public String getRequestID() { return UUID.randomUUID().toString(); } diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AlgoUpdate.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AlgoUpdate.java new file mode 100644 index 00000000..ec49f592 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AlgoUpdate.java @@ -0,0 +1,311 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** AlgoUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlgoUpdate extends BaseDTO { + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public static final String SERIALIZED_NAME_E = "E"; + + @SerializedName(SERIALIZED_NAME_E) + @jakarta.annotation.Nullable + private Long E; + + public static final String SERIALIZED_NAME_O_LOWER_CASE = "o"; + + @SerializedName(SERIALIZED_NAME_O_LOWER_CASE) + @jakarta.annotation.Nullable + private AlgoUpdateO oLowerCase; + + public AlgoUpdate() {} + + public AlgoUpdate T(@jakarta.annotation.Nullable Long T) { + this.T = T; + return this; + } + + /** + * Get T + * + * @return T + */ + @jakarta.annotation.Nullable + public Long getT() { + return T; + } + + public void setT(@jakarta.annotation.Nullable Long T) { + this.T = T; + } + + public AlgoUpdate E(@jakarta.annotation.Nullable Long E) { + this.E = E; + return this; + } + + /** + * Get E + * + * @return E + */ + @jakarta.annotation.Nullable + public Long getE() { + return E; + } + + public void setE(@jakarta.annotation.Nullable Long E) { + this.E = E; + } + + public AlgoUpdate oLowerCase(@jakarta.annotation.Nullable AlgoUpdateO oLowerCase) { + this.oLowerCase = oLowerCase; + return this; + } + + /** + * Get oLowerCase + * + * @return oLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public AlgoUpdateO getoLowerCase() { + return oLowerCase; + } + + public void setoLowerCase(@jakarta.annotation.Nullable AlgoUpdateO oLowerCase) { + this.oLowerCase = oLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlgoUpdate algoUpdate = (AlgoUpdate) o; + return Objects.equals(this.T, algoUpdate.T) + && Objects.equals(this.E, algoUpdate.E) + && Objects.equals(this.oLowerCase, algoUpdate.oLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(T, E, oLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlgoUpdate {\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" oLowerCase: ").append(toIndentedString(oLowerCase)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + Long EValue = getE(); + if (EValue != null) { + String EValueAsString = EValue.toString(); + valMap.put("E", EValueAsString); + } + AlgoUpdateO oLowerCaseValue = getoLowerCase(); + if (oLowerCaseValue != null) { + String oLowerCaseValueAsString = JSON.getGson().toJson(oLowerCaseValue); + valMap.put("oLowerCase", oLowerCaseValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object oLowerCaseValue = getoLowerCase(); + if (oLowerCaseValue != null) { + valMap.put("oLowerCase", oLowerCaseValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("T"); + openapiFields.add("E"); + openapiFields.add("o"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AlgoUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AlgoUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AlgoUpdate is not found in the empty" + + " JSON string", + AlgoUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AlgoUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AlgoUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `o` + if (jsonObj.get("o") != null && !jsonObj.get("o").isJsonNull()) { + AlgoUpdateO.validateJsonElement(jsonObj.get("o")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AlgoUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AlgoUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AlgoUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AlgoUpdate value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AlgoUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AlgoUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of AlgoUpdate + * @throws IOException if the JSON string is invalid with respect to AlgoUpdate + */ + public static AlgoUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AlgoUpdate.class); + } + + /** + * Convert an instance of AlgoUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AlgoUpdateO.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AlgoUpdateO.java new file mode 100644 index 00000000..4ef10377 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AlgoUpdateO.java @@ -0,0 +1,1296 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** AlgoUpdateO */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AlgoUpdateO extends BaseDTO { + public static final String SERIALIZED_NAME_CAID = "caid"; + + @SerializedName(SERIALIZED_NAME_CAID) + @jakarta.annotation.Nullable + private String caid; + + public static final String SERIALIZED_NAME_AID = "aid"; + + @SerializedName(SERIALIZED_NAME_AID) + @jakarta.annotation.Nullable + private Long aid; + + public static final String SERIALIZED_NAME_AT = "at"; + + @SerializedName(SERIALIZED_NAME_AT) + @jakarta.annotation.Nullable + private String at; + + public static final String SERIALIZED_NAME_O_LOWER_CASE = "o"; + + @SerializedName(SERIALIZED_NAME_O_LOWER_CASE) + @jakarta.annotation.Nullable + private String oLowerCase; + + public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; + + @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) + @jakarta.annotation.Nullable + private String sLowerCase; + + public static final String SERIALIZED_NAME_S = "S"; + + @SerializedName(SERIALIZED_NAME_S) + @jakarta.annotation.Nullable + private String S; + + public static final String SERIALIZED_NAME_PS = "ps"; + + @SerializedName(SERIALIZED_NAME_PS) + @jakarta.annotation.Nullable + private String ps; + + public static final String SERIALIZED_NAME_F_LOWER_CASE = "f"; + + @SerializedName(SERIALIZED_NAME_F_LOWER_CASE) + @jakarta.annotation.Nullable + private String fLowerCase; + + public static final String SERIALIZED_NAME_Q_LOWER_CASE = "q"; + + @SerializedName(SERIALIZED_NAME_Q_LOWER_CASE) + @jakarta.annotation.Nullable + private String qLowerCase; + + public static final String SERIALIZED_NAME_X = "X"; + + @SerializedName(SERIALIZED_NAME_X) + @jakarta.annotation.Nullable + private String X; + + public static final String SERIALIZED_NAME_AI = "ai"; + + @SerializedName(SERIALIZED_NAME_AI) + @jakarta.annotation.Nullable + private String ai; + + public static final String SERIALIZED_NAME_AP = "ap"; + + @SerializedName(SERIALIZED_NAME_AP) + @jakarta.annotation.Nullable + private String ap; + + public static final String SERIALIZED_NAME_AQ = "aq"; + + @SerializedName(SERIALIZED_NAME_AQ) + @jakarta.annotation.Nullable + private String aq; + + public static final String SERIALIZED_NAME_ACT = "act"; + + @SerializedName(SERIALIZED_NAME_ACT) + @jakarta.annotation.Nullable + private String act; + + public static final String SERIALIZED_NAME_TP = "tp"; + + @SerializedName(SERIALIZED_NAME_TP) + @jakarta.annotation.Nullable + private String tp; + + public static final String SERIALIZED_NAME_P_LOWER_CASE = "p"; + + @SerializedName(SERIALIZED_NAME_P_LOWER_CASE) + @jakarta.annotation.Nullable + private String pLowerCase; + + public static final String SERIALIZED_NAME_V = "V"; + + @SerializedName(SERIALIZED_NAME_V) + @jakarta.annotation.Nullable + private String V; + + public static final String SERIALIZED_NAME_WT = "wt"; + + @SerializedName(SERIALIZED_NAME_WT) + @jakarta.annotation.Nullable + private String wt; + + public static final String SERIALIZED_NAME_PM = "pm"; + + @SerializedName(SERIALIZED_NAME_PM) + @jakarta.annotation.Nullable + private String pm; + + public static final String SERIALIZED_NAME_CP = "cp"; + + @SerializedName(SERIALIZED_NAME_CP) + @jakarta.annotation.Nullable + private Boolean cp; + + public static final String SERIALIZED_NAME_P_P = "pP"; + + @SerializedName(SERIALIZED_NAME_P_P) + @jakarta.annotation.Nullable + private Boolean pP; + + public static final String SERIALIZED_NAME_R = "R"; + + @SerializedName(SERIALIZED_NAME_R) + @jakarta.annotation.Nullable + private Boolean R; + + public static final String SERIALIZED_NAME_TT = "tt"; + + @SerializedName(SERIALIZED_NAME_TT) + @jakarta.annotation.Nullable + private Long tt; + + public static final String SERIALIZED_NAME_GTD = "gtd"; + + @SerializedName(SERIALIZED_NAME_GTD) + @jakarta.annotation.Nullable + private Long gtd; + + public static final String SERIALIZED_NAME_RM = "rm"; + + @SerializedName(SERIALIZED_NAME_RM) + @jakarta.annotation.Nullable + private String rm; + + public AlgoUpdateO() {} + + public AlgoUpdateO caid(@jakarta.annotation.Nullable String caid) { + this.caid = caid; + return this; + } + + /** + * Get caid + * + * @return caid + */ + @jakarta.annotation.Nullable + public String getCaid() { + return caid; + } + + public void setCaid(@jakarta.annotation.Nullable String caid) { + this.caid = caid; + } + + public AlgoUpdateO aid(@jakarta.annotation.Nullable Long aid) { + this.aid = aid; + return this; + } + + /** + * Get aid + * + * @return aid + */ + @jakarta.annotation.Nullable + public Long getAid() { + return aid; + } + + public void setAid(@jakarta.annotation.Nullable Long aid) { + this.aid = aid; + } + + public AlgoUpdateO at(@jakarta.annotation.Nullable String at) { + this.at = at; + return this; + } + + /** + * Get at + * + * @return at + */ + @jakarta.annotation.Nullable + public String getAt() { + return at; + } + + public void setAt(@jakarta.annotation.Nullable String at) { + this.at = at; + } + + public AlgoUpdateO oLowerCase(@jakarta.annotation.Nullable String oLowerCase) { + this.oLowerCase = oLowerCase; + return this; + } + + /** + * Get oLowerCase + * + * @return oLowerCase + */ + @jakarta.annotation.Nullable + public String getoLowerCase() { + return oLowerCase; + } + + public void setoLowerCase(@jakarta.annotation.Nullable String oLowerCase) { + this.oLowerCase = oLowerCase; + } + + public AlgoUpdateO sLowerCase(@jakarta.annotation.Nullable String sLowerCase) { + this.sLowerCase = sLowerCase; + return this; + } + + /** + * Get sLowerCase + * + * @return sLowerCase + */ + @jakarta.annotation.Nullable + public String getsLowerCase() { + return sLowerCase; + } + + public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { + this.sLowerCase = sLowerCase; + } + + public AlgoUpdateO S(@jakarta.annotation.Nullable String S) { + this.S = S; + return this; + } + + /** + * Get S + * + * @return S + */ + @jakarta.annotation.Nullable + public String getS() { + return S; + } + + public void setS(@jakarta.annotation.Nullable String S) { + this.S = S; + } + + public AlgoUpdateO ps(@jakarta.annotation.Nullable String ps) { + this.ps = ps; + return this; + } + + /** + * Get ps + * + * @return ps + */ + @jakarta.annotation.Nullable + public String getPs() { + return ps; + } + + public void setPs(@jakarta.annotation.Nullable String ps) { + this.ps = ps; + } + + public AlgoUpdateO fLowerCase(@jakarta.annotation.Nullable String fLowerCase) { + this.fLowerCase = fLowerCase; + return this; + } + + /** + * Get fLowerCase + * + * @return fLowerCase + */ + @jakarta.annotation.Nullable + public String getfLowerCase() { + return fLowerCase; + } + + public void setfLowerCase(@jakarta.annotation.Nullable String fLowerCase) { + this.fLowerCase = fLowerCase; + } + + public AlgoUpdateO qLowerCase(@jakarta.annotation.Nullable String qLowerCase) { + this.qLowerCase = qLowerCase; + return this; + } + + /** + * Get qLowerCase + * + * @return qLowerCase + */ + @jakarta.annotation.Nullable + public String getqLowerCase() { + return qLowerCase; + } + + public void setqLowerCase(@jakarta.annotation.Nullable String qLowerCase) { + this.qLowerCase = qLowerCase; + } + + public AlgoUpdateO X(@jakarta.annotation.Nullable String X) { + this.X = X; + return this; + } + + /** + * Get X + * + * @return X + */ + @jakarta.annotation.Nullable + public String getX() { + return X; + } + + public void setX(@jakarta.annotation.Nullable String X) { + this.X = X; + } + + public AlgoUpdateO ai(@jakarta.annotation.Nullable String ai) { + this.ai = ai; + return this; + } + + /** + * Get ai + * + * @return ai + */ + @jakarta.annotation.Nullable + public String getAi() { + return ai; + } + + public void setAi(@jakarta.annotation.Nullable String ai) { + this.ai = ai; + } + + public AlgoUpdateO ap(@jakarta.annotation.Nullable String ap) { + this.ap = ap; + return this; + } + + /** + * Get ap + * + * @return ap + */ + @jakarta.annotation.Nullable + public String getAp() { + return ap; + } + + public void setAp(@jakarta.annotation.Nullable String ap) { + this.ap = ap; + } + + public AlgoUpdateO aq(@jakarta.annotation.Nullable String aq) { + this.aq = aq; + return this; + } + + /** + * Get aq + * + * @return aq + */ + @jakarta.annotation.Nullable + public String getAq() { + return aq; + } + + public void setAq(@jakarta.annotation.Nullable String aq) { + this.aq = aq; + } + + public AlgoUpdateO act(@jakarta.annotation.Nullable String act) { + this.act = act; + return this; + } + + /** + * Get act + * + * @return act + */ + @jakarta.annotation.Nullable + public String getAct() { + return act; + } + + public void setAct(@jakarta.annotation.Nullable String act) { + this.act = act; + } + + public AlgoUpdateO tp(@jakarta.annotation.Nullable String tp) { + this.tp = tp; + return this; + } + + /** + * Get tp + * + * @return tp + */ + @jakarta.annotation.Nullable + public String getTp() { + return tp; + } + + public void setTp(@jakarta.annotation.Nullable String tp) { + this.tp = tp; + } + + public AlgoUpdateO pLowerCase(@jakarta.annotation.Nullable String pLowerCase) { + this.pLowerCase = pLowerCase; + return this; + } + + /** + * Get pLowerCase + * + * @return pLowerCase + */ + @jakarta.annotation.Nullable + public String getpLowerCase() { + return pLowerCase; + } + + public void setpLowerCase(@jakarta.annotation.Nullable String pLowerCase) { + this.pLowerCase = pLowerCase; + } + + public AlgoUpdateO V(@jakarta.annotation.Nullable String V) { + this.V = V; + return this; + } + + /** + * Get V + * + * @return V + */ + @jakarta.annotation.Nullable + public String getV() { + return V; + } + + public void setV(@jakarta.annotation.Nullable String V) { + this.V = V; + } + + public AlgoUpdateO wt(@jakarta.annotation.Nullable String wt) { + this.wt = wt; + return this; + } + + /** + * Get wt + * + * @return wt + */ + @jakarta.annotation.Nullable + public String getWt() { + return wt; + } + + public void setWt(@jakarta.annotation.Nullable String wt) { + this.wt = wt; + } + + public AlgoUpdateO pm(@jakarta.annotation.Nullable String pm) { + this.pm = pm; + return this; + } + + /** + * Get pm + * + * @return pm + */ + @jakarta.annotation.Nullable + public String getPm() { + return pm; + } + + public void setPm(@jakarta.annotation.Nullable String pm) { + this.pm = pm; + } + + public AlgoUpdateO cp(@jakarta.annotation.Nullable Boolean cp) { + this.cp = cp; + return this; + } + + /** + * Get cp + * + * @return cp + */ + @jakarta.annotation.Nullable + public Boolean getCp() { + return cp; + } + + public void setCp(@jakarta.annotation.Nullable Boolean cp) { + this.cp = cp; + } + + public AlgoUpdateO pP(@jakarta.annotation.Nullable Boolean pP) { + this.pP = pP; + return this; + } + + /** + * Get pP + * + * @return pP + */ + @jakarta.annotation.Nullable + public Boolean getpP() { + return pP; + } + + public void setpP(@jakarta.annotation.Nullable Boolean pP) { + this.pP = pP; + } + + public AlgoUpdateO R(@jakarta.annotation.Nullable Boolean R) { + this.R = R; + return this; + } + + /** + * Get R + * + * @return R + */ + @jakarta.annotation.Nullable + public Boolean getR() { + return R; + } + + public void setR(@jakarta.annotation.Nullable Boolean R) { + this.R = R; + } + + public AlgoUpdateO tt(@jakarta.annotation.Nullable Long tt) { + this.tt = tt; + return this; + } + + /** + * Get tt + * + * @return tt + */ + @jakarta.annotation.Nullable + public Long getTt() { + return tt; + } + + public void setTt(@jakarta.annotation.Nullable Long tt) { + this.tt = tt; + } + + public AlgoUpdateO gtd(@jakarta.annotation.Nullable Long gtd) { + this.gtd = gtd; + return this; + } + + /** + * Get gtd + * + * @return gtd + */ + @jakarta.annotation.Nullable + public Long getGtd() { + return gtd; + } + + public void setGtd(@jakarta.annotation.Nullable Long gtd) { + this.gtd = gtd; + } + + public AlgoUpdateO rm(@jakarta.annotation.Nullable String rm) { + this.rm = rm; + return this; + } + + /** + * Get rm + * + * @return rm + */ + @jakarta.annotation.Nullable + public String getRm() { + return rm; + } + + public void setRm(@jakarta.annotation.Nullable String rm) { + this.rm = rm; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlgoUpdateO algoUpdateO = (AlgoUpdateO) o; + return Objects.equals(this.caid, algoUpdateO.caid) + && Objects.equals(this.aid, algoUpdateO.aid) + && Objects.equals(this.at, algoUpdateO.at) + && Objects.equals(this.oLowerCase, algoUpdateO.oLowerCase) + && Objects.equals(this.sLowerCase, algoUpdateO.sLowerCase) + && Objects.equals(this.S, algoUpdateO.S) + && Objects.equals(this.ps, algoUpdateO.ps) + && Objects.equals(this.fLowerCase, algoUpdateO.fLowerCase) + && Objects.equals(this.qLowerCase, algoUpdateO.qLowerCase) + && Objects.equals(this.X, algoUpdateO.X) + && Objects.equals(this.ai, algoUpdateO.ai) + && Objects.equals(this.ap, algoUpdateO.ap) + && Objects.equals(this.aq, algoUpdateO.aq) + && Objects.equals(this.act, algoUpdateO.act) + && Objects.equals(this.tp, algoUpdateO.tp) + && Objects.equals(this.pLowerCase, algoUpdateO.pLowerCase) + && Objects.equals(this.V, algoUpdateO.V) + && Objects.equals(this.wt, algoUpdateO.wt) + && Objects.equals(this.pm, algoUpdateO.pm) + && Objects.equals(this.cp, algoUpdateO.cp) + && Objects.equals(this.pP, algoUpdateO.pP) + && Objects.equals(this.R, algoUpdateO.R) + && Objects.equals(this.tt, algoUpdateO.tt) + && Objects.equals(this.gtd, algoUpdateO.gtd) + && Objects.equals(this.rm, algoUpdateO.rm); + } + + @Override + public int hashCode() { + return Objects.hash( + caid, + aid, + at, + oLowerCase, + sLowerCase, + S, + ps, + fLowerCase, + qLowerCase, + X, + ai, + ap, + aq, + act, + tp, + pLowerCase, + V, + wt, + pm, + cp, + pP, + R, + tt, + gtd, + rm); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlgoUpdateO {\n"); + sb.append(" caid: ").append(toIndentedString(caid)).append("\n"); + sb.append(" aid: ").append(toIndentedString(aid)).append("\n"); + sb.append(" at: ").append(toIndentedString(at)).append("\n"); + sb.append(" oLowerCase: ").append(toIndentedString(oLowerCase)).append("\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" S: ").append(toIndentedString(S)).append("\n"); + sb.append(" ps: ").append(toIndentedString(ps)).append("\n"); + sb.append(" fLowerCase: ").append(toIndentedString(fLowerCase)).append("\n"); + sb.append(" qLowerCase: ").append(toIndentedString(qLowerCase)).append("\n"); + sb.append(" X: ").append(toIndentedString(X)).append("\n"); + sb.append(" ai: ").append(toIndentedString(ai)).append("\n"); + sb.append(" ap: ").append(toIndentedString(ap)).append("\n"); + sb.append(" aq: ").append(toIndentedString(aq)).append("\n"); + sb.append(" act: ").append(toIndentedString(act)).append("\n"); + sb.append(" tp: ").append(toIndentedString(tp)).append("\n"); + sb.append(" pLowerCase: ").append(toIndentedString(pLowerCase)).append("\n"); + sb.append(" V: ").append(toIndentedString(V)).append("\n"); + sb.append(" wt: ").append(toIndentedString(wt)).append("\n"); + sb.append(" pm: ").append(toIndentedString(pm)).append("\n"); + sb.append(" cp: ").append(toIndentedString(cp)).append("\n"); + sb.append(" pP: ").append(toIndentedString(pP)).append("\n"); + sb.append(" R: ").append(toIndentedString(R)).append("\n"); + sb.append(" tt: ").append(toIndentedString(tt)).append("\n"); + sb.append(" gtd: ").append(toIndentedString(gtd)).append("\n"); + sb.append(" rm: ").append(toIndentedString(rm)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String caidValue = getCaid(); + if (caidValue != null) { + String caidValueAsString = caidValue.toString(); + valMap.put("caid", caidValueAsString); + } + Long aidValue = getAid(); + if (aidValue != null) { + String aidValueAsString = aidValue.toString(); + valMap.put("aid", aidValueAsString); + } + String atValue = getAt(); + if (atValue != null) { + String atValueAsString = atValue.toString(); + valMap.put("at", atValueAsString); + } + String oLowerCaseValue = getoLowerCase(); + if (oLowerCaseValue != null) { + String oLowerCaseValueAsString = oLowerCaseValue.toString(); + valMap.put("oLowerCase", oLowerCaseValueAsString); + } + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); + } + String SValue = getS(); + if (SValue != null) { + String SValueAsString = SValue.toString(); + valMap.put("S", SValueAsString); + } + String psValue = getPs(); + if (psValue != null) { + String psValueAsString = psValue.toString(); + valMap.put("ps", psValueAsString); + } + String fLowerCaseValue = getfLowerCase(); + if (fLowerCaseValue != null) { + String fLowerCaseValueAsString = fLowerCaseValue.toString(); + valMap.put("fLowerCase", fLowerCaseValueAsString); + } + String qLowerCaseValue = getqLowerCase(); + if (qLowerCaseValue != null) { + String qLowerCaseValueAsString = qLowerCaseValue.toString(); + valMap.put("qLowerCase", qLowerCaseValueAsString); + } + String XValue = getX(); + if (XValue != null) { + String XValueAsString = XValue.toString(); + valMap.put("X", XValueAsString); + } + String aiValue = getAi(); + if (aiValue != null) { + String aiValueAsString = aiValue.toString(); + valMap.put("ai", aiValueAsString); + } + String apValue = getAp(); + if (apValue != null) { + String apValueAsString = apValue.toString(); + valMap.put("ap", apValueAsString); + } + String aqValue = getAq(); + if (aqValue != null) { + String aqValueAsString = aqValue.toString(); + valMap.put("aq", aqValueAsString); + } + String actValue = getAct(); + if (actValue != null) { + String actValueAsString = actValue.toString(); + valMap.put("act", actValueAsString); + } + String tpValue = getTp(); + if (tpValue != null) { + String tpValueAsString = tpValue.toString(); + valMap.put("tp", tpValueAsString); + } + String pLowerCaseValue = getpLowerCase(); + if (pLowerCaseValue != null) { + String pLowerCaseValueAsString = pLowerCaseValue.toString(); + valMap.put("pLowerCase", pLowerCaseValueAsString); + } + String VValue = getV(); + if (VValue != null) { + String VValueAsString = VValue.toString(); + valMap.put("V", VValueAsString); + } + String wtValue = getWt(); + if (wtValue != null) { + String wtValueAsString = wtValue.toString(); + valMap.put("wt", wtValueAsString); + } + String pmValue = getPm(); + if (pmValue != null) { + String pmValueAsString = pmValue.toString(); + valMap.put("pm", pmValueAsString); + } + Boolean cpValue = getCp(); + if (cpValue != null) { + String cpValueAsString = cpValue.toString(); + valMap.put("cp", cpValueAsString); + } + Boolean pPValue = getpP(); + if (pPValue != null) { + String pPValueAsString = pPValue.toString(); + valMap.put("pP", pPValueAsString); + } + Boolean RValue = getR(); + if (RValue != null) { + String RValueAsString = RValue.toString(); + valMap.put("R", RValueAsString); + } + Long ttValue = getTt(); + if (ttValue != null) { + String ttValueAsString = ttValue.toString(); + valMap.put("tt", ttValueAsString); + } + Long gtdValue = getGtd(); + if (gtdValue != null) { + String gtdValueAsString = gtdValue.toString(); + valMap.put("gtd", gtdValueAsString); + } + String rmValue = getRm(); + if (rmValue != null) { + String rmValueAsString = rmValue.toString(); + valMap.put("rm", rmValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object caidValue = getCaid(); + if (caidValue != null) { + valMap.put("caid", caidValue); + } + Object aidValue = getAid(); + if (aidValue != null) { + valMap.put("aid", aidValue); + } + Object atValue = getAt(); + if (atValue != null) { + valMap.put("at", atValue); + } + Object oLowerCaseValue = getoLowerCase(); + if (oLowerCaseValue != null) { + valMap.put("oLowerCase", oLowerCaseValue); + } + Object sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + Object SValue = getS(); + if (SValue != null) { + valMap.put("S", SValue); + } + Object psValue = getPs(); + if (psValue != null) { + valMap.put("ps", psValue); + } + Object fLowerCaseValue = getfLowerCase(); + if (fLowerCaseValue != null) { + valMap.put("fLowerCase", fLowerCaseValue); + } + Object qLowerCaseValue = getqLowerCase(); + if (qLowerCaseValue != null) { + valMap.put("qLowerCase", qLowerCaseValue); + } + Object XValue = getX(); + if (XValue != null) { + valMap.put("X", XValue); + } + Object aiValue = getAi(); + if (aiValue != null) { + valMap.put("ai", aiValue); + } + Object apValue = getAp(); + if (apValue != null) { + valMap.put("ap", apValue); + } + Object aqValue = getAq(); + if (aqValue != null) { + valMap.put("aq", aqValue); + } + Object actValue = getAct(); + if (actValue != null) { + valMap.put("act", actValue); + } + Object tpValue = getTp(); + if (tpValue != null) { + valMap.put("tp", tpValue); + } + Object pLowerCaseValue = getpLowerCase(); + if (pLowerCaseValue != null) { + valMap.put("pLowerCase", pLowerCaseValue); + } + Object VValue = getV(); + if (VValue != null) { + valMap.put("V", VValue); + } + Object wtValue = getWt(); + if (wtValue != null) { + valMap.put("wt", wtValue); + } + Object pmValue = getPm(); + if (pmValue != null) { + valMap.put("pm", pmValue); + } + Object cpValue = getCp(); + if (cpValue != null) { + valMap.put("cp", cpValue); + } + Object pPValue = getpP(); + if (pPValue != null) { + valMap.put("pP", pPValue); + } + Object RValue = getR(); + if (RValue != null) { + valMap.put("R", RValue); + } + Object ttValue = getTt(); + if (ttValue != null) { + valMap.put("tt", ttValue); + } + Object gtdValue = getGtd(); + if (gtdValue != null) { + valMap.put("gtd", gtdValue); + } + Object rmValue = getRm(); + if (rmValue != null) { + valMap.put("rm", rmValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("caid"); + openapiFields.add("aid"); + openapiFields.add("at"); + openapiFields.add("o"); + openapiFields.add("s"); + openapiFields.add("S"); + openapiFields.add("ps"); + openapiFields.add("f"); + openapiFields.add("q"); + openapiFields.add("X"); + openapiFields.add("ai"); + openapiFields.add("ap"); + openapiFields.add("aq"); + openapiFields.add("act"); + openapiFields.add("tp"); + openapiFields.add("p"); + openapiFields.add("V"); + openapiFields.add("wt"); + openapiFields.add("pm"); + openapiFields.add("cp"); + openapiFields.add("pP"); + openapiFields.add("R"); + openapiFields.add("tt"); + openapiFields.add("gtd"); + openapiFields.add("rm"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AlgoUpdateO + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AlgoUpdateO.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AlgoUpdateO is not found in the empty" + + " JSON string", + AlgoUpdateO.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AlgoUpdateO.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AlgoUpdateO` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("caid") != null && !jsonObj.get("caid").isJsonNull()) + && !jsonObj.get("caid").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `caid` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("caid").toString())); + } + if ((jsonObj.get("at") != null && !jsonObj.get("at").isJsonNull()) + && !jsonObj.get("at").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `at` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("at").toString())); + } + if ((jsonObj.get("o") != null && !jsonObj.get("o").isJsonNull()) + && !jsonObj.get("o").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `o` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("o").toString())); + } + if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) + && !jsonObj.get("s").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `s` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("s").toString())); + } + if ((jsonObj.get("S") != null && !jsonObj.get("S").isJsonNull()) + && !jsonObj.get("S").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `S` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("S").toString())); + } + if ((jsonObj.get("ps") != null && !jsonObj.get("ps").isJsonNull()) + && !jsonObj.get("ps").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ps` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ps").toString())); + } + if ((jsonObj.get("f") != null && !jsonObj.get("f").isJsonNull()) + && !jsonObj.get("f").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `f` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("f").toString())); + } + if ((jsonObj.get("q") != null && !jsonObj.get("q").isJsonNull()) + && !jsonObj.get("q").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `q` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("q").toString())); + } + if ((jsonObj.get("X") != null && !jsonObj.get("X").isJsonNull()) + && !jsonObj.get("X").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `X` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("X").toString())); + } + if ((jsonObj.get("ai") != null && !jsonObj.get("ai").isJsonNull()) + && !jsonObj.get("ai").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ai` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ai").toString())); + } + if ((jsonObj.get("ap") != null && !jsonObj.get("ap").isJsonNull()) + && !jsonObj.get("ap").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ap` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ap").toString())); + } + if ((jsonObj.get("aq") != null && !jsonObj.get("aq").isJsonNull()) + && !jsonObj.get("aq").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `aq` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("aq").toString())); + } + if ((jsonObj.get("act") != null && !jsonObj.get("act").isJsonNull()) + && !jsonObj.get("act").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `act` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("act").toString())); + } + if ((jsonObj.get("tp") != null && !jsonObj.get("tp").isJsonNull()) + && !jsonObj.get("tp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tp` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("tp").toString())); + } + if ((jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) + && !jsonObj.get("p").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `p` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("p").toString())); + } + if ((jsonObj.get("V") != null && !jsonObj.get("V").isJsonNull()) + && !jsonObj.get("V").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `V` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("V").toString())); + } + if ((jsonObj.get("wt") != null && !jsonObj.get("wt").isJsonNull()) + && !jsonObj.get("wt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `wt` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("wt").toString())); + } + if ((jsonObj.get("pm") != null && !jsonObj.get("pm").isJsonNull()) + && !jsonObj.get("pm").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pm` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("pm").toString())); + } + if ((jsonObj.get("rm") != null && !jsonObj.get("rm").isJsonNull()) + && !jsonObj.get("rm").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rm` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("rm").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AlgoUpdateO.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AlgoUpdateO' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AlgoUpdateO.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AlgoUpdateO value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AlgoUpdateO read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AlgoUpdateO given an JSON string + * + * @param jsonString JSON string + * @return An instance of AlgoUpdateO + * @throws IOException if the JSON string is invalid with respect to AlgoUpdateO + */ + public static AlgoUpdateO fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AlgoUpdateO.class); + } + + /** + * Convert an instance of AlgoUpdateO to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/RpiDiffBookDepthStreamsRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/RpiDiffBookDepthStreamsRequest.java new file mode 100644 index 00000000..a02e51c8 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/RpiDiffBookDepthStreamsRequest.java @@ -0,0 +1,302 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** RpiDiffBookDepthStreamsRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RpiDiffBookDepthStreamsRequest extends BaseDTO { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @jakarta.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nonnull + private String symbol; + + public RpiDiffBookDepthStreamsRequest() {} + + public RpiDiffBookDepthStreamsRequest id(@jakarta.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @jakarta.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@jakarta.annotation.Nullable String id) { + this.id = id; + } + + public RpiDiffBookDepthStreamsRequest symbol(@jakarta.annotation.Nonnull String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nonnull + @NotNull + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nonnull String symbol) { + this.symbol = symbol; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RpiDiffBookDepthStreamsRequest rpiDiffBookDepthStreamsRequest = + (RpiDiffBookDepthStreamsRequest) o; + return Objects.equals(this.id, rpiDiffBookDepthStreamsRequest.id) + && Objects.equals(this.symbol, rpiDiffBookDepthStreamsRequest.symbol); + } + + @Override + public int hashCode() { + return Objects.hash(id, symbol); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RpiDiffBookDepthStreamsRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String idValue = getId(); + if (idValue != null) { + String idValueAsString = idValue.toString(); + valMap.put("id", idValueAsString); + } + String symbolValue = getSymbol(); + if (symbolValue != null) { + String symbolValueAsString = symbolValue.toString(); + valMap.put("symbol", symbolValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object idValue = getId(); + if (idValue != null) { + valMap.put("id", idValue); + } + Object symbolValue = getSymbol(); + if (symbolValue != null) { + valMap.put("symbol", symbolValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("symbol"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("symbol"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * RpiDiffBookDepthStreamsRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RpiDiffBookDepthStreamsRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RpiDiffBookDepthStreamsRequest is not" + + " found in the empty JSON string", + RpiDiffBookDepthStreamsRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RpiDiffBookDepthStreamsRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RpiDiffBookDepthStreamsRequest` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RpiDiffBookDepthStreamsRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RpiDiffBookDepthStreamsRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RpiDiffBookDepthStreamsRequest' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RpiDiffBookDepthStreamsRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RpiDiffBookDepthStreamsRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RpiDiffBookDepthStreamsRequest read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RpiDiffBookDepthStreamsRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RpiDiffBookDepthStreamsRequest + * @throws IOException if the JSON string is invalid with respect to + * RpiDiffBookDepthStreamsRequest + */ + public static RpiDiffBookDepthStreamsRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RpiDiffBookDepthStreamsRequest.class); + } + + /** + * Convert an instance of RpiDiffBookDepthStreamsRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/RpiDiffBookDepthStreamsResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/RpiDiffBookDepthStreamsResponse.java new file mode 100644 index 00000000..e71b7bc9 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/RpiDiffBookDepthStreamsResponse.java @@ -0,0 +1,599 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** RpiDiffBookDepthStreamsResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RpiDiffBookDepthStreamsResponse extends BaseDTO { + public static final String SERIALIZED_NAME_E_LOWER_CASE = "e"; + + @SerializedName(SERIALIZED_NAME_E_LOWER_CASE) + @jakarta.annotation.Nullable + private String eLowerCase; + + public static final String SERIALIZED_NAME_E = "E"; + + @SerializedName(SERIALIZED_NAME_E) + @jakarta.annotation.Nullable + private Long E; + + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; + + @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) + @jakarta.annotation.Nullable + private String sLowerCase; + + public static final String SERIALIZED_NAME_U = "U"; + + @SerializedName(SERIALIZED_NAME_U) + @jakarta.annotation.Nullable + private Long U; + + public static final String SERIALIZED_NAME_U_LOWER_CASE = "u"; + + @SerializedName(SERIALIZED_NAME_U_LOWER_CASE) + @jakarta.annotation.Nullable + private Long uLowerCase; + + public static final String SERIALIZED_NAME_PU = "pu"; + + @SerializedName(SERIALIZED_NAME_PU) + @jakarta.annotation.Nullable + private Long pu; + + public static final String SERIALIZED_NAME_B_LOWER_CASE = "b"; + + @SerializedName(SERIALIZED_NAME_B_LOWER_CASE) + @jakarta.annotation.Nullable + private List bLowerCase; + + public static final String SERIALIZED_NAME_A_LOWER_CASE = "a"; + + @SerializedName(SERIALIZED_NAME_A_LOWER_CASE) + @jakarta.annotation.Nullable + private List aLowerCase; + + public RpiDiffBookDepthStreamsResponse() {} + + public RpiDiffBookDepthStreamsResponse eLowerCase( + @jakarta.annotation.Nullable String eLowerCase) { + this.eLowerCase = eLowerCase; + return this; + } + + /** + * Get eLowerCase + * + * @return eLowerCase + */ + @jakarta.annotation.Nullable + public String geteLowerCase() { + return eLowerCase; + } + + public void seteLowerCase(@jakarta.annotation.Nullable String eLowerCase) { + this.eLowerCase = eLowerCase; + } + + public RpiDiffBookDepthStreamsResponse E(@jakarta.annotation.Nullable Long E) { + this.E = E; + return this; + } + + /** + * Get E + * + * @return E + */ + @jakarta.annotation.Nullable + public Long getE() { + return E; + } + + public void setE(@jakarta.annotation.Nullable Long E) { + this.E = E; + } + + public RpiDiffBookDepthStreamsResponse T(@jakarta.annotation.Nullable Long T) { + this.T = T; + return this; + } + + /** + * Get T + * + * @return T + */ + @jakarta.annotation.Nullable + public Long getT() { + return T; + } + + public void setT(@jakarta.annotation.Nullable Long T) { + this.T = T; + } + + public RpiDiffBookDepthStreamsResponse sLowerCase( + @jakarta.annotation.Nullable String sLowerCase) { + this.sLowerCase = sLowerCase; + return this; + } + + /** + * Get sLowerCase + * + * @return sLowerCase + */ + @jakarta.annotation.Nullable + public String getsLowerCase() { + return sLowerCase; + } + + public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { + this.sLowerCase = sLowerCase; + } + + public RpiDiffBookDepthStreamsResponse U(@jakarta.annotation.Nullable Long U) { + this.U = U; + return this; + } + + /** + * Get U + * + * @return U + */ + @jakarta.annotation.Nullable + public Long getU() { + return U; + } + + public void setU(@jakarta.annotation.Nullable Long U) { + this.U = U; + } + + public RpiDiffBookDepthStreamsResponse uLowerCase( + @jakarta.annotation.Nullable Long uLowerCase) { + this.uLowerCase = uLowerCase; + return this; + } + + /** + * Get uLowerCase + * + * @return uLowerCase + */ + @jakarta.annotation.Nullable + public Long getuLowerCase() { + return uLowerCase; + } + + public void setuLowerCase(@jakarta.annotation.Nullable Long uLowerCase) { + this.uLowerCase = uLowerCase; + } + + public RpiDiffBookDepthStreamsResponse pu(@jakarta.annotation.Nullable Long pu) { + this.pu = pu; + return this; + } + + /** + * Get pu + * + * @return pu + */ + @jakarta.annotation.Nullable + public Long getPu() { + return pu; + } + + public void setPu(@jakarta.annotation.Nullable Long pu) { + this.pu = pu; + } + + public RpiDiffBookDepthStreamsResponse bLowerCase( + @jakarta.annotation.Nullable List bLowerCase) { + this.bLowerCase = bLowerCase; + return this; + } + + public RpiDiffBookDepthStreamsResponse addBLowerCaseItem( + RpiDiffBookDepthStreamsResponseBItem bLowerCaseItem) { + if (this.bLowerCase == null) { + this.bLowerCase = new ArrayList<>(); + } + this.bLowerCase.add(bLowerCaseItem); + return this; + } + + /** + * Get bLowerCase + * + * @return bLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public List getbLowerCase() { + return bLowerCase; + } + + public void setbLowerCase( + @jakarta.annotation.Nullable List bLowerCase) { + this.bLowerCase = bLowerCase; + } + + public RpiDiffBookDepthStreamsResponse aLowerCase( + @jakarta.annotation.Nullable List aLowerCase) { + this.aLowerCase = aLowerCase; + return this; + } + + public RpiDiffBookDepthStreamsResponse addALowerCaseItem( + RpiDiffBookDepthStreamsResponseAItem aLowerCaseItem) { + if (this.aLowerCase == null) { + this.aLowerCase = new ArrayList<>(); + } + this.aLowerCase.add(aLowerCaseItem); + return this; + } + + /** + * Get aLowerCase + * + * @return aLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public List getaLowerCase() { + return aLowerCase; + } + + public void setaLowerCase( + @jakarta.annotation.Nullable List aLowerCase) { + this.aLowerCase = aLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RpiDiffBookDepthStreamsResponse rpiDiffBookDepthStreamsResponse = + (RpiDiffBookDepthStreamsResponse) o; + return Objects.equals(this.eLowerCase, rpiDiffBookDepthStreamsResponse.eLowerCase) + && Objects.equals(this.E, rpiDiffBookDepthStreamsResponse.E) + && Objects.equals(this.T, rpiDiffBookDepthStreamsResponse.T) + && Objects.equals(this.sLowerCase, rpiDiffBookDepthStreamsResponse.sLowerCase) + && Objects.equals(this.U, rpiDiffBookDepthStreamsResponse.U) + && Objects.equals(this.uLowerCase, rpiDiffBookDepthStreamsResponse.uLowerCase) + && Objects.equals(this.pu, rpiDiffBookDepthStreamsResponse.pu) + && Objects.equals(this.bLowerCase, rpiDiffBookDepthStreamsResponse.bLowerCase) + && Objects.equals(this.aLowerCase, rpiDiffBookDepthStreamsResponse.aLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash( + eLowerCase, E, T, sLowerCase, U, uLowerCase, pu, bLowerCase, aLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RpiDiffBookDepthStreamsResponse {\n"); + sb.append(" eLowerCase: ").append(toIndentedString(eLowerCase)).append("\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" U: ").append(toIndentedString(U)).append("\n"); + sb.append(" uLowerCase: ").append(toIndentedString(uLowerCase)).append("\n"); + sb.append(" pu: ").append(toIndentedString(pu)).append("\n"); + sb.append(" bLowerCase: ").append(toIndentedString(bLowerCase)).append("\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String eLowerCaseValue = geteLowerCase(); + if (eLowerCaseValue != null) { + String eLowerCaseValueAsString = eLowerCaseValue.toString(); + valMap.put("eLowerCase", eLowerCaseValueAsString); + } + Long EValue = getE(); + if (EValue != null) { + String EValueAsString = EValue.toString(); + valMap.put("E", EValueAsString); + } + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); + } + Long UValue = getU(); + if (UValue != null) { + String UValueAsString = UValue.toString(); + valMap.put("U", UValueAsString); + } + Long uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + String uLowerCaseValueAsString = uLowerCaseValue.toString(); + valMap.put("uLowerCase", uLowerCaseValueAsString); + } + Long puValue = getPu(); + if (puValue != null) { + String puValueAsString = puValue.toString(); + valMap.put("pu", puValueAsString); + } + List bLowerCaseValue = getbLowerCase(); + if (bLowerCaseValue != null) { + String bLowerCaseValueAsString = JSON.getGson().toJson(bLowerCaseValue); + valMap.put("bLowerCase", bLowerCaseValueAsString); + } + List aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + String aLowerCaseValueAsString = JSON.getGson().toJson(aLowerCaseValue); + valMap.put("aLowerCase", aLowerCaseValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object eLowerCaseValue = geteLowerCase(); + if (eLowerCaseValue != null) { + valMap.put("eLowerCase", eLowerCaseValue); + } + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + Object UValue = getU(); + if (UValue != null) { + valMap.put("U", UValue); + } + Object uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + valMap.put("uLowerCase", uLowerCaseValue); + } + Object puValue = getPu(); + if (puValue != null) { + valMap.put("pu", puValue); + } + Object bLowerCaseValue = getbLowerCase(); + if (bLowerCaseValue != null) { + valMap.put("bLowerCase", bLowerCaseValue); + } + Object aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + valMap.put("aLowerCase", aLowerCaseValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("e"); + openapiFields.add("E"); + openapiFields.add("T"); + openapiFields.add("s"); + openapiFields.add("U"); + openapiFields.add("u"); + openapiFields.add("pu"); + openapiFields.add("b"); + openapiFields.add("a"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * RpiDiffBookDepthStreamsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RpiDiffBookDepthStreamsResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RpiDiffBookDepthStreamsResponse is not" + + " found in the empty JSON string", + RpiDiffBookDepthStreamsResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RpiDiffBookDepthStreamsResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RpiDiffBookDepthStreamsResponse` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("e") != null && !jsonObj.get("e").isJsonNull()) + && !jsonObj.get("e").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `e` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("e").toString())); + } + if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) + && !jsonObj.get("s").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `s` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("s").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("b") != null + && !jsonObj.get("b").isJsonNull() + && !jsonObj.get("b").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `b` to be an array in the JSON string but got `%s`", + jsonObj.get("b").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("a") != null + && !jsonObj.get("a").isJsonNull() + && !jsonObj.get("a").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `a` to be an array in the JSON string but got `%s`", + jsonObj.get("a").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RpiDiffBookDepthStreamsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RpiDiffBookDepthStreamsResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RpiDiffBookDepthStreamsResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RpiDiffBookDepthStreamsResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RpiDiffBookDepthStreamsResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RpiDiffBookDepthStreamsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RpiDiffBookDepthStreamsResponse + * @throws IOException if the JSON string is invalid with respect to + * RpiDiffBookDepthStreamsResponse + */ + public static RpiDiffBookDepthStreamsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RpiDiffBookDepthStreamsResponse.class); + } + + /** + * Convert an instance of RpiDiffBookDepthStreamsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/RpiDiffBookDepthStreamsResponseAItem.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/RpiDiffBookDepthStreamsResponseAItem.java new file mode 100644 index 00000000..1d29cb89 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/RpiDiffBookDepthStreamsResponseAItem.java @@ -0,0 +1,198 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** RpiDiffBookDepthStreamsResponseAItem */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RpiDiffBookDepthStreamsResponseAItem extends ArrayList { + public RpiDiffBookDepthStreamsResponseAItem() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RpiDiffBookDepthStreamsResponseAItem {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * RpiDiffBookDepthStreamsResponseAItem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RpiDiffBookDepthStreamsResponseAItem.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RpiDiffBookDepthStreamsResponseAItem" + + " is not found in the empty JSON string", + RpiDiffBookDepthStreamsResponseAItem.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RpiDiffBookDepthStreamsResponseAItem.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RpiDiffBookDepthStreamsResponseAItem` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RpiDiffBookDepthStreamsResponseAItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RpiDiffBookDepthStreamsResponseAItem' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RpiDiffBookDepthStreamsResponseAItem.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, RpiDiffBookDepthStreamsResponseAItem value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + elementAdapter.write(out, obj); + } + + @Override + public RpiDiffBookDepthStreamsResponseAItem read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RpiDiffBookDepthStreamsResponseAItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of RpiDiffBookDepthStreamsResponseAItem + * @throws IOException if the JSON string is invalid with respect to + * RpiDiffBookDepthStreamsResponseAItem + */ + public static RpiDiffBookDepthStreamsResponseAItem fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, RpiDiffBookDepthStreamsResponseAItem.class); + } + + /** + * Convert an instance of RpiDiffBookDepthStreamsResponseAItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/RpiDiffBookDepthStreamsResponseBItem.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/RpiDiffBookDepthStreamsResponseBItem.java new file mode 100644 index 00000000..b86cb328 --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/RpiDiffBookDepthStreamsResponseBItem.java @@ -0,0 +1,198 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** RpiDiffBookDepthStreamsResponseBItem */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RpiDiffBookDepthStreamsResponseBItem extends ArrayList { + public RpiDiffBookDepthStreamsResponseBItem() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RpiDiffBookDepthStreamsResponseBItem {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * RpiDiffBookDepthStreamsResponseBItem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RpiDiffBookDepthStreamsResponseBItem.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RpiDiffBookDepthStreamsResponseBItem" + + " is not found in the empty JSON string", + RpiDiffBookDepthStreamsResponseBItem.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RpiDiffBookDepthStreamsResponseBItem.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RpiDiffBookDepthStreamsResponseBItem` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RpiDiffBookDepthStreamsResponseBItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RpiDiffBookDepthStreamsResponseBItem' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RpiDiffBookDepthStreamsResponseBItem.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, RpiDiffBookDepthStreamsResponseBItem value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + elementAdapter.write(out, obj); + } + + @Override + public RpiDiffBookDepthStreamsResponseBItem read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RpiDiffBookDepthStreamsResponseBItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of RpiDiffBookDepthStreamsResponseBItem + * @throws IOException if the JSON string is invalid with respect to + * RpiDiffBookDepthStreamsResponseBItem + */ + public static RpiDiffBookDepthStreamsResponseBItem fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, RpiDiffBookDepthStreamsResponseBItem.class); + } + + /** + * Convert an instance of RpiDiffBookDepthStreamsResponseBItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/TradingSessionStreamRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/TradingSessionStreamRequest.java new file mode 100644 index 00000000..586d8d0c --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/TradingSessionStreamRequest.java @@ -0,0 +1,242 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** TradingSessionStreamRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TradingSessionStreamRequest extends BaseDTO { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @jakarta.annotation.Nullable + private String id; + + public TradingSessionStreamRequest() {} + + public TradingSessionStreamRequest id(@jakarta.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @jakarta.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@jakarta.annotation.Nullable String id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TradingSessionStreamRequest tradingSessionStreamRequest = (TradingSessionStreamRequest) o; + return Objects.equals(this.id, tradingSessionStreamRequest.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TradingSessionStreamRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String idValue = getId(); + if (idValue != null) { + String idValueAsString = idValue.toString(); + valMap.put("id", idValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object idValue = getId(); + if (idValue != null) { + valMap.put("id", idValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * TradingSessionStreamRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TradingSessionStreamRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in TradingSessionStreamRequest is not" + + " found in the empty JSON string", + TradingSessionStreamRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TradingSessionStreamRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `TradingSessionStreamRequest` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TradingSessionStreamRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TradingSessionStreamRequest' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(TradingSessionStreamRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TradingSessionStreamRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TradingSessionStreamRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TradingSessionStreamRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of TradingSessionStreamRequest + * @throws IOException if the JSON string is invalid with respect to TradingSessionStreamRequest + */ + public static TradingSessionStreamRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TradingSessionStreamRequest.class); + } + + /** + * Convert an instance of TradingSessionStreamRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/TradingSessionStreamResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/TradingSessionStreamResponse.java new file mode 100644 index 00000000..cef18b6c --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/TradingSessionStreamResponse.java @@ -0,0 +1,401 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** TradingSessionStreamResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class TradingSessionStreamResponse extends BaseDTO { + public static final String SERIALIZED_NAME_E_LOWER_CASE = "e"; + + @SerializedName(SERIALIZED_NAME_E_LOWER_CASE) + @jakarta.annotation.Nullable + private String eLowerCase; + + public static final String SERIALIZED_NAME_E = "E"; + + @SerializedName(SERIALIZED_NAME_E) + @jakarta.annotation.Nullable + private Long E; + + public static final String SERIALIZED_NAME_T_LOWER_CASE = "t"; + + @SerializedName(SERIALIZED_NAME_T_LOWER_CASE) + @jakarta.annotation.Nullable + private Long tLowerCase; + + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public static final String SERIALIZED_NAME_S = "S"; + + @SerializedName(SERIALIZED_NAME_S) + @jakarta.annotation.Nullable + private String S; + + public TradingSessionStreamResponse() {} + + public TradingSessionStreamResponse eLowerCase(@jakarta.annotation.Nullable String eLowerCase) { + this.eLowerCase = eLowerCase; + return this; + } + + /** + * Get eLowerCase + * + * @return eLowerCase + */ + @jakarta.annotation.Nullable + public String geteLowerCase() { + return eLowerCase; + } + + public void seteLowerCase(@jakarta.annotation.Nullable String eLowerCase) { + this.eLowerCase = eLowerCase; + } + + public TradingSessionStreamResponse E(@jakarta.annotation.Nullable Long E) { + this.E = E; + return this; + } + + /** + * Get E + * + * @return E + */ + @jakarta.annotation.Nullable + public Long getE() { + return E; + } + + public void setE(@jakarta.annotation.Nullable Long E) { + this.E = E; + } + + public TradingSessionStreamResponse tLowerCase(@jakarta.annotation.Nullable Long tLowerCase) { + this.tLowerCase = tLowerCase; + return this; + } + + /** + * Get tLowerCase + * + * @return tLowerCase + */ + @jakarta.annotation.Nullable + public Long gettLowerCase() { + return tLowerCase; + } + + public void settLowerCase(@jakarta.annotation.Nullable Long tLowerCase) { + this.tLowerCase = tLowerCase; + } + + public TradingSessionStreamResponse T(@jakarta.annotation.Nullable Long T) { + this.T = T; + return this; + } + + /** + * Get T + * + * @return T + */ + @jakarta.annotation.Nullable + public Long getT() { + return T; + } + + public void setT(@jakarta.annotation.Nullable Long T) { + this.T = T; + } + + public TradingSessionStreamResponse S(@jakarta.annotation.Nullable String S) { + this.S = S; + return this; + } + + /** + * Get S + * + * @return S + */ + @jakarta.annotation.Nullable + public String getS() { + return S; + } + + public void setS(@jakarta.annotation.Nullable String S) { + this.S = S; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TradingSessionStreamResponse tradingSessionStreamResponse = + (TradingSessionStreamResponse) o; + return Objects.equals(this.eLowerCase, tradingSessionStreamResponse.eLowerCase) + && Objects.equals(this.E, tradingSessionStreamResponse.E) + && Objects.equals(this.tLowerCase, tradingSessionStreamResponse.tLowerCase) + && Objects.equals(this.T, tradingSessionStreamResponse.T) + && Objects.equals(this.S, tradingSessionStreamResponse.S); + } + + @Override + public int hashCode() { + return Objects.hash(eLowerCase, E, tLowerCase, T, S); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TradingSessionStreamResponse {\n"); + sb.append(" eLowerCase: ").append(toIndentedString(eLowerCase)).append("\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" tLowerCase: ").append(toIndentedString(tLowerCase)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" S: ").append(toIndentedString(S)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String eLowerCaseValue = geteLowerCase(); + if (eLowerCaseValue != null) { + String eLowerCaseValueAsString = eLowerCaseValue.toString(); + valMap.put("eLowerCase", eLowerCaseValueAsString); + } + Long EValue = getE(); + if (EValue != null) { + String EValueAsString = EValue.toString(); + valMap.put("E", EValueAsString); + } + Long tLowerCaseValue = gettLowerCase(); + if (tLowerCaseValue != null) { + String tLowerCaseValueAsString = tLowerCaseValue.toString(); + valMap.put("tLowerCase", tLowerCaseValueAsString); + } + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + String SValue = getS(); + if (SValue != null) { + String SValueAsString = SValue.toString(); + valMap.put("S", SValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object eLowerCaseValue = geteLowerCase(); + if (eLowerCaseValue != null) { + valMap.put("eLowerCase", eLowerCaseValue); + } + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object tLowerCaseValue = gettLowerCase(); + if (tLowerCaseValue != null) { + valMap.put("tLowerCase", tLowerCaseValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object SValue = getS(); + if (SValue != null) { + valMap.put("S", SValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("e"); + openapiFields.add("E"); + openapiFields.add("t"); + openapiFields.add("T"); + openapiFields.add("S"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * TradingSessionStreamResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TradingSessionStreamResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in TradingSessionStreamResponse is not" + + " found in the empty JSON string", + TradingSessionStreamResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TradingSessionStreamResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `TradingSessionStreamResponse` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("e") != null && !jsonObj.get("e").isJsonNull()) + && !jsonObj.get("e").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `e` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("e").toString())); + } + if ((jsonObj.get("S") != null && !jsonObj.get("S").isJsonNull()) + && !jsonObj.get("S").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `S` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("S").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TradingSessionStreamResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TradingSessionStreamResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(TradingSessionStreamResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TradingSessionStreamResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TradingSessionStreamResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TradingSessionStreamResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of TradingSessionStreamResponse + * @throws IOException if the JSON string is invalid with respect to + * TradingSessionStreamResponse + */ + public static TradingSessionStreamResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TradingSessionStreamResponse.class); + } + + /** + * Convert an instance of TradingSessionStreamResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/UserDataStreamEventsResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/UserDataStreamEventsResponse.java index 86716570..51f8d56e 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/UserDataStreamEventsResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/UserDataStreamEventsResponse.java @@ -49,6 +49,8 @@ public TypeAdapter create(Gson gson, TypeToken type) { final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter adapterAccountConfigUpdate = gson.getDelegateAdapter(this, TypeToken.get(AccountConfigUpdate.class)); + final TypeAdapter adapterAlgoUpdate = + gson.getDelegateAdapter(this, TypeToken.get(AlgoUpdate.class)); final TypeAdapter adapterAccountUpdate = gson.getDelegateAdapter(this, TypeToken.get(AccountUpdate.class)); final TypeAdapter adapterConditionalOrderTriggerReject = @@ -85,6 +87,14 @@ public void write(JsonWriter out, UserDataStreamEventsResponse value) elementAdapter.write(out, element); return; } + // check if the actual instance is of the type `AlgoUpdate` + if (value.getActualInstance() instanceof AlgoUpdate) { + JsonElement element = + adapterAlgoUpdate.toJsonTree( + (AlgoUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } // check if the actual instance is of the type `AccountUpdate` if (value.getActualInstance() instanceof AccountUpdate) { JsonElement element = @@ -154,7 +164,7 @@ public void write(JsonWriter out, UserDataStreamEventsResponse value) } throw new IOException( "Failed to serialize as the type doesn't match oneOf schemas:" - + " AccountConfigUpdate, AccountUpdate," + + " AccountConfigUpdate, AccountUpdate, AlgoUpdate," + " ConditionalOrderTriggerReject, GridUpdate," + " Listenkeyexpired, MarginCall, OrderTradeUpdate," + " StrategyUpdate, TradeLite"); @@ -191,6 +201,11 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { newUserDataStreamEventsResponse.setActualInstance( deserialized); return newUserDataStreamEventsResponse; + case "ALGO_UPDATE": + deserialized = adapterAlgoUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; case "CONDITIONAL_ORDER_TRIGGER_REJECT": deserialized = adapterConditionalOrderTriggerReject.fromJsonTree( @@ -243,6 +258,11 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { newUserDataStreamEventsResponse.setActualInstance( deserialized); return newUserDataStreamEventsResponse; + case "algoUpdate": + deserialized = adapterAlgoUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; case "conditionalOrderTriggerReject": deserialized = adapterConditionalOrderTriggerReject.fromJsonTree( @@ -293,12 +313,13 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { + " for UserDataStreamEventsResponse." + " Possible values:" + " ACCOUNT_CONFIG_UPDATE" - + " ACCOUNT_UPDATE" + + " ACCOUNT_UPDATE ALGO_UPDATE" + " CONDITIONAL_ORDER_TRIGGER_REJECT" + " GRID_UPDATE MARGIN_CALL" + " ORDER_TRADE_UPDATE STRATEGY_UPDATE" + " TRADE_LITE listenKeyExpired" + " accountConfigUpdate accountUpdate" + + " algoUpdate" + " conditionalOrderTriggerReject" + " gridUpdate listenkeyexpired" + " marginCall orderTradeUpdate" @@ -333,6 +354,24 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { "Input data does not match schema 'AccountConfigUpdate'", e); } + // deserialize AlgoUpdate + try { + // validate the JSON object to see if any exception is thrown + AlgoUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterAlgoUpdate; + match++; + log.log(Level.FINER, "Input data matches schema 'AlgoUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AlgoUpdate failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AlgoUpdate'", + e); + } // deserialize AccountUpdate try { // validate the JSON object to see if any exception is thrown @@ -524,6 +563,7 @@ public UserDataStreamEventsResponse(Object o) { static { schemas.put("AccountConfigUpdate", AccountConfigUpdate.class); + schemas.put("AlgoUpdate", AlgoUpdate.class); schemas.put("AccountUpdate", AccountUpdate.class); schemas.put("ConditionalOrderTriggerReject", ConditionalOrderTriggerReject.class); schemas.put("GridUpdate", GridUpdate.class); @@ -541,7 +581,7 @@ public Map> getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: AccountConfigUpdate, AccountUpdate, + * against the oneOf child schemas: AccountConfigUpdate, AccountUpdate, AlgoUpdate, * ConditionalOrderTriggerReject, GridUpdate, Listenkeyexpired, MarginCall, OrderTradeUpdate, * StrategyUpdate, TradeLite * @@ -554,6 +594,11 @@ public void setActualInstance(Object instance) { return; } + if (instance instanceof AlgoUpdate) { + super.setActualInstance(instance); + return; + } + if (instance instanceof AccountUpdate) { super.setActualInstance(instance); return; @@ -595,17 +640,17 @@ public void setActualInstance(Object instance) { } throw new RuntimeException( - "Invalid instance type. Must be AccountConfigUpdate, AccountUpdate," + "Invalid instance type. Must be AccountConfigUpdate, AccountUpdate, AlgoUpdate," + " ConditionalOrderTriggerReject, GridUpdate, Listenkeyexpired, MarginCall," + " OrderTradeUpdate, StrategyUpdate, TradeLite"); } /** * Get the actual instance, which can be the following: AccountConfigUpdate, AccountUpdate, - * ConditionalOrderTriggerReject, GridUpdate, Listenkeyexpired, MarginCall, OrderTradeUpdate, - * StrategyUpdate, TradeLite + * AlgoUpdate, ConditionalOrderTriggerReject, GridUpdate, Listenkeyexpired, MarginCall, + * OrderTradeUpdate, StrategyUpdate, TradeLite * - * @return The actual instance (AccountConfigUpdate, AccountUpdate, + * @return The actual instance (AccountConfigUpdate, AccountUpdate, AlgoUpdate, * ConditionalOrderTriggerReject, GridUpdate, Listenkeyexpired, MarginCall, * OrderTradeUpdate, StrategyUpdate, TradeLite) */ @@ -626,6 +671,17 @@ public AccountConfigUpdate getAccountConfigUpdate() throws ClassCastException { return (AccountConfigUpdate) super.getActualInstance(); } + /** + * Get the actual instance of `AlgoUpdate`. If the actual instance is not `AlgoUpdate`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `AlgoUpdate` + * @throws ClassCastException if the instance is not `AlgoUpdate` + */ + public AlgoUpdate getAlgoUpdate() throws ClassCastException { + return (AlgoUpdate) super.getActualInstance(); + } + /** * Get the actual instance of `AccountUpdate`. If the actual instance is not `AccountUpdate`, * the ClassCastException will be thrown. @@ -737,6 +793,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti e.getMessage())); // continue to the next one } + // validate the json string with AlgoUpdate + try { + AlgoUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for AlgoUpdate failed with `%s`.", e.getMessage())); + // continue to the next one + } // validate the json string with AccountUpdate try { AccountUpdate.validateJsonElement(jsonElement); @@ -825,7 +891,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IOException( String.format( "The JSON string is invalid for UserDataStreamEventsResponse with oneOf" - + " schemas: AccountConfigUpdate, AccountUpdate," + + " schemas: AccountConfigUpdate, AccountUpdate, AlgoUpdate," + " ConditionalOrderTriggerReject, GridUpdate, Listenkeyexpired," + " MarginCall, OrderTradeUpdate, StrategyUpdate, TradeLite. %d" + " class(es) match the result, expected 1. Detailed failure" diff --git a/clients/fiat/CHANGELOG.md b/clients/fiat/CHANGELOG.md index f2695603..a1e32e38 100644 --- a/clients/fiat/CHANGELOG.md +++ b/clients/fiat/CHANGELOG.md @@ -1,6 +1,14 @@ # Changelog +## 2.0.0 - 2025-11-10 + +### Added (2) + +- `fiatWithdraw()` (`GET /sapi/v2/fiat/withdraw`) +- `getOrderDetail()` (`GET /sapi/v1/fiat/get-order-detail`) + ## 1.2.1 - 2025-08-07 + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. @@ -17,4 +25,4 @@ ## 1.0.0 - 2025-04-24 -- Initial release \ No newline at end of file +- Initial release diff --git a/clients/fiat/docs/AccountInfo.md b/clients/fiat/docs/AccountInfo.md new file mode 100644 index 00000000..27eb9f10 --- /dev/null +++ b/clients/fiat/docs/AccountInfo.md @@ -0,0 +1,13 @@ + + +# AccountInfo + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accountNumber** | **String** | | [optional] | + + + diff --git a/clients/fiat/docs/DepositRequest.md b/clients/fiat/docs/DepositRequest.md new file mode 100644 index 00000000..df519490 --- /dev/null +++ b/clients/fiat/docs/DepositRequest.md @@ -0,0 +1,17 @@ + + +# DepositRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**recvWindow** | **Long** | | [optional] | +|**currency** | **String** | | | +|**apiPaymentMethod** | **String** | | | +|**amount** | **Long** | | | +|**ext** | **Object** | | [optional] | + + + diff --git a/clients/fiat/docs/DepositResponse.md b/clients/fiat/docs/DepositResponse.md new file mode 100644 index 00000000..523005ab --- /dev/null +++ b/clients/fiat/docs/DepositResponse.md @@ -0,0 +1,15 @@ + + +# DepositResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **String** | | [optional] | +|**message** | **String** | | [optional] | +|**data** | [**DepositResponseData**](DepositResponseData.md) | | [optional] | + + + diff --git a/clients/fiat/docs/DepositResponseData.md b/clients/fiat/docs/DepositResponseData.md new file mode 100644 index 00000000..68d7bc70 --- /dev/null +++ b/clients/fiat/docs/DepositResponseData.md @@ -0,0 +1,13 @@ + + +# DepositResponseData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**orderId** | **String** | | [optional] | + + + diff --git a/clients/fiat/docs/FiatApi.md b/clients/fiat/docs/FiatApi.md index 2f869426..7de4b129 100644 --- a/clients/fiat/docs/FiatApi.md +++ b/clients/fiat/docs/FiatApi.md @@ -4,17 +4,144 @@ All URIs are relative to *https://api.binance.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| +| [**deposit**](FiatApi.md#deposit) | **POST** /sapi/v1/fiat/deposit | Deposit(TRADE) | +| [**fiatWithdraw**](FiatApi.md#fiatWithdraw) | **POST** /sapi/v2/fiat/withdraw | Fiat Withdraw(WITHDRAW) | | [**getFiatDepositWithdrawHistory**](FiatApi.md#getFiatDepositWithdrawHistory) | **GET** /sapi/v1/fiat/orders | Get Fiat Deposit/Withdraw History (USER_DATA) | | [**getFiatPaymentsHistory**](FiatApi.md#getFiatPaymentsHistory) | **GET** /sapi/v1/fiat/payments | Get Fiat Payments History (USER_DATA) | +| [**getOrderDetail**](FiatApi.md#getOrderDetail) | **GET** /sapi/v1/fiat/get-order-detail | Get Order Detail(USER_DATA) | + +# **deposit** +> DepositResponse deposit(depositRequest) + +Deposit(TRADE) + +Submit deposit request, in this version, we only support BRL deposit via pix. For BRL deposit via pix, you need to place an order before making a transfer from your bank. Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website. Weight: 45000 + +### Example +```java +// Import classes: +import com.binance.connector.client.fiat.ApiClient; +import com.binance.connector.client.fiat.ApiException; +import com.binance.connector.client.fiat.Configuration; +import com.binance.connector.client.fiat.models.*; +import com.binance.connector.client.fiat.rest.api.FiatApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FiatApi apiInstance = new FiatApi(defaultClient); + DepositRequest depositRequest = new DepositRequest(); // DepositRequest | + try { + DepositResponse result = apiInstance.deposit(depositRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FiatApi#deposit"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **depositRequest** | [**DepositRequest**](DepositRequest.md)| | | + +### Return type + +[**DepositResponse**](DepositResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Deposit | - | + + +# **fiatWithdraw** +> FiatWithdrawResponse fiatWithdraw(fiatWithdrawRequest) + +Fiat Withdraw(WITHDRAW) + +Submit withdraw request, in this version, we only support BRL withdrawal via bank_transfer. You need to call this api first, and call query order detail api in a loop to get the status of the order until this order is successful. Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website. you need to bind your bank account on web/app before using the corresponding account number Weight: 45000 + +### Example +```java +// Import classes: +import com.binance.connector.client.fiat.ApiClient; +import com.binance.connector.client.fiat.ApiException; +import com.binance.connector.client.fiat.Configuration; +import com.binance.connector.client.fiat.models.*; +import com.binance.connector.client.fiat.rest.api.FiatApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FiatApi apiInstance = new FiatApi(defaultClient); + FiatWithdrawRequest fiatWithdrawRequest = new FiatWithdrawRequest(); // FiatWithdrawRequest | + try { + FiatWithdrawResponse result = apiInstance.fiatWithdraw(fiatWithdrawRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FiatApi#fiatWithdraw"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fiatWithdrawRequest** | [**FiatWithdrawRequest**](FiatWithdrawRequest.md)| | | + +### Return type + +[**FiatWithdrawResponse**](FiatWithdrawResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Fiat Withdraw | - | + # **getFiatDepositWithdrawHistory** > GetFiatDepositWithdrawHistoryResponse getFiatDepositWithdrawHistory(transactionType, beginTime, endTime, page, rows, recvWindow) Get Fiat Deposit/Withdraw History (USER_DATA) -Get Fiat Deposit/Withdraw History * If beginTime and endTime are not sent, the recent 30-day data will be returned. Weight: 90000 +Get Fiat Deposit/Withdraw History * If beginTime and endTime are not sent, the recent 30-day data will be returned. Weight: 45000 ### Example ```java @@ -152,3 +279,67 @@ No authorization required |-------------|-------------|------------------| | **200** | Get Fiat Payments History | - | + +# **getOrderDetail** +> GetOrderDetailResponse getOrderDetail(orderNo, recvWindow) + +Get Order Detail(USER_DATA) + +Get Order Detail Before calling this api, please make sure you have already completed your KYC or KYB, and already activated your fiat service on our website. Weight: 1 + +### Example +```java +// Import classes: +import com.binance.connector.client.fiat.ApiClient; +import com.binance.connector.client.fiat.ApiException; +import com.binance.connector.client.fiat.Configuration; +import com.binance.connector.client.fiat.models.*; +import com.binance.connector.client.fiat.rest.api.FiatApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FiatApi apiInstance = new FiatApi(defaultClient); + String orderNo = "orderNo_example"; // String | order id retrieved from the api call of withdrawal + Long recvWindow = 56L; // Long | + try { + GetOrderDetailResponse result = apiInstance.getOrderDetail(orderNo, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FiatApi#getOrderDetail"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderNo** | **String**| order id retrieved from the api call of withdrawal | | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetOrderDetailResponse**](GetOrderDetailResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Order Detail | - | + diff --git a/clients/fiat/docs/FiatWithdrawRequest.md b/clients/fiat/docs/FiatWithdrawRequest.md new file mode 100644 index 00000000..24df9e07 --- /dev/null +++ b/clients/fiat/docs/FiatWithdrawRequest.md @@ -0,0 +1,18 @@ + + +# FiatWithdrawRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**recvWindow** | **Long** | | [optional] | +|**currency** | **String** | | | +|**apiPaymentMethod** | **String** | | | +|**amount** | **Long** | | | +|**accountInfo** | [**AccountInfo**](AccountInfo.md) | | | +|**ext** | **Object** | | [optional] | + + + diff --git a/clients/fiat/docs/FiatWithdrawResponse.md b/clients/fiat/docs/FiatWithdrawResponse.md new file mode 100644 index 00000000..38fc87e3 --- /dev/null +++ b/clients/fiat/docs/FiatWithdrawResponse.md @@ -0,0 +1,15 @@ + + +# FiatWithdrawResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **String** | | [optional] | +|**message** | **String** | | [optional] | +|**data** | [**DepositResponseData**](DepositResponseData.md) | | [optional] | + + + diff --git a/clients/fiat/docs/GetOrderDetailResponse.md b/clients/fiat/docs/GetOrderDetailResponse.md new file mode 100644 index 00000000..10dbe772 --- /dev/null +++ b/clients/fiat/docs/GetOrderDetailResponse.md @@ -0,0 +1,15 @@ + + +# GetOrderDetailResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **String** | | [optional] | +|**message** | **String** | | [optional] | +|**data** | [**GetOrderDetailResponseData**](GetOrderDetailResponseData.md) | | [optional] | + + + diff --git a/clients/fiat/docs/GetOrderDetailResponseData.md b/clients/fiat/docs/GetOrderDetailResponseData.md new file mode 100644 index 00000000..b61f77f3 --- /dev/null +++ b/clients/fiat/docs/GetOrderDetailResponseData.md @@ -0,0 +1,20 @@ + + +# GetOrderDetailResponseData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**orderId** | **String** | | [optional] | +|**orderStatus** | **String** | | [optional] | +|**amount** | **String** | | [optional] | +|**fee** | **String** | | [optional] | +|**fiatCurrency** | **String** | | [optional] | +|**errorCode** | **String** | | [optional] | +|**errorMessage** | **String** | | [optional] | +|**ext** | **Object** | | [optional] | + + + diff --git a/clients/fiat/docs/rest-api/migration-guide.md b/clients/fiat/docs/rest-api/migration-guide.md index adbb3cda..df9be5a1 100644 --- a/clients/fiat/docs/rest-api/migration-guide.md +++ b/clients/fiat/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-fiat - 1.2.1 + 2.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-fiat - 1.2.1 + 2.0.0 ``` diff --git a/clients/fiat/example_rest.md b/clients/fiat/example_rest.md index 91e79979..72cc0f53 100644 --- a/clients/fiat/example_rest.md +++ b/clients/fiat/example_rest.md @@ -1,6 +1,12 @@ ## Fiat +[POST /sapi/v1/fiat/deposit](https://developers.binance.com/docs/fiat/rest-api/Fiat-Deposit) - deposit - [DepositExample.java:50](/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/DepositExample.java#L50) + +[POST /sapi/v2/fiat/withdraw](https://developers.binance.com/docs/fiat/rest-api/Fiat-Withdraw) - fiatWithdraw - [FiatWithdrawExample.java:53](/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/FiatWithdrawExample.java#L53) + [GET /sapi/v1/fiat/orders](https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History) - getFiatDepositWithdrawHistory - [GetFiatDepositWithdrawHistoryExample.java:47](/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/GetFiatDepositWithdrawHistoryExample.java#L47) [GET /sapi/v1/fiat/payments](https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Payments-History) - getFiatPaymentsHistory - [GetFiatPaymentsHistoryExample.java:49](/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/GetFiatPaymentsHistoryExample.java#L49) +[GET /sapi/v1/fiat/get-order-detail](https://developers.binance.com/docs/fiat/rest-api/Get-Order-Detail) - getOrderDetail - [GetOrderDetailExample.java:47](/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/GetOrderDetailExample.java#L47) + diff --git a/clients/fiat/pom.xml b/clients/fiat/pom.xml index 33bf4580..e73d5d54 100644 --- a/clients/fiat/pom.xml +++ b/clients/fiat/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-fiat fiat - 1.2.1 + 2.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.2.1 \ No newline at end of file diff --git a/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/JSON.java b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/JSON.java index 8a8f784f..46f9fab2 100644 --- a/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/JSON.java +++ b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/JSON.java @@ -108,6 +108,24 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.fiat.rest.model.AccountInfo + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.fiat.rest.model.DepositRequest + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.fiat.rest.model.DepositResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.fiat.rest.model.DepositResponseData + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.fiat.rest.model.FiatWithdrawRequest + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.fiat.rest.model.FiatWithdrawResponse + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.fiat.rest.model .GetFiatDepositWithdrawHistoryResponse.CustomTypeAdapterFactory()); @@ -120,6 +138,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.fiat.rest.model .GetFiatPaymentsHistoryResponseDataInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.fiat.rest.model.GetOrderDetailResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.fiat.rest.model.GetOrderDetailResponseData + .CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } diff --git a/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/api/FiatApi.java b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/api/FiatApi.java index e773d350..040b1c55 100644 --- a/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/api/FiatApi.java +++ b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/api/FiatApi.java @@ -15,14 +15,21 @@ import com.binance.connector.client.common.ApiClient; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.JSON; import com.binance.connector.client.common.Pair; import com.binance.connector.client.common.SystemUtil; import com.binance.connector.client.common.configuration.ClientConfiguration; import com.binance.connector.client.common.exception.ConstraintViolationException; +import com.binance.connector.client.fiat.rest.model.DepositRequest; +import com.binance.connector.client.fiat.rest.model.DepositResponse; +import com.binance.connector.client.fiat.rest.model.FiatWithdrawRequest; +import com.binance.connector.client.fiat.rest.model.FiatWithdrawResponse; import com.binance.connector.client.fiat.rest.model.GetFiatDepositWithdrawHistoryResponse; import com.binance.connector.client.fiat.rest.model.GetFiatPaymentsHistoryResponse; +import com.binance.connector.client.fiat.rest.model.GetOrderDetailResponse; import com.google.gson.reflect.TypeToken; import jakarta.validation.ConstraintViolation; +import jakarta.validation.Valid; import jakarta.validation.Validation; import jakarta.validation.Validator; import jakarta.validation.constraints.*; @@ -43,7 +50,7 @@ public class FiatApi { private static final String USER_AGENT = String.format( - "binance-fiat/1.2.1 (Java/%s; %s; %s)", + "binance-fiat/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -80,6 +87,313 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } + /** + * Build call for deposit + * + * @param depositRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Deposit -
+ * + * @see Deposit(TRADE) + * Documentation + */ + private okhttp3.Call depositCall(DepositRequest depositRequest) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/fiat/deposit"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (depositRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", depositRequest.getRecvWindow()); + } + + if (depositRequest.getCurrency() != null) { + localVarFormParams.put("currency", depositRequest.getCurrency()); + } + + if (depositRequest.getApiPaymentMethod() != null) { + localVarFormParams.put("apiPaymentMethod", depositRequest.getApiPaymentMethod()); + } + + if (depositRequest.getAmount() != null) { + localVarFormParams.put("amount", depositRequest.getAmount()); + } + + if (depositRequest.getExt() != null) { + localVarFormParams.put("ext", depositRequest.getExt()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call depositValidateBeforeCall(DepositRequest depositRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {depositRequest}; + Method method = this.getClass().getMethod("deposit", DepositRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return depositCall(depositRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Deposit(TRADE) Submit deposit request, in this version, we only support BRL deposit via pix. + * For BRL deposit via pix, you need to place an order before making a transfer from your bank. + * Before calling this api, please make sure you have already completed your KYC or KYB, and + * already activated your fiat service on our website. Weight: 45000 + * + * @param depositRequest (required) + * @return ApiResponse<DepositResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Deposit -
+ * + * @see Deposit(TRADE) + * Documentation + */ + public ApiResponse deposit(@Valid @NotNull DepositRequest depositRequest) + throws ApiException { + okhttp3.Call localVarCall = depositValidateBeforeCall(depositRequest); + java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for fiatWithdraw + * + * @param fiatWithdrawRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Fiat Withdraw -
+ * + * @see Fiat + * Withdraw(WITHDRAW) Documentation + */ + private okhttp3.Call fiatWithdrawCall(FiatWithdrawRequest fiatWithdrawRequest) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v2/fiat/withdraw"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (fiatWithdrawRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", fiatWithdrawRequest.getRecvWindow()); + } + + if (fiatWithdrawRequest.getCurrency() != null) { + localVarFormParams.put("currency", fiatWithdrawRequest.getCurrency()); + } + + if (fiatWithdrawRequest.getApiPaymentMethod() != null) { + localVarFormParams.put("apiPaymentMethod", fiatWithdrawRequest.getApiPaymentMethod()); + } + + if (fiatWithdrawRequest.getAmount() != null) { + localVarFormParams.put("amount", fiatWithdrawRequest.getAmount()); + } + + if (fiatWithdrawRequest.getAccountInfo() != null) { + String json = JSON.getGson().toJson(fiatWithdrawRequest.getAccountInfo()); + localVarFormParams.put("accountInfo", json); + } + + if (fiatWithdrawRequest.getExt() != null) { + localVarFormParams.put("ext", fiatWithdrawRequest.getExt()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call fiatWithdrawValidateBeforeCall(FiatWithdrawRequest fiatWithdrawRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {fiatWithdrawRequest}; + Method method = this.getClass().getMethod("fiatWithdraw", FiatWithdrawRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return fiatWithdrawCall(fiatWithdrawRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Fiat Withdraw(WITHDRAW) Submit withdraw request, in this version, we only support BRL + * withdrawal via bank_transfer. You need to call this api first, and call query order detail + * api in a loop to get the status of the order until this order is successful. Before calling + * this api, please make sure you have already completed your KYC or KYB, and already activated + * your fiat service on our website. you need to bind your bank account on web/app before using + * the corresponding account number Weight: 45000 + * + * @param fiatWithdrawRequest (required) + * @return ApiResponse<FiatWithdrawResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Fiat Withdraw -
+ * + * @see Fiat + * Withdraw(WITHDRAW) Documentation + */ + public ApiResponse fiatWithdraw( + @Valid @NotNull FiatWithdrawRequest fiatWithdrawRequest) throws ApiException { + okhttp3.Call localVarCall = fiatWithdrawValidateBeforeCall(fiatWithdrawRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for getFiatDepositWithdrawHistory * @@ -240,7 +554,7 @@ private okhttp3.Call getFiatDepositWithdrawHistoryValidateBeforeCall( /** * Get Fiat Deposit/Withdraw History (USER_DATA) Get Fiat Deposit/Withdraw History * If - * beginTime and endTime are not sent, the recent 30-day data will be returned. Weight: 90000 + * beginTime and endTime are not sent, the recent 30-day data will be returned. Weight: 45000 * * @param transactionType 0-buy,1-sell (required) * @param beginTime (optional) @@ -478,4 +792,143 @@ public ApiResponse getFiatPaymentsHistory( new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } + + /** + * Build call for getOrderDetail + * + * @param orderNo order id retrieved from the api call of withdrawal (required) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Order Detail -
+ * + * @see Get Order + * Detail(USER_DATA) Documentation + */ + private okhttp3.Call getOrderDetailCall(String orderNo, Long recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/fiat/get-order-detail"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (orderNo != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("orderNo", orderNo)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrderDetailValidateBeforeCall(String orderNo, Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {orderNo, recvWindow}; + Method method = this.getClass().getMethod("getOrderDetail", String.class, Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getOrderDetailCall(orderNo, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Order Detail(USER_DATA) Get Order Detail Before calling this api, please make sure you + * have already completed your KYC or KYB, and already activated your fiat service on our + * website. Weight: 1 + * + * @param orderNo order id retrieved from the api call of withdrawal (required) + * @param recvWindow (optional) + * @return ApiResponse<GetOrderDetailResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Order Detail -
+ * + * @see Get Order + * Detail(USER_DATA) Documentation + */ + public ApiResponse getOrderDetail( + @NotNull String orderNo, Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = getOrderDetailValidateBeforeCall(orderNo, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } } diff --git a/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/api/FiatRestApi.java b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/api/FiatRestApi.java index 03370436..ee3dfdb0 100644 --- a/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/api/FiatRestApi.java +++ b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/api/FiatRestApi.java @@ -5,8 +5,13 @@ import com.binance.connector.client.common.ApiResponse; import com.binance.connector.client.common.configuration.ClientConfiguration; import com.binance.connector.client.fiat.rest.FiatRestApiUtil; +import com.binance.connector.client.fiat.rest.model.DepositRequest; +import com.binance.connector.client.fiat.rest.model.DepositResponse; +import com.binance.connector.client.fiat.rest.model.FiatWithdrawRequest; +import com.binance.connector.client.fiat.rest.model.FiatWithdrawResponse; import com.binance.connector.client.fiat.rest.model.GetFiatDepositWithdrawHistoryResponse; import com.binance.connector.client.fiat.rest.model.GetFiatPaymentsHistoryResponse; +import com.binance.connector.client.fiat.rest.model.GetOrderDetailResponse; public class FiatRestApi { @@ -20,9 +25,60 @@ public FiatRestApi(ApiClient apiClient) { this.fiatApi = new FiatApi(apiClient); } + /** + * Deposit(TRADE) Submit deposit request, in this version, we only support BRL deposit via pix. + * For BRL deposit via pix, you need to place an order before making a transfer from your bank. + * Before calling this api, please make sure you have already completed your KYC or KYB, and + * already activated your fiat service on our website. Weight: 45000 + * + * @param depositRequest (required) + * @return ApiResponse<DepositResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Deposit -
+ * + * @see Deposit(TRADE) + * Documentation + */ + public ApiResponse deposit(DepositRequest depositRequest) throws ApiException { + return fiatApi.deposit(depositRequest); + } + + /** + * Fiat Withdraw(WITHDRAW) Submit withdraw request, in this version, we only support BRL + * withdrawal via bank_transfer. You need to call this api first, and call query order detail + * api in a loop to get the status of the order until this order is successful. Before calling + * this api, please make sure you have already completed your KYC or KYB, and already activated + * your fiat service on our website. you need to bind your bank account on web/app before using + * the corresponding account number Weight: 45000 + * + * @param fiatWithdrawRequest (required) + * @return ApiResponse<FiatWithdrawResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Fiat Withdraw -
+ * + * @see Fiat + * Withdraw(WITHDRAW) Documentation + */ + public ApiResponse fiatWithdraw(FiatWithdrawRequest fiatWithdrawRequest) + throws ApiException { + return fiatApi.fiatWithdraw(fiatWithdrawRequest); + } + /** * Get Fiat Deposit/Withdraw History (USER_DATA) Get Fiat Deposit/Withdraw History * If - * beginTime and endTime are not sent, the recent 30-day data will be returned. Weight: 90000 + * beginTime and endTime are not sent, the recent 30-day data will be returned. Weight: 45000 * * @param transactionType 0-buy,1-sell (required) * @param beginTime (optional) @@ -94,4 +150,29 @@ public ApiResponse getFiatPaymentsHistory( return fiatApi.getFiatPaymentsHistory( transactionType, beginTime, endTime, page, rows, recvWindow); } + + /** + * Get Order Detail(USER_DATA) Get Order Detail Before calling this api, please make sure you + * have already completed your KYC or KYB, and already activated your fiat service on our + * website. Weight: 1 + * + * @param orderNo order id retrieved from the api call of withdrawal (required) + * @param recvWindow (optional) + * @return ApiResponse<GetOrderDetailResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Order Detail -
+ * + * @see Get Order + * Detail(USER_DATA) Documentation + */ + public ApiResponse getOrderDetail(String orderNo, Long recvWindow) + throws ApiException { + return fiatApi.getOrderDetail(orderNo, recvWindow); + } } diff --git a/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/AccountInfo.java b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/AccountInfo.java new file mode 100644 index 00000000..75ae637c --- /dev/null +++ b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/AccountInfo.java @@ -0,0 +1,209 @@ +/* + * Binance Fiat REST API + * OpenAPI Specification for the Binance Fiat REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.fiat.rest.model; + +import com.binance.connector.client.fiat.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** AccountInfo */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class AccountInfo { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + @jakarta.annotation.Nullable + private String accountNumber; + + public AccountInfo() {} + + public AccountInfo accountNumber(@jakarta.annotation.Nullable String accountNumber) { + this.accountNumber = accountNumber; + return this; + } + + /** + * Get accountNumber + * + * @return accountNumber + */ + @jakarta.annotation.Nullable + public String getAccountNumber() { + return accountNumber; + } + + public void setAccountNumber(@jakarta.annotation.Nullable String accountNumber) { + this.accountNumber = accountNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountInfo accountInfo = (AccountInfo) o; + return Objects.equals(this.accountNumber, accountInfo.accountNumber); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountInfo {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object accountNumberValue = getAccountNumber(); + String accountNumberValueAsString = ""; + accountNumberValueAsString = accountNumberValue.toString(); + sb.append("accountNumber=").append(urlEncode(accountNumberValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AccountInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountInfo.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccountInfo is not found in the empty" + + " JSON string", + AccountInfo.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) + && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `accountNumber` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("accountNumber").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccountInfo.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountInfo value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountInfo read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccountInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountInfo + * @throws IOException if the JSON string is invalid with respect to AccountInfo + */ + public static AccountInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountInfo.class); + } + + /** + * Convert an instance of AccountInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/DepositRequest.java b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/DepositRequest.java new file mode 100644 index 00000000..0d70a4fd --- /dev/null +++ b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/DepositRequest.java @@ -0,0 +1,359 @@ +/* + * Binance Fiat REST API + * OpenAPI Specification for the Binance Fiat REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.fiat.rest.model; + +import com.binance.connector.client.fiat.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** DepositRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DepositRequest { + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Long recvWindow; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + + @SerializedName(SERIALIZED_NAME_CURRENCY) + @jakarta.annotation.Nonnull + private String currency; + + public static final String SERIALIZED_NAME_API_PAYMENT_METHOD = "apiPaymentMethod"; + + @SerializedName(SERIALIZED_NAME_API_PAYMENT_METHOD) + @jakarta.annotation.Nonnull + private String apiPaymentMethod; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + + @SerializedName(SERIALIZED_NAME_AMOUNT) + @jakarta.annotation.Nonnull + private Long amount; + + public static final String SERIALIZED_NAME_EXT = "ext"; + + @SerializedName(SERIALIZED_NAME_EXT) + @jakarta.annotation.Nullable + private Object ext; + + public DepositRequest() {} + + public DepositRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + public Long getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + } + + public DepositRequest currency(@jakarta.annotation.Nonnull String currency) { + this.currency = currency; + return this; + } + + /** + * Get currency + * + * @return currency + */ + @jakarta.annotation.Nonnull + @NotNull + public String getCurrency() { + return currency; + } + + public void setCurrency(@jakarta.annotation.Nonnull String currency) { + this.currency = currency; + } + + public DepositRequest apiPaymentMethod(@jakarta.annotation.Nonnull String apiPaymentMethod) { + this.apiPaymentMethod = apiPaymentMethod; + return this; + } + + /** + * Get apiPaymentMethod + * + * @return apiPaymentMethod + */ + @jakarta.annotation.Nonnull + @NotNull + public String getApiPaymentMethod() { + return apiPaymentMethod; + } + + public void setApiPaymentMethod(@jakarta.annotation.Nonnull String apiPaymentMethod) { + this.apiPaymentMethod = apiPaymentMethod; + } + + public DepositRequest amount(@jakarta.annotation.Nonnull Long amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * + * @return amount + */ + @jakarta.annotation.Nonnull + @NotNull + public Long getAmount() { + return amount; + } + + public void setAmount(@jakarta.annotation.Nonnull Long amount) { + this.amount = amount; + } + + public DepositRequest ext(@jakarta.annotation.Nullable Object ext) { + this.ext = ext; + return this; + } + + /** + * Get ext + * + * @return ext + */ + @jakarta.annotation.Nullable + public Object getExt() { + return ext; + } + + public void setExt(@jakarta.annotation.Nullable Object ext) { + this.ext = ext; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DepositRequest depositRequest = (DepositRequest) o; + return Objects.equals(this.recvWindow, depositRequest.recvWindow) + && Objects.equals(this.currency, depositRequest.currency) + && Objects.equals(this.apiPaymentMethod, depositRequest.apiPaymentMethod) + && Objects.equals(this.amount, depositRequest.amount) + && Objects.equals(this.ext, depositRequest.ext); + } + + @Override + public int hashCode() { + return Objects.hash(recvWindow, currency, apiPaymentMethod, amount, ext); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DepositRequest {\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" apiPaymentMethod: ").append(toIndentedString(apiPaymentMethod)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" ext: ").append(toIndentedString(ext)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object recvWindowValue = getRecvWindow(); + String recvWindowValueAsString = ""; + recvWindowValueAsString = recvWindowValue.toString(); + sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); + Object currencyValue = getCurrency(); + String currencyValueAsString = ""; + currencyValueAsString = currencyValue.toString(); + sb.append("currency=").append(urlEncode(currencyValueAsString)).append(""); + Object apiPaymentMethodValue = getApiPaymentMethod(); + String apiPaymentMethodValueAsString = ""; + apiPaymentMethodValueAsString = apiPaymentMethodValue.toString(); + sb.append("apiPaymentMethod=").append(urlEncode(apiPaymentMethodValueAsString)).append(""); + Object amountValue = getAmount(); + String amountValueAsString = ""; + amountValueAsString = amountValue.toString(); + sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); + Object extValue = getExt(); + String extValueAsString = ""; + extValueAsString = extValue.toString(); + sb.append("ext=").append(urlEncode(extValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("recvWindow"); + openapiFields.add("currency"); + openapiFields.add("apiPaymentMethod"); + openapiFields.add("amount"); + openapiFields.add("ext"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("currency"); + openapiRequiredFields.add("apiPaymentMethod"); + openapiRequiredFields.add("amount"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DepositRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DepositRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DepositRequest is not found in the" + + " empty JSON string", + DepositRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DepositRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("currency").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `currency` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("currency").toString())); + } + if (!jsonObj.get("apiPaymentMethod").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `apiPaymentMethod` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("apiPaymentMethod").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DepositRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DepositRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DepositRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DepositRequest value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DepositRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DepositRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of DepositRequest + * @throws IOException if the JSON string is invalid with respect to DepositRequest + */ + public static DepositRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DepositRequest.class); + } + + /** + * Convert an instance of DepositRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/DepositResponse.java b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/DepositResponse.java new file mode 100644 index 00000000..35e2ae63 --- /dev/null +++ b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/DepositResponse.java @@ -0,0 +1,288 @@ +/* + * Binance Fiat REST API + * OpenAPI Specification for the Binance Fiat REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.fiat.rest.model; + +import com.binance.connector.client.fiat.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** DepositResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DepositResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private String code; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + + @SerializedName(SERIALIZED_NAME_MESSAGE) + @jakarta.annotation.Nullable + private String message; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private DepositResponseData data; + + public DepositResponse() {} + + public DepositResponse code(@jakarta.annotation.Nullable String code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code + */ + @jakarta.annotation.Nullable + public String getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable String code) { + this.code = code; + } + + public DepositResponse message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message + */ + @jakarta.annotation.Nullable + public String getMessage() { + return message; + } + + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + public DepositResponse data(@jakarta.annotation.Nullable DepositResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public DepositResponseData getData() { + return data; + } + + public void setData(@jakarta.annotation.Nullable DepositResponseData data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DepositResponse depositResponse = (DepositResponse) o; + return Objects.equals(this.code, depositResponse.code) + && Objects.equals(this.message, depositResponse.message) + && Objects.equals(this.data, depositResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DepositResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object messageValue = getMessage(); + String messageValueAsString = ""; + messageValueAsString = messageValue.toString(); + sb.append("message=").append(urlEncode(messageValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("message"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DepositResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DepositResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DepositResponse is not found in the" + + " empty JSON string", + DepositResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) + && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `code` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("code").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) + && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `message` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("message").toString())); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DepositResponseData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DepositResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DepositResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DepositResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DepositResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DepositResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DepositResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DepositResponse + * @throws IOException if the JSON string is invalid with respect to DepositResponse + */ + public static DepositResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DepositResponse.class); + } + + /** + * Convert an instance of DepositResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/DepositResponseData.java b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/DepositResponseData.java new file mode 100644 index 00000000..661a3bcd --- /dev/null +++ b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/DepositResponseData.java @@ -0,0 +1,210 @@ +/* + * Binance Fiat REST API + * OpenAPI Specification for the Binance Fiat REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.fiat.rest.model; + +import com.binance.connector.client.fiat.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** DepositResponseData */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DepositResponseData { + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private String orderId; + + public DepositResponseData() {} + + public DepositResponseData orderId(@jakarta.annotation.Nullable String orderId) { + this.orderId = orderId; + return this; + } + + /** + * Get orderId + * + * @return orderId + */ + @jakarta.annotation.Nullable + public String getOrderId() { + return orderId; + } + + public void setOrderId(@jakarta.annotation.Nullable String orderId) { + this.orderId = orderId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DepositResponseData depositResponseData = (DepositResponseData) o; + return Objects.equals(this.orderId, depositResponseData.orderId); + } + + @Override + public int hashCode() { + return Objects.hash(orderId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DepositResponseData {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object orderIdValue = getOrderId(); + String orderIdValueAsString = ""; + orderIdValueAsString = orderIdValue.toString(); + sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("orderId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DepositResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DepositResponseData.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DepositResponseData is not found in" + + " the empty JSON string", + DepositResponseData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("orderId") != null && !jsonObj.get("orderId").isJsonNull()) + && !jsonObj.get("orderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("orderId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DepositResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DepositResponseData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DepositResponseData.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DepositResponseData value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DepositResponseData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DepositResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of DepositResponseData + * @throws IOException if the JSON string is invalid with respect to DepositResponseData + */ + public static DepositResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DepositResponseData.class); + } + + /** + * Convert an instance of DepositResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/FiatWithdrawRequest.java b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/FiatWithdrawRequest.java new file mode 100644 index 00000000..53e201f7 --- /dev/null +++ b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/FiatWithdrawRequest.java @@ -0,0 +1,399 @@ +/* + * Binance Fiat REST API + * OpenAPI Specification for the Binance Fiat REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.fiat.rest.model; + +import com.binance.connector.client.fiat.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** FiatWithdrawRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class FiatWithdrawRequest { + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Long recvWindow; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + + @SerializedName(SERIALIZED_NAME_CURRENCY) + @jakarta.annotation.Nonnull + private String currency; + + public static final String SERIALIZED_NAME_API_PAYMENT_METHOD = "apiPaymentMethod"; + + @SerializedName(SERIALIZED_NAME_API_PAYMENT_METHOD) + @jakarta.annotation.Nonnull + private String apiPaymentMethod; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + + @SerializedName(SERIALIZED_NAME_AMOUNT) + @jakarta.annotation.Nonnull + private Long amount; + + public static final String SERIALIZED_NAME_ACCOUNT_INFO = "accountInfo"; + + @SerializedName(SERIALIZED_NAME_ACCOUNT_INFO) + @jakarta.annotation.Nonnull + private AccountInfo accountInfo; + + public static final String SERIALIZED_NAME_EXT = "ext"; + + @SerializedName(SERIALIZED_NAME_EXT) + @jakarta.annotation.Nullable + private Object ext; + + public FiatWithdrawRequest() {} + + public FiatWithdrawRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + public Long getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + } + + public FiatWithdrawRequest currency(@jakarta.annotation.Nonnull String currency) { + this.currency = currency; + return this; + } + + /** + * Get currency + * + * @return currency + */ + @jakarta.annotation.Nonnull + @NotNull + public String getCurrency() { + return currency; + } + + public void setCurrency(@jakarta.annotation.Nonnull String currency) { + this.currency = currency; + } + + public FiatWithdrawRequest apiPaymentMethod( + @jakarta.annotation.Nonnull String apiPaymentMethod) { + this.apiPaymentMethod = apiPaymentMethod; + return this; + } + + /** + * Get apiPaymentMethod + * + * @return apiPaymentMethod + */ + @jakarta.annotation.Nonnull + @NotNull + public String getApiPaymentMethod() { + return apiPaymentMethod; + } + + public void setApiPaymentMethod(@jakarta.annotation.Nonnull String apiPaymentMethod) { + this.apiPaymentMethod = apiPaymentMethod; + } + + public FiatWithdrawRequest amount(@jakarta.annotation.Nonnull Long amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * + * @return amount + */ + @jakarta.annotation.Nonnull + @NotNull + public Long getAmount() { + return amount; + } + + public void setAmount(@jakarta.annotation.Nonnull Long amount) { + this.amount = amount; + } + + public FiatWithdrawRequest accountInfo(@jakarta.annotation.Nonnull AccountInfo accountInfo) { + this.accountInfo = accountInfo; + return this; + } + + /** + * Get accountInfo + * + * @return accountInfo + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public AccountInfo getAccountInfo() { + return accountInfo; + } + + public void setAccountInfo(@jakarta.annotation.Nonnull AccountInfo accountInfo) { + this.accountInfo = accountInfo; + } + + public FiatWithdrawRequest ext(@jakarta.annotation.Nullable Object ext) { + this.ext = ext; + return this; + } + + /** + * Get ext + * + * @return ext + */ + @jakarta.annotation.Nullable + public Object getExt() { + return ext; + } + + public void setExt(@jakarta.annotation.Nullable Object ext) { + this.ext = ext; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FiatWithdrawRequest fiatWithdrawRequest = (FiatWithdrawRequest) o; + return Objects.equals(this.recvWindow, fiatWithdrawRequest.recvWindow) + && Objects.equals(this.currency, fiatWithdrawRequest.currency) + && Objects.equals(this.apiPaymentMethod, fiatWithdrawRequest.apiPaymentMethod) + && Objects.equals(this.amount, fiatWithdrawRequest.amount) + && Objects.equals(this.accountInfo, fiatWithdrawRequest.accountInfo) + && Objects.equals(this.ext, fiatWithdrawRequest.ext); + } + + @Override + public int hashCode() { + return Objects.hash(recvWindow, currency, apiPaymentMethod, amount, accountInfo, ext); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FiatWithdrawRequest {\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" apiPaymentMethod: ").append(toIndentedString(apiPaymentMethod)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" accountInfo: ").append(toIndentedString(accountInfo)).append("\n"); + sb.append(" ext: ").append(toIndentedString(ext)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object recvWindowValue = getRecvWindow(); + String recvWindowValueAsString = ""; + recvWindowValueAsString = recvWindowValue.toString(); + sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); + Object currencyValue = getCurrency(); + String currencyValueAsString = ""; + currencyValueAsString = currencyValue.toString(); + sb.append("currency=").append(urlEncode(currencyValueAsString)).append(""); + Object apiPaymentMethodValue = getApiPaymentMethod(); + String apiPaymentMethodValueAsString = ""; + apiPaymentMethodValueAsString = apiPaymentMethodValue.toString(); + sb.append("apiPaymentMethod=").append(urlEncode(apiPaymentMethodValueAsString)).append(""); + Object amountValue = getAmount(); + String amountValueAsString = ""; + amountValueAsString = amountValue.toString(); + sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); + Object accountInfoValue = getAccountInfo(); + String accountInfoValueAsString = ""; + accountInfoValueAsString = accountInfoValue.toString(); + sb.append("accountInfo=").append(urlEncode(accountInfoValueAsString)).append(""); + Object extValue = getExt(); + String extValueAsString = ""; + extValueAsString = extValue.toString(); + sb.append("ext=").append(urlEncode(extValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("recvWindow"); + openapiFields.add("currency"); + openapiFields.add("apiPaymentMethod"); + openapiFields.add("amount"); + openapiFields.add("accountInfo"); + openapiFields.add("ext"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("currency"); + openapiRequiredFields.add("apiPaymentMethod"); + openapiRequiredFields.add("amount"); + openapiRequiredFields.add("accountInfo"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FiatWithdrawRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FiatWithdrawRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in FiatWithdrawRequest is not found in" + + " the empty JSON string", + FiatWithdrawRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FiatWithdrawRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("currency").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `currency` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("currency").toString())); + } + if (!jsonObj.get("apiPaymentMethod").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `apiPaymentMethod` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("apiPaymentMethod").toString())); + } + // validate the required field `accountInfo` + AccountInfo.validateJsonElement(jsonObj.get("accountInfo")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FiatWithdrawRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FiatWithdrawRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(FiatWithdrawRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, FiatWithdrawRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FiatWithdrawRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of FiatWithdrawRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FiatWithdrawRequest + * @throws IOException if the JSON string is invalid with respect to FiatWithdrawRequest + */ + public static FiatWithdrawRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FiatWithdrawRequest.class); + } + + /** + * Convert an instance of FiatWithdrawRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/FiatWithdrawResponse.java b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/FiatWithdrawResponse.java new file mode 100644 index 00000000..5fd65e0f --- /dev/null +++ b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/FiatWithdrawResponse.java @@ -0,0 +1,288 @@ +/* + * Binance Fiat REST API + * OpenAPI Specification for the Binance Fiat REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.fiat.rest.model; + +import com.binance.connector.client.fiat.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** FiatWithdrawResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class FiatWithdrawResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private String code; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + + @SerializedName(SERIALIZED_NAME_MESSAGE) + @jakarta.annotation.Nullable + private String message; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private DepositResponseData data; + + public FiatWithdrawResponse() {} + + public FiatWithdrawResponse code(@jakarta.annotation.Nullable String code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code + */ + @jakarta.annotation.Nullable + public String getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable String code) { + this.code = code; + } + + public FiatWithdrawResponse message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message + */ + @jakarta.annotation.Nullable + public String getMessage() { + return message; + } + + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + public FiatWithdrawResponse data(@jakarta.annotation.Nullable DepositResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public DepositResponseData getData() { + return data; + } + + public void setData(@jakarta.annotation.Nullable DepositResponseData data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FiatWithdrawResponse fiatWithdrawResponse = (FiatWithdrawResponse) o; + return Objects.equals(this.code, fiatWithdrawResponse.code) + && Objects.equals(this.message, fiatWithdrawResponse.message) + && Objects.equals(this.data, fiatWithdrawResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FiatWithdrawResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object messageValue = getMessage(); + String messageValueAsString = ""; + messageValueAsString = messageValue.toString(); + sb.append("message=").append(urlEncode(messageValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("message"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FiatWithdrawResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FiatWithdrawResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in FiatWithdrawResponse is not found in" + + " the empty JSON string", + FiatWithdrawResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) + && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `code` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("code").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) + && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `message` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("message").toString())); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DepositResponseData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FiatWithdrawResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FiatWithdrawResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(FiatWithdrawResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, FiatWithdrawResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FiatWithdrawResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of FiatWithdrawResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of FiatWithdrawResponse + * @throws IOException if the JSON string is invalid with respect to FiatWithdrawResponse + */ + public static FiatWithdrawResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FiatWithdrawResponse.class); + } + + /** + * Convert an instance of FiatWithdrawResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/GetOrderDetailResponse.java b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/GetOrderDetailResponse.java new file mode 100644 index 00000000..87175a16 --- /dev/null +++ b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/GetOrderDetailResponse.java @@ -0,0 +1,289 @@ +/* + * Binance Fiat REST API + * OpenAPI Specification for the Binance Fiat REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.fiat.rest.model; + +import com.binance.connector.client.fiat.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetOrderDetailResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetOrderDetailResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private String code; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + + @SerializedName(SERIALIZED_NAME_MESSAGE) + @jakarta.annotation.Nullable + private String message; + + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + @jakarta.annotation.Nullable + private GetOrderDetailResponseData data; + + public GetOrderDetailResponse() {} + + public GetOrderDetailResponse code(@jakarta.annotation.Nullable String code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code + */ + @jakarta.annotation.Nullable + public String getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable String code) { + this.code = code; + } + + public GetOrderDetailResponse message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message + */ + @jakarta.annotation.Nullable + public String getMessage() { + return message; + } + + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + public GetOrderDetailResponse data( + @jakarta.annotation.Nullable GetOrderDetailResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @jakarta.annotation.Nullable + @Valid + public GetOrderDetailResponseData getData() { + return data; + } + + public void setData(@jakarta.annotation.Nullable GetOrderDetailResponseData data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetOrderDetailResponse getOrderDetailResponse = (GetOrderDetailResponse) o; + return Objects.equals(this.code, getOrderDetailResponse.code) + && Objects.equals(this.message, getOrderDetailResponse.message) + && Objects.equals(this.data, getOrderDetailResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetOrderDetailResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object messageValue = getMessage(); + String messageValueAsString = ""; + messageValueAsString = messageValue.toString(); + sb.append("message=").append(urlEncode(messageValueAsString)).append(""); + Object dataValue = getData(); + String dataValueAsString = ""; + dataValueAsString = dataValue.toString(); + sb.append("data=").append(urlEncode(dataValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("message"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetOrderDetailResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetOrderDetailResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetOrderDetailResponse is not found in" + + " the empty JSON string", + GetOrderDetailResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) + && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `code` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("code").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) + && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `message` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("message").toString())); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetOrderDetailResponseData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetOrderDetailResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetOrderDetailResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetOrderDetailResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetOrderDetailResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetOrderDetailResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetOrderDetailResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetOrderDetailResponse + * @throws IOException if the JSON string is invalid with respect to GetOrderDetailResponse + */ + public static GetOrderDetailResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetOrderDetailResponse.class); + } + + /** + * Convert an instance of GetOrderDetailResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/GetOrderDetailResponseData.java b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/GetOrderDetailResponseData.java new file mode 100644 index 00000000..80815d59 --- /dev/null +++ b/clients/fiat/src/main/java/com/binance/connector/client/fiat/rest/model/GetOrderDetailResponseData.java @@ -0,0 +1,486 @@ +/* + * Binance Fiat REST API + * OpenAPI Specification for the Binance Fiat REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.fiat.rest.model; + +import com.binance.connector.client.fiat.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetOrderDetailResponseData */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetOrderDetailResponseData { + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private String orderId; + + public static final String SERIALIZED_NAME_ORDER_STATUS = "orderStatus"; + + @SerializedName(SERIALIZED_NAME_ORDER_STATUS) + @jakarta.annotation.Nullable + private String orderStatus; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + + @SerializedName(SERIALIZED_NAME_AMOUNT) + @jakarta.annotation.Nullable + private String amount; + + public static final String SERIALIZED_NAME_FEE = "fee"; + + @SerializedName(SERIALIZED_NAME_FEE) + @jakarta.annotation.Nullable + private String fee; + + public static final String SERIALIZED_NAME_FIAT_CURRENCY = "fiatCurrency"; + + @SerializedName(SERIALIZED_NAME_FIAT_CURRENCY) + @jakarta.annotation.Nullable + private String fiatCurrency; + + public static final String SERIALIZED_NAME_ERROR_CODE = "errorCode"; + + @SerializedName(SERIALIZED_NAME_ERROR_CODE) + @jakarta.annotation.Nullable + private String errorCode; + + public static final String SERIALIZED_NAME_ERROR_MESSAGE = "errorMessage"; + + @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) + @jakarta.annotation.Nullable + private String errorMessage; + + public static final String SERIALIZED_NAME_EXT = "ext"; + + @SerializedName(SERIALIZED_NAME_EXT) + @jakarta.annotation.Nullable + private Object ext; + + public GetOrderDetailResponseData() {} + + public GetOrderDetailResponseData orderId(@jakarta.annotation.Nullable String orderId) { + this.orderId = orderId; + return this; + } + + /** + * Get orderId + * + * @return orderId + */ + @jakarta.annotation.Nullable + public String getOrderId() { + return orderId; + } + + public void setOrderId(@jakarta.annotation.Nullable String orderId) { + this.orderId = orderId; + } + + public GetOrderDetailResponseData orderStatus(@jakarta.annotation.Nullable String orderStatus) { + this.orderStatus = orderStatus; + return this; + } + + /** + * Get orderStatus + * + * @return orderStatus + */ + @jakarta.annotation.Nullable + public String getOrderStatus() { + return orderStatus; + } + + public void setOrderStatus(@jakarta.annotation.Nullable String orderStatus) { + this.orderStatus = orderStatus; + } + + public GetOrderDetailResponseData amount(@jakarta.annotation.Nullable String amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * + * @return amount + */ + @jakarta.annotation.Nullable + public String getAmount() { + return amount; + } + + public void setAmount(@jakarta.annotation.Nullable String amount) { + this.amount = amount; + } + + public GetOrderDetailResponseData fee(@jakarta.annotation.Nullable String fee) { + this.fee = fee; + return this; + } + + /** + * Get fee + * + * @return fee + */ + @jakarta.annotation.Nullable + public String getFee() { + return fee; + } + + public void setFee(@jakarta.annotation.Nullable String fee) { + this.fee = fee; + } + + public GetOrderDetailResponseData fiatCurrency( + @jakarta.annotation.Nullable String fiatCurrency) { + this.fiatCurrency = fiatCurrency; + return this; + } + + /** + * Get fiatCurrency + * + * @return fiatCurrency + */ + @jakarta.annotation.Nullable + public String getFiatCurrency() { + return fiatCurrency; + } + + public void setFiatCurrency(@jakarta.annotation.Nullable String fiatCurrency) { + this.fiatCurrency = fiatCurrency; + } + + public GetOrderDetailResponseData errorCode(@jakarta.annotation.Nullable String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get errorCode + * + * @return errorCode + */ + @jakarta.annotation.Nullable + public String getErrorCode() { + return errorCode; + } + + public void setErrorCode(@jakarta.annotation.Nullable String errorCode) { + this.errorCode = errorCode; + } + + public GetOrderDetailResponseData errorMessage( + @jakarta.annotation.Nullable String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get errorMessage + * + * @return errorMessage + */ + @jakarta.annotation.Nullable + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(@jakarta.annotation.Nullable String errorMessage) { + this.errorMessage = errorMessage; + } + + public GetOrderDetailResponseData ext(@jakarta.annotation.Nullable Object ext) { + this.ext = ext; + return this; + } + + /** + * Get ext + * + * @return ext + */ + @jakarta.annotation.Nullable + public Object getExt() { + return ext; + } + + public void setExt(@jakarta.annotation.Nullable Object ext) { + this.ext = ext; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetOrderDetailResponseData getOrderDetailResponseData = (GetOrderDetailResponseData) o; + return Objects.equals(this.orderId, getOrderDetailResponseData.orderId) + && Objects.equals(this.orderStatus, getOrderDetailResponseData.orderStatus) + && Objects.equals(this.amount, getOrderDetailResponseData.amount) + && Objects.equals(this.fee, getOrderDetailResponseData.fee) + && Objects.equals(this.fiatCurrency, getOrderDetailResponseData.fiatCurrency) + && Objects.equals(this.errorCode, getOrderDetailResponseData.errorCode) + && Objects.equals(this.errorMessage, getOrderDetailResponseData.errorMessage) + && Objects.equals(this.ext, getOrderDetailResponseData.ext); + } + + @Override + public int hashCode() { + return Objects.hash( + orderId, orderStatus, amount, fee, fiatCurrency, errorCode, errorMessage, ext); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetOrderDetailResponseData {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" orderStatus: ").append(toIndentedString(orderStatus)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" fiatCurrency: ").append(toIndentedString(fiatCurrency)).append("\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" ext: ").append(toIndentedString(ext)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object orderIdValue = getOrderId(); + String orderIdValueAsString = ""; + orderIdValueAsString = orderIdValue.toString(); + sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); + Object orderStatusValue = getOrderStatus(); + String orderStatusValueAsString = ""; + orderStatusValueAsString = orderStatusValue.toString(); + sb.append("orderStatus=").append(urlEncode(orderStatusValueAsString)).append(""); + Object amountValue = getAmount(); + String amountValueAsString = ""; + amountValueAsString = amountValue.toString(); + sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); + Object feeValue = getFee(); + String feeValueAsString = ""; + feeValueAsString = feeValue.toString(); + sb.append("fee=").append(urlEncode(feeValueAsString)).append(""); + Object fiatCurrencyValue = getFiatCurrency(); + String fiatCurrencyValueAsString = ""; + fiatCurrencyValueAsString = fiatCurrencyValue.toString(); + sb.append("fiatCurrency=").append(urlEncode(fiatCurrencyValueAsString)).append(""); + Object errorCodeValue = getErrorCode(); + String errorCodeValueAsString = ""; + errorCodeValueAsString = errorCodeValue.toString(); + sb.append("errorCode=").append(urlEncode(errorCodeValueAsString)).append(""); + Object errorMessageValue = getErrorMessage(); + String errorMessageValueAsString = ""; + errorMessageValueAsString = errorMessageValue.toString(); + sb.append("errorMessage=").append(urlEncode(errorMessageValueAsString)).append(""); + Object extValue = getExt(); + String extValueAsString = ""; + extValueAsString = extValue.toString(); + sb.append("ext=").append(urlEncode(extValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("orderId"); + openapiFields.add("orderStatus"); + openapiFields.add("amount"); + openapiFields.add("fee"); + openapiFields.add("fiatCurrency"); + openapiFields.add("errorCode"); + openapiFields.add("errorMessage"); + openapiFields.add("ext"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetOrderDetailResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetOrderDetailResponseData.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetOrderDetailResponseData is not" + + " found in the empty JSON string", + GetOrderDetailResponseData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("orderId") != null && !jsonObj.get("orderId").isJsonNull()) + && !jsonObj.get("orderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("orderId").toString())); + } + if ((jsonObj.get("orderStatus") != null && !jsonObj.get("orderStatus").isJsonNull()) + && !jsonObj.get("orderStatus").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `orderStatus` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("orderStatus").toString())); + } + if ((jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonNull()) + && !jsonObj.get("amount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `amount` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("amount").toString())); + } + if ((jsonObj.get("fee") != null && !jsonObj.get("fee").isJsonNull()) + && !jsonObj.get("fee").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fee` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("fee").toString())); + } + if ((jsonObj.get("fiatCurrency") != null && !jsonObj.get("fiatCurrency").isJsonNull()) + && !jsonObj.get("fiatCurrency").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fiatCurrency` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("fiatCurrency").toString())); + } + if ((jsonObj.get("errorCode") != null && !jsonObj.get("errorCode").isJsonNull()) + && !jsonObj.get("errorCode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `errorCode` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("errorCode").toString())); + } + if ((jsonObj.get("errorMessage") != null && !jsonObj.get("errorMessage").isJsonNull()) + && !jsonObj.get("errorMessage").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `errorMessage` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("errorMessage").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetOrderDetailResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetOrderDetailResponseData' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetOrderDetailResponseData.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetOrderDetailResponseData value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetOrderDetailResponseData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetOrderDetailResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetOrderDetailResponseData + * @throws IOException if the JSON string is invalid with respect to GetOrderDetailResponseData + */ + public static GetOrderDetailResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetOrderDetailResponseData.class); + } + + /** + * Convert an instance of GetOrderDetailResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/margin-trading/CHANGELOG.md b/clients/margin-trading/CHANGELOG.md index f8d82311..a5890e10 100644 --- a/clients/margin-trading/CHANGELOG.md +++ b/clients/margin-trading/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 5.0.0 - 2025-12-16 + +### Removed (6) + +#### REST API + +- `closeIsolatedMarginUserDataStream()` (`DELETE /sapi/v1/userDataStream/isolated`) +- `closeMarginUserDataStream()` (`DELETE /sapi/v1/userDataStream`) +- `keepaliveIsolatedMarginUserDataStream()` (`PUT /sapi/v1/userDataStream/isolated`) +- `keepaliveMarginUserDataStream()` (`PUT /sapi/v1/userDataStream`) +- `startIsolatedMarginUserDataStream()` (`POST /sapi/v1/userDataStream/isolated`) +- `startMarginUserDataStream()` (`POST /sapi/v1/userDataStream`) + ## 4.0.0 - 2025-09-22 ### Added (1) @@ -42,4 +55,4 @@ ## 1.0.0 - 2025-04-24 -- Initial release \ No newline at end of file +- Initial release diff --git a/clients/margin-trading/docs/TradeApi.md b/clients/margin-trading/docs/TradeApi.md index 8fa1b5f2..b7daad5e 100644 --- a/clients/margin-trading/docs/TradeApi.md +++ b/clients/margin-trading/docs/TradeApi.md @@ -37,7 +37,7 @@ All URIs are relative to *https://api.binance.com* Create Special Key(Low-Latency Trading)(TRADE) -**Binance Margin offers low-latency trading through a [special key](https://www.binance.com/en/support/faq/frequently-asked-questions-on-margin-special-api-key-3208663e900d4d2e9fec4140e1832f4e), available exclusively to users with VIP level 4 or higher. ** **If you are VIP level 3 or below, please contact your VIP manager for eligibility criterias.** We support several types of API keys: * Ed25519 (recommended) * HMAC * RSA We recommend to **use Ed25519 API keys** as it should provide the best performance and security out of all supported key types. We accept PKCS#8 (BEGIN PUBLIC KEY). For how to generate an RSA key pair to send API requests on Binance. Please refer to the document below [FAQ](https://www.binance.com/en/support/faq/how-to-generate-an-rsa-key-pair-to-send-api-requests-on-binance-2b79728f331e43079b27440d9d15c5db) . Read [REST API](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#signed-trade-and-user_data-endpoint-security) or [WebSocket API](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md#request-security) documentation to learn how to use different API keys You need to enable Permits “Enable Spot & Margin Trading” option for the API Key which requests this endpoint. Weight: 1(UID) +- Binance Margin offers low-latency trading through a [special key](https://www.binance.com/en/support/faq/frequently-asked-questions-on-margin-special-api-key-3208663e900d4d2e9fec4140e1832f4e), available exclusively to users with VIP level 4 or higher. - If you are VIP level 3 or below, please contact your VIP manager for eligibility criterias.** **Supported Products:** - Cross Margin - Isolated Margin - Portfolio Margin Pro - Cross Margin Pro (Additional agreement required and subject to meeting eligibility criteria) **Unsupported Products:** - Portfolio Margin We support several types of API keys: * Ed25519 (recommended) * HMAC * RSA We recommend to **use Ed25519 API keys** as it should provide the best performance and security out of all supported key types. We accept PKCS#8 (BEGIN PUBLIC KEY). For how to generate an RSA key pair to send API requests on Binance. Please refer to the document below [FAQ](https://www.binance.com/en/support/faq/how-to-generate-an-rsa-key-pair-to-send-api-requests-on-binance-2b79728f331e43079b27440d9d15c5db) . Weight: 1(UID) ### Example ```java diff --git a/clients/margin-trading/docs/rest-api/migration-guide.md b/clients/margin-trading/docs/rest-api/migration-guide.md index ab932316..71283e8e 100644 --- a/clients/margin-trading/docs/rest-api/migration-guide.md +++ b/clients/margin-trading/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-margin-trading - 4.0.0 + 5.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-margin-trading - 4.0.0 + 5.0.0 ``` diff --git a/clients/margin-trading/example_rest.md b/clients/margin-trading/example_rest.md index 030d0b9c..2d7d8021 100644 --- a/clients/margin-trading/example_rest.md +++ b/clients/margin-trading/example_rest.md @@ -48,6 +48,8 @@ [GET /sapi/v1/margin/delist-schedule](https://developers.binance.com/docs/margin_trading/market-data/Get-Delist-Schedule) - getDelistSchedule - [GetDelistScheduleExample.java:47](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetDelistScheduleExample.java#L47) +[GET /sapi/v1/margin/limit-price-pairs](https://developers.binance.com/docs/margin_trading/market-data/Get-Limit-Price-Pairs) - getLimitPricePairs - [GetLimitPricePairsExample.java:56](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetLimitPricePairsExample.java#L56) + [GET /sapi/v1/margin/list-schedule](https://developers.binance.com/docs/margin_trading/market-data/Get-list-Schedule) - getListSchedule - [GetListScheduleExample.java:48](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetListScheduleExample.java#L48) [GET /sapi/v1/margin/isolatedMarginTier](https://developers.binance.com/docs/margin_trading/market-data/Query-Isolated-Margin-Tier-Data) - queryIsolatedMarginTierData - [QueryIsolatedMarginTierDataExample.java:48](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/QueryIsolatedMarginTierDataExample.java#L48) @@ -68,7 +70,7 @@ ## Trade -[POST /sapi/v1/margin/apiKey](https://developers.binance.com/docs/margin_trading/trade/Create-Special-Key-of-Low-Latency-Trading) - createSpecialKey - [CreateSpecialKeyExample.java:62](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/CreateSpecialKeyExample.java#L62) +[POST /sapi/v1/margin/apiKey](https://developers.binance.com/docs/margin_trading/trade/Create-Special-Key-of-Low-Latency-Trading) - createSpecialKey - [CreateSpecialKeyExample.java:59](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/CreateSpecialKeyExample.java#L59) [DELETE /sapi/v1/margin/apiKey](https://developers.binance.com/docs/margin_trading/trade/Delete-Special-Key-of-Low-Latency-Trading) - deleteSpecialKey - [DeleteSpecialKeyExample.java:48](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/DeleteSpecialKeyExample.java#L48) @@ -118,20 +120,6 @@ [POST /sapi/v1/margin/exchange-small-liability](https://developers.binance.com/docs/margin_trading/trade/Small-Liability-Exchange) - smallLiabilityExchange - [SmallLiabilityExchangeExample.java:48](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/SmallLiabilityExchangeExample.java#L48) -## TradeDataStream - -[DELETE /sapi/v1/userDataStream/isolated](https://developers.binance.com/docs/margin_trading/trade-data-stream/Close-Isolated-Margin-User-Data-Stream) - closeIsolatedMarginUserDataStream - [CloseIsolatedMarginUserDataStreamExample.java:45](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/CloseIsolatedMarginUserDataStreamExample.java#L45) - -[DELETE /sapi/v1/userDataStream](https://developers.binance.com/docs/margin_trading/trade-data-stream/Close-Margin-User-Data-Stream) - closeMarginUserDataStream - [CloseMarginUserDataStreamExample.java:45](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/CloseMarginUserDataStreamExample.java#L45) - -[PUT /sapi/v1/userDataStream/isolated](https://developers.binance.com/docs/margin_trading/trade-data-stream/Keepalive-Isolated-Margin-User-Data-Stream) - keepaliveIsolatedMarginUserDataStream - [KeepaliveIsolatedMarginUserDataStreamExample.java:46](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/KeepaliveIsolatedMarginUserDataStreamExample.java#L46) - -[PUT /sapi/v1/userDataStream](https://developers.binance.com/docs/margin_trading/trade-data-stream/Keepalive-Margin-User-Data-Stream) - keepaliveMarginUserDataStream - [KeepaliveMarginUserDataStreamExample.java:46](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/KeepaliveMarginUserDataStreamExample.java#L46) - -[POST /sapi/v1/userDataStream/isolated](https://developers.binance.com/docs/margin_trading/trade-data-stream/Start-Isolated-Margin-User-Data-Stream) - startIsolatedMarginUserDataStream - [StartIsolatedMarginUserDataStreamExample.java:50](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/StartIsolatedMarginUserDataStreamExample.java#L50) - -[POST /sapi/v1/userDataStream](https://developers.binance.com/docs/margin_trading/trade-data-stream/Start-Margin-User-Data-Stream) - startMarginUserDataStream - [StartMarginUserDataStreamExample.java:49](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/StartMarginUserDataStreamExample.java#L49) - ## Transfer [GET /sapi/v1/margin/transfer](https://developers.binance.com/docs/margin_trading/transfer/Get-Cross-Margin-Transfer-History) - getCrossMarginTransferHistory - [GetCrossMarginTransferHistoryExample.java:49](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/transfer/GetCrossMarginTransferHistoryExample.java#L49) diff --git a/clients/margin-trading/pom.xml b/clients/margin-trading/pom.xml index 79a1728e..cc927b97 100644 --- a/clients/margin-trading/pom.xml +++ b/clients/margin-trading/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-margin-trading margin-trading - 4.0.0 + 5.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.1 + 2.2.1 \ No newline at end of file diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/JSON.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/JSON.java index 11722ebb..28d6dd28 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/JSON.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/JSON.java @@ -221,12 +221,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.margin_trading.rest.model .GetSummaryOfMarginAccountResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.margin_trading.rest.model - .KeepaliveIsolatedMarginUserDataStreamRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.margin_trading.rest.model - .KeepaliveMarginUserDataStreamRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.margin_trading.rest.model .KeepaliveUserDataStreamRequest.CustomTypeAdapterFactory()); @@ -475,15 +469,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.margin_trading.rest.model .SmallLiabilityExchangeRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.margin_trading.rest.model - .StartIsolatedMarginUserDataStreamRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.margin_trading.rest.model - .StartIsolatedMarginUserDataStreamResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.margin_trading.rest.model - .StartMarginUserDataStreamResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.margin_trading.rest.model .StartUserDataStreamResponse.CustomTypeAdapterFactory()); diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/AccountApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/AccountApi.java index d4041234..a525b164 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/AccountApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/AccountApi.java @@ -55,7 +55,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/4.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/BorrowRepayApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/BorrowRepayApi.java index 3906d04d..0342ff0d 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/BorrowRepayApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/BorrowRepayApi.java @@ -49,7 +49,7 @@ public class BorrowRepayApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/4.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarginTradingRestApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarginTradingRestApi.java index c398cc0b..e0204bda 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarginTradingRestApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarginTradingRestApi.java @@ -28,8 +28,6 @@ import com.binance.connector.client.margin_trading.rest.model.GetSmallLiabilityExchangeCoinListResponse; import com.binance.connector.client.margin_trading.rest.model.GetSmallLiabilityExchangeHistoryResponse; import com.binance.connector.client.margin_trading.rest.model.GetSummaryOfMarginAccountResponse; -import com.binance.connector.client.margin_trading.rest.model.KeepaliveIsolatedMarginUserDataStreamRequest; -import com.binance.connector.client.margin_trading.rest.model.KeepaliveMarginUserDataStreamRequest; import com.binance.connector.client.margin_trading.rest.model.KeepaliveUserDataStreamRequest; import com.binance.connector.client.margin_trading.rest.model.MarginAccountBorrowRepayRequest; import com.binance.connector.client.margin_trading.rest.model.MarginAccountBorrowRepayResponse; @@ -71,9 +69,6 @@ import com.binance.connector.client.margin_trading.rest.model.QuerySpecialKeyListResponse; import com.binance.connector.client.margin_trading.rest.model.QuerySpecialKeyResponse; import com.binance.connector.client.margin_trading.rest.model.SmallLiabilityExchangeRequest; -import com.binance.connector.client.margin_trading.rest.model.StartIsolatedMarginUserDataStreamRequest; -import com.binance.connector.client.margin_trading.rest.model.StartIsolatedMarginUserDataStreamResponse; -import com.binance.connector.client.margin_trading.rest.model.StartMarginUserDataStreamResponse; import com.binance.connector.client.margin_trading.rest.model.StartUserDataStreamResponse; public class MarginTradingRestApi { @@ -83,7 +78,6 @@ public class MarginTradingRestApi { private final MarketDataApi marketDataApi; private final RiskDataStreamApi riskDataStreamApi; private final TradeApi tradeApi; - private final TradeDataStreamApi tradeDataStreamApi; private final TransferApi transferApi; public MarginTradingRestApi(ClientConfiguration configuration) { @@ -96,7 +90,6 @@ public MarginTradingRestApi(ApiClient apiClient) { this.marketDataApi = new MarketDataApi(apiClient); this.riskDataStreamApi = new RiskDataStreamApi(apiClient); this.tradeApi = new TradeApi(apiClient); - this.tradeDataStreamApi = new TradeDataStreamApi(apiClient); this.transferApi = new TransferApi(apiClient); } @@ -934,22 +927,19 @@ public ApiResponse startUserDataStream() throws Api } /** - * Create Special Key(Low-Latency Trading)(TRADE) **Binance Margin offers low-latency trading + * Create Special Key(Low-Latency Trading)(TRADE) - Binance Margin offers low-latency trading * through a [special * key](https://www.binance.com/en/support/faq/frequently-asked-questions-on-margin-special-api-key-3208663e900d4d2e9fec4140e1832f4e), - * available exclusively to users with VIP level 4 or higher. ** **If you are VIP level 3 or - * below, please contact your VIP manager for eligibility criterias.** We support several types - * of API keys: * Ed25519 (recommended) * HMAC * RSA We recommend to **use Ed25519 API keys** as - * it should provide the best performance and security out of all supported key types. We accept - * PKCS#8 (BEGIN PUBLIC KEY). For how to generate an RSA key pair to send API requests on - * Binance. Please refer to the document below + * available exclusively to users with VIP level 4 or higher. - If you are VIP level 3 or below, + * please contact your VIP manager for eligibility criterias.** **Supported Products:** - Cross + * Margin - Isolated Margin - Portfolio Margin Pro - Cross Margin Pro (Additional agreement + * required and subject to meeting eligibility criteria) **Unsupported Products:** - Portfolio + * Margin We support several types of API keys: * Ed25519 (recommended) * HMAC * RSA We + * recommend to **use Ed25519 API keys** as it should provide the best performance and security + * out of all supported key types. We accept PKCS#8 (BEGIN PUBLIC KEY). For how to generate an + * RSA key pair to send API requests on Binance. Please refer to the document below * [FAQ](https://www.binance.com/en/support/faq/how-to-generate-an-rsa-key-pair-to-send-api-requests-on-binance-2b79728f331e43079b27440d9d15c5db) - * . Read [REST - * API](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#signed-trade-and-user_data-endpoint-security) - * or [WebSocket - * API](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md#request-security) - * documentation to learn how to use different API keys You need to enable Permits “Enable Spot - * & Margin Trading” option for the API Key which requests this endpoint. Weight: 1(UID) + * . Weight: 1(UID) * * @param createSpecialKeyRequest (required) * @return ApiResponse<CreateSpecialKeyResponse> @@ -1724,158 +1714,6 @@ public void smallLiabilityExchange(SmallLiabilityExchangeRequest smallLiabilityE tradeApi.smallLiabilityExchange(smallLiabilityExchangeRequest); } - /** - * Close Isolated Margin User Data Stream (USER_STREAM) Close out a isolated margin user data - * stream. Weight: 3000 - * - * @param symbol (required) - * @param listenkey (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
- * - * @see Close - * Isolated Margin User Data Stream (USER_STREAM) Documentation - */ - public void closeIsolatedMarginUserDataStream(String symbol, String listenkey) - throws ApiException { - tradeDataStreamApi.closeIsolatedMarginUserDataStream(symbol, listenkey); - } - - /** - * Close Margin User Data Stream (USER_STREAM) Close out a Margin user data stream. Weight: 3000 - * - * @param listenkey (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
- * - * @see Close - * Margin User Data Stream (USER_STREAM) Documentation - */ - public void closeMarginUserDataStream(String listenkey) throws ApiException { - tradeDataStreamApi.closeMarginUserDataStream(listenkey); - } - - /** - * Keepalive Isolated Margin User Data Stream (USER_STREAM) Keepalive an isolated margin user - * data stream to prevent a time out. Weight: 1 - * - * @param keepaliveIsolatedMarginUserDataStreamRequest (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
- * - * @see Keepalive - * Isolated Margin User Data Stream (USER_STREAM) Documentation - */ - public void keepaliveIsolatedMarginUserDataStream( - KeepaliveIsolatedMarginUserDataStreamRequest - keepaliveIsolatedMarginUserDataStreamRequest) - throws ApiException { - tradeDataStreamApi.keepaliveIsolatedMarginUserDataStream( - keepaliveIsolatedMarginUserDataStreamRequest); - } - - /** - * Keepalive Margin User Data Stream (USER_STREAM) Keepalive a margin user data stream to - * prevent a time out. Weight: 1 - * - * @param keepaliveMarginUserDataStreamRequest (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
- * - * @see Keepalive - * Margin User Data Stream (USER_STREAM) Documentation - */ - public void keepaliveMarginUserDataStream( - KeepaliveMarginUserDataStreamRequest keepaliveMarginUserDataStreamRequest) - throws ApiException { - tradeDataStreamApi.keepaliveMarginUserDataStream(keepaliveMarginUserDataStreamRequest); - } - - /** - * Start Isolated Margin User Data Stream (USER_STREAM) Start a new isolated margin user data - * stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has - * an active listenKey, that listenKey will be returned and its validity will be extended for 60 - * minutes. Weight: 1 - * - * @param startIsolatedMarginUserDataStreamRequest (required) - * @return ApiResponse<StartIsolatedMarginUserDataStreamResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Start Isolated Margin User Data Stream -
- * - * @see Start - * Isolated Margin User Data Stream (USER_STREAM) Documentation - */ - public ApiResponse startIsolatedMarginUserDataStream( - StartIsolatedMarginUserDataStreamRequest startIsolatedMarginUserDataStreamRequest) - throws ApiException { - return tradeDataStreamApi.startIsolatedMarginUserDataStream( - startIsolatedMarginUserDataStreamRequest); - } - - /** - * Start Margin User Data Stream (USER_STREAM) Start a new margin user data stream. The stream - * will close after 60 minutes unless a keepalive is sent. If the account has an active - * listenKey, that listenKey will be returned and its validity will be extended for 60 minutes. - * Weight: 1 - * - * @return ApiResponse<StartMarginUserDataStreamResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Start Margin User Data Stream -
- * - * @see Start - * Margin User Data Stream (USER_STREAM) Documentation - */ - public ApiResponse startMarginUserDataStream() - throws ApiException { - return tradeDataStreamApi.startMarginUserDataStream(); - } - /** * Get Cross Margin Transfer History (USER_DATA) Get Cross Margin Transfer History * Response in * descending order * The max interval between `startTime` and `endTime` is diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarketDataApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarketDataApi.java index b730e67d..27f6e009 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarketDataApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarketDataApi.java @@ -52,7 +52,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/4.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/RiskDataStreamApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/RiskDataStreamApi.java index 4853fbf2..d952edf1 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/RiskDataStreamApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/RiskDataStreamApi.java @@ -44,7 +44,7 @@ public class RiskDataStreamApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/4.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeApi.java index 64449e2d..5706291e 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeApi.java @@ -74,7 +74,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/4.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -241,22 +241,19 @@ private okhttp3.Call createSpecialKeyValidateBeforeCall( } /** - * Create Special Key(Low-Latency Trading)(TRADE) **Binance Margin offers low-latency trading + * Create Special Key(Low-Latency Trading)(TRADE) - Binance Margin offers low-latency trading * through a [special * key](https://www.binance.com/en/support/faq/frequently-asked-questions-on-margin-special-api-key-3208663e900d4d2e9fec4140e1832f4e), - * available exclusively to users with VIP level 4 or higher. ** **If you are VIP level 3 or - * below, please contact your VIP manager for eligibility criterias.** We support several types - * of API keys: * Ed25519 (recommended) * HMAC * RSA We recommend to **use Ed25519 API keys** as - * it should provide the best performance and security out of all supported key types. We accept - * PKCS#8 (BEGIN PUBLIC KEY). For how to generate an RSA key pair to send API requests on - * Binance. Please refer to the document below + * available exclusively to users with VIP level 4 or higher. - If you are VIP level 3 or below, + * please contact your VIP manager for eligibility criterias.** **Supported Products:** - Cross + * Margin - Isolated Margin - Portfolio Margin Pro - Cross Margin Pro (Additional agreement + * required and subject to meeting eligibility criteria) **Unsupported Products:** - Portfolio + * Margin We support several types of API keys: * Ed25519 (recommended) * HMAC * RSA We + * recommend to **use Ed25519 API keys** as it should provide the best performance and security + * out of all supported key types. We accept PKCS#8 (BEGIN PUBLIC KEY). For how to generate an + * RSA key pair to send API requests on Binance. Please refer to the document below * [FAQ](https://www.binance.com/en/support/faq/how-to-generate-an-rsa-key-pair-to-send-api-requests-on-binance-2b79728f331e43079b27440d9d15c5db) - * . Read [REST - * API](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#signed-trade-and-user_data-endpoint-security) - * or [WebSocket - * API](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md#request-security) - * documentation to learn how to use different API keys You need to enable Permits “Enable Spot - * & Margin Trading” option for the API Key which requests this endpoint. Weight: 1(UID) + * . Weight: 1(UID) * * @param createSpecialKeyRequest (required) * @return ApiResponse<CreateSpecialKeyResponse> diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApi.java index 7aeea117..d61ad135 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApi.java @@ -47,7 +47,7 @@ public class TradeDataStreamApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/4.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -98,10 +98,12 @@ public void setCustomBaseUrl(String customBaseUrl) { * 200 OK - * * + * @deprecated * @see Close * Isolated Margin User Data Stream (USER_STREAM) Documentation */ + @Deprecated private okhttp3.Call closeIsolatedMarginUserDataStreamCall(String symbol, String listenkey) throws ApiException { String basePath = null; @@ -165,6 +167,7 @@ private okhttp3.Call closeIsolatedMarginUserDataStreamCall(String symbol, String localVarAuthNames); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call closeIsolatedMarginUserDataStreamValidateBeforeCall( String symbol, String listenkey) throws ApiException { @@ -217,10 +220,12 @@ private okhttp3.Call closeIsolatedMarginUserDataStreamValidateBeforeCall( * 200 OK - * * + * @deprecated * @see Close * Isolated Margin User Data Stream (USER_STREAM) Documentation */ + @Deprecated public ApiResponse closeIsolatedMarginUserDataStream( @NotNull String symbol, @NotNull String listenkey) throws ApiException { okhttp3.Call localVarCall = @@ -241,10 +246,12 @@ public ApiResponse closeIsolatedMarginUserDataStream( * 200 OK - * * + * @deprecated * @see Close * Margin User Data Stream (USER_STREAM) Documentation */ + @Deprecated private okhttp3.Call closeMarginUserDataStreamCall(String listenkey) throws ApiException { String basePath = null; // Operation Servers @@ -303,6 +310,7 @@ private okhttp3.Call closeMarginUserDataStreamCall(String listenkey) throws ApiE localVarAuthNames); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call closeMarginUserDataStreamValidateBeforeCall(String listenkey) throws ApiException { @@ -348,10 +356,12 @@ private okhttp3.Call closeMarginUserDataStreamValidateBeforeCall(String listenke * 200 OK - * * + * @deprecated * @see Close * Margin User Data Stream (USER_STREAM) Documentation */ + @Deprecated public ApiResponse closeMarginUserDataStream(@NotNull String listenkey) throws ApiException { okhttp3.Call localVarCall = closeMarginUserDataStreamValidateBeforeCall(listenkey); @@ -371,10 +381,12 @@ public ApiResponse closeMarginUserDataStream(@NotNull String listenkey) * 200 OK - * * + * @deprecated * @see Keepalive * Isolated Margin User Data Stream (USER_STREAM) Documentation */ + @Deprecated private okhttp3.Call keepaliveIsolatedMarginUserDataStreamCall( KeepaliveIsolatedMarginUserDataStreamRequest keepaliveIsolatedMarginUserDataStreamRequest) @@ -442,6 +454,7 @@ private okhttp3.Call keepaliveIsolatedMarginUserDataStreamCall( localVarAuthNames); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call keepaliveIsolatedMarginUserDataStreamValidateBeforeCall( KeepaliveIsolatedMarginUserDataStreamRequest @@ -495,10 +508,12 @@ private okhttp3.Call keepaliveIsolatedMarginUserDataStreamValidateBeforeCall( * 200 OK - * * + * @deprecated * @see Keepalive * Isolated Margin User Data Stream (USER_STREAM) Documentation */ + @Deprecated public ApiResponse keepaliveIsolatedMarginUserDataStream( @Valid @NotNull KeepaliveIsolatedMarginUserDataStreamRequest @@ -523,10 +538,12 @@ public ApiResponse keepaliveIsolatedMarginUserDataStream( * 200 OK - * * + * @deprecated * @see Keepalive * Margin User Data Stream (USER_STREAM) Documentation */ + @Deprecated private okhttp3.Call keepaliveMarginUserDataStreamCall( KeepaliveMarginUserDataStreamRequest keepaliveMarginUserDataStreamRequest) throws ApiException { @@ -588,6 +605,7 @@ private okhttp3.Call keepaliveMarginUserDataStreamCall( localVarAuthNames); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call keepaliveMarginUserDataStreamValidateBeforeCall( KeepaliveMarginUserDataStreamRequest keepaliveMarginUserDataStreamRequest) @@ -639,10 +657,12 @@ private okhttp3.Call keepaliveMarginUserDataStreamValidateBeforeCall( * 200 OK - * * + * @deprecated * @see Keepalive * Margin User Data Stream (USER_STREAM) Documentation */ + @Deprecated public ApiResponse keepaliveMarginUserDataStream( @Valid @NotNull KeepaliveMarginUserDataStreamRequest keepaliveMarginUserDataStreamRequest) @@ -666,10 +686,12 @@ public ApiResponse keepaliveMarginUserDataStream( * 200 Start Isolated Margin User Data Stream - * * + * @deprecated * @see Start * Isolated Margin User Data Stream (USER_STREAM) Documentation */ + @Deprecated private okhttp3.Call startIsolatedMarginUserDataStreamCall( StartIsolatedMarginUserDataStreamRequest startIsolatedMarginUserDataStreamRequest) throws ApiException { @@ -730,6 +752,7 @@ private okhttp3.Call startIsolatedMarginUserDataStreamCall( localVarAuthNames); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call startIsolatedMarginUserDataStreamValidateBeforeCall( StartIsolatedMarginUserDataStreamRequest startIsolatedMarginUserDataStreamRequest) @@ -784,10 +807,12 @@ private okhttp3.Call startIsolatedMarginUserDataStreamValidateBeforeCall( * 200 Start Isolated Margin User Data Stream - * * + * @deprecated * @see Start * Isolated Margin User Data Stream (USER_STREAM) Documentation */ + @Deprecated public ApiResponse startIsolatedMarginUserDataStream( @Valid @NotNull StartIsolatedMarginUserDataStreamRequest @@ -813,10 +838,12 @@ public ApiResponse startIsolatedMargi * 200 Start Margin User Data Stream - * * + * @deprecated * @see Start * Margin User Data Stream (USER_STREAM) Documentation */ + @Deprecated private okhttp3.Call startMarginUserDataStreamCall() throws ApiException { String basePath = null; // Operation Servers @@ -871,6 +898,7 @@ private okhttp3.Call startMarginUserDataStreamCall() throws ApiException { localVarAuthNames); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call startMarginUserDataStreamValidateBeforeCall() throws ApiException { try { @@ -917,10 +945,12 @@ private okhttp3.Call startMarginUserDataStreamValidateBeforeCall() throws ApiExc * 200 Start Margin User Data Stream - * * + * @deprecated * @see Start * Margin User Data Stream (USER_STREAM) Documentation */ + @Deprecated public ApiResponse startMarginUserDataStream() throws ApiException { okhttp3.Call localVarCall = startMarginUserDataStreamValidateBeforeCall(); diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TransferApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TransferApi.java index 1a55cb7c..57a22423 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TransferApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TransferApi.java @@ -43,7 +43,7 @@ public class TransferApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/4.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/api/MarginTradingWebSocketStreams.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/api/MarginTradingWebSocketStreams.java index 3b47db89..d1b66a94 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/api/MarginTradingWebSocketStreams.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/api/MarginTradingWebSocketStreams.java @@ -20,7 +20,7 @@ public class MarginTradingWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-margin-trading/4.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/simple-earn/CHANGELOG.md b/clients/simple-earn/CHANGELOG.md index da007d89..a73fde37 100644 --- a/clients/simple-earn/CHANGELOG.md +++ b/clients/simple-earn/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 4.0.0 - 2025-12-16 + +### Added (8) + +- `getBfusdAccount()` (`GET /sapi/v1/bfusd/account`) +- `getBfusdQuotaDetails()` (`GET /sapi/v1/bfusd/quota`) +- `getBfusdRateHistory()` (`GET /sapi/v1/bfusd/history/rateHistory`) +- `getBfusdRedemptionHistory()` (`GET /sapi/v1/bfusd/history/redemptionHistory`) +- `getBfusdRewardsHistory()` (`GET /sapi/v1/bfusd/history/rewardsHistory`) +- `getBfusdSubscriptionHistory()` (`GET /sapi/v1/bfusd/history/subscriptionHistory`) +- `redeemBfusd()` (`POST /sapi/v1/bfusd/redeem`) +- `subscribeBfusd()` (`POST /sapi/v1/bfusd/subscribe`) + ## 3.0.0 - 2025-09-22 ### Added (8) @@ -38,6 +51,7 @@ - `getFlexibleRewardsHistory()` (`GET /sapi/v1/simple-earn/flexible/history/rewardsRecord`) ## 2.1.1 - 2025-08-07 + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/simple-earn/docs/BfusdApi.md b/clients/simple-earn/docs/BfusdApi.md new file mode 100644 index 00000000..f58465a7 --- /dev/null +++ b/clients/simple-earn/docs/BfusdApi.md @@ -0,0 +1,546 @@ +# BfusdApi + +All URIs are relative to *https://api.binance.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getBfusdAccount**](BfusdApi.md#getBfusdAccount) | **GET** /sapi/v1/bfusd/account | Get BFUSD Account (USER_DATA) | +| [**getBfusdQuotaDetails**](BfusdApi.md#getBfusdQuotaDetails) | **GET** /sapi/v1/bfusd/quota | Get BFUSD Quota Details (USER_DATA) | +| [**getBfusdRateHistory**](BfusdApi.md#getBfusdRateHistory) | **GET** /sapi/v1/bfusd/history/rateHistory | Get BFUSD Rate History (USER_DATA) | +| [**getBfusdRedemptionHistory**](BfusdApi.md#getBfusdRedemptionHistory) | **GET** /sapi/v1/bfusd/history/redemptionHistory | Get BFUSD Redemption History (USER_DATA) | +| [**getBfusdRewardsHistory**](BfusdApi.md#getBfusdRewardsHistory) | **GET** /sapi/v1/bfusd/history/rewardsHistory | Get BFUSD Rewards History (USER_DATA) | +| [**getBfusdSubscriptionHistory**](BfusdApi.md#getBfusdSubscriptionHistory) | **GET** /sapi/v1/bfusd/history/subscriptionHistory | Get BFUSD subscription history(USER_DATA) | +| [**redeemBfusd**](BfusdApi.md#redeemBfusd) | **POST** /sapi/v1/bfusd/redeem | Redeem BFUSD(TRADE) | +| [**subscribeBfusd**](BfusdApi.md#subscribeBfusd) | **POST** /sapi/v1/bfusd/subscribe | Subscribe BFUSD(TRADE) | + + + +# **getBfusdAccount** +> GetBfusdAccountResponse getBfusdAccount(recvWindow) + +Get BFUSD Account (USER_DATA) + +Get BFUSD account information. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.BfusdApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + BfusdApi apiInstance = new BfusdApi(defaultClient); + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) + try { + GetBfusdAccountResponse result = apiInstance.getBfusdAccount(recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BfusdApi#getBfusdAccount"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | + +### Return type + +[**GetBfusdAccountResponse**](GetBfusdAccountResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get BFUSD Account | - | + + +# **getBfusdQuotaDetails** +> GetBfusdQuotaDetailsResponse getBfusdQuotaDetails(recvWindow) + +Get BFUSD Quota Details (USER_DATA) + +Get BFUSD quota details including fast redemption quota and standard redemption quota. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.BfusdApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + BfusdApi apiInstance = new BfusdApi(defaultClient); + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) + try { + GetBfusdQuotaDetailsResponse result = apiInstance.getBfusdQuotaDetails(recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BfusdApi#getBfusdQuotaDetails"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | + +### Return type + +[**GetBfusdQuotaDetailsResponse**](GetBfusdQuotaDetailsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get BFUSD Quota Details | - | + + +# **getBfusdRateHistory** +> GetBfusdRateHistoryResponse getBfusdRateHistory(startTime, endTime, current, size, recvWindow) + +Get BFUSD Rate History (USER_DATA) + +Get BFUSD rate history sorted by descending order. * The time between `startTime` and `endTime` cannot be longer than 6 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned. * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.BfusdApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + BfusdApi apiInstance = new BfusdApi(defaultClient); + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) + try { + GetBfusdRateHistoryResponse result = apiInstance.getBfusdRateHistory(startTime, endTime, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BfusdApi#getBfusdRateHistory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | + +### Return type + +[**GetBfusdRateHistoryResponse**](GetBfusdRateHistoryResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get BFUSD Rate History | - | + + +# **getBfusdRedemptionHistory** +> GetBfusdRedemptionHistoryResponse getBfusdRedemptionHistory(startTime, endTime, current, size, recvWindow) + +Get BFUSD Redemption History (USER_DATA) + +Get BFUSD redemption history. * The time between `startTime` and `endTime` cannot be longer than 6 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned. * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.BfusdApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + BfusdApi apiInstance = new BfusdApi(defaultClient); + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) + try { + GetBfusdRedemptionHistoryResponse result = apiInstance.getBfusdRedemptionHistory(startTime, endTime, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BfusdApi#getBfusdRedemptionHistory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | + +### Return type + +[**GetBfusdRedemptionHistoryResponse**](GetBfusdRedemptionHistoryResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get BFUSD Redemption History | - | + + +# **getBfusdRewardsHistory** +> GetBfusdRewardsHistoryResponse getBfusdRewardsHistory(startTime, endTime, current, size, recvWindow) + +Get BFUSD Rewards History (USER_DATA) + +Get BFUSD rewards history. * The time between `startTime` and `endTime` cannot be longer than 6 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned. * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.BfusdApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + BfusdApi apiInstance = new BfusdApi(defaultClient); + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) + try { + GetBfusdRewardsHistoryResponse result = apiInstance.getBfusdRewardsHistory(startTime, endTime, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BfusdApi#getBfusdRewardsHistory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | + +### Return type + +[**GetBfusdRewardsHistoryResponse**](GetBfusdRewardsHistoryResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get BFUSD Rewards History | - | + + +# **getBfusdSubscriptionHistory** +> GetBfusdSubscriptionHistoryResponse getBfusdSubscriptionHistory(asset, startTime, endTime, current, size, recvWindow) + +Get BFUSD subscription history(USER_DATA) + +Get BFUSD subscription history * The time between `startTime` and `endTime` cannot be longer than 6 months. * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned. * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned. * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time advanced by one month, and data between `startTime` and `endTime` will be returned. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.BfusdApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + BfusdApi apiInstance = new BfusdApi(defaultClient); + String asset = "asset_example"; // String | USDC or USDT + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) + try { + GetBfusdSubscriptionHistoryResponse result = apiInstance.getBfusdSubscriptionHistory(asset, startTime, endTime, current, size, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BfusdApi#getBfusdSubscriptionHistory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **asset** | **String**| USDC or USDT | [optional] | +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | + +### Return type + +[**GetBfusdSubscriptionHistoryResponse**](GetBfusdSubscriptionHistoryResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get BFUSD subscription history | - | + + +# **redeemBfusd** +> RedeemBfusdResponse redeemBfusd(redeemBfusdRequest) + +Redeem BFUSD(TRADE) + +Redeem BFUSD to USDT * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.BfusdApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + BfusdApi apiInstance = new BfusdApi(defaultClient); + RedeemBfusdRequest redeemBfusdRequest = new RedeemBfusdRequest(); // RedeemBfusdRequest | + try { + RedeemBfusdResponse result = apiInstance.redeemBfusd(redeemBfusdRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BfusdApi#redeemBfusd"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **redeemBfusdRequest** | [**RedeemBfusdRequest**](RedeemBfusdRequest.md)| | | + +### Return type + +[**RedeemBfusdResponse**](RedeemBfusdResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Redeem BFUSD | - | + + +# **subscribeBfusd** +> SubscribeBfusdResponse subscribeBfusd(subscribeBfusdRequest) + +Subscribe BFUSD(TRADE) + +Subscribe BFUSD * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint. Weight: 150 + +### Example +```java +// Import classes: +import com.binance.connector.client.simple_earn.ApiClient; +import com.binance.connector.client.simple_earn.ApiException; +import com.binance.connector.client.simple_earn.Configuration; +import com.binance.connector.client.simple_earn.models.*; +import com.binance.connector.client.simple_earn.rest.api.BfusdApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + BfusdApi apiInstance = new BfusdApi(defaultClient); + SubscribeBfusdRequest subscribeBfusdRequest = new SubscribeBfusdRequest(); // SubscribeBfusdRequest | + try { + SubscribeBfusdResponse result = apiInstance.subscribeBfusd(subscribeBfusdRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BfusdApi#subscribeBfusd"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **subscribeBfusdRequest** | [**SubscribeBfusdRequest**](SubscribeBfusdRequest.md)| | | + +### Return type + +[**SubscribeBfusdResponse**](SubscribeBfusdResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Subscribe BFUSD | - | + diff --git a/clients/simple-earn/docs/FlexibleLockedApi.md b/clients/simple-earn/docs/FlexibleLockedApi.md index c2226b1a..26795d55 100644 --- a/clients/simple-earn/docs/FlexibleLockedApi.md +++ b/clients/simple-earn/docs/FlexibleLockedApi.md @@ -56,9 +56,9 @@ public class Example { String productId = "productId_example"; // String | Long startTime = 56L; // Long | Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetCollateralRecordResponse result = apiInstance.getCollateralRecord(productId, startTime, endTime, current, size, recvWindow); System.out.println(result); @@ -80,9 +80,9 @@ public class Example { | **productId** | **String**| | [optional] | | **startTime** | **Long**| | [optional] | | **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -126,7 +126,7 @@ public class Example { FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); String productId = "productId_example"; // String | - Long recvWindow = 56L; // Long | + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetFlexiblePersonalLeftQuotaResponse result = apiInstance.getFlexiblePersonalLeftQuota(productId, recvWindow); System.out.println(result); @@ -146,7 +146,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **productId** | **String**| | | -| **recvWindow** | **Long**| | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -191,9 +191,9 @@ public class Example { FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); String asset = "asset_example"; // String | USDC or USDT String productId = "productId_example"; // String | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetFlexibleProductPositionResponse result = apiInstance.getFlexibleProductPosition(asset, productId, current, size, recvWindow); System.out.println(result); @@ -214,9 +214,9 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **asset** | **String**| USDC or USDT | [optional] | | **productId** | **String**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -264,9 +264,9 @@ public class Example { String asset = "asset_example"; // String | USDC or USDT Long startTime = 56L; // Long | Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetFlexibleRedemptionRecordResponse result = apiInstance.getFlexibleRedemptionRecord(productId, redeemId, asset, startTime, endTime, current, size, recvWindow); System.out.println(result); @@ -290,9 +290,9 @@ public class Example { | **asset** | **String**| USDC or USDT | [optional] | | **startTime** | **Long**| | [optional] | | **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -340,9 +340,9 @@ public class Example { String asset = "asset_example"; // String | USDC or USDT Long startTime = 56L; // Long | Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetFlexibleRewardsHistoryResponse result = apiInstance.getFlexibleRewardsHistory(type, productId, asset, startTime, endTime, current, size, recvWindow); System.out.println(result); @@ -366,9 +366,9 @@ public class Example { | **asset** | **String**| USDC or USDT | [optional] | | **startTime** | **Long**| | [optional] | | **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -413,7 +413,7 @@ public class Example { FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); String productId = "productId_example"; // String | Double amount = 3.4D; // Double | - Long recvWindow = 56L; // Long | + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetFlexibleSubscriptionPreviewResponse result = apiInstance.getFlexibleSubscriptionPreview(productId, amount, recvWindow); System.out.println(result); @@ -434,7 +434,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **productId** | **String**| | | | **amount** | **Double**| | | -| **recvWindow** | **Long**| | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -482,9 +482,9 @@ public class Example { String asset = "asset_example"; // String | USDC or USDT Long startTime = 56L; // Long | Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetFlexibleSubscriptionRecordResponse result = apiInstance.getFlexibleSubscriptionRecord(productId, purchaseId, asset, startTime, endTime, current, size, recvWindow); System.out.println(result); @@ -508,9 +508,9 @@ public class Example { | **asset** | **String**| USDC or USDT | [optional] | | **startTime** | **Long**| | [optional] | | **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -554,7 +554,7 @@ public class Example { FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); String projectId = "projectId_example"; // String | - Long recvWindow = 56L; // Long | + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetLockedPersonalLeftQuotaResponse result = apiInstance.getLockedPersonalLeftQuota(projectId, recvWindow); System.out.println(result); @@ -574,7 +574,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **projectId** | **String**| | | -| **recvWindow** | **Long**| | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -620,9 +620,9 @@ public class Example { String asset = "asset_example"; // String | USDC or USDT String positionId = "positionId_example"; // String | String projectId = "projectId_example"; // String | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetLockedProductPositionResponse result = apiInstance.getLockedProductPosition(asset, positionId, projectId, current, size, recvWindow); System.out.println(result); @@ -644,9 +644,9 @@ public class Example { | **asset** | **String**| USDC or USDT | [optional] | | **positionId** | **String**| | [optional] | | **projectId** | **String**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -694,9 +694,9 @@ public class Example { String asset = "asset_example"; // String | USDC or USDT Long startTime = 56L; // Long | Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetLockedRedemptionRecordResponse result = apiInstance.getLockedRedemptionRecord(positionId, redeemId, asset, startTime, endTime, current, size, recvWindow); System.out.println(result); @@ -720,9 +720,9 @@ public class Example { | **asset** | **String**| USDC or USDT | [optional] | | **startTime** | **Long**| | [optional] | | **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -769,9 +769,9 @@ public class Example { String asset = "asset_example"; // String | USDC or USDT Long startTime = 56L; // Long | Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetLockedRewardsHistoryResponse result = apiInstance.getLockedRewardsHistory(positionId, asset, startTime, endTime, current, size, recvWindow); System.out.println(result); @@ -794,9 +794,9 @@ public class Example { | **asset** | **String**| USDC or USDT | [optional] | | **startTime** | **Long**| | [optional] | | **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -842,7 +842,7 @@ public class Example { String projectId = "projectId_example"; // String | Double amount = 3.4D; // Double | Boolean autoSubscribe = true; // Boolean | true or false, default true. - Long recvWindow = 56L; // Long | + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetLockedSubscriptionPreviewResponse result = apiInstance.getLockedSubscriptionPreview(projectId, amount, autoSubscribe, recvWindow); System.out.println(result); @@ -864,7 +864,7 @@ public class Example { | **projectId** | **String**| | | | **amount** | **Double**| | | | **autoSubscribe** | **Boolean**| true or false, default true. | [optional] | -| **recvWindow** | **Long**| | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -911,9 +911,9 @@ public class Example { String asset = "asset_example"; // String | USDC or USDT Long startTime = 56L; // Long | Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetLockedSubscriptionRecordResponse result = apiInstance.getLockedSubscriptionRecord(purchaseId, asset, startTime, endTime, current, size, recvWindow); System.out.println(result); @@ -936,9 +936,9 @@ public class Example { | **asset** | **String**| USDC or USDT | [optional] | | **startTime** | **Long**| | [optional] | | **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -985,9 +985,9 @@ public class Example { String aprPeriod = "aprPeriod_example"; // String | \"DAY\",\"YEAR\",default\"DAY\" Long startTime = 56L; // Long | Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetRateHistoryResponse result = apiInstance.getRateHistory(productId, aprPeriod, startTime, endTime, current, size, recvWindow); System.out.println(result); @@ -1010,9 +1010,9 @@ public class Example { | **aprPeriod** | **String**| \"DAY\",\"YEAR\",default\"DAY\" | [optional] | | **startTime** | **Long**| | [optional] | | **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -1056,9 +1056,9 @@ public class Example { FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); String asset = "asset_example"; // String | USDC or USDT - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetSimpleEarnFlexibleProductListResponse result = apiInstance.getSimpleEarnFlexibleProductList(asset, current, size, recvWindow); System.out.println(result); @@ -1078,9 +1078,9 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **asset** | **String**| USDC or USDT | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -1124,9 +1124,9 @@ public class Example { FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); String asset = "asset_example"; // String | USDC or USDT - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetSimpleEarnLockedProductListResponse result = apiInstance.getSimpleEarnLockedProductList(asset, current, size, recvWindow); System.out.println(result); @@ -1146,9 +1146,9 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **asset** | **String**| USDC or USDT | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -1501,7 +1501,7 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); FlexibleLockedApi apiInstance = new FlexibleLockedApi(defaultClient); - Long recvWindow = 56L; // Long | + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { SimpleAccountResponse result = apiInstance.simpleAccount(recvWindow); System.out.println(result); @@ -1520,7 +1520,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **recvWindow** | **Long**| | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type diff --git a/clients/simple-earn/docs/GetBfusdAccountResponse.md b/clients/simple-earn/docs/GetBfusdAccountResponse.md new file mode 100644 index 00000000..856b5fc0 --- /dev/null +++ b/clients/simple-earn/docs/GetBfusdAccountResponse.md @@ -0,0 +1,15 @@ + + +# GetBfusdAccountResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bfusdAmount** | **String** | | [optional] | +|**usdtProfit** | **String** | | [optional] | +|**bfusdProfit** | **String** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetBfusdQuotaDetailsResponse.md b/clients/simple-earn/docs/GetBfusdQuotaDetailsResponse.md new file mode 100644 index 00000000..79cdd0b0 --- /dev/null +++ b/clients/simple-earn/docs/GetBfusdQuotaDetailsResponse.md @@ -0,0 +1,16 @@ + + +# GetBfusdQuotaDetailsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fastRedemptionQuota** | [**GetBfusdQuotaDetailsResponseFastRedemptionQuota**](GetBfusdQuotaDetailsResponseFastRedemptionQuota.md) | | [optional] | +|**standardRedemptionQuota** | [**GetBfusdQuotaDetailsResponseStandardRedemptionQuota**](GetBfusdQuotaDetailsResponseStandardRedemptionQuota.md) | | [optional] | +|**subscribeEnable** | **Boolean** | | [optional] | +|**redeemEnable** | **Boolean** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetBfusdQuotaDetailsResponseFastRedemptionQuota.md b/clients/simple-earn/docs/GetBfusdQuotaDetailsResponseFastRedemptionQuota.md new file mode 100644 index 00000000..fb0235b7 --- /dev/null +++ b/clients/simple-earn/docs/GetBfusdQuotaDetailsResponseFastRedemptionQuota.md @@ -0,0 +1,16 @@ + + +# GetBfusdQuotaDetailsResponseFastRedemptionQuota + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**leftQuota** | **String** | | [optional] | +|**minimum** | **String** | | [optional] | +|**fee** | **String** | | [optional] | +|**freeQuota** | **String** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetBfusdQuotaDetailsResponseStandardRedemptionQuota.md b/clients/simple-earn/docs/GetBfusdQuotaDetailsResponseStandardRedemptionQuota.md new file mode 100644 index 00000000..93484b6d --- /dev/null +++ b/clients/simple-earn/docs/GetBfusdQuotaDetailsResponseStandardRedemptionQuota.md @@ -0,0 +1,16 @@ + + +# GetBfusdQuotaDetailsResponseStandardRedemptionQuota + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**leftQuota** | **String** | | [optional] | +|**minimum** | **String** | | [optional] | +|**fee** | **String** | | [optional] | +|**redeemPeriod** | **Long** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetBfusdRateHistoryResponse.md b/clients/simple-earn/docs/GetBfusdRateHistoryResponse.md new file mode 100644 index 00000000..ffe9cd4b --- /dev/null +++ b/clients/simple-earn/docs/GetBfusdRateHistoryResponse.md @@ -0,0 +1,14 @@ + + +# GetBfusdRateHistoryResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rows** | [**List<GetBfusdRateHistoryResponseRowsInner>**](GetBfusdRateHistoryResponseRowsInner.md) | | [optional] | +|**total** | **String** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetRwusdRateHistoryResponseRowsInner.md b/clients/simple-earn/docs/GetBfusdRateHistoryResponseRowsInner.md similarity index 85% rename from clients/simple-earn/docs/GetRwusdRateHistoryResponseRowsInner.md rename to clients/simple-earn/docs/GetBfusdRateHistoryResponseRowsInner.md index d015a4e4..ef3098b7 100644 --- a/clients/simple-earn/docs/GetRwusdRateHistoryResponseRowsInner.md +++ b/clients/simple-earn/docs/GetBfusdRateHistoryResponseRowsInner.md @@ -1,6 +1,6 @@ -# GetRwusdRateHistoryResponseRowsInner +# GetBfusdRateHistoryResponseRowsInner ## Properties diff --git a/clients/simple-earn/docs/GetBfusdRedemptionHistoryResponse.md b/clients/simple-earn/docs/GetBfusdRedemptionHistoryResponse.md new file mode 100644 index 00000000..729c1c04 --- /dev/null +++ b/clients/simple-earn/docs/GetBfusdRedemptionHistoryResponse.md @@ -0,0 +1,14 @@ + + +# GetBfusdRedemptionHistoryResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rows** | [**List<GetBfusdRedemptionHistoryResponseRowsInner>**](GetBfusdRedemptionHistoryResponseRowsInner.md) | | [optional] | +|**total** | **Long** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetBfusdRedemptionHistoryResponseRowsInner.md b/clients/simple-earn/docs/GetBfusdRedemptionHistoryResponseRowsInner.md new file mode 100644 index 00000000..382fcb3e --- /dev/null +++ b/clients/simple-earn/docs/GetBfusdRedemptionHistoryResponseRowsInner.md @@ -0,0 +1,20 @@ + + +# GetBfusdRedemptionHistoryResponseRowsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**time** | **Long** | | [optional] | +|**asset** | **String** | | [optional] | +|**amount** | **String** | | [optional] | +|**receiveAsset** | **String** | | [optional] | +|**receiveAmount** | **String** | | [optional] | +|**fee** | **String** | | [optional] | +|**arrivalTime** | **Long** | | [optional] | +|**status** | **String** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetBfusdRewardsHistoryResponse.md b/clients/simple-earn/docs/GetBfusdRewardsHistoryResponse.md new file mode 100644 index 00000000..954901a4 --- /dev/null +++ b/clients/simple-earn/docs/GetBfusdRewardsHistoryResponse.md @@ -0,0 +1,14 @@ + + +# GetBfusdRewardsHistoryResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rows** | [**List<GetBfusdRewardsHistoryResponseRowsInner>**](GetBfusdRewardsHistoryResponseRowsInner.md) | | [optional] | +|**total** | **Long** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetBfusdRewardsHistoryResponseRowsInner.md b/clients/simple-earn/docs/GetBfusdRewardsHistoryResponseRowsInner.md new file mode 100644 index 00000000..b3692e84 --- /dev/null +++ b/clients/simple-earn/docs/GetBfusdRewardsHistoryResponseRowsInner.md @@ -0,0 +1,17 @@ + + +# GetBfusdRewardsHistoryResponseRowsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**time** | **Long** | | [optional] | +|**rewardAsset** | **String** | | [optional] | +|**rewardsAmount** | **String** | | [optional] | +|**bfUSDPosition** | **String** | | [optional] | +|**annualPercentageRate** | **String** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetBfusdSubscriptionHistoryResponse.md b/clients/simple-earn/docs/GetBfusdSubscriptionHistoryResponse.md new file mode 100644 index 00000000..dc66ad3a --- /dev/null +++ b/clients/simple-earn/docs/GetBfusdSubscriptionHistoryResponse.md @@ -0,0 +1,14 @@ + + +# GetBfusdSubscriptionHistoryResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rows** | [**List<GetBfusdSubscriptionHistoryResponseRowsInner>**](GetBfusdSubscriptionHistoryResponseRowsInner.md) | | [optional] | +|**total** | **Long** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetBfusdSubscriptionHistoryResponseRowsInner.md b/clients/simple-earn/docs/GetBfusdSubscriptionHistoryResponseRowsInner.md new file mode 100644 index 00000000..a59a3b8f --- /dev/null +++ b/clients/simple-earn/docs/GetBfusdSubscriptionHistoryResponseRowsInner.md @@ -0,0 +1,18 @@ + + +# GetBfusdSubscriptionHistoryResponseRowsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**time** | **Long** | | [optional] | +|**asset** | **String** | | [optional] | +|**amount** | **String** | | [optional] | +|**receiveAsset** | **String** | | [optional] | +|**receiveAmount** | **String** | | [optional] | +|**status** | **String** | | [optional] | + + + diff --git a/clients/simple-earn/docs/GetRwusdRateHistoryResponse.md b/clients/simple-earn/docs/GetRwusdRateHistoryResponse.md index 078a547a..28648515 100644 --- a/clients/simple-earn/docs/GetRwusdRateHistoryResponse.md +++ b/clients/simple-earn/docs/GetRwusdRateHistoryResponse.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**rows** | [**List<GetRwusdRateHistoryResponseRowsInner>**](GetRwusdRateHistoryResponseRowsInner.md) | | [optional] | +|**rows** | [**List<GetBfusdRateHistoryResponseRowsInner>**](GetBfusdRateHistoryResponseRowsInner.md) | | [optional] | |**total** | **String** | | [optional] | diff --git a/clients/simple-earn/docs/RedeemBfusdRequest.md b/clients/simple-earn/docs/RedeemBfusdRequest.md new file mode 100644 index 00000000..60252b50 --- /dev/null +++ b/clients/simple-earn/docs/RedeemBfusdRequest.md @@ -0,0 +1,15 @@ + + +# RedeemBfusdRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**amount** | **Double** | | | +|**type** | **String** | | | +|**recvWindow** | **Long** | | [optional] | + + + diff --git a/clients/simple-earn/docs/RedeemBfusdResponse.md b/clients/simple-earn/docs/RedeemBfusdResponse.md new file mode 100644 index 00000000..e2406381 --- /dev/null +++ b/clients/simple-earn/docs/RedeemBfusdResponse.md @@ -0,0 +1,16 @@ + + +# RedeemBfusdResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**success** | **Boolean** | | [optional] | +|**receiveAmount** | **String** | | [optional] | +|**fee** | **String** | | [optional] | +|**arrivalTime** | **Long** | | [optional] | + + + diff --git a/clients/simple-earn/docs/RwusdApi.md b/clients/simple-earn/docs/RwusdApi.md index 5bdb3bff..6be84266 100644 --- a/clients/simple-earn/docs/RwusdApi.md +++ b/clients/simple-earn/docs/RwusdApi.md @@ -37,7 +37,7 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); RwusdApi apiInstance = new RwusdApi(defaultClient); - Long recvWindow = 56L; // Long | + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetRwusdAccountResponse result = apiInstance.getRwusdAccount(recvWindow); System.out.println(result); @@ -56,7 +56,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **recvWindow** | **Long**| | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -99,7 +99,7 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); RwusdApi apiInstance = new RwusdApi(defaultClient); - Long recvWindow = 56L; // Long | + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetRwusdQuotaDetailsResponse result = apiInstance.getRwusdQuotaDetails(recvWindow); System.out.println(result); @@ -118,7 +118,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **recvWindow** | **Long**| | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -163,9 +163,9 @@ public class Example { RwusdApi apiInstance = new RwusdApi(defaultClient); Long startTime = 56L; // Long | Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetRwusdRateHistoryResponse result = apiInstance.getRwusdRateHistory(startTime, endTime, current, size, recvWindow); System.out.println(result); @@ -186,9 +186,9 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **startTime** | **Long**| | [optional] | | **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -233,9 +233,9 @@ public class Example { RwusdApi apiInstance = new RwusdApi(defaultClient); Long startTime = 56L; // Long | Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetRwusdRedemptionHistoryResponse result = apiInstance.getRwusdRedemptionHistory(startTime, endTime, current, size, recvWindow); System.out.println(result); @@ -256,9 +256,9 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **startTime** | **Long**| | [optional] | | **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -303,9 +303,9 @@ public class Example { RwusdApi apiInstance = new RwusdApi(defaultClient); Long startTime = 56L; // Long | Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetRwusdRewardsHistoryResponse result = apiInstance.getRwusdRewardsHistory(startTime, endTime, current, size, recvWindow); System.out.println(result); @@ -326,9 +326,9 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **startTime** | **Long**| | [optional] | | **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type @@ -374,9 +374,9 @@ public class Example { String asset = "asset_example"; // String | USDC or USDT Long startTime = 56L; // Long | Long endTime = 56L; // Long | - Long current = 56L; // Long | Currently querying the page. Start from 1. Default:1 - Long size = 56L; // Long | Default:10, Max:100 - Long recvWindow = 56L; // Long | + Long current = 56L; // Long | Currently querying page. Starts from 1. Default: 1 + Long size = 56L; // Long | Number of results per page. Default: 10, Max: 100 + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 (ms) try { GetRwusdSubscriptionHistoryResponse result = apiInstance.getRwusdSubscriptionHistory(asset, startTime, endTime, current, size, recvWindow); System.out.println(result); @@ -398,9 +398,9 @@ public class Example { | **asset** | **String**| USDC or USDT | [optional] | | **startTime** | **Long**| | [optional] | | **endTime** | **Long**| | [optional] | -| **current** | **Long**| Currently querying the page. Start from 1. Default:1 | [optional] | -| **size** | **Long**| Default:10, Max:100 | [optional] | -| **recvWindow** | **Long**| | [optional] | +| **current** | **Long**| Currently querying page. Starts from 1. Default: 1 | [optional] | +| **size** | **Long**| Number of results per page. Default: 10, Max: 100 | [optional] | +| **recvWindow** | **Long**| The value cannot be greater than 60000 (ms) | [optional] | ### Return type diff --git a/clients/simple-earn/docs/SubscribeBfusdRequest.md b/clients/simple-earn/docs/SubscribeBfusdRequest.md new file mode 100644 index 00000000..7ba23942 --- /dev/null +++ b/clients/simple-earn/docs/SubscribeBfusdRequest.md @@ -0,0 +1,15 @@ + + +# SubscribeBfusdRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**asset** | **String** | | | +|**amount** | **Double** | | | +|**recvWindow** | **Long** | | [optional] | + + + diff --git a/clients/simple-earn/docs/SubscribeBfusdResponse.md b/clients/simple-earn/docs/SubscribeBfusdResponse.md new file mode 100644 index 00000000..fee9e344 --- /dev/null +++ b/clients/simple-earn/docs/SubscribeBfusdResponse.md @@ -0,0 +1,14 @@ + + +# SubscribeBfusdResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**success** | **Boolean** | | [optional] | +|**bfusdAmount** | **String** | | [optional] | + + + diff --git a/clients/simple-earn/docs/rest-api/migration-guide.md b/clients/simple-earn/docs/rest-api/migration-guide.md index 0357605e..df963076 100644 --- a/clients/simple-earn/docs/rest-api/migration-guide.md +++ b/clients/simple-earn/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-simple-earn - 3.0.0 + 4.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-simple-earn - 3.0.0 + 4.0.0 ``` diff --git a/clients/simple-earn/example_rest.md b/clients/simple-earn/example_rest.md index 3e215a07..8a0abef3 100644 --- a/clients/simple-earn/example_rest.md +++ b/clients/simple-earn/example_rest.md @@ -1,54 +1,86 @@ -## Account +## Bfusd -[GET /sapi/v1/simple-earn/flexible/personalLeftQuota](https://developers.binance.com/docs/simple_earn/account/Get-Flexible-Personal-Left-Quota) - getFlexiblePersonalLeftQuota - [GetFlexiblePersonalLeftQuotaExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetFlexiblePersonalLeftQuotaExample.java#L47) +[GET /sapi/v1/bfusd/account](https://developers.binance.com/docs/simple_earn/bfusd/account/) - getBfusdAccount - [GetBfusdAccountExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdAccountExample.java#L47) -[GET /sapi/v1/simple-earn/flexible/position](https://developers.binance.com/docs/simple_earn/account/Get-Flexible-Product-Position) - getFlexibleProductPosition - [GetFlexibleProductPositionExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetFlexibleProductPositionExample.java#L47) +[GET /sapi/v1/bfusd/quota](https://developers.binance.com/docs/simple_earn/bfusd/account/Get-BFUSD-Quota-Details) - getBfusdQuotaDetails - [GetBfusdQuotaDetailsExample.java:48](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdQuotaDetailsExample.java#L48) -[GET /sapi/v1/simple-earn/locked/personalLeftQuota](https://developers.binance.com/docs/simple_earn/account/Get-Locked-Personal-Left-Quota) - getLockedPersonalLeftQuota - [GetLockedPersonalLeftQuotaExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetLockedPersonalLeftQuotaExample.java#L47) +[GET /sapi/v1/bfusd/history/rateHistory](https://developers.binance.com/docs/simple_earn/bfusd/history/Get-BFUSD-Rate-History) - getBfusdRateHistory - [GetBfusdRateHistoryExample.java:55](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdRateHistoryExample.java#L55) -[GET /sapi/v1/simple-earn/locked/position](https://developers.binance.com/docs/simple_earn/account/Get-Locked-Product-Position) - getLockedProductPosition - [GetLockedProductPositionExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetLockedProductPositionExample.java#L47) +[GET /sapi/v1/bfusd/history/redemptionHistory](https://developers.binance.com/docs/simple_earn/bfusd/history/Get-BFUSD-Redemption-History) - getBfusdRedemptionHistory - [GetBfusdRedemptionHistoryExample.java:54](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdRedemptionHistoryExample.java#L54) -[GET /sapi/v1/simple-earn/flexible/list](https://developers.binance.com/docs/simple_earn/account/Get-Simple-Earn-Flexible-Product-List) - getSimpleEarnFlexibleProductList - [GetSimpleEarnFlexibleProductListExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetSimpleEarnFlexibleProductListExample.java#L47) +[GET /sapi/v1/bfusd/history/rewardsHistory](https://developers.binance.com/docs/simple_earn/bfusd/history/Get-BFUSD-Rewards-History) - getBfusdRewardsHistory - [GetBfusdRewardsHistoryExample.java:54](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdRewardsHistoryExample.java#L54) -[GET /sapi/v1/simple-earn/locked/list](https://developers.binance.com/docs/simple_earn/account/Get-Simple-Earn-Locked-Product-List) - getSimpleEarnLockedProductList - [GetSimpleEarnLockedProductListExample.java:48](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/GetSimpleEarnLockedProductListExample.java#L48) +[GET /sapi/v1/bfusd/history/subscriptionHistory](https://developers.binance.com/docs/simple_earn/bfusd/history/Get-BFUSD-subscription-history) - getBfusdSubscriptionHistory - [GetBfusdSubscriptionHistoryExample.java:54](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdSubscriptionHistoryExample.java#L54) -[GET /sapi/v1/simple-earn/account](https://developers.binance.com/docs/simple_earn/account/Simple-Account) - simpleAccount - [SimpleAccountExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/account/SimpleAccountExample.java#L47) +[POST /sapi/v1/bfusd/redeem](https://developers.binance.com/docs/simple_earn/bfusd/earn/Redeem-BFUSD) - redeemBfusd - [RedeemBfusdExample.java:49](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/RedeemBfusdExample.java#L49) -## Earn +[POST /sapi/v1/bfusd/subscribe](https://developers.binance.com/docs/simple_earn/bfusd/earn/Subscribe-BFUSD) - subscribeBfusd - [SubscribeBfusdExample.java:49](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/SubscribeBfusdExample.java#L49) -[GET /sapi/v1/simple-earn/flexible/subscriptionPreview](https://developers.binance.com/docs/simple_earn/earn/Get-Flexible-Subscription-Preview) - getFlexibleSubscriptionPreview - [GetFlexibleSubscriptionPreviewExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/GetFlexibleSubscriptionPreviewExample.java#L47) +## FlexibleLocked -[GET /sapi/v1/simple-earn/locked/subscriptionPreview](https://developers.binance.com/docs/simple_earn/earn/Get-Locked-Subscription-Preview) - getLockedSubscriptionPreview - [GetLockedSubscriptionPreviewExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/GetLockedSubscriptionPreviewExample.java#L47) +[GET /sapi/v1/simple-earn/flexible/history/collateralRecord](https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Collateral-Record) - getCollateralRecord - [GetCollateralRecordExample.java:53](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetCollateralRecordExample.java#L53) -[POST /sapi/v1/simple-earn/flexible/redeem](https://developers.binance.com/docs/simple_earn/earn/Redeem-Flexible-Product) - redeemFlexibleProduct - [RedeemFlexibleProductExample.java:49](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/RedeemFlexibleProductExample.java#L49) +[GET /sapi/v1/simple-earn/flexible/personalLeftQuota](https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Flexible-Personal-Left-Quota) - getFlexiblePersonalLeftQuota - [GetFlexiblePersonalLeftQuotaExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexiblePersonalLeftQuotaExample.java#L47) -[POST /sapi/v1/simple-earn/locked/redeem](https://developers.binance.com/docs/simple_earn/earn/Redeem-Locked-Product) - redeemLockedProduct - [RedeemLockedProductExample.java:49](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/RedeemLockedProductExample.java#L49) +[GET /sapi/v1/simple-earn/flexible/position](https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Flexible-Product-Position) - getFlexibleProductPosition - [GetFlexibleProductPositionExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleProductPositionExample.java#L47) -[POST /sapi/v1/simple-earn/flexible/setAutoSubscribe](https://developers.binance.com/docs/simple_earn/earn/Set-Flexible-Auto-Subscribe) - setFlexibleAutoSubscribe - [SetFlexibleAutoSubscribeExample.java:48](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SetFlexibleAutoSubscribeExample.java#L48) +[GET /sapi/v1/simple-earn/flexible/history/redemptionRecord](https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Flexible-Redemption-Record) - getFlexibleRedemptionRecord - [GetFlexibleRedemptionRecordExample.java:53](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleRedemptionRecordExample.java#L53) -[POST /sapi/v1/simple-earn/locked/setAutoSubscribe](https://developers.binance.com/docs/simple_earn/earn/Set-Locked-Auto-Subscribe) - setLockedAutoSubscribe - [SetLockedAutoSubscribeExample.java:48](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SetLockedAutoSubscribeExample.java#L48) +[GET /sapi/v1/simple-earn/flexible/history/rewardsRecord](https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Flexible-Rewards-History) - getFlexibleRewardsHistory - [GetFlexibleRewardsHistoryExample.java:53](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleRewardsHistoryExample.java#L53) -[POST /sapi/v1/simple-earn/locked/setRedeemOption](https://developers.binance.com/docs/simple_earn/earn/Set-Locked-Redeem-Option) - setLockedProductRedeemOption - [SetLockedProductRedeemOptionExample.java:48](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SetLockedProductRedeemOptionExample.java#L48) +[GET /sapi/v1/simple-earn/flexible/subscriptionPreview](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Get-Flexible-Subscription-Preview) - getFlexibleSubscriptionPreview - [GetFlexibleSubscriptionPreviewExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleSubscriptionPreviewExample.java#L47) -[POST /sapi/v1/simple-earn/flexible/subscribe](https://developers.binance.com/docs/simple_earn/earn/Subscribe-Flexible-Product) - subscribeFlexibleProduct - [SubscribeFlexibleProductExample.java:49](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SubscribeFlexibleProductExample.java#L49) +[GET /sapi/v1/simple-earn/flexible/history/subscriptionRecord](https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Flexible-Subscription-Record) - getFlexibleSubscriptionRecord - [GetFlexibleSubscriptionRecordExample.java:53](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetFlexibleSubscriptionRecordExample.java#L53) -[POST /sapi/v1/simple-earn/locked/subscribe](https://developers.binance.com/docs/simple_earn/earn/Subscribe-Locked-Product) - subscribeLockedProduct - [SubscribeLockedProductExample.java:49](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/earn/SubscribeLockedProductExample.java#L49) +[GET /sapi/v1/simple-earn/locked/personalLeftQuota](https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Locked-Personal-Left-Quota) - getLockedPersonalLeftQuota - [GetLockedPersonalLeftQuotaExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedPersonalLeftQuotaExample.java#L47) -## History +[GET /sapi/v1/simple-earn/locked/position](https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Locked-Product-Position) - getLockedProductPosition - [GetLockedProductPositionExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedProductPositionExample.java#L47) -[GET /sapi/v1/simple-earn/flexible/history/collateralRecord](https://developers.binance.com/docs/simple_earn/history/Get-Collateral-Record) - getCollateralRecord - [GetCollateralRecordExample.java:53](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetCollateralRecordExample.java#L53) +[GET /sapi/v1/simple-earn/locked/history/redemptionRecord](https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Locked-Redemption-Record) - getLockedRedemptionRecord - [GetLockedRedemptionRecordExample.java:53](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedRedemptionRecordExample.java#L53) -[GET /sapi/v1/simple-earn/flexible/history/redemptionRecord](https://developers.binance.com/docs/simple_earn/history/Get-Flexible-Redemption-Record) - getFlexibleRedemptionRecord - [GetFlexibleRedemptionRecordExample.java:53](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetFlexibleRedemptionRecordExample.java#L53) +[GET /sapi/v1/simple-earn/locked/history/rewardsRecord](https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Locked-Rewards-History) - getLockedRewardsHistory - [GetLockedRewardsHistoryExample.java:53](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedRewardsHistoryExample.java#L53) -[GET /sapi/v1/simple-earn/flexible/history/rewardsRecord](https://developers.binance.com/docs/simple_earn/history/Get-Flexible-Rewards-History) - getFlexibleRewardsHistory - [GetFlexibleRewardsHistoryExample.java:53](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetFlexibleRewardsHistoryExample.java#L53) +[GET /sapi/v1/simple-earn/locked/subscriptionPreview](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Get-Locked-Subscription-Preview) - getLockedSubscriptionPreview - [GetLockedSubscriptionPreviewExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedSubscriptionPreviewExample.java#L47) -[GET /sapi/v1/simple-earn/flexible/history/subscriptionRecord](https://developers.binance.com/docs/simple_earn/history/Get-Flexible-Subscription-Record) - getFlexibleSubscriptionRecord - [GetFlexibleSubscriptionRecordExample.java:53](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetFlexibleSubscriptionRecordExample.java#L53) +[GET /sapi/v1/simple-earn/locked/history/subscriptionRecord](https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Locked-Subscription-Record) - getLockedSubscriptionRecord - [GetLockedSubscriptionRecordExample.java:53](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetLockedSubscriptionRecordExample.java#L53) -[GET /sapi/v1/simple-earn/locked/history/redemptionRecord](https://developers.binance.com/docs/simple_earn/history/Get-Locked-Redemption-Record) - getLockedRedemptionRecord - [GetLockedRedemptionRecordExample.java:53](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetLockedRedemptionRecordExample.java#L53) +[GET /sapi/v1/simple-earn/flexible/history/rateHistory](https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Rate-History) - getRateHistory - [GetRateHistoryExample.java:52](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetRateHistoryExample.java#L52) -[GET /sapi/v1/simple-earn/locked/history/rewardsRecord](https://developers.binance.com/docs/simple_earn/history/Get-Locked-Rewards-History) - getLockedRewardsHistory - [GetLockedRewardsHistoryExample.java:53](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetLockedRewardsHistoryExample.java#L53) +[GET /sapi/v1/simple-earn/flexible/list](https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Simple-Earn-Flexible-Product-List) - getSimpleEarnFlexibleProductList - [GetSimpleEarnFlexibleProductListExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetSimpleEarnFlexibleProductListExample.java#L47) -[GET /sapi/v1/simple-earn/locked/history/subscriptionRecord](https://developers.binance.com/docs/simple_earn/history/Get-Locked-Subscription-Record) - getLockedSubscriptionRecord - [GetLockedSubscriptionRecordExample.java:53](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetLockedSubscriptionRecordExample.java#L53) +[GET /sapi/v1/simple-earn/locked/list](https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Simple-Earn-Locked-Product-List) - getSimpleEarnLockedProductList - [GetSimpleEarnLockedProductListExample.java:48](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/GetSimpleEarnLockedProductListExample.java#L48) -[GET /sapi/v1/simple-earn/flexible/history/rateHistory](https://developers.binance.com/docs/simple_earn/history/Get-Rate-History) - getRateHistory - [GetRateHistoryExample.java:52](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/history/GetRateHistoryExample.java#L52) +[POST /sapi/v1/simple-earn/flexible/redeem](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Redeem-Flexible-Product) - redeemFlexibleProduct - [RedeemFlexibleProductExample.java:49](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/RedeemFlexibleProductExample.java#L49) + +[POST /sapi/v1/simple-earn/locked/redeem](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Redeem-Locked-Product) - redeemLockedProduct - [RedeemLockedProductExample.java:49](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/RedeemLockedProductExample.java#L49) + +[POST /sapi/v1/simple-earn/flexible/setAutoSubscribe](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Set-Flexible-Auto-Subscribe) - setFlexibleAutoSubscribe - [SetFlexibleAutoSubscribeExample.java:48](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SetFlexibleAutoSubscribeExample.java#L48) + +[POST /sapi/v1/simple-earn/locked/setAutoSubscribe](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Set-Locked-Auto-Subscribe) - setLockedAutoSubscribe - [SetLockedAutoSubscribeExample.java:48](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SetLockedAutoSubscribeExample.java#L48) + +[POST /sapi/v1/simple-earn/locked/setRedeemOption](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Set-Locked-Redeem-Option) - setLockedProductRedeemOption - [SetLockedProductRedeemOptionExample.java:48](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SetLockedProductRedeemOptionExample.java#L48) + +[GET /sapi/v1/simple-earn/account](https://developers.binance.com/docs/simple_earn/flexible-locked/account/Simple-Account) - simpleAccount - [SimpleAccountExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SimpleAccountExample.java#L47) + +[POST /sapi/v1/simple-earn/flexible/subscribe](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Subscribe-Flexible-Product) - subscribeFlexibleProduct - [SubscribeFlexibleProductExample.java:49](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SubscribeFlexibleProductExample.java#L49) + +[POST /sapi/v1/simple-earn/locked/subscribe](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Subscribe-Locked-Product) - subscribeLockedProduct - [SubscribeLockedProductExample.java:49](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SubscribeLockedProductExample.java#L49) + +## Rwusd + +[GET /sapi/v1/rwusd/account](https://developers.binance.com/docs/simple_earn/rwusd/account/) - getRwusdAccount - [GetRwusdAccountExample.java:47](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdAccountExample.java#L47) + +[GET /sapi/v1/rwusd/quota](https://developers.binance.com/docs/simple_earn/rwusd/account/Get-RWUSD-Quota-Details) - getRwusdQuotaDetails - [GetRwusdQuotaDetailsExample.java:48](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdQuotaDetailsExample.java#L48) + +[GET /sapi/v1/rwusd/history/rateHistory](https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-Rate-History) - getRwusdRateHistory - [GetRwusdRateHistoryExample.java:55](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdRateHistoryExample.java#L55) + +[GET /sapi/v1/rwusd/history/redemptionHistory](https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-Redemption-History) - getRwusdRedemptionHistory - [GetRwusdRedemptionHistoryExample.java:54](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdRedemptionHistoryExample.java#L54) + +[GET /sapi/v1/rwusd/history/rewardsHistory](https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-Rewards-History) - getRwusdRewardsHistory - [GetRwusdRewardsHistoryExample.java:54](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdRewardsHistoryExample.java#L54) + +[GET /sapi/v1/rwusd/history/subscriptionHistory](https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-subscription-history) - getRwusdSubscriptionHistory - [GetRwusdSubscriptionHistoryExample.java:54](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/GetRwusdSubscriptionHistoryExample.java#L54) + +[POST /sapi/v1/rwusd/redeem](https://developers.binance.com/docs/simple_earn/rwusd/earn/Redeem-RWUSD) - redeemRwusd - [RedeemRwusdExample.java:49](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/RedeemRwusdExample.java#L49) + +[POST /sapi/v1/rwusd/subscribe](https://developers.binance.com/docs/simple_earn/rwusd/earn/Subscribe-RWUSD) - subscribeRwusd - [SubscribeRwusdExample.java:49](/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/rwusd/SubscribeRwusdExample.java#L49) diff --git a/clients/simple-earn/pom.xml b/clients/simple-earn/pom.xml index 214c28f6..155b4c9d 100644 --- a/clients/simple-earn/pom.xml +++ b/clients/simple-earn/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-simple-earn simple-earn - 3.0.0 + 4.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.1 + 2.2.1 \ No newline at end of file diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/JSON.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/JSON.java index 580082ee..1cd9c096 100644 --- a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/JSON.java +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/JSON.java @@ -108,6 +108,44 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model.GetBfusdAccountResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model.GetBfusdQuotaDetailsResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetBfusdQuotaDetailsResponseFastRedemptionQuota + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetBfusdQuotaDetailsResponseStandardRedemptionQuota + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model.GetBfusdRateHistoryResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetBfusdRateHistoryResponseRowsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetBfusdRedemptionHistoryResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetBfusdRedemptionHistoryResponseRowsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetBfusdRewardsHistoryResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetBfusdRewardsHistoryResponseRowsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetBfusdSubscriptionHistoryResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model + .GetBfusdSubscriptionHistoryResponseRowsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.simple_earn.rest.model.GetCollateralRecordResponse .CustomTypeAdapterFactory()); @@ -207,9 +245,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.simple_earn.rest.model.GetRwusdRateHistoryResponse .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.simple_earn.rest.model - .GetRwusdRateHistoryResponseRowsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.simple_earn.rest.model .GetRwusdRedemptionHistoryResponse.CustomTypeAdapterFactory()); @@ -250,6 +285,12 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.simple_earn.rest.model .GetSimpleEarnLockedProductListResponseRowsInnerQuota .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model.RedeemBfusdRequest + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model.RedeemBfusdResponse + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.simple_earn.rest.model.RedeemFlexibleProductRequest .CustomTypeAdapterFactory()); @@ -289,6 +330,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.simple_earn.rest.model.SimpleAccountResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model.SubscribeBfusdRequest + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.simple_earn.rest.model.SubscribeBfusdResponse + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.simple_earn.rest.model .SubscribeFlexibleProductRequest.CustomTypeAdapterFactory()); diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/BfusdApi.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/BfusdApi.java new file mode 100644 index 00000000..d6ca30ca --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/BfusdApi.java @@ -0,0 +1,1369 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.api; + +import com.binance.connector.client.common.ApiClient; +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.DecimalFormatter; +import com.binance.connector.client.common.Pair; +import com.binance.connector.client.common.SystemUtil; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.exception.ConstraintViolationException; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdAccountResponse; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdQuotaDetailsResponse; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdRateHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdRedemptionHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdRewardsHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdSubscriptionHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.RedeemBfusdRequest; +import com.binance.connector.client.simple_earn.rest.model.RedeemBfusdResponse; +import com.binance.connector.client.simple_earn.rest.model.SubscribeBfusdRequest; +import com.binance.connector.client.simple_earn.rest.model.SubscribeBfusdResponse; +import com.google.gson.reflect.TypeToken; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Valid; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.constraints.*; +import jakarta.validation.executable.ExecutableValidator; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; + +public class BfusdApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + private static final String USER_AGENT = + String.format( + "binance-simple-earn/4.0.0 (Java/%s; %s; %s)", + SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + private static final boolean HAS_TIME_UNIT = false; + + public BfusdApi(ClientConfiguration clientConfiguration) { + this(new ApiClient(clientConfiguration)); + } + + public BfusdApi(ApiClient apiClient) { + apiClient.setUserAgent(USER_AGENT); + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getBfusdAccount + * + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD Account -
+ * + * @see Get BFUSD + * Account (USER_DATA) Documentation + */ + private okhttp3.Call getBfusdAccountCall(Long recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/bfusd/account"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBfusdAccountValidateBeforeCall(Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {recvWindow}; + Method method = this.getClass().getMethod("getBfusdAccount", Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getBfusdAccountCall(recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get BFUSD Account (USER_DATA) Get BFUSD account information. Weight: 150 + * + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return ApiResponse<GetBfusdAccountResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD Account -
+ * + * @see Get BFUSD + * Account (USER_DATA) Documentation + */ + public ApiResponse getBfusdAccount(Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = getBfusdAccountValidateBeforeCall(recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getBfusdQuotaDetails + * + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD Quota Details -
+ * + * @see Get + * BFUSD Quota Details (USER_DATA) Documentation + */ + private okhttp3.Call getBfusdQuotaDetailsCall(Long recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/bfusd/quota"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBfusdQuotaDetailsValidateBeforeCall(Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {recvWindow}; + Method method = this.getClass().getMethod("getBfusdQuotaDetails", Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getBfusdQuotaDetailsCall(recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get BFUSD Quota Details (USER_DATA) Get BFUSD quota details including fast redemption quota + * and standard redemption quota. Weight: 150 + * + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return ApiResponse<GetBfusdQuotaDetailsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD Quota Details -
+ * + * @see Get + * BFUSD Quota Details (USER_DATA) Documentation + */ + public ApiResponse getBfusdQuotaDetails(Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = getBfusdQuotaDetailsValidateBeforeCall(recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getBfusdRateHistory + * + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD Rate History -
+ * + * @see Get + * BFUSD Rate History (USER_DATA) Documentation + */ + private okhttp3.Call getBfusdRateHistoryCall( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/bfusd/history/rateHistory"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBfusdRateHistoryValidateBeforeCall( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {startTime, endTime, current, size, recvWindow}; + Method method = + this.getClass() + .getMethod( + "getBfusdRateHistory", + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getBfusdRateHistoryCall(startTime, endTime, current, size, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get BFUSD Rate History (USER_DATA) Get BFUSD rate history sorted by descending order. * The + * time between `startTime` and `endTime` cannot be longer than 6 months. * + * If `startTime` and `endTime` are both not sent, then the last 30 + * days' data will be returned. * If `startTime` is sent but `endTime` + * is not sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time minus + * one month, and data between `startTime` and `endTime` will be returned. + * Weight: 150 + * + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return ApiResponse<GetBfusdRateHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD Rate History -
+ * + * @see Get + * BFUSD Rate History (USER_DATA) Documentation + */ + public ApiResponse getBfusdRateHistory( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getBfusdRateHistoryValidateBeforeCall( + startTime, endTime, current, size, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getBfusdRedemptionHistory + * + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD Redemption History -
+ * + * @see Get + * BFUSD Redemption History (USER_DATA) Documentation + */ + private okhttp3.Call getBfusdRedemptionHistoryCall( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/bfusd/history/redemptionHistory"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBfusdRedemptionHistoryValidateBeforeCall( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {startTime, endTime, current, size, recvWindow}; + Method method = + this.getClass() + .getMethod( + "getBfusdRedemptionHistory", + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getBfusdRedemptionHistoryCall(startTime, endTime, current, size, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get BFUSD Redemption History (USER_DATA) Get BFUSD redemption history. * The time between + * `startTime` and `endTime` cannot be longer than 6 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time minus + * one month, and data between `startTime` and `endTime` will be returned. + * Weight: 150 + * + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return ApiResponse<GetBfusdRedemptionHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD Redemption History -
+ * + * @see Get + * BFUSD Redemption History (USER_DATA) Documentation + */ + public ApiResponse getBfusdRedemptionHistory( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getBfusdRedemptionHistoryValidateBeforeCall( + startTime, endTime, current, size, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getBfusdRewardsHistory + * + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD Rewards History -
+ * + * @see Get + * BFUSD Rewards History (USER_DATA) Documentation + */ + private okhttp3.Call getBfusdRewardsHistoryCall( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/bfusd/history/rewardsHistory"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBfusdRewardsHistoryValidateBeforeCall( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {startTime, endTime, current, size, recvWindow}; + Method method = + this.getClass() + .getMethod( + "getBfusdRewardsHistory", + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getBfusdRewardsHistoryCall(startTime, endTime, current, size, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get BFUSD Rewards History (USER_DATA) Get BFUSD rewards history. * The time between + * `startTime` and `endTime` cannot be longer than 6 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time minus + * one month, and data between `startTime` and `endTime` will be returned. + * Weight: 150 + * + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return ApiResponse<GetBfusdRewardsHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD Rewards History -
+ * + * @see Get + * BFUSD Rewards History (USER_DATA) Documentation + */ + public ApiResponse getBfusdRewardsHistory( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getBfusdRewardsHistoryValidateBeforeCall( + startTime, endTime, current, size, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getBfusdSubscriptionHistory + * + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD subscription history -
+ * + * @see Get + * BFUSD subscription history(USER_DATA) Documentation + */ + private okhttp3.Call getBfusdSubscriptionHistoryCall( + String asset, Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/bfusd/history/subscriptionHistory"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (asset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (size != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBfusdSubscriptionHistoryValidateBeforeCall( + String asset, Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {asset, startTime, endTime, current, size, recvWindow}; + Method method = + this.getClass() + .getMethod( + "getBfusdSubscriptionHistory", + String.class, + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getBfusdSubscriptionHistoryCall( + asset, startTime, endTime, current, size, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get BFUSD subscription history(USER_DATA) Get BFUSD subscription history * The time between + * `startTime` and `endTime` cannot be longer than 6 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time + * advanced by one month, and data between `startTime` and `endTime` will be + * returned. Weight: 150 + * + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return ApiResponse<GetBfusdSubscriptionHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD subscription history -
+ * + * @see Get + * BFUSD subscription history(USER_DATA) Documentation + */ + public ApiResponse getBfusdSubscriptionHistory( + String asset, Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getBfusdSubscriptionHistoryValidateBeforeCall( + asset, startTime, endTime, current, size, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for redeemBfusd + * + * @param redeemBfusdRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Redeem BFUSD -
+ * + * @see Redeem + * BFUSD(TRADE) Documentation + */ + private okhttp3.Call redeemBfusdCall(RedeemBfusdRequest redeemBfusdRequest) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/bfusd/redeem"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (redeemBfusdRequest.getAmount() != null) { + localVarFormParams.put( + "amount", + DecimalFormatter.getFormatter().format(redeemBfusdRequest.getAmount())); + } + + if (redeemBfusdRequest.getType() != null) { + localVarFormParams.put("type", redeemBfusdRequest.getType()); + } + + if (redeemBfusdRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", redeemBfusdRequest.getRecvWindow()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call redeemBfusdValidateBeforeCall(RedeemBfusdRequest redeemBfusdRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {redeemBfusdRequest}; + Method method = this.getClass().getMethod("redeemBfusd", RedeemBfusdRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return redeemBfusdCall(redeemBfusdRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Redeem BFUSD(TRADE) Redeem BFUSD to USDT * You need to open Enable Spot & Margin Trading + * permission for the API Key which requests this endpoint. Weight: 150 + * + * @param redeemBfusdRequest (required) + * @return ApiResponse<RedeemBfusdResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Redeem BFUSD -
+ * + * @see Redeem + * BFUSD(TRADE) Documentation + */ + public ApiResponse redeemBfusd( + @Valid @NotNull RedeemBfusdRequest redeemBfusdRequest) throws ApiException { + okhttp3.Call localVarCall = redeemBfusdValidateBeforeCall(redeemBfusdRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for subscribeBfusd + * + * @param subscribeBfusdRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Subscribe BFUSD -
+ * + * @see Subscribe + * BFUSD(TRADE) Documentation + */ + private okhttp3.Call subscribeBfusdCall(SubscribeBfusdRequest subscribeBfusdRequest) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/bfusd/subscribe"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (subscribeBfusdRequest.getAsset() != null) { + localVarFormParams.put("asset", subscribeBfusdRequest.getAsset()); + } + + if (subscribeBfusdRequest.getAmount() != null) { + localVarFormParams.put( + "amount", + DecimalFormatter.getFormatter().format(subscribeBfusdRequest.getAmount())); + } + + if (subscribeBfusdRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", subscribeBfusdRequest.getRecvWindow()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call subscribeBfusdValidateBeforeCall( + SubscribeBfusdRequest subscribeBfusdRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {subscribeBfusdRequest}; + Method method = + this.getClass().getMethod("subscribeBfusd", SubscribeBfusdRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return subscribeBfusdCall(subscribeBfusdRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Subscribe BFUSD(TRADE) Subscribe BFUSD * You need to open Enable Spot & Margin Trading + * permission for the API Key which requests this endpoint. Weight: 150 + * + * @param subscribeBfusdRequest (required) + * @return ApiResponse<SubscribeBfusdResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Subscribe BFUSD -
+ * + * @see Subscribe + * BFUSD(TRADE) Documentation + */ + public ApiResponse subscribeBfusd( + @Valid @NotNull SubscribeBfusdRequest subscribeBfusdRequest) throws ApiException { + okhttp3.Call localVarCall = subscribeBfusdValidateBeforeCall(subscribeBfusdRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/FlexibleLockedApi.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/FlexibleLockedApi.java index b20eeadb..de236c50 100644 --- a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/FlexibleLockedApi.java +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/FlexibleLockedApi.java @@ -74,7 +74,7 @@ public class FlexibleLockedApi { private static final String USER_AGENT = String.format( - "binance-simple-earn/3.0.0 (Java/%s; %s; %s)", + "binance-simple-earn/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -117,9 +117,9 @@ public void setCustomBaseUrl(String customBaseUrl) { * @param productId (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -278,9 +278,9 @@ private okhttp3.Call getCollateralRecordValidateBeforeCall( * @param productId (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetCollateralRecordResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -315,7 +315,7 @@ public ApiResponse getCollateralRecord( * Build call for getFlexiblePersonalLeftQuota * * @param productId (required) - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -430,7 +430,7 @@ private okhttp3.Call getFlexiblePersonalLeftQuotaValidateBeforeCall( * Get Flexible Personal Left Quota(USER_DATA) Get Flexible Personal Left Quota Weight: 150 * * @param productId (required) - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetFlexiblePersonalLeftQuotaResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -459,9 +459,9 @@ public ApiResponse getFlexiblePersonalLeft * * @param asset USDC or USDT (optional) * @param productId (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -597,9 +597,9 @@ private okhttp3.Call getFlexibleProductPositionValidateBeforeCall( * * @param asset USDC or USDT (optional) * @param productId (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetFlexibleProductPositionResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -633,9 +633,9 @@ public ApiResponse getFlexibleProductPositio * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -812,9 +812,9 @@ private okhttp3.Call getFlexibleRedemptionRecordValidateBeforeCall( * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetFlexibleRedemptionRecordResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -856,9 +856,9 @@ public ApiResponse getFlexibleRedemptionRec * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1036,9 +1036,9 @@ private okhttp3.Call getFlexibleRewardsHistoryValidateBeforeCall( * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetFlexibleRewardsHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1076,7 +1076,7 @@ public ApiResponse getFlexibleRewardsHistory( * * @param productId (required) * @param amount (required) - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1202,7 +1202,7 @@ private okhttp3.Call getFlexibleSubscriptionPreviewValidateBeforeCall( * * @param productId (required) * @param amount (required) - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetFlexibleSubscriptionPreviewResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1235,9 +1235,9 @@ public ApiResponse getFlexibleSubscripti * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1421,9 +1421,9 @@ private okhttp3.Call getFlexibleSubscriptionRecordValidateBeforeCall( * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetFlexibleSubscriptionRecordResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1467,7 +1467,7 @@ public ApiResponse getFlexibleSubscriptio * Build call for getLockedPersonalLeftQuota * * @param projectId (required) - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1582,7 +1582,7 @@ private okhttp3.Call getLockedPersonalLeftQuotaValidateBeforeCall( * Get Locked Personal Left Quota(USER_DATA) Get Locked Personal Left Quota Weight: 150 * * @param projectId (required) - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetLockedPersonalLeftQuotaResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1612,9 +1612,9 @@ public ApiResponse getLockedPersonalLeftQuot * @param asset USDC or USDT (optional) * @param positionId (optional) * @param projectId (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1767,9 +1767,9 @@ private okhttp3.Call getLockedProductPositionValidateBeforeCall( * @param asset USDC or USDT (optional) * @param positionId (optional) * @param projectId (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetLockedProductPositionResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1808,9 +1808,9 @@ public ApiResponse getLockedProductPosition( * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1987,9 +1987,9 @@ private okhttp3.Call getLockedRedemptionRecordValidateBeforeCall( * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetLockedRedemptionRecordResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -2029,9 +2029,9 @@ public ApiResponse getLockedRedemptionRecord( * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -2200,9 +2200,9 @@ private okhttp3.Call getLockedRewardsHistoryValidateBeforeCall( * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetLockedRewardsHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -2240,7 +2240,7 @@ public ApiResponse getLockedRewardsHistory( * @param projectId (required) * @param amount (required) * @param autoSubscribe true or false, default true. (optional) - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -2376,7 +2376,7 @@ private okhttp3.Call getLockedSubscriptionPreviewValidateBeforeCall( * @param projectId (required) * @param amount (required) * @param autoSubscribe true or false, default true. (optional) - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetLockedSubscriptionPreviewResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -2412,9 +2412,9 @@ public ApiResponse getLockedSubscriptionPr * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -2583,9 +2583,9 @@ private okhttp3.Call getLockedSubscriptionRecordValidateBeforeCall( * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetLockedSubscriptionRecordResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -2624,9 +2624,9 @@ public ApiResponse getLockedSubscriptionRec * @param aprPeriod \"DAY\",\"YEAR\",default\"DAY\" (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -2795,9 +2795,9 @@ private okhttp3.Call getRateHistoryValidateBeforeCall( * @param aprPeriod \"DAY\",\"YEAR\",default\"DAY\" (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetRateHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -2833,9 +2833,9 @@ public ApiResponse getRateHistory( * Build call for getSimpleEarnFlexibleProductList * * @param asset USDC or USDT (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -2964,9 +2964,9 @@ private okhttp3.Call getSimpleEarnFlexibleProductListValidateBeforeCall( * list Weight: 150 * * @param asset USDC or USDT (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetSimpleEarnFlexibleProductListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -2995,9 +2995,9 @@ public ApiResponse getSimpleEarnFlexib * Build call for getSimpleEarnLockedProductList * * @param asset USDC or USDT (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -3126,9 +3126,9 @@ private okhttp3.Call getSimpleEarnLockedProductListValidateBeforeCall( * available Simple Earn locked product list Weight: 150 * * @param asset USDC or USDT (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetSimpleEarnLockedProductListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -3906,7 +3906,7 @@ public ApiResponse setLockedProductRedeemO /** * Build call for simpleAccount * - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -4012,7 +4012,7 @@ private okhttp3.Call simpleAccountValidateBeforeCall(Long recvWindow) throws Api /** * Simple Account(USER_DATA) Simple Account query Weight: 150 * - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<SimpleAccountResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -4361,6 +4361,4 @@ public ApiResponse subscribeLockedProduct( new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } - - } diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/RwusdApi.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/RwusdApi.java index b5375833..d250a1ef 100644 --- a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/RwusdApi.java +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/RwusdApi.java @@ -53,7 +53,7 @@ public class RwusdApi { private static final String USER_AGENT = String.format( - "binance-simple-earn/3.0.0 (Java/%s; %s; %s)", + "binance-simple-earn/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -93,7 +93,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for getRwusdAccount * - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -198,7 +198,7 @@ private okhttp3.Call getRwusdAccountValidateBeforeCall(Long recvWindow) throws A /** * Get RWUSD Account (USER_DATA) Get RWUSD account information. Weight: 150 * - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetRwusdAccountResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -223,7 +223,7 @@ public ApiResponse getRwusdAccount(Long recvWindow) /** * Build call for getRwusdQuotaDetails * - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -331,7 +331,7 @@ private okhttp3.Call getRwusdQuotaDetailsValidateBeforeCall(Long recvWindow) * Get RWUSD Quota Details (USER_DATA) Get RWUSD quota details including subscription quota, * fast redemption quota, and standard redemption quota. Weight: 150 * - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetRwusdQuotaDetailsResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -359,9 +359,9 @@ public ApiResponse getRwusdQuotaDetails(Long recvW * * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -505,9 +505,9 @@ private okhttp3.Call getRwusdRateHistoryValidateBeforeCall( * * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetRwusdRateHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -538,9 +538,9 @@ public ApiResponse getRwusdRateHistory( * * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -684,9 +684,9 @@ private okhttp3.Call getRwusdRedemptionHistoryValidateBeforeCall( * * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetRwusdRedemptionHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -717,9 +717,9 @@ public ApiResponse getRwusdRedemptionHistory( * * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -863,9 +863,9 @@ private okhttp3.Call getRwusdRewardsHistoryValidateBeforeCall( * * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetRwusdRewardsHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -897,9 +897,9 @@ public ApiResponse getRwusdRewardsHistory( * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -1050,9 +1050,9 @@ private okhttp3.Call getRwusdSubscriptionHistoryValidateBeforeCall( * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetRwusdSubscriptionHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/SimpleEarnRestApi.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/SimpleEarnRestApi.java index 67aaade4..e498a863 100644 --- a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/SimpleEarnRestApi.java +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/SimpleEarnRestApi.java @@ -5,6 +5,12 @@ import com.binance.connector.client.common.ApiResponse; import com.binance.connector.client.common.configuration.ClientConfiguration; import com.binance.connector.client.simple_earn.rest.SimpleEarnRestApiUtil; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdAccountResponse; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdQuotaDetailsResponse; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdRateHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdRedemptionHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdRewardsHistoryResponse; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdSubscriptionHistoryResponse; import com.binance.connector.client.simple_earn.rest.model.GetCollateralRecordResponse; import com.binance.connector.client.simple_earn.rest.model.GetFlexiblePersonalLeftQuotaResponse; import com.binance.connector.client.simple_earn.rest.model.GetFlexibleProductPositionResponse; @@ -27,6 +33,8 @@ import com.binance.connector.client.simple_earn.rest.model.GetRwusdSubscriptionHistoryResponse; import com.binance.connector.client.simple_earn.rest.model.GetSimpleEarnFlexibleProductListResponse; import com.binance.connector.client.simple_earn.rest.model.GetSimpleEarnLockedProductListResponse; +import com.binance.connector.client.simple_earn.rest.model.RedeemBfusdRequest; +import com.binance.connector.client.simple_earn.rest.model.RedeemBfusdResponse; import com.binance.connector.client.simple_earn.rest.model.RedeemFlexibleProductRequest; import com.binance.connector.client.simple_earn.rest.model.RedeemFlexibleProductResponse; import com.binance.connector.client.simple_earn.rest.model.RedeemLockedProductRequest; @@ -40,6 +48,8 @@ import com.binance.connector.client.simple_earn.rest.model.SetLockedProductRedeemOptionRequest; import com.binance.connector.client.simple_earn.rest.model.SetLockedProductRedeemOptionResponse; import com.binance.connector.client.simple_earn.rest.model.SimpleAccountResponse; +import com.binance.connector.client.simple_earn.rest.model.SubscribeBfusdRequest; +import com.binance.connector.client.simple_earn.rest.model.SubscribeBfusdResponse; import com.binance.connector.client.simple_earn.rest.model.SubscribeFlexibleProductRequest; import com.binance.connector.client.simple_earn.rest.model.SubscribeFlexibleProductResponse; import com.binance.connector.client.simple_earn.rest.model.SubscribeLockedProductRequest; @@ -49,6 +59,7 @@ public class SimpleEarnRestApi { + private final BfusdApi bfusdApi; private final FlexibleLockedApi flexibleLockedApi; private final RwusdApi rwusdApi; @@ -57,10 +68,250 @@ public SimpleEarnRestApi(ClientConfiguration configuration) { } public SimpleEarnRestApi(ApiClient apiClient) { + this.bfusdApi = new BfusdApi(apiClient); this.flexibleLockedApi = new FlexibleLockedApi(apiClient); this.rwusdApi = new RwusdApi(apiClient); } + /** + * Get BFUSD Account (USER_DATA) Get BFUSD account information. Weight: 150 + * + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return ApiResponse<GetBfusdAccountResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD Account -
+ * + * @see Get BFUSD + * Account (USER_DATA) Documentation + */ + public ApiResponse getBfusdAccount(Long recvWindow) + throws ApiException { + return bfusdApi.getBfusdAccount(recvWindow); + } + + /** + * Get BFUSD Quota Details (USER_DATA) Get BFUSD quota details including fast redemption quota + * and standard redemption quota. Weight: 150 + * + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return ApiResponse<GetBfusdQuotaDetailsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD Quota Details -
+ * + * @see Get + * BFUSD Quota Details (USER_DATA) Documentation + */ + public ApiResponse getBfusdQuotaDetails(Long recvWindow) + throws ApiException { + return bfusdApi.getBfusdQuotaDetails(recvWindow); + } + + /** + * Get BFUSD Rate History (USER_DATA) Get BFUSD rate history sorted by descending order. * The + * time between `startTime` and `endTime` cannot be longer than 6 months. * + * If `startTime` and `endTime` are both not sent, then the last 30 + * days' data will be returned. * If `startTime` is sent but `endTime` + * is not sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time minus + * one month, and data between `startTime` and `endTime` will be returned. + * Weight: 150 + * + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return ApiResponse<GetBfusdRateHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD Rate History -
+ * + * @see Get + * BFUSD Rate History (USER_DATA) Documentation + */ + public ApiResponse getBfusdRateHistory( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + return bfusdApi.getBfusdRateHistory(startTime, endTime, current, size, recvWindow); + } + + /** + * Get BFUSD Redemption History (USER_DATA) Get BFUSD redemption history. * The time between + * `startTime` and `endTime` cannot be longer than 6 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time minus + * one month, and data between `startTime` and `endTime` will be returned. + * Weight: 150 + * + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return ApiResponse<GetBfusdRedemptionHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD Redemption History -
+ * + * @see Get + * BFUSD Redemption History (USER_DATA) Documentation + */ + public ApiResponse getBfusdRedemptionHistory( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + return bfusdApi.getBfusdRedemptionHistory(startTime, endTime, current, size, recvWindow); + } + + /** + * Get BFUSD Rewards History (USER_DATA) Get BFUSD rewards history. * The time between + * `startTime` and `endTime` cannot be longer than 6 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time minus + * one month, and data between `startTime` and `endTime` will be returned. + * Weight: 150 + * + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return ApiResponse<GetBfusdRewardsHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD Rewards History -
+ * + * @see Get + * BFUSD Rewards History (USER_DATA) Documentation + */ + public ApiResponse getBfusdRewardsHistory( + Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + return bfusdApi.getBfusdRewardsHistory(startTime, endTime, current, size, recvWindow); + } + + /** + * Get BFUSD subscription history(USER_DATA) Get BFUSD subscription history * The time between + * `startTime` and `endTime` cannot be longer than 6 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time + * advanced by one month, and data between `startTime` and `endTime` will be + * returned. Weight: 150 + * + * @param asset USDC or USDT (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) + * @return ApiResponse<GetBfusdSubscriptionHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get BFUSD subscription history -
+ * + * @see Get + * BFUSD subscription history(USER_DATA) Documentation + */ + public ApiResponse getBfusdSubscriptionHistory( + String asset, Long startTime, Long endTime, Long current, Long size, Long recvWindow) + throws ApiException { + return bfusdApi.getBfusdSubscriptionHistory( + asset, startTime, endTime, current, size, recvWindow); + } + + /** + * Redeem BFUSD(TRADE) Redeem BFUSD to USDT * You need to open Enable Spot & Margin Trading + * permission for the API Key which requests this endpoint. Weight: 150 + * + * @param redeemBfusdRequest (required) + * @return ApiResponse<RedeemBfusdResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Redeem BFUSD -
+ * + * @see Redeem + * BFUSD(TRADE) Documentation + */ + public ApiResponse redeemBfusd(RedeemBfusdRequest redeemBfusdRequest) + throws ApiException { + return bfusdApi.redeemBfusd(redeemBfusdRequest); + } + + /** + * Subscribe BFUSD(TRADE) Subscribe BFUSD * You need to open Enable Spot & Margin Trading + * permission for the API Key which requests this endpoint. Weight: 150 + * + * @param subscribeBfusdRequest (required) + * @return ApiResponse<SubscribeBfusdResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Subscribe BFUSD -
+ * + * @see Subscribe + * BFUSD(TRADE) Documentation + */ + public ApiResponse subscribeBfusd( + SubscribeBfusdRequest subscribeBfusdRequest) throws ApiException { + return bfusdApi.subscribeBfusd(subscribeBfusdRequest); + } + /** * Get Collateral Record(USER_DATA) Get Collateral Record * The time between * `startTime` and `endTime` cannot be longer than 30 days. * If @@ -73,9 +324,9 @@ public SimpleEarnRestApi(ApiClient apiClient) { * @param productId (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetCollateralRecordResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -106,7 +357,7 @@ public ApiResponse getCollateralRecord( * Get Flexible Personal Left Quota(USER_DATA) Get Flexible Personal Left Quota Weight: 150 * * @param productId (required) - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetFlexiblePersonalLeftQuotaResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -131,9 +382,9 @@ public ApiResponse getFlexiblePersonalLeft * * @param asset USDC or USDT (optional) * @param productId (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetFlexibleProductPositionResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -169,9 +420,9 @@ public ApiResponse getFlexibleProductPositio * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetFlexibleRedemptionRecordResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -215,9 +466,9 @@ public ApiResponse getFlexibleRedemptionRec * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetFlexibleRewardsHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -251,7 +502,7 @@ public ApiResponse getFlexibleRewardsHistory( * * @param productId (required) * @param amount (required) - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetFlexibleSubscriptionPreviewResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -285,9 +536,9 @@ public ApiResponse getFlexibleSubscripti * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetFlexibleSubscriptionRecordResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -320,7 +571,7 @@ public ApiResponse getFlexibleSubscriptio * Get Locked Personal Left Quota(USER_DATA) Get Locked Personal Left Quota Weight: 150 * * @param projectId (required) - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetLockedPersonalLeftQuotaResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -346,9 +597,9 @@ public ApiResponse getLockedPersonalLeftQuot * @param asset USDC or USDT (optional) * @param positionId (optional) * @param projectId (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetLockedProductPositionResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -389,9 +640,9 @@ public ApiResponse getLockedProductPosition( * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetLockedRedemptionRecordResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -433,9 +684,9 @@ public ApiResponse getLockedRedemptionRecord( * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetLockedRewardsHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -469,7 +720,7 @@ public ApiResponse getLockedRewardsHistory( * @param projectId (required) * @param amount (required) * @param autoSubscribe true or false, default true. (optional) - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetLockedSubscriptionPreviewResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -504,9 +755,9 @@ public ApiResponse getLockedSubscriptionPr * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetLockedSubscriptionRecordResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -547,9 +798,9 @@ public ApiResponse getLockedSubscriptionRec * @param aprPeriod \"DAY\",\"YEAR\",default\"DAY\" (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetRateHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -582,9 +833,9 @@ public ApiResponse getRateHistory( * list Weight: 150 * * @param asset USDC or USDT (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetSimpleEarnFlexibleProductListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -609,9 +860,9 @@ public ApiResponse getSimpleEarnFlexib * available Simple Earn locked product list Weight: 150 * * @param asset USDC or USDT (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetSimpleEarnLockedProductListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -753,7 +1004,7 @@ public ApiResponse setLockedProductRedeemO /** * Simple Account(USER_DATA) Simple Account query Weight: 150 * - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<SimpleAccountResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -824,7 +1075,7 @@ public ApiResponse subscribeLockedProduct( /** * Get RWUSD Account (USER_DATA) Get RWUSD account information. Weight: 150 * - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetRwusdAccountResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -847,7 +1098,7 @@ public ApiResponse getRwusdAccount(Long recvWindow) * Get RWUSD Quota Details (USER_DATA) Get RWUSD quota details including subscription quota, * fast redemption quota, and standard redemption quota. Weight: 150 * - * @param recvWindow (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetRwusdQuotaDetailsResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -880,9 +1131,9 @@ public ApiResponse getRwusdQuotaDetails(Long recvW * * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetRwusdRateHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -916,9 +1167,9 @@ public ApiResponse getRwusdRateHistory( * * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetRwusdRedemptionHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -952,9 +1203,9 @@ public ApiResponse getRwusdRedemptionHistory( * * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetRwusdRewardsHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -989,9 +1240,9 @@ public ApiResponse getRwusdRewardsHistory( * @param asset USDC or USDT (optional) * @param startTime (optional) * @param endTime (optional) - * @param current Currently querying the page. Start from 1. Default:1 (optional) - * @param size Default:10, Max:100 (optional) - * @param recvWindow (optional) + * @param current Currently querying page. Starts from 1. Default: 1 (optional) + * @param size Number of results per page. Default: 10, Max: 100 (optional) + * @param recvWindow The value cannot be greater than 60000 (ms) (optional) * @return ApiResponse<GetRwusdSubscriptionHistoryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdAccountResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdAccountResponse.java new file mode 100644 index 00000000..8cb7451a --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdAccountResponse.java @@ -0,0 +1,291 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetBfusdAccountResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetBfusdAccountResponse { + public static final String SERIALIZED_NAME_BFUSD_AMOUNT = "bfusdAmount"; + + @SerializedName(SERIALIZED_NAME_BFUSD_AMOUNT) + @jakarta.annotation.Nullable + private String bfusdAmount; + + public static final String SERIALIZED_NAME_USDT_PROFIT = "usdtProfit"; + + @SerializedName(SERIALIZED_NAME_USDT_PROFIT) + @jakarta.annotation.Nullable + private String usdtProfit; + + public static final String SERIALIZED_NAME_BFUSD_PROFIT = "bfusdProfit"; + + @SerializedName(SERIALIZED_NAME_BFUSD_PROFIT) + @jakarta.annotation.Nullable + private String bfusdProfit; + + public GetBfusdAccountResponse() {} + + public GetBfusdAccountResponse bfusdAmount(@jakarta.annotation.Nullable String bfusdAmount) { + this.bfusdAmount = bfusdAmount; + return this; + } + + /** + * Get bfusdAmount + * + * @return bfusdAmount + */ + @jakarta.annotation.Nullable + public String getBfusdAmount() { + return bfusdAmount; + } + + public void setBfusdAmount(@jakarta.annotation.Nullable String bfusdAmount) { + this.bfusdAmount = bfusdAmount; + } + + public GetBfusdAccountResponse usdtProfit(@jakarta.annotation.Nullable String usdtProfit) { + this.usdtProfit = usdtProfit; + return this; + } + + /** + * Get usdtProfit + * + * @return usdtProfit + */ + @jakarta.annotation.Nullable + public String getUsdtProfit() { + return usdtProfit; + } + + public void setUsdtProfit(@jakarta.annotation.Nullable String usdtProfit) { + this.usdtProfit = usdtProfit; + } + + public GetBfusdAccountResponse bfusdProfit(@jakarta.annotation.Nullable String bfusdProfit) { + this.bfusdProfit = bfusdProfit; + return this; + } + + /** + * Get bfusdProfit + * + * @return bfusdProfit + */ + @jakarta.annotation.Nullable + public String getBfusdProfit() { + return bfusdProfit; + } + + public void setBfusdProfit(@jakarta.annotation.Nullable String bfusdProfit) { + this.bfusdProfit = bfusdProfit; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBfusdAccountResponse getBfusdAccountResponse = (GetBfusdAccountResponse) o; + return Objects.equals(this.bfusdAmount, getBfusdAccountResponse.bfusdAmount) + && Objects.equals(this.usdtProfit, getBfusdAccountResponse.usdtProfit) + && Objects.equals(this.bfusdProfit, getBfusdAccountResponse.bfusdProfit); + } + + @Override + public int hashCode() { + return Objects.hash(bfusdAmount, usdtProfit, bfusdProfit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBfusdAccountResponse {\n"); + sb.append(" bfusdAmount: ").append(toIndentedString(bfusdAmount)).append("\n"); + sb.append(" usdtProfit: ").append(toIndentedString(usdtProfit)).append("\n"); + sb.append(" bfusdProfit: ").append(toIndentedString(bfusdProfit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object bfusdAmountValue = getBfusdAmount(); + String bfusdAmountValueAsString = ""; + bfusdAmountValueAsString = bfusdAmountValue.toString(); + sb.append("bfusdAmount=").append(urlEncode(bfusdAmountValueAsString)).append(""); + Object usdtProfitValue = getUsdtProfit(); + String usdtProfitValueAsString = ""; + usdtProfitValueAsString = usdtProfitValue.toString(); + sb.append("usdtProfit=").append(urlEncode(usdtProfitValueAsString)).append(""); + Object bfusdProfitValue = getBfusdProfit(); + String bfusdProfitValueAsString = ""; + bfusdProfitValueAsString = bfusdProfitValue.toString(); + sb.append("bfusdProfit=").append(urlEncode(bfusdProfitValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bfusdAmount"); + openapiFields.add("usdtProfit"); + openapiFields.add("bfusdProfit"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetBfusdAccountResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetBfusdAccountResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetBfusdAccountResponse is not found" + + " in the empty JSON string", + GetBfusdAccountResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("bfusdAmount") != null && !jsonObj.get("bfusdAmount").isJsonNull()) + && !jsonObj.get("bfusdAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bfusdAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("bfusdAmount").toString())); + } + if ((jsonObj.get("usdtProfit") != null && !jsonObj.get("usdtProfit").isJsonNull()) + && !jsonObj.get("usdtProfit").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `usdtProfit` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("usdtProfit").toString())); + } + if ((jsonObj.get("bfusdProfit") != null && !jsonObj.get("bfusdProfit").isJsonNull()) + && !jsonObj.get("bfusdProfit").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bfusdProfit` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("bfusdProfit").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBfusdAccountResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBfusdAccountResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetBfusdAccountResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBfusdAccountResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBfusdAccountResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetBfusdAccountResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBfusdAccountResponse + * @throws IOException if the JSON string is invalid with respect to GetBfusdAccountResponse + */ + public static GetBfusdAccountResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBfusdAccountResponse.class); + } + + /** + * Convert an instance of GetBfusdAccountResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdQuotaDetailsResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdQuotaDetailsResponse.java new file mode 100644 index 00000000..aa33250f --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdQuotaDetailsResponse.java @@ -0,0 +1,342 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetBfusdQuotaDetailsResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetBfusdQuotaDetailsResponse { + public static final String SERIALIZED_NAME_FAST_REDEMPTION_QUOTA = "fastRedemptionQuota"; + + @SerializedName(SERIALIZED_NAME_FAST_REDEMPTION_QUOTA) + @jakarta.annotation.Nullable + private GetBfusdQuotaDetailsResponseFastRedemptionQuota fastRedemptionQuota; + + public static final String SERIALIZED_NAME_STANDARD_REDEMPTION_QUOTA = + "standardRedemptionQuota"; + + @SerializedName(SERIALIZED_NAME_STANDARD_REDEMPTION_QUOTA) + @jakarta.annotation.Nullable + private GetBfusdQuotaDetailsResponseStandardRedemptionQuota standardRedemptionQuota; + + public static final String SERIALIZED_NAME_SUBSCRIBE_ENABLE = "subscribeEnable"; + + @SerializedName(SERIALIZED_NAME_SUBSCRIBE_ENABLE) + @jakarta.annotation.Nullable + private Boolean subscribeEnable; + + public static final String SERIALIZED_NAME_REDEEM_ENABLE = "redeemEnable"; + + @SerializedName(SERIALIZED_NAME_REDEEM_ENABLE) + @jakarta.annotation.Nullable + private Boolean redeemEnable; + + public GetBfusdQuotaDetailsResponse() {} + + public GetBfusdQuotaDetailsResponse fastRedemptionQuota( + @jakarta.annotation.Nullable + GetBfusdQuotaDetailsResponseFastRedemptionQuota fastRedemptionQuota) { + this.fastRedemptionQuota = fastRedemptionQuota; + return this; + } + + /** + * Get fastRedemptionQuota + * + * @return fastRedemptionQuota + */ + @jakarta.annotation.Nullable + @Valid + public GetBfusdQuotaDetailsResponseFastRedemptionQuota getFastRedemptionQuota() { + return fastRedemptionQuota; + } + + public void setFastRedemptionQuota( + @jakarta.annotation.Nullable + GetBfusdQuotaDetailsResponseFastRedemptionQuota fastRedemptionQuota) { + this.fastRedemptionQuota = fastRedemptionQuota; + } + + public GetBfusdQuotaDetailsResponse standardRedemptionQuota( + @jakarta.annotation.Nullable + GetBfusdQuotaDetailsResponseStandardRedemptionQuota standardRedemptionQuota) { + this.standardRedemptionQuota = standardRedemptionQuota; + return this; + } + + /** + * Get standardRedemptionQuota + * + * @return standardRedemptionQuota + */ + @jakarta.annotation.Nullable + @Valid + public GetBfusdQuotaDetailsResponseStandardRedemptionQuota getStandardRedemptionQuota() { + return standardRedemptionQuota; + } + + public void setStandardRedemptionQuota( + @jakarta.annotation.Nullable + GetBfusdQuotaDetailsResponseStandardRedemptionQuota standardRedemptionQuota) { + this.standardRedemptionQuota = standardRedemptionQuota; + } + + public GetBfusdQuotaDetailsResponse subscribeEnable( + @jakarta.annotation.Nullable Boolean subscribeEnable) { + this.subscribeEnable = subscribeEnable; + return this; + } + + /** + * Get subscribeEnable + * + * @return subscribeEnable + */ + @jakarta.annotation.Nullable + public Boolean getSubscribeEnable() { + return subscribeEnable; + } + + public void setSubscribeEnable(@jakarta.annotation.Nullable Boolean subscribeEnable) { + this.subscribeEnable = subscribeEnable; + } + + public GetBfusdQuotaDetailsResponse redeemEnable( + @jakarta.annotation.Nullable Boolean redeemEnable) { + this.redeemEnable = redeemEnable; + return this; + } + + /** + * Get redeemEnable + * + * @return redeemEnable + */ + @jakarta.annotation.Nullable + public Boolean getRedeemEnable() { + return redeemEnable; + } + + public void setRedeemEnable(@jakarta.annotation.Nullable Boolean redeemEnable) { + this.redeemEnable = redeemEnable; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBfusdQuotaDetailsResponse getBfusdQuotaDetailsResponse = + (GetBfusdQuotaDetailsResponse) o; + return Objects.equals( + this.fastRedemptionQuota, getBfusdQuotaDetailsResponse.fastRedemptionQuota) + && Objects.equals( + this.standardRedemptionQuota, + getBfusdQuotaDetailsResponse.standardRedemptionQuota) + && Objects.equals( + this.subscribeEnable, getBfusdQuotaDetailsResponse.subscribeEnable) + && Objects.equals(this.redeemEnable, getBfusdQuotaDetailsResponse.redeemEnable); + } + + @Override + public int hashCode() { + return Objects.hash( + fastRedemptionQuota, standardRedemptionQuota, subscribeEnable, redeemEnable); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBfusdQuotaDetailsResponse {\n"); + sb.append(" fastRedemptionQuota: ") + .append(toIndentedString(fastRedemptionQuota)) + .append("\n"); + sb.append(" standardRedemptionQuota: ") + .append(toIndentedString(standardRedemptionQuota)) + .append("\n"); + sb.append(" subscribeEnable: ").append(toIndentedString(subscribeEnable)).append("\n"); + sb.append(" redeemEnable: ").append(toIndentedString(redeemEnable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object fastRedemptionQuotaValue = getFastRedemptionQuota(); + String fastRedemptionQuotaValueAsString = ""; + fastRedemptionQuotaValueAsString = fastRedemptionQuotaValue.toString(); + sb.append("fastRedemptionQuota=") + .append(urlEncode(fastRedemptionQuotaValueAsString)) + .append(""); + Object standardRedemptionQuotaValue = getStandardRedemptionQuota(); + String standardRedemptionQuotaValueAsString = ""; + standardRedemptionQuotaValueAsString = standardRedemptionQuotaValue.toString(); + sb.append("standardRedemptionQuota=") + .append(urlEncode(standardRedemptionQuotaValueAsString)) + .append(""); + Object subscribeEnableValue = getSubscribeEnable(); + String subscribeEnableValueAsString = ""; + subscribeEnableValueAsString = subscribeEnableValue.toString(); + sb.append("subscribeEnable=").append(urlEncode(subscribeEnableValueAsString)).append(""); + Object redeemEnableValue = getRedeemEnable(); + String redeemEnableValueAsString = ""; + redeemEnableValueAsString = redeemEnableValue.toString(); + sb.append("redeemEnable=").append(urlEncode(redeemEnableValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("fastRedemptionQuota"); + openapiFields.add("standardRedemptionQuota"); + openapiFields.add("subscribeEnable"); + openapiFields.add("redeemEnable"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetBfusdQuotaDetailsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetBfusdQuotaDetailsResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetBfusdQuotaDetailsResponse is not" + + " found in the empty JSON string", + GetBfusdQuotaDetailsResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `fastRedemptionQuota` + if (jsonObj.get("fastRedemptionQuota") != null + && !jsonObj.get("fastRedemptionQuota").isJsonNull()) { + GetBfusdQuotaDetailsResponseFastRedemptionQuota.validateJsonElement( + jsonObj.get("fastRedemptionQuota")); + } + // validate the optional field `standardRedemptionQuota` + if (jsonObj.get("standardRedemptionQuota") != null + && !jsonObj.get("standardRedemptionQuota").isJsonNull()) { + GetBfusdQuotaDetailsResponseStandardRedemptionQuota.validateJsonElement( + jsonObj.get("standardRedemptionQuota")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBfusdQuotaDetailsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBfusdQuotaDetailsResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetBfusdQuotaDetailsResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBfusdQuotaDetailsResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBfusdQuotaDetailsResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetBfusdQuotaDetailsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBfusdQuotaDetailsResponse + * @throws IOException if the JSON string is invalid with respect to + * GetBfusdQuotaDetailsResponse + */ + public static GetBfusdQuotaDetailsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBfusdQuotaDetailsResponse.class); + } + + /** + * Convert an instance of GetBfusdQuotaDetailsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdQuotaDetailsResponseFastRedemptionQuota.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdQuotaDetailsResponseFastRedemptionQuota.java new file mode 100644 index 00000000..34e07918 --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdQuotaDetailsResponseFastRedemptionQuota.java @@ -0,0 +1,353 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetBfusdQuotaDetailsResponseFastRedemptionQuota */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetBfusdQuotaDetailsResponseFastRedemptionQuota { + public static final String SERIALIZED_NAME_LEFT_QUOTA = "leftQuota"; + + @SerializedName(SERIALIZED_NAME_LEFT_QUOTA) + @jakarta.annotation.Nullable + private String leftQuota; + + public static final String SERIALIZED_NAME_MINIMUM = "minimum"; + + @SerializedName(SERIALIZED_NAME_MINIMUM) + @jakarta.annotation.Nullable + private String minimum; + + public static final String SERIALIZED_NAME_FEE = "fee"; + + @SerializedName(SERIALIZED_NAME_FEE) + @jakarta.annotation.Nullable + private String fee; + + public static final String SERIALIZED_NAME_FREE_QUOTA = "freeQuota"; + + @SerializedName(SERIALIZED_NAME_FREE_QUOTA) + @jakarta.annotation.Nullable + private String freeQuota; + + public GetBfusdQuotaDetailsResponseFastRedemptionQuota() {} + + public GetBfusdQuotaDetailsResponseFastRedemptionQuota leftQuota( + @jakarta.annotation.Nullable String leftQuota) { + this.leftQuota = leftQuota; + return this; + } + + /** + * Get leftQuota + * + * @return leftQuota + */ + @jakarta.annotation.Nullable + public String getLeftQuota() { + return leftQuota; + } + + public void setLeftQuota(@jakarta.annotation.Nullable String leftQuota) { + this.leftQuota = leftQuota; + } + + public GetBfusdQuotaDetailsResponseFastRedemptionQuota minimum( + @jakarta.annotation.Nullable String minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get minimum + * + * @return minimum + */ + @jakarta.annotation.Nullable + public String getMinimum() { + return minimum; + } + + public void setMinimum(@jakarta.annotation.Nullable String minimum) { + this.minimum = minimum; + } + + public GetBfusdQuotaDetailsResponseFastRedemptionQuota fee( + @jakarta.annotation.Nullable String fee) { + this.fee = fee; + return this; + } + + /** + * Get fee + * + * @return fee + */ + @jakarta.annotation.Nullable + public String getFee() { + return fee; + } + + public void setFee(@jakarta.annotation.Nullable String fee) { + this.fee = fee; + } + + public GetBfusdQuotaDetailsResponseFastRedemptionQuota freeQuota( + @jakarta.annotation.Nullable String freeQuota) { + this.freeQuota = freeQuota; + return this; + } + + /** + * Get freeQuota + * + * @return freeQuota + */ + @jakarta.annotation.Nullable + public String getFreeQuota() { + return freeQuota; + } + + public void setFreeQuota(@jakarta.annotation.Nullable String freeQuota) { + this.freeQuota = freeQuota; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBfusdQuotaDetailsResponseFastRedemptionQuota + getBfusdQuotaDetailsResponseFastRedemptionQuota = + (GetBfusdQuotaDetailsResponseFastRedemptionQuota) o; + return Objects.equals( + this.leftQuota, getBfusdQuotaDetailsResponseFastRedemptionQuota.leftQuota) + && Objects.equals( + this.minimum, getBfusdQuotaDetailsResponseFastRedemptionQuota.minimum) + && Objects.equals(this.fee, getBfusdQuotaDetailsResponseFastRedemptionQuota.fee) + && Objects.equals( + this.freeQuota, getBfusdQuotaDetailsResponseFastRedemptionQuota.freeQuota); + } + + @Override + public int hashCode() { + return Objects.hash(leftQuota, minimum, fee, freeQuota); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBfusdQuotaDetailsResponseFastRedemptionQuota {\n"); + sb.append(" leftQuota: ").append(toIndentedString(leftQuota)).append("\n"); + sb.append(" minimum: ").append(toIndentedString(minimum)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" freeQuota: ").append(toIndentedString(freeQuota)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object leftQuotaValue = getLeftQuota(); + String leftQuotaValueAsString = ""; + leftQuotaValueAsString = leftQuotaValue.toString(); + sb.append("leftQuota=").append(urlEncode(leftQuotaValueAsString)).append(""); + Object minimumValue = getMinimum(); + String minimumValueAsString = ""; + minimumValueAsString = minimumValue.toString(); + sb.append("minimum=").append(urlEncode(minimumValueAsString)).append(""); + Object feeValue = getFee(); + String feeValueAsString = ""; + feeValueAsString = feeValue.toString(); + sb.append("fee=").append(urlEncode(feeValueAsString)).append(""); + Object freeQuotaValue = getFreeQuota(); + String freeQuotaValueAsString = ""; + freeQuotaValueAsString = freeQuotaValue.toString(); + sb.append("freeQuota=").append(urlEncode(freeQuotaValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("leftQuota"); + openapiFields.add("minimum"); + openapiFields.add("fee"); + openapiFields.add("freeQuota"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetBfusdQuotaDetailsResponseFastRedemptionQuota + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetBfusdQuotaDetailsResponseFastRedemptionQuota.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetBfusdQuotaDetailsResponseFastRedemptionQuota is not" + + " found in the empty JSON string", + GetBfusdQuotaDetailsResponseFastRedemptionQuota + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("leftQuota") != null && !jsonObj.get("leftQuota").isJsonNull()) + && !jsonObj.get("leftQuota").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `leftQuota` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("leftQuota").toString())); + } + if ((jsonObj.get("minimum") != null && !jsonObj.get("minimum").isJsonNull()) + && !jsonObj.get("minimum").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minimum` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("minimum").toString())); + } + if ((jsonObj.get("fee") != null && !jsonObj.get("fee").isJsonNull()) + && !jsonObj.get("fee").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fee` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("fee").toString())); + } + if ((jsonObj.get("freeQuota") != null && !jsonObj.get("freeQuota").isJsonNull()) + && !jsonObj.get("freeQuota").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `freeQuota` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("freeQuota").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBfusdQuotaDetailsResponseFastRedemptionQuota.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetBfusdQuotaDetailsResponseFastRedemptionQuota' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GetBfusdQuotaDetailsResponseFastRedemptionQuota.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetBfusdQuotaDetailsResponseFastRedemptionQuota value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBfusdQuotaDetailsResponseFastRedemptionQuota read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetBfusdQuotaDetailsResponseFastRedemptionQuota given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBfusdQuotaDetailsResponseFastRedemptionQuota + * @throws IOException if the JSON string is invalid with respect to + * GetBfusdQuotaDetailsResponseFastRedemptionQuota + */ + public static GetBfusdQuotaDetailsResponseFastRedemptionQuota fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetBfusdQuotaDetailsResponseFastRedemptionQuota.class); + } + + /** + * Convert an instance of GetBfusdQuotaDetailsResponseFastRedemptionQuota to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdQuotaDetailsResponseStandardRedemptionQuota.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdQuotaDetailsResponseStandardRedemptionQuota.java new file mode 100644 index 00000000..23800c9f --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdQuotaDetailsResponseStandardRedemptionQuota.java @@ -0,0 +1,350 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetBfusdQuotaDetailsResponseStandardRedemptionQuota */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetBfusdQuotaDetailsResponseStandardRedemptionQuota { + public static final String SERIALIZED_NAME_LEFT_QUOTA = "leftQuota"; + + @SerializedName(SERIALIZED_NAME_LEFT_QUOTA) + @jakarta.annotation.Nullable + private String leftQuota; + + public static final String SERIALIZED_NAME_MINIMUM = "minimum"; + + @SerializedName(SERIALIZED_NAME_MINIMUM) + @jakarta.annotation.Nullable + private String minimum; + + public static final String SERIALIZED_NAME_FEE = "fee"; + + @SerializedName(SERIALIZED_NAME_FEE) + @jakarta.annotation.Nullable + private String fee; + + public static final String SERIALIZED_NAME_REDEEM_PERIOD = "redeemPeriod"; + + @SerializedName(SERIALIZED_NAME_REDEEM_PERIOD) + @jakarta.annotation.Nullable + private Long redeemPeriod; + + public GetBfusdQuotaDetailsResponseStandardRedemptionQuota() {} + + public GetBfusdQuotaDetailsResponseStandardRedemptionQuota leftQuota( + @jakarta.annotation.Nullable String leftQuota) { + this.leftQuota = leftQuota; + return this; + } + + /** + * Get leftQuota + * + * @return leftQuota + */ + @jakarta.annotation.Nullable + public String getLeftQuota() { + return leftQuota; + } + + public void setLeftQuota(@jakarta.annotation.Nullable String leftQuota) { + this.leftQuota = leftQuota; + } + + public GetBfusdQuotaDetailsResponseStandardRedemptionQuota minimum( + @jakarta.annotation.Nullable String minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get minimum + * + * @return minimum + */ + @jakarta.annotation.Nullable + public String getMinimum() { + return minimum; + } + + public void setMinimum(@jakarta.annotation.Nullable String minimum) { + this.minimum = minimum; + } + + public GetBfusdQuotaDetailsResponseStandardRedemptionQuota fee( + @jakarta.annotation.Nullable String fee) { + this.fee = fee; + return this; + } + + /** + * Get fee + * + * @return fee + */ + @jakarta.annotation.Nullable + public String getFee() { + return fee; + } + + public void setFee(@jakarta.annotation.Nullable String fee) { + this.fee = fee; + } + + public GetBfusdQuotaDetailsResponseStandardRedemptionQuota redeemPeriod( + @jakarta.annotation.Nullable Long redeemPeriod) { + this.redeemPeriod = redeemPeriod; + return this; + } + + /** + * Get redeemPeriod + * + * @return redeemPeriod + */ + @jakarta.annotation.Nullable + public Long getRedeemPeriod() { + return redeemPeriod; + } + + public void setRedeemPeriod(@jakarta.annotation.Nullable Long redeemPeriod) { + this.redeemPeriod = redeemPeriod; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBfusdQuotaDetailsResponseStandardRedemptionQuota + getBfusdQuotaDetailsResponseStandardRedemptionQuota = + (GetBfusdQuotaDetailsResponseStandardRedemptionQuota) o; + return Objects.equals( + this.leftQuota, + getBfusdQuotaDetailsResponseStandardRedemptionQuota.leftQuota) + && Objects.equals( + this.minimum, getBfusdQuotaDetailsResponseStandardRedemptionQuota.minimum) + && Objects.equals(this.fee, getBfusdQuotaDetailsResponseStandardRedemptionQuota.fee) + && Objects.equals( + this.redeemPeriod, + getBfusdQuotaDetailsResponseStandardRedemptionQuota.redeemPeriod); + } + + @Override + public int hashCode() { + return Objects.hash(leftQuota, minimum, fee, redeemPeriod); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBfusdQuotaDetailsResponseStandardRedemptionQuota {\n"); + sb.append(" leftQuota: ").append(toIndentedString(leftQuota)).append("\n"); + sb.append(" minimum: ").append(toIndentedString(minimum)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" redeemPeriod: ").append(toIndentedString(redeemPeriod)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object leftQuotaValue = getLeftQuota(); + String leftQuotaValueAsString = ""; + leftQuotaValueAsString = leftQuotaValue.toString(); + sb.append("leftQuota=").append(urlEncode(leftQuotaValueAsString)).append(""); + Object minimumValue = getMinimum(); + String minimumValueAsString = ""; + minimumValueAsString = minimumValue.toString(); + sb.append("minimum=").append(urlEncode(minimumValueAsString)).append(""); + Object feeValue = getFee(); + String feeValueAsString = ""; + feeValueAsString = feeValue.toString(); + sb.append("fee=").append(urlEncode(feeValueAsString)).append(""); + Object redeemPeriodValue = getRedeemPeriod(); + String redeemPeriodValueAsString = ""; + redeemPeriodValueAsString = redeemPeriodValue.toString(); + sb.append("redeemPeriod=").append(urlEncode(redeemPeriodValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("leftQuota"); + openapiFields.add("minimum"); + openapiFields.add("fee"); + openapiFields.add("redeemPeriod"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetBfusdQuotaDetailsResponseStandardRedemptionQuota + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetBfusdQuotaDetailsResponseStandardRedemptionQuota.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetBfusdQuotaDetailsResponseStandardRedemptionQuota is not" + + " found in the empty JSON string", + GetBfusdQuotaDetailsResponseStandardRedemptionQuota + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("leftQuota") != null && !jsonObj.get("leftQuota").isJsonNull()) + && !jsonObj.get("leftQuota").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `leftQuota` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("leftQuota").toString())); + } + if ((jsonObj.get("minimum") != null && !jsonObj.get("minimum").isJsonNull()) + && !jsonObj.get("minimum").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minimum` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("minimum").toString())); + } + if ((jsonObj.get("fee") != null && !jsonObj.get("fee").isJsonNull()) + && !jsonObj.get("fee").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fee` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("fee").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBfusdQuotaDetailsResponseStandardRedemptionQuota.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetBfusdQuotaDetailsResponseStandardRedemptionQuota' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetBfusdQuotaDetailsResponseStandardRedemptionQuota.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetBfusdQuotaDetailsResponseStandardRedemptionQuota value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBfusdQuotaDetailsResponseStandardRedemptionQuota read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetBfusdQuotaDetailsResponseStandardRedemptionQuota given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of GetBfusdQuotaDetailsResponseStandardRedemptionQuota + * @throws IOException if the JSON string is invalid with respect to + * GetBfusdQuotaDetailsResponseStandardRedemptionQuota + */ + public static GetBfusdQuotaDetailsResponseStandardRedemptionQuota fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetBfusdQuotaDetailsResponseStandardRedemptionQuota.class); + } + + /** + * Convert an instance of GetBfusdQuotaDetailsResponseStandardRedemptionQuota to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRateHistoryResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRateHistoryResponse.java new file mode 100644 index 00000000..9a8db537 --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRateHistoryResponse.java @@ -0,0 +1,283 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GetBfusdRateHistoryResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetBfusdRateHistoryResponse { + public static final String SERIALIZED_NAME_ROWS = "rows"; + + @SerializedName(SERIALIZED_NAME_ROWS) + @jakarta.annotation.Nullable + private List<@Valid GetBfusdRateHistoryResponseRowsInner> rows; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + + @SerializedName(SERIALIZED_NAME_TOTAL) + @jakarta.annotation.Nullable + private String total; + + public GetBfusdRateHistoryResponse() {} + + public GetBfusdRateHistoryResponse rows( + @jakarta.annotation.Nullable List<@Valid GetBfusdRateHistoryResponseRowsInner> rows) { + this.rows = rows; + return this; + } + + public GetBfusdRateHistoryResponse addRowsItem(GetBfusdRateHistoryResponseRowsInner rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * + * @return rows + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetBfusdRateHistoryResponseRowsInner> getRows() { + return rows; + } + + public void setRows( + @jakarta.annotation.Nullable List<@Valid GetBfusdRateHistoryResponseRowsInner> rows) { + this.rows = rows; + } + + public GetBfusdRateHistoryResponse total(@jakarta.annotation.Nullable String total) { + this.total = total; + return this; + } + + /** + * Get total + * + * @return total + */ + @jakarta.annotation.Nullable + public String getTotal() { + return total; + } + + public void setTotal(@jakarta.annotation.Nullable String total) { + this.total = total; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBfusdRateHistoryResponse getBfusdRateHistoryResponse = (GetBfusdRateHistoryResponse) o; + return Objects.equals(this.rows, getBfusdRateHistoryResponse.rows) + && Objects.equals(this.total, getBfusdRateHistoryResponse.total); + } + + @Override + public int hashCode() { + return Objects.hash(rows, total); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBfusdRateHistoryResponse {\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object rowsValue = getRows(); + String rowsValueAsString = ""; + rowsValueAsString = + (String) + ((Collection) rowsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("rows=").append(urlEncode(rowsValueAsString)).append(""); + Object totalValue = getTotal(); + String totalValueAsString = ""; + totalValueAsString = totalValue.toString(); + sb.append("total=").append(urlEncode(totalValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rows"); + openapiFields.add("total"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetBfusdRateHistoryResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetBfusdRateHistoryResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetBfusdRateHistoryResponse is not" + + " found in the empty JSON string", + GetBfusdRateHistoryResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + if (jsonArrayrows != null) { + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rows` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("rows").toString())); + } + + // validate the optional field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + GetBfusdRateHistoryResponseRowsInner.validateJsonElement(jsonArrayrows.get(i)); + } + ; + } + } + if ((jsonObj.get("total") != null && !jsonObj.get("total").isJsonNull()) + && !jsonObj.get("total").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `total` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("total").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBfusdRateHistoryResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBfusdRateHistoryResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetBfusdRateHistoryResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBfusdRateHistoryResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBfusdRateHistoryResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetBfusdRateHistoryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBfusdRateHistoryResponse + * @throws IOException if the JSON string is invalid with respect to GetBfusdRateHistoryResponse + */ + public static GetBfusdRateHistoryResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBfusdRateHistoryResponse.class); + } + + /** + * Convert an instance of GetBfusdRateHistoryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRateHistoryResponseRowsInner.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRateHistoryResponseRowsInner.java similarity index 83% rename from clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRateHistoryResponseRowsInner.java rename to clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRateHistoryResponseRowsInner.java index a4d8a869..b2a01677 100644 --- a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRateHistoryResponseRowsInner.java +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRateHistoryResponseRowsInner.java @@ -31,11 +31,11 @@ import java.util.Objects; import org.hibernate.validator.constraints.*; -/** GetRwusdRateHistoryResponseRowsInner */ +/** GetBfusdRateHistoryResponseRowsInner */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class GetRwusdRateHistoryResponseRowsInner { +public class GetBfusdRateHistoryResponseRowsInner { public static final String SERIALIZED_NAME_ANNUAL_PERCENTAGE_RATE = "annualPercentageRate"; @SerializedName(SERIALIZED_NAME_ANNUAL_PERCENTAGE_RATE) @@ -48,9 +48,9 @@ public class GetRwusdRateHistoryResponseRowsInner { @jakarta.annotation.Nullable private Long time; - public GetRwusdRateHistoryResponseRowsInner() {} + public GetBfusdRateHistoryResponseRowsInner() {} - public GetRwusdRateHistoryResponseRowsInner annualPercentageRate( + public GetBfusdRateHistoryResponseRowsInner annualPercentageRate( @jakarta.annotation.Nullable String annualPercentageRate) { this.annualPercentageRate = annualPercentageRate; return this; @@ -70,7 +70,7 @@ public void setAnnualPercentageRate(@jakarta.annotation.Nullable String annualPe this.annualPercentageRate = annualPercentageRate; } - public GetRwusdRateHistoryResponseRowsInner time(@jakarta.annotation.Nullable Long time) { + public GetBfusdRateHistoryResponseRowsInner time(@jakarta.annotation.Nullable Long time) { this.time = time; return this; } @@ -97,12 +97,12 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - GetRwusdRateHistoryResponseRowsInner getRwusdRateHistoryResponseRowsInner = - (GetRwusdRateHistoryResponseRowsInner) o; + GetBfusdRateHistoryResponseRowsInner getBfusdRateHistoryResponseRowsInner = + (GetBfusdRateHistoryResponseRowsInner) o; return Objects.equals( this.annualPercentageRate, - getRwusdRateHistoryResponseRowsInner.annualPercentageRate) - && Objects.equals(this.time, getRwusdRateHistoryResponseRowsInner.time); + getBfusdRateHistoryResponseRowsInner.annualPercentageRate) + && Objects.equals(this.time, getBfusdRateHistoryResponseRowsInner.time); } @Override @@ -113,7 +113,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class GetRwusdRateHistoryResponseRowsInner {\n"); + sb.append("class GetBfusdRateHistoryResponseRowsInner {\n"); sb.append(" annualPercentageRate: ") .append(toIndentedString(annualPercentageRate)) .append("\n"); @@ -175,17 +175,17 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * GetRwusdRateHistoryResponseRowsInner + * GetBfusdRateHistoryResponseRowsInner */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!GetRwusdRateHistoryResponseRowsInner.openapiRequiredFields + if (!GetBfusdRateHistoryResponseRowsInner.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in GetRwusdRateHistoryResponseRowsInner" + "The required field(s) %s in GetBfusdRateHistoryResponseRowsInner" + " is not found in the empty JSON string", - GetRwusdRateHistoryResponseRowsInner.openapiRequiredFields + GetBfusdRateHistoryResponseRowsInner.openapiRequiredFields .toString())); } } @@ -205,27 +205,27 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetRwusdRateHistoryResponseRowsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetRwusdRateHistoryResponseRowsInner' + if (!GetBfusdRateHistoryResponseRowsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBfusdRateHistoryResponseRowsInner' // and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = + final TypeAdapter thisAdapter = gson.getDelegateAdapter( - this, TypeToken.get(GetRwusdRateHistoryResponseRowsInner.class)); + this, TypeToken.get(GetBfusdRateHistoryResponseRowsInner.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override public void write( - JsonWriter out, GetRwusdRateHistoryResponseRowsInner value) + JsonWriter out, GetBfusdRateHistoryResponseRowsInner value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public GetRwusdRateHistoryResponseRowsInner read(JsonReader in) + public GetBfusdRateHistoryResponseRowsInner read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); @@ -236,20 +236,20 @@ public GetRwusdRateHistoryResponseRowsInner read(JsonReader in) } /** - * Create an instance of GetRwusdRateHistoryResponseRowsInner given an JSON string + * Create an instance of GetBfusdRateHistoryResponseRowsInner given an JSON string * * @param jsonString JSON string - * @return An instance of GetRwusdRateHistoryResponseRowsInner + * @return An instance of GetBfusdRateHistoryResponseRowsInner * @throws IOException if the JSON string is invalid with respect to - * GetRwusdRateHistoryResponseRowsInner + * GetBfusdRateHistoryResponseRowsInner */ - public static GetRwusdRateHistoryResponseRowsInner fromJson(String jsonString) + public static GetBfusdRateHistoryResponseRowsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetRwusdRateHistoryResponseRowsInner.class); + return JSON.getGson().fromJson(jsonString, GetBfusdRateHistoryResponseRowsInner.class); } /** - * Convert an instance of GetRwusdRateHistoryResponseRowsInner to an JSON string + * Convert an instance of GetBfusdRateHistoryResponseRowsInner to an JSON string * * @return JSON string */ diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRedemptionHistoryResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRedemptionHistoryResponse.java new file mode 100644 index 00000000..37a53209 --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRedemptionHistoryResponse.java @@ -0,0 +1,284 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GetBfusdRedemptionHistoryResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetBfusdRedemptionHistoryResponse { + public static final String SERIALIZED_NAME_ROWS = "rows"; + + @SerializedName(SERIALIZED_NAME_ROWS) + @jakarta.annotation.Nullable + private List<@Valid GetBfusdRedemptionHistoryResponseRowsInner> rows; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + + @SerializedName(SERIALIZED_NAME_TOTAL) + @jakarta.annotation.Nullable + private Long total; + + public GetBfusdRedemptionHistoryResponse() {} + + public GetBfusdRedemptionHistoryResponse rows( + @jakarta.annotation.Nullable + List<@Valid GetBfusdRedemptionHistoryResponseRowsInner> rows) { + this.rows = rows; + return this; + } + + public GetBfusdRedemptionHistoryResponse addRowsItem( + GetBfusdRedemptionHistoryResponseRowsInner rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * + * @return rows + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetBfusdRedemptionHistoryResponseRowsInner> getRows() { + return rows; + } + + public void setRows( + @jakarta.annotation.Nullable + List<@Valid GetBfusdRedemptionHistoryResponseRowsInner> rows) { + this.rows = rows; + } + + public GetBfusdRedemptionHistoryResponse total(@jakarta.annotation.Nullable Long total) { + this.total = total; + return this; + } + + /** + * Get total + * + * @return total + */ + @jakarta.annotation.Nullable + public Long getTotal() { + return total; + } + + public void setTotal(@jakarta.annotation.Nullable Long total) { + this.total = total; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBfusdRedemptionHistoryResponse getBfusdRedemptionHistoryResponse = + (GetBfusdRedemptionHistoryResponse) o; + return Objects.equals(this.rows, getBfusdRedemptionHistoryResponse.rows) + && Objects.equals(this.total, getBfusdRedemptionHistoryResponse.total); + } + + @Override + public int hashCode() { + return Objects.hash(rows, total); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBfusdRedemptionHistoryResponse {\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object rowsValue = getRows(); + String rowsValueAsString = ""; + rowsValueAsString = + (String) + ((Collection) rowsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("rows=").append(urlEncode(rowsValueAsString)).append(""); + Object totalValue = getTotal(); + String totalValueAsString = ""; + totalValueAsString = totalValue.toString(); + sb.append("total=").append(urlEncode(totalValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rows"); + openapiFields.add("total"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetBfusdRedemptionHistoryResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetBfusdRedemptionHistoryResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetBfusdRedemptionHistoryResponse is" + + " not found in the empty JSON string", + GetBfusdRedemptionHistoryResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + if (jsonArrayrows != null) { + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rows` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("rows").toString())); + } + + // validate the optional field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + GetBfusdRedemptionHistoryResponseRowsInner.validateJsonElement( + jsonArrayrows.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBfusdRedemptionHistoryResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBfusdRedemptionHistoryResponse' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetBfusdRedemptionHistoryResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBfusdRedemptionHistoryResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBfusdRedemptionHistoryResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetBfusdRedemptionHistoryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBfusdRedemptionHistoryResponse + * @throws IOException if the JSON string is invalid with respect to + * GetBfusdRedemptionHistoryResponse + */ + public static GetBfusdRedemptionHistoryResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBfusdRedemptionHistoryResponse.class); + } + + /** + * Convert an instance of GetBfusdRedemptionHistoryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRedemptionHistoryResponseRowsInner.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRedemptionHistoryResponseRowsInner.java new file mode 100644 index 00000000..7fad6501 --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRedemptionHistoryResponseRowsInner.java @@ -0,0 +1,497 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetBfusdRedemptionHistoryResponseRowsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetBfusdRedemptionHistoryResponseRowsInner { + public static final String SERIALIZED_NAME_TIME = "time"; + + @SerializedName(SERIALIZED_NAME_TIME) + @jakarta.annotation.Nullable + private Long time; + + public static final String SERIALIZED_NAME_ASSET = "asset"; + + @SerializedName(SERIALIZED_NAME_ASSET) + @jakarta.annotation.Nullable + private String asset; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + + @SerializedName(SERIALIZED_NAME_AMOUNT) + @jakarta.annotation.Nullable + private String amount; + + public static final String SERIALIZED_NAME_RECEIVE_ASSET = "receiveAsset"; + + @SerializedName(SERIALIZED_NAME_RECEIVE_ASSET) + @jakarta.annotation.Nullable + private String receiveAsset; + + public static final String SERIALIZED_NAME_RECEIVE_AMOUNT = "receiveAmount"; + + @SerializedName(SERIALIZED_NAME_RECEIVE_AMOUNT) + @jakarta.annotation.Nullable + private String receiveAmount; + + public static final String SERIALIZED_NAME_FEE = "fee"; + + @SerializedName(SERIALIZED_NAME_FEE) + @jakarta.annotation.Nullable + private String fee; + + public static final String SERIALIZED_NAME_ARRIVAL_TIME = "arrivalTime"; + + @SerializedName(SERIALIZED_NAME_ARRIVAL_TIME) + @jakarta.annotation.Nullable + private Long arrivalTime; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private String status; + + public GetBfusdRedemptionHistoryResponseRowsInner() {} + + public GetBfusdRedemptionHistoryResponseRowsInner time(@jakarta.annotation.Nullable Long time) { + this.time = time; + return this; + } + + /** + * Get time + * + * @return time + */ + @jakarta.annotation.Nullable + public Long getTime() { + return time; + } + + public void setTime(@jakarta.annotation.Nullable Long time) { + this.time = time; + } + + public GetBfusdRedemptionHistoryResponseRowsInner asset( + @jakarta.annotation.Nullable String asset) { + this.asset = asset; + return this; + } + + /** + * Get asset + * + * @return asset + */ + @jakarta.annotation.Nullable + public String getAsset() { + return asset; + } + + public void setAsset(@jakarta.annotation.Nullable String asset) { + this.asset = asset; + } + + public GetBfusdRedemptionHistoryResponseRowsInner amount( + @jakarta.annotation.Nullable String amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * + * @return amount + */ + @jakarta.annotation.Nullable + public String getAmount() { + return amount; + } + + public void setAmount(@jakarta.annotation.Nullable String amount) { + this.amount = amount; + } + + public GetBfusdRedemptionHistoryResponseRowsInner receiveAsset( + @jakarta.annotation.Nullable String receiveAsset) { + this.receiveAsset = receiveAsset; + return this; + } + + /** + * Get receiveAsset + * + * @return receiveAsset + */ + @jakarta.annotation.Nullable + public String getReceiveAsset() { + return receiveAsset; + } + + public void setReceiveAsset(@jakarta.annotation.Nullable String receiveAsset) { + this.receiveAsset = receiveAsset; + } + + public GetBfusdRedemptionHistoryResponseRowsInner receiveAmount( + @jakarta.annotation.Nullable String receiveAmount) { + this.receiveAmount = receiveAmount; + return this; + } + + /** + * Get receiveAmount + * + * @return receiveAmount + */ + @jakarta.annotation.Nullable + public String getReceiveAmount() { + return receiveAmount; + } + + public void setReceiveAmount(@jakarta.annotation.Nullable String receiveAmount) { + this.receiveAmount = receiveAmount; + } + + public GetBfusdRedemptionHistoryResponseRowsInner fee(@jakarta.annotation.Nullable String fee) { + this.fee = fee; + return this; + } + + /** + * Get fee + * + * @return fee + */ + @jakarta.annotation.Nullable + public String getFee() { + return fee; + } + + public void setFee(@jakarta.annotation.Nullable String fee) { + this.fee = fee; + } + + public GetBfusdRedemptionHistoryResponseRowsInner arrivalTime( + @jakarta.annotation.Nullable Long arrivalTime) { + this.arrivalTime = arrivalTime; + return this; + } + + /** + * Get arrivalTime + * + * @return arrivalTime + */ + @jakarta.annotation.Nullable + public Long getArrivalTime() { + return arrivalTime; + } + + public void setArrivalTime(@jakarta.annotation.Nullable Long arrivalTime) { + this.arrivalTime = arrivalTime; + } + + public GetBfusdRedemptionHistoryResponseRowsInner status( + @jakarta.annotation.Nullable String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @jakarta.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(@jakarta.annotation.Nullable String status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBfusdRedemptionHistoryResponseRowsInner getBfusdRedemptionHistoryResponseRowsInner = + (GetBfusdRedemptionHistoryResponseRowsInner) o; + return Objects.equals(this.time, getBfusdRedemptionHistoryResponseRowsInner.time) + && Objects.equals(this.asset, getBfusdRedemptionHistoryResponseRowsInner.asset) + && Objects.equals(this.amount, getBfusdRedemptionHistoryResponseRowsInner.amount) + && Objects.equals( + this.receiveAsset, getBfusdRedemptionHistoryResponseRowsInner.receiveAsset) + && Objects.equals( + this.receiveAmount, + getBfusdRedemptionHistoryResponseRowsInner.receiveAmount) + && Objects.equals(this.fee, getBfusdRedemptionHistoryResponseRowsInner.fee) + && Objects.equals( + this.arrivalTime, getBfusdRedemptionHistoryResponseRowsInner.arrivalTime) + && Objects.equals(this.status, getBfusdRedemptionHistoryResponseRowsInner.status); + } + + @Override + public int hashCode() { + return Objects.hash( + time, asset, amount, receiveAsset, receiveAmount, fee, arrivalTime, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBfusdRedemptionHistoryResponseRowsInner {\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" receiveAsset: ").append(toIndentedString(receiveAsset)).append("\n"); + sb.append(" receiveAmount: ").append(toIndentedString(receiveAmount)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" arrivalTime: ").append(toIndentedString(arrivalTime)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object timeValue = getTime(); + String timeValueAsString = ""; + timeValueAsString = timeValue.toString(); + sb.append("time=").append(urlEncode(timeValueAsString)).append(""); + Object assetValue = getAsset(); + String assetValueAsString = ""; + assetValueAsString = assetValue.toString(); + sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); + Object amountValue = getAmount(); + String amountValueAsString = ""; + amountValueAsString = amountValue.toString(); + sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); + Object receiveAssetValue = getReceiveAsset(); + String receiveAssetValueAsString = ""; + receiveAssetValueAsString = receiveAssetValue.toString(); + sb.append("receiveAsset=").append(urlEncode(receiveAssetValueAsString)).append(""); + Object receiveAmountValue = getReceiveAmount(); + String receiveAmountValueAsString = ""; + receiveAmountValueAsString = receiveAmountValue.toString(); + sb.append("receiveAmount=").append(urlEncode(receiveAmountValueAsString)).append(""); + Object feeValue = getFee(); + String feeValueAsString = ""; + feeValueAsString = feeValue.toString(); + sb.append("fee=").append(urlEncode(feeValueAsString)).append(""); + Object arrivalTimeValue = getArrivalTime(); + String arrivalTimeValueAsString = ""; + arrivalTimeValueAsString = arrivalTimeValue.toString(); + sb.append("arrivalTime=").append(urlEncode(arrivalTimeValueAsString)).append(""); + Object statusValue = getStatus(); + String statusValueAsString = ""; + statusValueAsString = statusValue.toString(); + sb.append("status=").append(urlEncode(statusValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("time"); + openapiFields.add("asset"); + openapiFields.add("amount"); + openapiFields.add("receiveAsset"); + openapiFields.add("receiveAmount"); + openapiFields.add("fee"); + openapiFields.add("arrivalTime"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetBfusdRedemptionHistoryResponseRowsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetBfusdRedemptionHistoryResponseRowsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetBfusdRedemptionHistoryResponseRowsInner is not found in" + + " the empty JSON string", + GetBfusdRedemptionHistoryResponseRowsInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) + && !jsonObj.get("asset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `asset` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("asset").toString())); + } + if ((jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonNull()) + && !jsonObj.get("amount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `amount` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("amount").toString())); + } + if ((jsonObj.get("receiveAsset") != null && !jsonObj.get("receiveAsset").isJsonNull()) + && !jsonObj.get("receiveAsset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `receiveAsset` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("receiveAsset").toString())); + } + if ((jsonObj.get("receiveAmount") != null && !jsonObj.get("receiveAmount").isJsonNull()) + && !jsonObj.get("receiveAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `receiveAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("receiveAmount").toString())); + } + if ((jsonObj.get("fee") != null && !jsonObj.get("fee").isJsonNull()) + && !jsonObj.get("fee").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fee` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("fee").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBfusdRedemptionHistoryResponseRowsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetBfusdRedemptionHistoryResponseRowsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetBfusdRedemptionHistoryResponseRowsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetBfusdRedemptionHistoryResponseRowsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBfusdRedemptionHistoryResponseRowsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetBfusdRedemptionHistoryResponseRowsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBfusdRedemptionHistoryResponseRowsInner + * @throws IOException if the JSON string is invalid with respect to + * GetBfusdRedemptionHistoryResponseRowsInner + */ + public static GetBfusdRedemptionHistoryResponseRowsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetBfusdRedemptionHistoryResponseRowsInner.class); + } + + /** + * Convert an instance of GetBfusdRedemptionHistoryResponseRowsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRewardsHistoryResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRewardsHistoryResponse.java new file mode 100644 index 00000000..a383f0ec --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRewardsHistoryResponse.java @@ -0,0 +1,283 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GetBfusdRewardsHistoryResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetBfusdRewardsHistoryResponse { + public static final String SERIALIZED_NAME_ROWS = "rows"; + + @SerializedName(SERIALIZED_NAME_ROWS) + @jakarta.annotation.Nullable + private List<@Valid GetBfusdRewardsHistoryResponseRowsInner> rows; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + + @SerializedName(SERIALIZED_NAME_TOTAL) + @jakarta.annotation.Nullable + private Long total; + + public GetBfusdRewardsHistoryResponse() {} + + public GetBfusdRewardsHistoryResponse rows( + @jakarta.annotation.Nullable + List<@Valid GetBfusdRewardsHistoryResponseRowsInner> rows) { + this.rows = rows; + return this; + } + + public GetBfusdRewardsHistoryResponse addRowsItem( + GetBfusdRewardsHistoryResponseRowsInner rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * + * @return rows + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetBfusdRewardsHistoryResponseRowsInner> getRows() { + return rows; + } + + public void setRows( + @jakarta.annotation.Nullable + List<@Valid GetBfusdRewardsHistoryResponseRowsInner> rows) { + this.rows = rows; + } + + public GetBfusdRewardsHistoryResponse total(@jakarta.annotation.Nullable Long total) { + this.total = total; + return this; + } + + /** + * Get total + * + * @return total + */ + @jakarta.annotation.Nullable + public Long getTotal() { + return total; + } + + public void setTotal(@jakarta.annotation.Nullable Long total) { + this.total = total; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBfusdRewardsHistoryResponse getBfusdRewardsHistoryResponse = + (GetBfusdRewardsHistoryResponse) o; + return Objects.equals(this.rows, getBfusdRewardsHistoryResponse.rows) + && Objects.equals(this.total, getBfusdRewardsHistoryResponse.total); + } + + @Override + public int hashCode() { + return Objects.hash(rows, total); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBfusdRewardsHistoryResponse {\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object rowsValue = getRows(); + String rowsValueAsString = ""; + rowsValueAsString = + (String) + ((Collection) rowsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("rows=").append(urlEncode(rowsValueAsString)).append(""); + Object totalValue = getTotal(); + String totalValueAsString = ""; + totalValueAsString = totalValue.toString(); + sb.append("total=").append(urlEncode(totalValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rows"); + openapiFields.add("total"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetBfusdRewardsHistoryResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetBfusdRewardsHistoryResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetBfusdRewardsHistoryResponse is not" + + " found in the empty JSON string", + GetBfusdRewardsHistoryResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + if (jsonArrayrows != null) { + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rows` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("rows").toString())); + } + + // validate the optional field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + GetBfusdRewardsHistoryResponseRowsInner.validateJsonElement( + jsonArrayrows.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBfusdRewardsHistoryResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBfusdRewardsHistoryResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetBfusdRewardsHistoryResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBfusdRewardsHistoryResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBfusdRewardsHistoryResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetBfusdRewardsHistoryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBfusdRewardsHistoryResponse + * @throws IOException if the JSON string is invalid with respect to + * GetBfusdRewardsHistoryResponse + */ + public static GetBfusdRewardsHistoryResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBfusdRewardsHistoryResponse.class); + } + + /** + * Convert an instance of GetBfusdRewardsHistoryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRewardsHistoryResponseRowsInner.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRewardsHistoryResponseRowsInner.java new file mode 100644 index 00000000..d863b981 --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdRewardsHistoryResponseRowsInner.java @@ -0,0 +1,387 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetBfusdRewardsHistoryResponseRowsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetBfusdRewardsHistoryResponseRowsInner { + public static final String SERIALIZED_NAME_TIME = "time"; + + @SerializedName(SERIALIZED_NAME_TIME) + @jakarta.annotation.Nullable + private Long time; + + public static final String SERIALIZED_NAME_REWARD_ASSET = "rewardAsset"; + + @SerializedName(SERIALIZED_NAME_REWARD_ASSET) + @jakarta.annotation.Nullable + private String rewardAsset; + + public static final String SERIALIZED_NAME_REWARDS_AMOUNT = "rewardsAmount"; + + @SerializedName(SERIALIZED_NAME_REWARDS_AMOUNT) + @jakarta.annotation.Nullable + private String rewardsAmount; + + public static final String SERIALIZED_NAME_BF_U_S_D_POSITION = "BFUSDPosition"; + + @SerializedName(SERIALIZED_NAME_BF_U_S_D_POSITION) + @jakarta.annotation.Nullable + private String bfUSDPosition; + + public static final String SERIALIZED_NAME_ANNUAL_PERCENTAGE_RATE = "annualPercentageRate"; + + @SerializedName(SERIALIZED_NAME_ANNUAL_PERCENTAGE_RATE) + @jakarta.annotation.Nullable + private String annualPercentageRate; + + public GetBfusdRewardsHistoryResponseRowsInner() {} + + public GetBfusdRewardsHistoryResponseRowsInner time(@jakarta.annotation.Nullable Long time) { + this.time = time; + return this; + } + + /** + * Get time + * + * @return time + */ + @jakarta.annotation.Nullable + public Long getTime() { + return time; + } + + public void setTime(@jakarta.annotation.Nullable Long time) { + this.time = time; + } + + public GetBfusdRewardsHistoryResponseRowsInner rewardAsset( + @jakarta.annotation.Nullable String rewardAsset) { + this.rewardAsset = rewardAsset; + return this; + } + + /** + * Get rewardAsset + * + * @return rewardAsset + */ + @jakarta.annotation.Nullable + public String getRewardAsset() { + return rewardAsset; + } + + public void setRewardAsset(@jakarta.annotation.Nullable String rewardAsset) { + this.rewardAsset = rewardAsset; + } + + public GetBfusdRewardsHistoryResponseRowsInner rewardsAmount( + @jakarta.annotation.Nullable String rewardsAmount) { + this.rewardsAmount = rewardsAmount; + return this; + } + + /** + * Get rewardsAmount + * + * @return rewardsAmount + */ + @jakarta.annotation.Nullable + public String getRewardsAmount() { + return rewardsAmount; + } + + public void setRewardsAmount(@jakarta.annotation.Nullable String rewardsAmount) { + this.rewardsAmount = rewardsAmount; + } + + public GetBfusdRewardsHistoryResponseRowsInner bfUSDPosition( + @jakarta.annotation.Nullable String bfUSDPosition) { + this.bfUSDPosition = bfUSDPosition; + return this; + } + + /** + * Get bfUSDPosition + * + * @return bfUSDPosition + */ + @jakarta.annotation.Nullable + public String getBfUSDPosition() { + return bfUSDPosition; + } + + public void setBfUSDPosition(@jakarta.annotation.Nullable String bfUSDPosition) { + this.bfUSDPosition = bfUSDPosition; + } + + public GetBfusdRewardsHistoryResponseRowsInner annualPercentageRate( + @jakarta.annotation.Nullable String annualPercentageRate) { + this.annualPercentageRate = annualPercentageRate; + return this; + } + + /** + * Get annualPercentageRate + * + * @return annualPercentageRate + */ + @jakarta.annotation.Nullable + public String getAnnualPercentageRate() { + return annualPercentageRate; + } + + public void setAnnualPercentageRate(@jakarta.annotation.Nullable String annualPercentageRate) { + this.annualPercentageRate = annualPercentageRate; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBfusdRewardsHistoryResponseRowsInner getBfusdRewardsHistoryResponseRowsInner = + (GetBfusdRewardsHistoryResponseRowsInner) o; + return Objects.equals(this.time, getBfusdRewardsHistoryResponseRowsInner.time) + && Objects.equals( + this.rewardAsset, getBfusdRewardsHistoryResponseRowsInner.rewardAsset) + && Objects.equals( + this.rewardsAmount, getBfusdRewardsHistoryResponseRowsInner.rewardsAmount) + && Objects.equals( + this.bfUSDPosition, getBfusdRewardsHistoryResponseRowsInner.bfUSDPosition) + && Objects.equals( + this.annualPercentageRate, + getBfusdRewardsHistoryResponseRowsInner.annualPercentageRate); + } + + @Override + public int hashCode() { + return Objects.hash(time, rewardAsset, rewardsAmount, bfUSDPosition, annualPercentageRate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBfusdRewardsHistoryResponseRowsInner {\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" rewardAsset: ").append(toIndentedString(rewardAsset)).append("\n"); + sb.append(" rewardsAmount: ").append(toIndentedString(rewardsAmount)).append("\n"); + sb.append(" bfUSDPosition: ").append(toIndentedString(bfUSDPosition)).append("\n"); + sb.append(" annualPercentageRate: ") + .append(toIndentedString(annualPercentageRate)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object timeValue = getTime(); + String timeValueAsString = ""; + timeValueAsString = timeValue.toString(); + sb.append("time=").append(urlEncode(timeValueAsString)).append(""); + Object rewardAssetValue = getRewardAsset(); + String rewardAssetValueAsString = ""; + rewardAssetValueAsString = rewardAssetValue.toString(); + sb.append("rewardAsset=").append(urlEncode(rewardAssetValueAsString)).append(""); + Object rewardsAmountValue = getRewardsAmount(); + String rewardsAmountValueAsString = ""; + rewardsAmountValueAsString = rewardsAmountValue.toString(); + sb.append("rewardsAmount=").append(urlEncode(rewardsAmountValueAsString)).append(""); + Object bfUSDPositionValue = getBfUSDPosition(); + String bfUSDPositionValueAsString = ""; + bfUSDPositionValueAsString = bfUSDPositionValue.toString(); + sb.append("bfUSDPosition=").append(urlEncode(bfUSDPositionValueAsString)).append(""); + Object annualPercentageRateValue = getAnnualPercentageRate(); + String annualPercentageRateValueAsString = ""; + annualPercentageRateValueAsString = annualPercentageRateValue.toString(); + sb.append("annualPercentageRate=") + .append(urlEncode(annualPercentageRateValueAsString)) + .append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("time"); + openapiFields.add("rewardAsset"); + openapiFields.add("rewardsAmount"); + openapiFields.add("BFUSDPosition"); + openapiFields.add("annualPercentageRate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetBfusdRewardsHistoryResponseRowsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetBfusdRewardsHistoryResponseRowsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetBfusdRewardsHistoryResponseRowsInner is not found in the" + + " empty JSON string", + GetBfusdRewardsHistoryResponseRowsInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("rewardAsset") != null && !jsonObj.get("rewardAsset").isJsonNull()) + && !jsonObj.get("rewardAsset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rewardAsset` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("rewardAsset").toString())); + } + if ((jsonObj.get("rewardsAmount") != null && !jsonObj.get("rewardsAmount").isJsonNull()) + && !jsonObj.get("rewardsAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rewardsAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("rewardsAmount").toString())); + } + if ((jsonObj.get("BFUSDPosition") != null && !jsonObj.get("BFUSDPosition").isJsonNull()) + && !jsonObj.get("BFUSDPosition").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `BFUSDPosition` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("BFUSDPosition").toString())); + } + if ((jsonObj.get("annualPercentageRate") != null + && !jsonObj.get("annualPercentageRate").isJsonNull()) + && !jsonObj.get("annualPercentageRate").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `annualPercentageRate` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("annualPercentageRate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBfusdRewardsHistoryResponseRowsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'GetBfusdRewardsHistoryResponseRowsInner' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetBfusdRewardsHistoryResponseRowsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetBfusdRewardsHistoryResponseRowsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBfusdRewardsHistoryResponseRowsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetBfusdRewardsHistoryResponseRowsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBfusdRewardsHistoryResponseRowsInner + * @throws IOException if the JSON string is invalid with respect to + * GetBfusdRewardsHistoryResponseRowsInner + */ + public static GetBfusdRewardsHistoryResponseRowsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetBfusdRewardsHistoryResponseRowsInner.class); + } + + /** + * Convert an instance of GetBfusdRewardsHistoryResponseRowsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdSubscriptionHistoryResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdSubscriptionHistoryResponse.java new file mode 100644 index 00000000..93e30e4f --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdSubscriptionHistoryResponse.java @@ -0,0 +1,285 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GetBfusdSubscriptionHistoryResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetBfusdSubscriptionHistoryResponse { + public static final String SERIALIZED_NAME_ROWS = "rows"; + + @SerializedName(SERIALIZED_NAME_ROWS) + @jakarta.annotation.Nullable + private List<@Valid GetBfusdSubscriptionHistoryResponseRowsInner> rows; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + + @SerializedName(SERIALIZED_NAME_TOTAL) + @jakarta.annotation.Nullable + private Long total; + + public GetBfusdSubscriptionHistoryResponse() {} + + public GetBfusdSubscriptionHistoryResponse rows( + @jakarta.annotation.Nullable + List<@Valid GetBfusdSubscriptionHistoryResponseRowsInner> rows) { + this.rows = rows; + return this; + } + + public GetBfusdSubscriptionHistoryResponse addRowsItem( + GetBfusdSubscriptionHistoryResponseRowsInner rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * + * @return rows + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetBfusdSubscriptionHistoryResponseRowsInner> getRows() { + return rows; + } + + public void setRows( + @jakarta.annotation.Nullable + List<@Valid GetBfusdSubscriptionHistoryResponseRowsInner> rows) { + this.rows = rows; + } + + public GetBfusdSubscriptionHistoryResponse total(@jakarta.annotation.Nullable Long total) { + this.total = total; + return this; + } + + /** + * Get total + * + * @return total + */ + @jakarta.annotation.Nullable + public Long getTotal() { + return total; + } + + public void setTotal(@jakarta.annotation.Nullable Long total) { + this.total = total; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBfusdSubscriptionHistoryResponse getBfusdSubscriptionHistoryResponse = + (GetBfusdSubscriptionHistoryResponse) o; + return Objects.equals(this.rows, getBfusdSubscriptionHistoryResponse.rows) + && Objects.equals(this.total, getBfusdSubscriptionHistoryResponse.total); + } + + @Override + public int hashCode() { + return Objects.hash(rows, total); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBfusdSubscriptionHistoryResponse {\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object rowsValue = getRows(); + String rowsValueAsString = ""; + rowsValueAsString = + (String) + ((Collection) rowsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("rows=").append(urlEncode(rowsValueAsString)).append(""); + Object totalValue = getTotal(); + String totalValueAsString = ""; + totalValueAsString = totalValue.toString(); + sb.append("total=").append(urlEncode(totalValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rows"); + openapiFields.add("total"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetBfusdSubscriptionHistoryResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetBfusdSubscriptionHistoryResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetBfusdSubscriptionHistoryResponse is" + + " not found in the empty JSON string", + GetBfusdSubscriptionHistoryResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + if (jsonArrayrows != null) { + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rows` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("rows").toString())); + } + + // validate the optional field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + GetBfusdSubscriptionHistoryResponseRowsInner.validateJsonElement( + jsonArrayrows.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBfusdSubscriptionHistoryResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBfusdSubscriptionHistoryResponse' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetBfusdSubscriptionHistoryResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBfusdSubscriptionHistoryResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBfusdSubscriptionHistoryResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetBfusdSubscriptionHistoryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBfusdSubscriptionHistoryResponse + * @throws IOException if the JSON string is invalid with respect to + * GetBfusdSubscriptionHistoryResponse + */ + public static GetBfusdSubscriptionHistoryResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetBfusdSubscriptionHistoryResponse.class); + } + + /** + * Convert an instance of GetBfusdSubscriptionHistoryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdSubscriptionHistoryResponseRowsInner.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdSubscriptionHistoryResponseRowsInner.java new file mode 100644 index 00000000..9a38dc9d --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdSubscriptionHistoryResponseRowsInner.java @@ -0,0 +1,425 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetBfusdSubscriptionHistoryResponseRowsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetBfusdSubscriptionHistoryResponseRowsInner { + public static final String SERIALIZED_NAME_TIME = "time"; + + @SerializedName(SERIALIZED_NAME_TIME) + @jakarta.annotation.Nullable + private Long time; + + public static final String SERIALIZED_NAME_ASSET = "asset"; + + @SerializedName(SERIALIZED_NAME_ASSET) + @jakarta.annotation.Nullable + private String asset; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + + @SerializedName(SERIALIZED_NAME_AMOUNT) + @jakarta.annotation.Nullable + private String amount; + + public static final String SERIALIZED_NAME_RECEIVE_ASSET = "receiveAsset"; + + @SerializedName(SERIALIZED_NAME_RECEIVE_ASSET) + @jakarta.annotation.Nullable + private String receiveAsset; + + public static final String SERIALIZED_NAME_RECEIVE_AMOUNT = "receiveAmount"; + + @SerializedName(SERIALIZED_NAME_RECEIVE_AMOUNT) + @jakarta.annotation.Nullable + private String receiveAmount; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private String status; + + public GetBfusdSubscriptionHistoryResponseRowsInner() {} + + public GetBfusdSubscriptionHistoryResponseRowsInner time( + @jakarta.annotation.Nullable Long time) { + this.time = time; + return this; + } + + /** + * Get time + * + * @return time + */ + @jakarta.annotation.Nullable + public Long getTime() { + return time; + } + + public void setTime(@jakarta.annotation.Nullable Long time) { + this.time = time; + } + + public GetBfusdSubscriptionHistoryResponseRowsInner asset( + @jakarta.annotation.Nullable String asset) { + this.asset = asset; + return this; + } + + /** + * Get asset + * + * @return asset + */ + @jakarta.annotation.Nullable + public String getAsset() { + return asset; + } + + public void setAsset(@jakarta.annotation.Nullable String asset) { + this.asset = asset; + } + + public GetBfusdSubscriptionHistoryResponseRowsInner amount( + @jakarta.annotation.Nullable String amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * + * @return amount + */ + @jakarta.annotation.Nullable + public String getAmount() { + return amount; + } + + public void setAmount(@jakarta.annotation.Nullable String amount) { + this.amount = amount; + } + + public GetBfusdSubscriptionHistoryResponseRowsInner receiveAsset( + @jakarta.annotation.Nullable String receiveAsset) { + this.receiveAsset = receiveAsset; + return this; + } + + /** + * Get receiveAsset + * + * @return receiveAsset + */ + @jakarta.annotation.Nullable + public String getReceiveAsset() { + return receiveAsset; + } + + public void setReceiveAsset(@jakarta.annotation.Nullable String receiveAsset) { + this.receiveAsset = receiveAsset; + } + + public GetBfusdSubscriptionHistoryResponseRowsInner receiveAmount( + @jakarta.annotation.Nullable String receiveAmount) { + this.receiveAmount = receiveAmount; + return this; + } + + /** + * Get receiveAmount + * + * @return receiveAmount + */ + @jakarta.annotation.Nullable + public String getReceiveAmount() { + return receiveAmount; + } + + public void setReceiveAmount(@jakarta.annotation.Nullable String receiveAmount) { + this.receiveAmount = receiveAmount; + } + + public GetBfusdSubscriptionHistoryResponseRowsInner status( + @jakarta.annotation.Nullable String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @jakarta.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(@jakarta.annotation.Nullable String status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBfusdSubscriptionHistoryResponseRowsInner getBfusdSubscriptionHistoryResponseRowsInner = + (GetBfusdSubscriptionHistoryResponseRowsInner) o; + return Objects.equals(this.time, getBfusdSubscriptionHistoryResponseRowsInner.time) + && Objects.equals(this.asset, getBfusdSubscriptionHistoryResponseRowsInner.asset) + && Objects.equals(this.amount, getBfusdSubscriptionHistoryResponseRowsInner.amount) + && Objects.equals( + this.receiveAsset, + getBfusdSubscriptionHistoryResponseRowsInner.receiveAsset) + && Objects.equals( + this.receiveAmount, + getBfusdSubscriptionHistoryResponseRowsInner.receiveAmount) + && Objects.equals(this.status, getBfusdSubscriptionHistoryResponseRowsInner.status); + } + + @Override + public int hashCode() { + return Objects.hash(time, asset, amount, receiveAsset, receiveAmount, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBfusdSubscriptionHistoryResponseRowsInner {\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" receiveAsset: ").append(toIndentedString(receiveAsset)).append("\n"); + sb.append(" receiveAmount: ").append(toIndentedString(receiveAmount)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object timeValue = getTime(); + String timeValueAsString = ""; + timeValueAsString = timeValue.toString(); + sb.append("time=").append(urlEncode(timeValueAsString)).append(""); + Object assetValue = getAsset(); + String assetValueAsString = ""; + assetValueAsString = assetValue.toString(); + sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); + Object amountValue = getAmount(); + String amountValueAsString = ""; + amountValueAsString = amountValue.toString(); + sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); + Object receiveAssetValue = getReceiveAsset(); + String receiveAssetValueAsString = ""; + receiveAssetValueAsString = receiveAssetValue.toString(); + sb.append("receiveAsset=").append(urlEncode(receiveAssetValueAsString)).append(""); + Object receiveAmountValue = getReceiveAmount(); + String receiveAmountValueAsString = ""; + receiveAmountValueAsString = receiveAmountValue.toString(); + sb.append("receiveAmount=").append(urlEncode(receiveAmountValueAsString)).append(""); + Object statusValue = getStatus(); + String statusValueAsString = ""; + statusValueAsString = statusValue.toString(); + sb.append("status=").append(urlEncode(statusValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("time"); + openapiFields.add("asset"); + openapiFields.add("amount"); + openapiFields.add("receiveAsset"); + openapiFields.add("receiveAmount"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetBfusdSubscriptionHistoryResponseRowsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetBfusdSubscriptionHistoryResponseRowsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetBfusdSubscriptionHistoryResponseRowsInner is not found" + + " in the empty JSON string", + GetBfusdSubscriptionHistoryResponseRowsInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) + && !jsonObj.get("asset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `asset` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("asset").toString())); + } + if ((jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonNull()) + && !jsonObj.get("amount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `amount` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("amount").toString())); + } + if ((jsonObj.get("receiveAsset") != null && !jsonObj.get("receiveAsset").isJsonNull()) + && !jsonObj.get("receiveAsset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `receiveAsset` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("receiveAsset").toString())); + } + if ((jsonObj.get("receiveAmount") != null && !jsonObj.get("receiveAmount").isJsonNull()) + && !jsonObj.get("receiveAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `receiveAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("receiveAmount").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBfusdSubscriptionHistoryResponseRowsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetBfusdSubscriptionHistoryResponseRowsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GetBfusdSubscriptionHistoryResponseRowsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetBfusdSubscriptionHistoryResponseRowsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBfusdSubscriptionHistoryResponseRowsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetBfusdSubscriptionHistoryResponseRowsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBfusdSubscriptionHistoryResponseRowsInner + * @throws IOException if the JSON string is invalid with respect to + * GetBfusdSubscriptionHistoryResponseRowsInner + */ + public static GetBfusdSubscriptionHistoryResponseRowsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetBfusdSubscriptionHistoryResponseRowsInner.class); + } + + /** + * Convert an instance of GetBfusdSubscriptionHistoryResponseRowsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRateHistoryResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRateHistoryResponse.java index 7642e2ca..8e9de75e 100644 --- a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRateHistoryResponse.java +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetRwusdRateHistoryResponse.java @@ -46,7 +46,7 @@ public class GetRwusdRateHistoryResponse { @SerializedName(SERIALIZED_NAME_ROWS) @jakarta.annotation.Nullable - private List<@Valid GetRwusdRateHistoryResponseRowsInner> rows; + private List<@Valid GetBfusdRateHistoryResponseRowsInner> rows; public static final String SERIALIZED_NAME_TOTAL = "total"; @@ -57,12 +57,12 @@ public class GetRwusdRateHistoryResponse { public GetRwusdRateHistoryResponse() {} public GetRwusdRateHistoryResponse rows( - @jakarta.annotation.Nullable List<@Valid GetRwusdRateHistoryResponseRowsInner> rows) { + @jakarta.annotation.Nullable List<@Valid GetBfusdRateHistoryResponseRowsInner> rows) { this.rows = rows; return this; } - public GetRwusdRateHistoryResponse addRowsItem(GetRwusdRateHistoryResponseRowsInner rowsItem) { + public GetRwusdRateHistoryResponse addRowsItem(GetBfusdRateHistoryResponseRowsInner rowsItem) { if (this.rows == null) { this.rows = new ArrayList<>(); } @@ -77,12 +77,12 @@ public GetRwusdRateHistoryResponse addRowsItem(GetRwusdRateHistoryResponseRowsIn */ @jakarta.annotation.Nullable @Valid - public List<@Valid GetRwusdRateHistoryResponseRowsInner> getRows() { + public List<@Valid GetBfusdRateHistoryResponseRowsInner> getRows() { return rows; } public void setRows( - @jakarta.annotation.Nullable List<@Valid GetRwusdRateHistoryResponseRowsInner> rows) { + @jakarta.annotation.Nullable List<@Valid GetBfusdRateHistoryResponseRowsInner> rows) { this.rows = rows; } @@ -215,7 +215,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `rows` (array) for (int i = 0; i < jsonArrayrows.size(); i++) { - GetRwusdRateHistoryResponseRowsInner.validateJsonElement(jsonArrayrows.get(i)); + GetBfusdRateHistoryResponseRowsInner.validateJsonElement(jsonArrayrows.get(i)); } ; } diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/RedeemBfusdRequest.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/RedeemBfusdRequest.java new file mode 100644 index 00000000..cb28efca --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/RedeemBfusdRequest.java @@ -0,0 +1,289 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** RedeemBfusdRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RedeemBfusdRequest { + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + + @SerializedName(SERIALIZED_NAME_AMOUNT) + @jakarta.annotation.Nonnull + private Double amount; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Long recvWindow; + + public RedeemBfusdRequest() {} + + public RedeemBfusdRequest amount(@jakarta.annotation.Nonnull Double amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * + * @return amount + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Double getAmount() { + return amount; + } + + public void setAmount(@jakarta.annotation.Nonnull Double amount) { + this.amount = amount; + } + + public RedeemBfusdRequest type(@jakarta.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nonnull + @NotNull + public String getType() { + return type; + } + + public void setType(@jakarta.annotation.Nonnull String type) { + this.type = type; + } + + public RedeemBfusdRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + public Long getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RedeemBfusdRequest redeemBfusdRequest = (RedeemBfusdRequest) o; + return Objects.equals(this.amount, redeemBfusdRequest.amount) + && Objects.equals(this.type, redeemBfusdRequest.type) + && Objects.equals(this.recvWindow, redeemBfusdRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash(amount, type, recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RedeemBfusdRequest {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object amountValue = getAmount(); + String amountValueAsString = ""; + amountValueAsString = amountValue.toString(); + sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); + Object typeValue = getType(); + String typeValueAsString = ""; + typeValueAsString = typeValue.toString(); + sb.append("type=").append(urlEncode(typeValueAsString)).append(""); + Object recvWindowValue = getRecvWindow(); + String recvWindowValueAsString = ""; + recvWindowValueAsString = recvWindowValue.toString(); + sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("amount"); + openapiFields.add("type"); + openapiFields.add("recvWindow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("amount"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RedeemBfusdRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RedeemBfusdRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RedeemBfusdRequest is not found in the" + + " empty JSON string", + RedeemBfusdRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RedeemBfusdRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RedeemBfusdRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RedeemBfusdRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RedeemBfusdRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RedeemBfusdRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RedeemBfusdRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RedeemBfusdRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RedeemBfusdRequest + * @throws IOException if the JSON string is invalid with respect to RedeemBfusdRequest + */ + public static RedeemBfusdRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RedeemBfusdRequest.class); + } + + /** + * Convert an instance of RedeemBfusdRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/RedeemBfusdResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/RedeemBfusdResponse.java new file mode 100644 index 00000000..5ddd3310 --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/RedeemBfusdResponse.java @@ -0,0 +1,314 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** RedeemBfusdResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RedeemBfusdResponse { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public static final String SERIALIZED_NAME_RECEIVE_AMOUNT = "receiveAmount"; + + @SerializedName(SERIALIZED_NAME_RECEIVE_AMOUNT) + @jakarta.annotation.Nullable + private String receiveAmount; + + public static final String SERIALIZED_NAME_FEE = "fee"; + + @SerializedName(SERIALIZED_NAME_FEE) + @jakarta.annotation.Nullable + private String fee; + + public static final String SERIALIZED_NAME_ARRIVAL_TIME = "arrivalTime"; + + @SerializedName(SERIALIZED_NAME_ARRIVAL_TIME) + @jakarta.annotation.Nullable + private Long arrivalTime; + + public RedeemBfusdResponse() {} + + public RedeemBfusdResponse success(@jakarta.annotation.Nullable Boolean success) { + this.success = success; + return this; + } + + /** + * Get success + * + * @return success + */ + @jakarta.annotation.Nullable + public Boolean getSuccess() { + return success; + } + + public void setSuccess(@jakarta.annotation.Nullable Boolean success) { + this.success = success; + } + + public RedeemBfusdResponse receiveAmount(@jakarta.annotation.Nullable String receiveAmount) { + this.receiveAmount = receiveAmount; + return this; + } + + /** + * Get receiveAmount + * + * @return receiveAmount + */ + @jakarta.annotation.Nullable + public String getReceiveAmount() { + return receiveAmount; + } + + public void setReceiveAmount(@jakarta.annotation.Nullable String receiveAmount) { + this.receiveAmount = receiveAmount; + } + + public RedeemBfusdResponse fee(@jakarta.annotation.Nullable String fee) { + this.fee = fee; + return this; + } + + /** + * Get fee + * + * @return fee + */ + @jakarta.annotation.Nullable + public String getFee() { + return fee; + } + + public void setFee(@jakarta.annotation.Nullable String fee) { + this.fee = fee; + } + + public RedeemBfusdResponse arrivalTime(@jakarta.annotation.Nullable Long arrivalTime) { + this.arrivalTime = arrivalTime; + return this; + } + + /** + * Get arrivalTime + * + * @return arrivalTime + */ + @jakarta.annotation.Nullable + public Long getArrivalTime() { + return arrivalTime; + } + + public void setArrivalTime(@jakarta.annotation.Nullable Long arrivalTime) { + this.arrivalTime = arrivalTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RedeemBfusdResponse redeemBfusdResponse = (RedeemBfusdResponse) o; + return Objects.equals(this.success, redeemBfusdResponse.success) + && Objects.equals(this.receiveAmount, redeemBfusdResponse.receiveAmount) + && Objects.equals(this.fee, redeemBfusdResponse.fee) + && Objects.equals(this.arrivalTime, redeemBfusdResponse.arrivalTime); + } + + @Override + public int hashCode() { + return Objects.hash(success, receiveAmount, fee, arrivalTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RedeemBfusdResponse {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" receiveAmount: ").append(toIndentedString(receiveAmount)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" arrivalTime: ").append(toIndentedString(arrivalTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object successValue = getSuccess(); + String successValueAsString = ""; + successValueAsString = successValue.toString(); + sb.append("success=").append(urlEncode(successValueAsString)).append(""); + Object receiveAmountValue = getReceiveAmount(); + String receiveAmountValueAsString = ""; + receiveAmountValueAsString = receiveAmountValue.toString(); + sb.append("receiveAmount=").append(urlEncode(receiveAmountValueAsString)).append(""); + Object feeValue = getFee(); + String feeValueAsString = ""; + feeValueAsString = feeValue.toString(); + sb.append("fee=").append(urlEncode(feeValueAsString)).append(""); + Object arrivalTimeValue = getArrivalTime(); + String arrivalTimeValueAsString = ""; + arrivalTimeValueAsString = arrivalTimeValue.toString(); + sb.append("arrivalTime=").append(urlEncode(arrivalTimeValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("receiveAmount"); + openapiFields.add("fee"); + openapiFields.add("arrivalTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RedeemBfusdResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RedeemBfusdResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RedeemBfusdResponse is not found in" + + " the empty JSON string", + RedeemBfusdResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("receiveAmount") != null && !jsonObj.get("receiveAmount").isJsonNull()) + && !jsonObj.get("receiveAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `receiveAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("receiveAmount").toString())); + } + if ((jsonObj.get("fee") != null && !jsonObj.get("fee").isJsonNull()) + && !jsonObj.get("fee").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fee` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("fee").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RedeemBfusdResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RedeemBfusdResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RedeemBfusdResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RedeemBfusdResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RedeemBfusdResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RedeemBfusdResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RedeemBfusdResponse + * @throws IOException if the JSON string is invalid with respect to RedeemBfusdResponse + */ + public static RedeemBfusdResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RedeemBfusdResponse.class); + } + + /** + * Convert an instance of RedeemBfusdResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/SubscribeBfusdRequest.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/SubscribeBfusdRequest.java new file mode 100644 index 00000000..7f9c3491 --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/SubscribeBfusdRequest.java @@ -0,0 +1,289 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** SubscribeBfusdRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class SubscribeBfusdRequest { + public static final String SERIALIZED_NAME_ASSET = "asset"; + + @SerializedName(SERIALIZED_NAME_ASSET) + @jakarta.annotation.Nonnull + private String asset; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + + @SerializedName(SERIALIZED_NAME_AMOUNT) + @jakarta.annotation.Nonnull + private Double amount; + + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Long recvWindow; + + public SubscribeBfusdRequest() {} + + public SubscribeBfusdRequest asset(@jakarta.annotation.Nonnull String asset) { + this.asset = asset; + return this; + } + + /** + * Get asset + * + * @return asset + */ + @jakarta.annotation.Nonnull + @NotNull + public String getAsset() { + return asset; + } + + public void setAsset(@jakarta.annotation.Nonnull String asset) { + this.asset = asset; + } + + public SubscribeBfusdRequest amount(@jakarta.annotation.Nonnull Double amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * + * @return amount + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public Double getAmount() { + return amount; + } + + public void setAmount(@jakarta.annotation.Nonnull Double amount) { + this.amount = amount; + } + + public SubscribeBfusdRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + public Long getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubscribeBfusdRequest subscribeBfusdRequest = (SubscribeBfusdRequest) o; + return Objects.equals(this.asset, subscribeBfusdRequest.asset) + && Objects.equals(this.amount, subscribeBfusdRequest.amount) + && Objects.equals(this.recvWindow, subscribeBfusdRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash(asset, amount, recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubscribeBfusdRequest {\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object assetValue = getAsset(); + String assetValueAsString = ""; + assetValueAsString = assetValue.toString(); + sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); + Object amountValue = getAmount(); + String amountValueAsString = ""; + amountValueAsString = amountValue.toString(); + sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); + Object recvWindowValue = getRecvWindow(); + String recvWindowValueAsString = ""; + recvWindowValueAsString = recvWindowValue.toString(); + sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("asset"); + openapiFields.add("amount"); + openapiFields.add("recvWindow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("asset"); + openapiRequiredFields.add("amount"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscribeBfusdRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SubscribeBfusdRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SubscribeBfusdRequest is not found in" + + " the empty JSON string", + SubscribeBfusdRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SubscribeBfusdRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("asset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `asset` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("asset").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubscribeBfusdRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubscribeBfusdRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SubscribeBfusdRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SubscribeBfusdRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubscribeBfusdRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SubscribeBfusdRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubscribeBfusdRequest + * @throws IOException if the JSON string is invalid with respect to SubscribeBfusdRequest + */ + public static SubscribeBfusdRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubscribeBfusdRequest.class); + } + + /** + * Convert an instance of SubscribeBfusdRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/SubscribeBfusdResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/SubscribeBfusdResponse.java new file mode 100644 index 00000000..d8a552bd --- /dev/null +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/SubscribeBfusdResponse.java @@ -0,0 +1,242 @@ +/* + * Binance Simple Earn REST API + * OpenAPI Specification for the Binance Simple Earn REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.model; + +import com.binance.connector.client.simple_earn.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** SubscribeBfusdResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class SubscribeBfusdResponse { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + @jakarta.annotation.Nullable + private Boolean success; + + public static final String SERIALIZED_NAME_BFUSD_AMOUNT = "bfusdAmount"; + + @SerializedName(SERIALIZED_NAME_BFUSD_AMOUNT) + @jakarta.annotation.Nullable + private String bfusdAmount; + + public SubscribeBfusdResponse() {} + + public SubscribeBfusdResponse success(@jakarta.annotation.Nullable Boolean success) { + this.success = success; + return this; + } + + /** + * Get success + * + * @return success + */ + @jakarta.annotation.Nullable + public Boolean getSuccess() { + return success; + } + + public void setSuccess(@jakarta.annotation.Nullable Boolean success) { + this.success = success; + } + + public SubscribeBfusdResponse bfusdAmount(@jakarta.annotation.Nullable String bfusdAmount) { + this.bfusdAmount = bfusdAmount; + return this; + } + + /** + * Get bfusdAmount + * + * @return bfusdAmount + */ + @jakarta.annotation.Nullable + public String getBfusdAmount() { + return bfusdAmount; + } + + public void setBfusdAmount(@jakarta.annotation.Nullable String bfusdAmount) { + this.bfusdAmount = bfusdAmount; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubscribeBfusdResponse subscribeBfusdResponse = (SubscribeBfusdResponse) o; + return Objects.equals(this.success, subscribeBfusdResponse.success) + && Objects.equals(this.bfusdAmount, subscribeBfusdResponse.bfusdAmount); + } + + @Override + public int hashCode() { + return Objects.hash(success, bfusdAmount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubscribeBfusdResponse {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" bfusdAmount: ").append(toIndentedString(bfusdAmount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object successValue = getSuccess(); + String successValueAsString = ""; + successValueAsString = successValue.toString(); + sb.append("success=").append(urlEncode(successValueAsString)).append(""); + Object bfusdAmountValue = getBfusdAmount(); + String bfusdAmountValueAsString = ""; + bfusdAmountValueAsString = bfusdAmountValue.toString(); + sb.append("bfusdAmount=").append(urlEncode(bfusdAmountValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("bfusdAmount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscribeBfusdResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SubscribeBfusdResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SubscribeBfusdResponse is not found in" + + " the empty JSON string", + SubscribeBfusdResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("bfusdAmount") != null && !jsonObj.get("bfusdAmount").isJsonNull()) + && !jsonObj.get("bfusdAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bfusdAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("bfusdAmount").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubscribeBfusdResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubscribeBfusdResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SubscribeBfusdResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SubscribeBfusdResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubscribeBfusdResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SubscribeBfusdResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubscribeBfusdResponse + * @throws IOException if the JSON string is invalid with respect to SubscribeBfusdResponse + */ + public static SubscribeBfusdResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubscribeBfusdResponse.class); + } + + /** + * Convert an instance of SubscribeBfusdResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/staking/CHANGELOG.md b/clients/staking/CHANGELOG.md index 93d2a2d4..0496a104 100644 --- a/clients/staking/CHANGELOG.md +++ b/clients/staking/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 4.0.0 - 2025-12-16 + +### Changed (1) + +- Modified response for `getCurrentEthStakingQuota()` (`GET /sapi/v1/eth-staking/eth/quota`): + - property `calculating` added + - property `minStakeAmount` added + - property `redeemPeriod` added + - property `stakeable` added + - property `commissionFee` added + - property `redeemable` added + - property `minRedeemAmount` added + ## 3.0.0 - 2025-09-22 ### Added (3) @@ -9,6 +22,7 @@ - `setSoftStaking()` (`GET /sapi/v1/soft-staking/set`) ## 2.1.1 - 2025-08-07 + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/staking/docs/GetCurrentEthStakingQuotaResponse.md b/clients/staking/docs/GetCurrentEthStakingQuotaResponse.md index 39bdc884..64fe3d1c 100644 --- a/clients/staking/docs/GetCurrentEthStakingQuotaResponse.md +++ b/clients/staking/docs/GetCurrentEthStakingQuotaResponse.md @@ -9,6 +9,13 @@ |------------ | ------------- | ------------- | -------------| |**leftStakingPersonalQuota** | **String** | | [optional] | |**leftRedemptionPersonalQuota** | **String** | | [optional] | +|**minStakeAmount** | **String** | | [optional] | +|**minRedeemAmount** | **String** | | [optional] | +|**redeemPeriod** | **Long** | | [optional] | +|**stakeable** | **Boolean** | | [optional] | +|**redeemable** | **Boolean** | | [optional] | +|**commissionFee** | **String** | | [optional] | +|**calculating** | **Boolean** | | [optional] | diff --git a/clients/staking/docs/rest-api/migration-guide.md b/clients/staking/docs/rest-api/migration-guide.md index 69e7317f..03f59ad8 100644 --- a/clients/staking/docs/rest-api/migration-guide.md +++ b/clients/staking/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-staking - 3.0.0 + 4.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-staking - 3.0.0 + 4.0.0 ``` diff --git a/clients/staking/example_rest.md b/clients/staking/example_rest.md index 0c4f6f69..00109436 100644 --- a/clients/staking/example_rest.md +++ b/clients/staking/example_rest.md @@ -48,6 +48,14 @@ [POST /sapi/v1/onchain-yields/locked/subscribe](https://developers.binance.com/docs/staking/on-chain-yields/earn/Subscribe-Onchain-Locked-Product) - subscribeOnChainYieldsLockedProduct - [SubscribeOnChainYieldsLockedProductExample.java:48](/examples/staking/src/main/java/com/binance/connector/client/staking/rest/onchainyields/SubscribeOnChainYieldsLockedProductExample.java#L48) +## SoftStaking + +[GET /sapi/v1/soft-staking/list](https://developers.binance.com/docs/staking/soft-staking/) - getSoftStakingProductList - [GetSoftStakingProductListExample.java:46](/examples/staking/src/main/java/com/binance/connector/client/staking/rest/softstaking/GetSoftStakingProductListExample.java#L46) + +[GET /sapi/v1/soft-staking/history/rewardsRecord](https://developers.binance.com/docs/staking/soft-staking/Get-Soft-Staking-Rewards-History) - getSoftStakingRewardsHistory - [GetSoftStakingRewardsHistoryExample.java:52](/examples/staking/src/main/java/com/binance/connector/client/staking/rest/softstaking/GetSoftStakingRewardsHistoryExample.java#L52) + +[GET /sapi/v1/soft-staking/set](https://developers.binance.com/docs/staking/soft-staking/Set-Soft-Staking) - setSoftStaking - [SetSoftStakingExample.java:46](/examples/staking/src/main/java/com/binance/connector/client/staking/rest/softstaking/SetSoftStakingExample.java#L46) + ## SolStaking [POST /sapi/v1/sol-staking/sol/claim](https://developers.binance.com/docs/staking/sol-staking/staking/Claim-Boost-Rewards) - claimBoostRewards - [ClaimBoostRewardsExample.java:48](/examples/staking/src/main/java/com/binance/connector/client/staking/rest/solstaking/ClaimBoostRewardsExample.java#L48) diff --git a/clients/staking/pom.xml b/clients/staking/pom.xml index 2446190a..6a8c4045 100644 --- a/clients/staking/pom.xml +++ b/clients/staking/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-staking staking - 3.0.0 + 4.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.1 + 2.2.1 \ No newline at end of file diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/EthStakingApi.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/EthStakingApi.java index b2020898..462e1a39 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/EthStakingApi.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/EthStakingApi.java @@ -57,7 +57,7 @@ public class EthStakingApi { private static final String USER_AGENT = String.format( - "binance-staking/3.0.0 (Java/%s; %s; %s)", + "binance-staking/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/OnChainYieldsApi.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/OnChainYieldsApi.java index 285973a8..ee23c446 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/OnChainYieldsApi.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/OnChainYieldsApi.java @@ -59,7 +59,7 @@ public class OnChainYieldsApi { private static final String USER_AGENT = String.format( - "binance-staking/3.0.0 (Java/%s; %s; %s)", + "binance-staking/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SoftStakingApi.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SoftStakingApi.java index 75d30b93..70586f7c 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SoftStakingApi.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SoftStakingApi.java @@ -44,7 +44,7 @@ public class SoftStakingApi { private static final String USER_AGENT = String.format( - "binance-staking/3.0.0 (Java/%s; %s; %s)", + "binance-staking/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SolStakingApi.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SolStakingApi.java index 22ca9067..eca94223 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SolStakingApi.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/api/SolStakingApi.java @@ -57,7 +57,7 @@ public class SolStakingApi { private static final String USER_AGENT = String.format( - "binance-staking/3.0.0 (Java/%s; %s; %s)", + "binance-staking/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetCurrentEthStakingQuotaResponse.java b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetCurrentEthStakingQuotaResponse.java index d3d09aa1..9c0936f0 100644 --- a/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetCurrentEthStakingQuotaResponse.java +++ b/clients/staking/src/main/java/com/binance/connector/client/staking/rest/model/GetCurrentEthStakingQuotaResponse.java @@ -50,6 +50,48 @@ public class GetCurrentEthStakingQuotaResponse { @jakarta.annotation.Nullable private String leftRedemptionPersonalQuota; + public static final String SERIALIZED_NAME_MIN_STAKE_AMOUNT = "minStakeAmount"; + + @SerializedName(SERIALIZED_NAME_MIN_STAKE_AMOUNT) + @jakarta.annotation.Nullable + private String minStakeAmount; + + public static final String SERIALIZED_NAME_MIN_REDEEM_AMOUNT = "minRedeemAmount"; + + @SerializedName(SERIALIZED_NAME_MIN_REDEEM_AMOUNT) + @jakarta.annotation.Nullable + private String minRedeemAmount; + + public static final String SERIALIZED_NAME_REDEEM_PERIOD = "redeemPeriod"; + + @SerializedName(SERIALIZED_NAME_REDEEM_PERIOD) + @jakarta.annotation.Nullable + private Long redeemPeriod; + + public static final String SERIALIZED_NAME_STAKEABLE = "stakeable"; + + @SerializedName(SERIALIZED_NAME_STAKEABLE) + @jakarta.annotation.Nullable + private Boolean stakeable; + + public static final String SERIALIZED_NAME_REDEEMABLE = "redeemable"; + + @SerializedName(SERIALIZED_NAME_REDEEMABLE) + @jakarta.annotation.Nullable + private Boolean redeemable; + + public static final String SERIALIZED_NAME_COMMISSION_FEE = "commissionFee"; + + @SerializedName(SERIALIZED_NAME_COMMISSION_FEE) + @jakarta.annotation.Nullable + private String commissionFee; + + public static final String SERIALIZED_NAME_CALCULATING = "calculating"; + + @SerializedName(SERIALIZED_NAME_CALCULATING) + @jakarta.annotation.Nullable + private Boolean calculating; + public GetCurrentEthStakingQuotaResponse() {} public GetCurrentEthStakingQuotaResponse leftStakingPersonalQuota( @@ -94,6 +136,146 @@ public void setLeftRedemptionPersonalQuota( this.leftRedemptionPersonalQuota = leftRedemptionPersonalQuota; } + public GetCurrentEthStakingQuotaResponse minStakeAmount( + @jakarta.annotation.Nullable String minStakeAmount) { + this.minStakeAmount = minStakeAmount; + return this; + } + + /** + * Get minStakeAmount + * + * @return minStakeAmount + */ + @jakarta.annotation.Nullable + public String getMinStakeAmount() { + return minStakeAmount; + } + + public void setMinStakeAmount(@jakarta.annotation.Nullable String minStakeAmount) { + this.minStakeAmount = minStakeAmount; + } + + public GetCurrentEthStakingQuotaResponse minRedeemAmount( + @jakarta.annotation.Nullable String minRedeemAmount) { + this.minRedeemAmount = minRedeemAmount; + return this; + } + + /** + * Get minRedeemAmount + * + * @return minRedeemAmount + */ + @jakarta.annotation.Nullable + public String getMinRedeemAmount() { + return minRedeemAmount; + } + + public void setMinRedeemAmount(@jakarta.annotation.Nullable String minRedeemAmount) { + this.minRedeemAmount = minRedeemAmount; + } + + public GetCurrentEthStakingQuotaResponse redeemPeriod( + @jakarta.annotation.Nullable Long redeemPeriod) { + this.redeemPeriod = redeemPeriod; + return this; + } + + /** + * Get redeemPeriod + * + * @return redeemPeriod + */ + @jakarta.annotation.Nullable + public Long getRedeemPeriod() { + return redeemPeriod; + } + + public void setRedeemPeriod(@jakarta.annotation.Nullable Long redeemPeriod) { + this.redeemPeriod = redeemPeriod; + } + + public GetCurrentEthStakingQuotaResponse stakeable( + @jakarta.annotation.Nullable Boolean stakeable) { + this.stakeable = stakeable; + return this; + } + + /** + * Get stakeable + * + * @return stakeable + */ + @jakarta.annotation.Nullable + public Boolean getStakeable() { + return stakeable; + } + + public void setStakeable(@jakarta.annotation.Nullable Boolean stakeable) { + this.stakeable = stakeable; + } + + public GetCurrentEthStakingQuotaResponse redeemable( + @jakarta.annotation.Nullable Boolean redeemable) { + this.redeemable = redeemable; + return this; + } + + /** + * Get redeemable + * + * @return redeemable + */ + @jakarta.annotation.Nullable + public Boolean getRedeemable() { + return redeemable; + } + + public void setRedeemable(@jakarta.annotation.Nullable Boolean redeemable) { + this.redeemable = redeemable; + } + + public GetCurrentEthStakingQuotaResponse commissionFee( + @jakarta.annotation.Nullable String commissionFee) { + this.commissionFee = commissionFee; + return this; + } + + /** + * Get commissionFee + * + * @return commissionFee + */ + @jakarta.annotation.Nullable + public String getCommissionFee() { + return commissionFee; + } + + public void setCommissionFee(@jakarta.annotation.Nullable String commissionFee) { + this.commissionFee = commissionFee; + } + + public GetCurrentEthStakingQuotaResponse calculating( + @jakarta.annotation.Nullable Boolean calculating) { + this.calculating = calculating; + return this; + } + + /** + * Get calculating + * + * @return calculating + */ + @jakarta.annotation.Nullable + public Boolean getCalculating() { + return calculating; + } + + public void setCalculating(@jakarta.annotation.Nullable Boolean calculating) { + this.calculating = calculating; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -109,12 +291,31 @@ public boolean equals(Object o) { getCurrentEthStakingQuotaResponse.leftStakingPersonalQuota) && Objects.equals( this.leftRedemptionPersonalQuota, - getCurrentEthStakingQuotaResponse.leftRedemptionPersonalQuota); + getCurrentEthStakingQuotaResponse.leftRedemptionPersonalQuota) + && Objects.equals( + this.minStakeAmount, getCurrentEthStakingQuotaResponse.minStakeAmount) + && Objects.equals( + this.minRedeemAmount, getCurrentEthStakingQuotaResponse.minRedeemAmount) + && Objects.equals(this.redeemPeriod, getCurrentEthStakingQuotaResponse.redeemPeriod) + && Objects.equals(this.stakeable, getCurrentEthStakingQuotaResponse.stakeable) + && Objects.equals(this.redeemable, getCurrentEthStakingQuotaResponse.redeemable) + && Objects.equals( + this.commissionFee, getCurrentEthStakingQuotaResponse.commissionFee) + && Objects.equals(this.calculating, getCurrentEthStakingQuotaResponse.calculating); } @Override public int hashCode() { - return Objects.hash(leftStakingPersonalQuota, leftRedemptionPersonalQuota); + return Objects.hash( + leftStakingPersonalQuota, + leftRedemptionPersonalQuota, + minStakeAmount, + minRedeemAmount, + redeemPeriod, + stakeable, + redeemable, + commissionFee, + calculating); } @Override @@ -127,6 +328,13 @@ public String toString() { sb.append(" leftRedemptionPersonalQuota: ") .append(toIndentedString(leftRedemptionPersonalQuota)) .append("\n"); + sb.append(" minStakeAmount: ").append(toIndentedString(minStakeAmount)).append("\n"); + sb.append(" minRedeemAmount: ").append(toIndentedString(minRedeemAmount)).append("\n"); + sb.append(" redeemPeriod: ").append(toIndentedString(redeemPeriod)).append("\n"); + sb.append(" stakeable: ").append(toIndentedString(stakeable)).append("\n"); + sb.append(" redeemable: ").append(toIndentedString(redeemable)).append("\n"); + sb.append(" commissionFee: ").append(toIndentedString(commissionFee)).append("\n"); + sb.append(" calculating: ").append(toIndentedString(calculating)).append("\n"); sb.append("}"); return sb.toString(); } @@ -146,6 +354,34 @@ public String toUrlQueryString() { sb.append("leftRedemptionPersonalQuota=") .append(urlEncode(leftRedemptionPersonalQuotaValueAsString)) .append(""); + Object minStakeAmountValue = getMinStakeAmount(); + String minStakeAmountValueAsString = ""; + minStakeAmountValueAsString = minStakeAmountValue.toString(); + sb.append("minStakeAmount=").append(urlEncode(minStakeAmountValueAsString)).append(""); + Object minRedeemAmountValue = getMinRedeemAmount(); + String minRedeemAmountValueAsString = ""; + minRedeemAmountValueAsString = minRedeemAmountValue.toString(); + sb.append("minRedeemAmount=").append(urlEncode(minRedeemAmountValueAsString)).append(""); + Object redeemPeriodValue = getRedeemPeriod(); + String redeemPeriodValueAsString = ""; + redeemPeriodValueAsString = redeemPeriodValue.toString(); + sb.append("redeemPeriod=").append(urlEncode(redeemPeriodValueAsString)).append(""); + Object stakeableValue = getStakeable(); + String stakeableValueAsString = ""; + stakeableValueAsString = stakeableValue.toString(); + sb.append("stakeable=").append(urlEncode(stakeableValueAsString)).append(""); + Object redeemableValue = getRedeemable(); + String redeemableValueAsString = ""; + redeemableValueAsString = redeemableValue.toString(); + sb.append("redeemable=").append(urlEncode(redeemableValueAsString)).append(""); + Object commissionFeeValue = getCommissionFee(); + String commissionFeeValueAsString = ""; + commissionFeeValueAsString = commissionFeeValue.toString(); + sb.append("commissionFee=").append(urlEncode(commissionFeeValueAsString)).append(""); + Object calculatingValue = getCalculating(); + String calculatingValueAsString = ""; + calculatingValueAsString = calculatingValue.toString(); + sb.append("calculating=").append(urlEncode(calculatingValueAsString)).append(""); return sb.toString(); } @@ -176,6 +412,13 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("leftStakingPersonalQuota"); openapiFields.add("leftRedemptionPersonalQuota"); + openapiFields.add("minStakeAmount"); + openapiFields.add("minRedeemAmount"); + openapiFields.add("redeemPeriod"); + openapiFields.add("stakeable"); + openapiFields.add("redeemable"); + openapiFields.add("commissionFee"); + openapiFields.add("calculating"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -219,6 +462,30 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " type in the JSON string but got `%s`", jsonObj.get("leftRedemptionPersonalQuota").toString())); } + if ((jsonObj.get("minStakeAmount") != null && !jsonObj.get("minStakeAmount").isJsonNull()) + && !jsonObj.get("minStakeAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minStakeAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("minStakeAmount").toString())); + } + if ((jsonObj.get("minRedeemAmount") != null && !jsonObj.get("minRedeemAmount").isJsonNull()) + && !jsonObj.get("minRedeemAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minRedeemAmount` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("minRedeemAmount").toString())); + } + if ((jsonObj.get("commissionFee") != null && !jsonObj.get("commissionFee").isJsonNull()) + && !jsonObj.get("commissionFee").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `commissionFee` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("commissionFee").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/examples/c2c/pom.xml b/examples/c2c/pom.xml index cb3475a4..6f81014f 100644 --- a/examples/c2c/pom.xml +++ b/examples/c2c/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-c2c - 1.2.1 + 2.0.0 \ No newline at end of file diff --git a/examples/c2c/src/main/java/com/binance/connector/client/c2c/rest/c2c/GetC2CTradeHistoryExample.java b/examples/c2c/src/main/java/com/binance/connector/client/c2c/rest/c2c/GetC2CTradeHistoryExample.java index b821fcc3..595e76d3 100644 --- a/examples/c2c/src/main/java/com/binance/connector/client/c2c/rest/c2c/GetC2CTradeHistoryExample.java +++ b/examples/c2c/src/main/java/com/binance/connector/client/c2c/rest/c2c/GetC2CTradeHistoryExample.java @@ -39,20 +39,23 @@ public C2cRestApi getApi() { /** * Get C2C Trade History (USER_DATA) * - *

Get C2C Trade History * The max interval between startTime and endTime is 30 days. * If - * startTime and endTime are not sent, the recent 7 days' data will be returned. * The - * earliest startTime is supported on June 10, 2020 * Return up to 200 records per request. - * Weight: 1 + *

Get C2C Trade History * The max interval between startTimestamp and endTimestamp is 30 + * days. * If startTimestamp and endTimestamp are not sent, the recent 30 days' data will be + * returned. * You can only view data from the past 6 months. To see all C2C orders, please + * check https://c2c.binance.com/en/fiatOrder Weight: 1 * * @throws ApiException if the Api call fails */ public void getC2CTradeHistoryExample() throws ApiException { - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; + String tradeType = ""; + Long startTimestamp = 0L; + Long endTimestamp = 0L; Long page = 1L; + Long rows = 100L; Long recvWindow = 5000L; ApiResponse response = - getApi().getC2CTradeHistory(startTime, endTime, page, recvWindow); + getApi().getC2CTradeHistory( + tradeType, startTimestamp, endTimestamp, page, rows, recvWindow); System.out.println(response.getData()); } } diff --git a/examples/derivatives-trading-coin-futures/pom.xml b/examples/derivatives-trading-coin-futures/pom.xml index 57203022..4959cd6b 100644 --- a/examples/derivatives-trading-coin-futures/pom.xml +++ b/examples/derivatives-trading-coin-futures/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-coin-futures - 4.0.0 + 5.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-options/pom.xml b/examples/derivatives-trading-options/pom.xml index 698ef3de..e03ecc64 100644 --- a/examples/derivatives-trading-options/pom.xml +++ b/examples/derivatives-trading-options/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-options - 4.0.0 + 5.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/SymbolPriceTickerExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/IndexPriceTickerExample.java similarity index 89% rename from examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/SymbolPriceTickerExample.java rename to examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/IndexPriceTickerExample.java index 04dbe2e5..1d3a9fab 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/SymbolPriceTickerExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/IndexPriceTickerExample.java @@ -18,10 +18,10 @@ import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.derivatives_trading_options.rest.DerivativesTradingOptionsRestApiUtil; import com.binance.connector.client.derivatives_trading_options.rest.api.DerivativesTradingOptionsRestApi; -import com.binance.connector.client.derivatives_trading_options.rest.model.SymbolPriceTickerResponse; +import com.binance.connector.client.derivatives_trading_options.rest.model.IndexPriceTickerResponse; /** API examples for MarketDataApi */ -public class SymbolPriceTickerExample { +public class IndexPriceTickerExample { private DerivativesTradingOptionsRestApi api; public DerivativesTradingOptionsRestApi getApi() { @@ -38,15 +38,15 @@ public DerivativesTradingOptionsRestApi getApi() { } /** - * Symbol Price Ticker + * Index Price Ticker * *

Get spot index price for option underlying. Weight: 1 * * @throws ApiException if the Api call fails */ - public void symbolPriceTickerExample() throws ApiException { + public void indexPriceTickerExample() throws ApiException { String underlying = ""; - ApiResponse response = getApi().symbolPriceTicker(underlying); + ApiResponse response = getApi().indexPriceTicker(underlying); System.out.println(response.getData()); } } diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelMultipleOptionOrdersExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelMultipleOptionOrdersExample.java index 31a72dfb..ec8f8b60 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelMultipleOptionOrdersExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelMultipleOptionOrdersExample.java @@ -43,7 +43,8 @@ public DerivativesTradingOptionsRestApi getApi() { * Cancel Multiple Option Orders (TRADE) * *

Cancel multiple orders. * At least one instance of `orderId` and - * `clientOrderId` must be sent. Weight: 1 + * `clientOrderId` must be sent. * Max 10 orders can be deleted in one request Weight: + * 1 * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-portfolio-margin-pro/pom.xml b/examples/derivatives-trading-portfolio-margin-pro/pom.xml index b332210b..fe42d288 100644 --- a/examples/derivatives-trading-portfolio-margin-pro/pom.xml +++ b/examples/derivatives-trading-portfolio-margin-pro/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-portfolio-margin-pro - 4.0.0 + 5.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/RedeemBfusdForPortfolioMarginExample.java b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/RedeemBfusdForPortfolioMarginExample.java deleted file mode 100644 index 44cef43c..00000000 --- a/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/RedeemBfusdForPortfolioMarginExample.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.account; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.DerivativesTradingPortfolioMarginProRestApiUtil; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.api.DerivativesTradingPortfolioMarginProRestApi; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RedeemBfusdForPortfolioMarginRequest; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RedeemBfusdForPortfolioMarginResponse; - -/** API examples for AccountApi */ -public class RedeemBfusdForPortfolioMarginExample { - private DerivativesTradingPortfolioMarginProRestApi api; - - public DerivativesTradingPortfolioMarginProRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - DerivativesTradingPortfolioMarginProRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new DerivativesTradingPortfolioMarginProRestApi(clientConfiguration); - } - return api; - } - - /** - * Redeem BFUSD for Portfolio Margin(TRADE) - * - *

Redeem BFUSD for all types of Portfolio Margin account Weight: 1500 - * - * @throws ApiException if the Api call fails - */ - public void redeemBfusdForPortfolioMarginExample() throws ApiException { - RedeemBfusdForPortfolioMarginRequest redeemBfusdForPortfolioMarginRequest = - new RedeemBfusdForPortfolioMarginRequest(); - redeemBfusdForPortfolioMarginRequest.fromAsset(""); - redeemBfusdForPortfolioMarginRequest.targetAsset(""); - redeemBfusdForPortfolioMarginRequest.amount(1.0d); - ApiResponse response = - getApi().redeemBfusdForPortfolioMargin(redeemBfusdForPortfolioMarginRequest); - System.out.println(response.getData()); - } -} diff --git a/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/TransferLdusdtForPortfolioMarginExample.java b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/TransferLdusdtForPortfolioMarginExample.java deleted file mode 100644 index ab469689..00000000 --- a/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/TransferLdusdtForPortfolioMarginExample.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.account; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.DerivativesTradingPortfolioMarginProRestApiUtil; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.api.DerivativesTradingPortfolioMarginProRestApi; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtForPortfolioMarginRequest; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtForPortfolioMarginResponse; - -/** API examples for AccountApi */ -public class TransferLdusdtForPortfolioMarginExample { - private DerivativesTradingPortfolioMarginProRestApi api; - - public DerivativesTradingPortfolioMarginProRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - DerivativesTradingPortfolioMarginProRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new DerivativesTradingPortfolioMarginProRestApi(clientConfiguration); - } - return api; - } - - /** - * Transfer LDUSDT for Portfolio Margin(TRADE) - * - *

Transfer LDUSDT as collateral for all types of Portfolio Margin account Weight: 1500 - * - * @throws ApiException if the Api call fails - */ - public void transferLdusdtForPortfolioMarginExample() throws ApiException { - TransferLdusdtForPortfolioMarginRequest transferLdusdtForPortfolioMarginRequest = - new TransferLdusdtForPortfolioMarginRequest(); - transferLdusdtForPortfolioMarginRequest.asset(""); - transferLdusdtForPortfolioMarginRequest.transferType(""); - transferLdusdtForPortfolioMarginRequest.amount(1.0d); - ApiResponse response = - getApi().transferLdusdtForPortfolioMargin(transferLdusdtForPortfolioMarginRequest); - System.out.println(response.getData()); - } -} diff --git a/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/MintBfusdForPortfolioMarginExample.java b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/TransferLdusdtRwusdForPortfolioMarginExample.java similarity index 68% rename from examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/MintBfusdForPortfolioMarginExample.java rename to examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/TransferLdusdtRwusdForPortfolioMarginExample.java index f6998e02..487f077b 100644 --- a/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/MintBfusdForPortfolioMarginExample.java +++ b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/TransferLdusdtRwusdForPortfolioMarginExample.java @@ -18,11 +18,11 @@ import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.DerivativesTradingPortfolioMarginProRestApiUtil; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.api.DerivativesTradingPortfolioMarginProRestApi; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.MintBfusdForPortfolioMarginRequest; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.MintBfusdForPortfolioMarginResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtRwusdForPortfolioMarginRequest; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtRwusdForPortfolioMarginResponse; /** API examples for AccountApi */ -public class MintBfusdForPortfolioMarginExample { +public class TransferLdusdtRwusdForPortfolioMarginExample { private DerivativesTradingPortfolioMarginProRestApi api; public DerivativesTradingPortfolioMarginProRestApi getApi() { @@ -39,20 +39,21 @@ public DerivativesTradingPortfolioMarginProRestApi getApi() { } /** - * Mint BFUSD for Portfolio Margin(TRADE) + * Transfer LDUSDT/RWUSD for Portfolio Margin(TRADE) * - *

Mint BFUSD for all types of Portfolio Margin account Weight: 1500 + *

Transfer LDUSDT/RWUSD as collateral for all types of Portfolio Margin account Weight: 1500 * * @throws ApiException if the Api call fails */ - public void mintBfusdForPortfolioMarginExample() throws ApiException { - MintBfusdForPortfolioMarginRequest mintBfusdForPortfolioMarginRequest = - new MintBfusdForPortfolioMarginRequest(); - mintBfusdForPortfolioMarginRequest.fromAsset(""); - mintBfusdForPortfolioMarginRequest.targetAsset(""); - mintBfusdForPortfolioMarginRequest.amount(1.0d); - ApiResponse response = - getApi().mintBfusdForPortfolioMargin(mintBfusdForPortfolioMarginRequest); + public void transferLdusdtRwusdForPortfolioMarginExample() throws ApiException { + TransferLdusdtRwusdForPortfolioMarginRequest transferLdusdtRwusdForPortfolioMarginRequest = + new TransferLdusdtRwusdForPortfolioMarginRequest(); + transferLdusdtRwusdForPortfolioMarginRequest.asset(""); + transferLdusdtRwusdForPortfolioMarginRequest.transferType(""); + transferLdusdtRwusdForPortfolioMarginRequest.amount(1.0d); + ApiResponse response = + getApi().transferLdusdtRwusdForPortfolioMargin( + transferLdusdtRwusdForPortfolioMarginRequest); System.out.println(response.getData()); } } diff --git a/examples/derivatives-trading-portfolio-margin/pom.xml b/examples/derivatives-trading-portfolio-margin/pom.xml index 70ee9875..be18022a 100644 --- a/examples/derivatives-trading-portfolio-margin/pom.xml +++ b/examples/derivatives-trading-portfolio-margin/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-portfolio-margin - 3.0.0 + 4.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-usds-futures/pom.xml b/examples/derivatives-trading-usds-futures/pom.xml index 278ed07d..3bd5e0a4 100644 --- a/examples/derivatives-trading-usds-futures/pom.xml +++ b/examples/derivatives-trading-usds-futures/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-usds-futures - 6.0.0 + 7.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/AdlRiskExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/AdlRiskExample.java new file mode 100644 index 00000000..fe19ec5b --- /dev/null +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/AdlRiskExample.java @@ -0,0 +1,56 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.marketdata; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.DerivativesTradingUsdsFuturesRestApiUtil; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.api.DerivativesTradingUsdsFuturesRestApi; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.AdlRiskResponse; + +/** API examples for MarketDataApi */ +public class AdlRiskExample { + private DerivativesTradingUsdsFuturesRestApi api; + + public DerivativesTradingUsdsFuturesRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingUsdsFuturesRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingUsdsFuturesRestApi(clientConfiguration); + } + return api; + } + + /** + * ADL Risk + * + *

Query the symbol-level ADL risk rating. The ADL risk rating measures the likelihood of ADL + * during liquidation, and the rating takes into account the insurance fund balance, position + * concentration on the symbol, order book depth, price volatility, average leverage, unrealized + * PnL, and margin utilization at the symbol level. The rating can be high, medium and low, and + * is updated every 30 minutes. Weight: 1 + * + * @throws ApiException if the Api call fails + */ + public void adlRiskExample() throws ApiException { + String symbol = ""; + ApiResponse response = getApi().adlRisk(symbol); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/CompressedAggregateTradesListExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/CompressedAggregateTradesListExample.java index 2cd4e8a6..27d38f5c 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/CompressedAggregateTradesListExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/CompressedAggregateTradesListExample.java @@ -41,15 +41,17 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { * Compressed/Aggregate Trades List * *

Get compressed, aggregate market trades. Market trades that fill in 100ms with the same - * price and the same taking side will have the quantity aggregated. * support querying futures - * trade histories that are not older than one year * If both `startTime` and - * `endTime` are sent, time between `startTime` and `endTime` must - * be less than 1 hour. * If `fromId`, `startTime`, and `endTime` - * are not sent, the most recent aggregate trades will be returned. * Only market trades will be - * aggregated and returned, which means the insurance fund trades and ADL trades won't be - * aggregated. * Sending both `startTime`/`endTime` and `fromId` - * might cause response timeout, please send either `fromId` or - * `startTime`/`endTime` Weight: 20 + * price and the same taking side will have the quantity aggregated. Retail Price + * Improvement(RPI) orders are aggregated and without special tags to be distinguished. * + * support querying futures trade histories that are not older than one year * If both + * `startTime` and `endTime` are sent, time between `startTime` + * and `endTime` must be less than 1 hour. * If `fromId`, + * `startTime`, and `endTime` are not sent, the most recent aggregate trades + * will be returned. * Only market trades will be aggregated and returned, which means the + * insurance fund trades and ADL trades won't be aggregated. * Sending both + * `startTime`/`endTime` and `fromId` might cause response + * timeout, please send either `fromId` or `startTime`/`endTime` + * Weight: 20 * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/ContinuousContractKlineCandlestickDataExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/ContinuousContractKlineCandlestickDataExample.java index 9a42bc67..b15680a8 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/ContinuousContractKlineCandlestickDataExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/ContinuousContractKlineCandlestickDataExample.java @@ -44,9 +44,9 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { * *

Kline/candlestick bars for a specific contract type. Klines are uniquely identified by * their open time. * If startTime and endTime are not sent, the most recent klines are - * returned. * Contract type: * PERPETUAL * CURRENT_QUARTER * NEXT_QUARTER Weight: based on - * parameter LIMIT | LIMIT | weight | | ----------- | ------ | | [1,100) | 1 | | [100, 500) | 2 - * | | [500, 1000] | 5 | | > 1000 | 10 | + * returned. * Contract type: * PERPETUAL * CURRENT_QUARTER * NEXT_QUARTER * TRADIFI_PERPETUAL + * Weight: based on parameter LIMIT | LIMIT | weight | | ----------- | ------ | | [1,100) | 1 | + * | [100, 500) | 2 | | [500, 1000] | 5 | | > 1000 | 10 | * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/MarkPriceExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/MarkPriceExample.java index 65b66675..7fe92f62 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/MarkPriceExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/MarkPriceExample.java @@ -40,7 +40,7 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { /** * Mark Price * - *

Mark Price and Funding Rate Weight: 1 + *

Mark Price and Funding Rate Weight: 1 with symbol, 10 without symbol * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/OrderBookExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/OrderBookExample.java index 6e80f0e3..f5c79663 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/OrderBookExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/OrderBookExample.java @@ -40,7 +40,8 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { /** * Order Book * - *

Query symbol orderbook Weight: Adjusted based on the limit: | Limit | Weight | | + *

Query symbol orderbook Retail Price Improvement(RPI) orders are not visible and excluded + * in the response message. Weight: Adjusted based on the limit: | Limit | Weight | | * ------------- | ------ | | 5, 10, 20, 50 | 2 | | 100 | 5 | | 500 | 10 | | 1000 | 20 | * * @throws ApiException if the Api call fails diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/QueryIndexPriceConstituentsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/QueryIndexPriceConstituentsExample.java index 5db1067a..f6b131b8 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/QueryIndexPriceConstituentsExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/QueryIndexPriceConstituentsExample.java @@ -40,7 +40,8 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { /** * Query Index Price Constituents * - *

Query index price constituents Weight: 2 + *

Query index price constituents **Note**: Prices from constituents of TradFi perps will be + * hiden and displayed as -1. Weight: 2 * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/RpiOrderBookExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/RpiOrderBookExample.java new file mode 100644 index 00000000..a43fdc50 --- /dev/null +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/RpiOrderBookExample.java @@ -0,0 +1,55 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.marketdata; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.DerivativesTradingUsdsFuturesRestApiUtil; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.api.DerivativesTradingUsdsFuturesRestApi; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.RpiOrderBookResponse; + +/** API examples for MarketDataApi */ +public class RpiOrderBookExample { + private DerivativesTradingUsdsFuturesRestApi api; + + public DerivativesTradingUsdsFuturesRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingUsdsFuturesRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingUsdsFuturesRestApi(clientConfiguration); + } + return api; + } + + /** + * RPI Order Book + * + *

Query symbol orderbook with RPI orders RPI(Retail Price Improvement) orders are included + * and aggreated in the response message. Crossed price levels are hidden and invisible. Weight: + * Adjusted based on the limit: | Limit | Weight | | ------------- | ------ | | 1000 | 20 | + * + * @throws ApiException if the Api call fails + */ + public void rpiOrderBookExample() throws ApiException { + String symbol = ""; + Long limit = 100L; + ApiResponse response = getApi().rpiOrderBook(symbol, limit); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/SymbolOrderBookTickerExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/SymbolOrderBookTickerExample.java index 3410976f..3a8bca96 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/SymbolOrderBookTickerExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/SymbolOrderBookTickerExample.java @@ -40,7 +40,8 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { /** * Symbol Order Book Ticker * - *

Best price/qty on the order book for a symbol or symbols. * If the symbol is not sent, + *

Best price/qty on the order book for a symbol or symbols. Retail Price Improvement(RPI) + * orders are not visible and excluded in the response message. * If the symbol is not sent, * bookTickers for all symbols will be returned in an array. * The field * `X-MBX-USED-WEIGHT-1M` in response header is not accurate from this endpoint, * please ignore. Weight: 2 for a single symbol; 5 when the symbol parameter is omitted diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/SymbolPriceTickerExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/SymbolPriceTickerExample.java index f323c097..cd43744b 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/SymbolPriceTickerExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/SymbolPriceTickerExample.java @@ -38,7 +38,7 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { } /** - * Symbol Price Ticker(Deprecated) + * Symbol Price Ticker * *

Latest price for a symbol or symbols. * If the symbol is not sent, prices for all symbols * will be returned in an array. Weight: 1 for a single symbol; 2 when the symbol parameter is diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/TradingScheduleExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/TradingScheduleExample.java new file mode 100644 index 00000000..50b7953c --- /dev/null +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/TradingScheduleExample.java @@ -0,0 +1,55 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.marketdata; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.DerivativesTradingUsdsFuturesRestApiUtil; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.api.DerivativesTradingUsdsFuturesRestApi; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.TradingScheduleResponse; + +/** API examples for MarketDataApi */ +public class TradingScheduleExample { + private DerivativesTradingUsdsFuturesRestApi api; + + public DerivativesTradingUsdsFuturesRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingUsdsFuturesRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingUsdsFuturesRestApi(clientConfiguration); + } + return api; + } + + /** + * Trading Schedule + * + *

Trading session schedules for a one-week period starting from the day prior to the query + * time, covering both the U.S. equity and commodity markets. Equity market session types + * include \"PRE_MARKET\", \"REGULAR\", \"AFTER_MARKET\", + * \"OVERNIGHT\", and \"NO_TRADING\", while commodity market session types + * include \"REGULAR\" and \"NO_TRADING\". Weight: 5 + * + * @throws ApiException if the Api call fails + */ + public void tradingScheduleExample() throws ApiException { + ApiResponse response = getApi().tradingSchedule(); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CancelAlgoOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CancelAlgoOrderExample.java new file mode 100644 index 00000000..909b0534 --- /dev/null +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CancelAlgoOrderExample.java @@ -0,0 +1,56 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.trade; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.DerivativesTradingUsdsFuturesRestApiUtil; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.api.DerivativesTradingUsdsFuturesRestApi; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CancelAlgoOrderResponse; + +/** API examples for TradeApi */ +public class CancelAlgoOrderExample { + private DerivativesTradingUsdsFuturesRestApi api; + + public DerivativesTradingUsdsFuturesRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingUsdsFuturesRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingUsdsFuturesRestApi(clientConfiguration); + } + return api; + } + + /** + * Cancel Algo Order (TRADE) + * + *

Cancel an active algo order. * Either `algoid` or `clientalgoid` must + * be sent. Weight: 1 + * + * @throws ApiException if the Api call fails + */ + public void cancelAlgoOrderExample() throws ApiException { + Long algoid = 0L; + String clientalgoid = ""; + Long recvWindow = 5000L; + ApiResponse response = + getApi().cancelAlgoOrder(algoid, clientalgoid, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/StartMarginUserDataStreamExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CancelAllAlgoOpenOrdersExample.java similarity index 55% rename from examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/StartMarginUserDataStreamExample.java rename to examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CancelAllAlgoOpenOrdersExample.java index bf5a1b3d..a2eedf66 100644 --- a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/StartMarginUserDataStreamExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CancelAllAlgoOpenOrdersExample.java @@ -10,45 +10,45 @@ * Do not edit the class manually. */ -package com.binance.connector.client.margin_trading.rest.tradedatastream; +package com.binance.connector.client.derivatives_trading_usds_futures.rest.trade; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; import com.binance.connector.client.common.configuration.ClientConfiguration; import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.margin_trading.rest.MarginTradingRestApiUtil; -import com.binance.connector.client.margin_trading.rest.api.MarginTradingRestApi; -import com.binance.connector.client.margin_trading.rest.model.StartMarginUserDataStreamResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.DerivativesTradingUsdsFuturesRestApiUtil; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.api.DerivativesTradingUsdsFuturesRestApi; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CancelAllAlgoOpenOrdersResponse; -/** API examples for TradeDataStreamApi */ -public class StartMarginUserDataStreamExample { - private MarginTradingRestApi api; +/** API examples for TradeApi */ +public class CancelAllAlgoOpenOrdersExample { + private DerivativesTradingUsdsFuturesRestApi api; - public MarginTradingRestApi getApi() { + public DerivativesTradingUsdsFuturesRestApi getApi() { if (api == null) { ClientConfiguration clientConfiguration = - MarginTradingRestApiUtil.getClientConfiguration(); + DerivativesTradingUsdsFuturesRestApiUtil.getClientConfiguration(); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("path/to/private.key"); clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new MarginTradingRestApi(clientConfiguration); + api = new DerivativesTradingUsdsFuturesRestApi(clientConfiguration); } return api; } /** - * Start Margin User Data Stream (USER_STREAM) + * Cancel All Algo Open Orders (TRADE) * - *

Start a new margin user data stream. The stream will close after 60 minutes unless a - * keepalive is sent. If the account has an active listenKey, that listenKey will be returned - * and its validity will be extended for 60 minutes. Weight: 1 + *

Cancel All Algo Open Orders Weight: 1 * * @throws ApiException if the Api call fails */ - public void startMarginUserDataStreamExample() throws ApiException { - ApiResponse response = - getApi().startMarginUserDataStream(); + public void cancelAllAlgoOpenOrdersExample() throws ApiException { + String symbol = ""; + Long recvWindow = 5000L; + ApiResponse response = + getApi().cancelAllAlgoOpenOrders(symbol, recvWindow); System.out.println(response.getData()); } } diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CurrentAllAlgoOpenOrdersExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CurrentAllAlgoOpenOrdersExample.java new file mode 100644 index 00000000..92898e94 --- /dev/null +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CurrentAllAlgoOpenOrdersExample.java @@ -0,0 +1,58 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.trade; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.DerivativesTradingUsdsFuturesRestApiUtil; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.api.DerivativesTradingUsdsFuturesRestApi; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.CurrentAllAlgoOpenOrdersResponse; + +/** API examples for TradeApi */ +public class CurrentAllAlgoOpenOrdersExample { + private DerivativesTradingUsdsFuturesRestApi api; + + public DerivativesTradingUsdsFuturesRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingUsdsFuturesRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingUsdsFuturesRestApi(clientConfiguration); + } + return api; + } + + /** + * Current All Algo Open Orders (USER_DATA) + * + *

Get all algo open orders on a symbol. * If the symbol is not sent, orders for all symbols + * will be returned in an array. Weight: 1 for a single symbol; 40 when the symbol parameter is + * omitted Careful when accessing this with no symbol. + * + * @throws ApiException if the Api call fails + */ + public void currentAllAlgoOpenOrdersExample() throws ApiException { + String algoType = ""; + String symbol = ""; + Long algoId = 1L; + Long recvWindow = 5000L; + ApiResponse response = + getApi().currentAllAlgoOpenOrders(algoType, symbol, algoId, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/FuturesTradfiPerpsContractExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/FuturesTradfiPerpsContractExample.java new file mode 100644 index 00000000..678438f0 --- /dev/null +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/FuturesTradfiPerpsContractExample.java @@ -0,0 +1,55 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.trade; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.DerivativesTradingUsdsFuturesRestApiUtil; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.api.DerivativesTradingUsdsFuturesRestApi; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesTradfiPerpsContractRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.FuturesTradfiPerpsContractResponse; + +/** API examples for TradeApi */ +public class FuturesTradfiPerpsContractExample { + private DerivativesTradingUsdsFuturesRestApi api; + + public DerivativesTradingUsdsFuturesRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingUsdsFuturesRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingUsdsFuturesRestApi(clientConfiguration); + } + return api; + } + + /** + * Futures TradFi Perps Contract(USER_DATA) + * + *

Sign TradFi-Perps agreement contract Weight: 0 + * + * @throws ApiException if the Api call fails + */ + public void futuresTradfiPerpsContractExample() throws ApiException { + FuturesTradfiPerpsContractRequest futuresTradfiPerpsContractRequest = + new FuturesTradfiPerpsContractRequest(); + ApiResponse response = + getApi().futuresTradfiPerpsContract(futuresTradfiPerpsContractRequest); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/NewAlgoOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/NewAlgoOrderExample.java new file mode 100644 index 00000000..3df4ab75 --- /dev/null +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/NewAlgoOrderExample.java @@ -0,0 +1,88 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.trade; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.DerivativesTradingUsdsFuturesRestApiUtil; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.api.DerivativesTradingUsdsFuturesRestApi; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.NewAlgoOrderRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.NewAlgoOrderResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.Side; + +/** API examples for TradeApi */ +public class NewAlgoOrderExample { + private DerivativesTradingUsdsFuturesRestApi api; + + public DerivativesTradingUsdsFuturesRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingUsdsFuturesRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingUsdsFuturesRestApi(clientConfiguration); + } + return api; + } + + /** + * New Algo Order(TRADE) + * + *

Send in a new Algo order. * Condition orders will be triggered when: * If + * parameter`priceProtect`is sent as true: * when price reaches the + * `triggerPrice` ,the difference rate between \"MARK_PRICE\" and + * \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the + * symbol * \"triggerProtect\" of a symbol can be got from `GET + * /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * BUY: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * SELL: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `triggerPrice` * `TAKE_PROFIT`, + * `TAKE_PROFIT_MARKET`: * BUY: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after + * order placed <= `activationPrice`, and the latest price >= the + * lowest price * (1 + `callbackRate`) * SELL: the highest price after order placed + * >= `activationPrice`, and the latest price <= the highest price * + * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error + * code. ``{\"code\": -2021, \"msg\": \"Order would + * immediately trigger.\"}`` means that the parameters you send do not meet the + * following requirements: * BUY: `activationPrice` should be smaller than latest + * price. * SELL: `activationPrice` should be larger than latest price. * + * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with + * `closePosition`=`true`: * Follow the same rules for condition + * orders. * If triggered,**close all** current long position( if `SELL`) or current + * short position( if `BUY`). * Cannot be used with `quantity` paremeter * + * Cannot be used with `reduceOnly` parameter * In Hedge Mode,cannot be used with + * `BUY` orders in `LONG` position side. and cannot be used with + * `SELL` orders in `SHORT` position side * + * `selfTradePreventionMode` is only effective when `timeInForce` set to + * `IOC` or `GTC` or `GTD`. Weight: 0 on IP rate + * limit(x-mbx-used-weight-1m) + * + * @throws ApiException if the Api call fails + */ + public void newAlgoOrderExample() throws ApiException { + NewAlgoOrderRequest newAlgoOrderRequest = new NewAlgoOrderRequest(); + newAlgoOrderRequest.algoType(""); + newAlgoOrderRequest.symbol(""); + newAlgoOrderRequest.side(Side.BUY); + newAlgoOrderRequest.type(""); + ApiResponse response = getApi().newAlgoOrder(newAlgoOrderRequest); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/QueryAlgoOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/QueryAlgoOrderExample.java new file mode 100644 index 00000000..71b4e521 --- /dev/null +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/QueryAlgoOrderExample.java @@ -0,0 +1,59 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.trade; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.DerivativesTradingUsdsFuturesRestApiUtil; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.api.DerivativesTradingUsdsFuturesRestApi; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.QueryAlgoOrderResponse; + +/** API examples for TradeApi */ +public class QueryAlgoOrderExample { + private DerivativesTradingUsdsFuturesRestApi api; + + public DerivativesTradingUsdsFuturesRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingUsdsFuturesRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingUsdsFuturesRestApi(clientConfiguration); + } + return api; + } + + /** + * Query Algo Order (USER_DATA) + * + *

Check an algo order's status. * These orders will not be found: * order status is + * `CANCELED` or `EXPIRED` **AND** order has NO filled trade **AND** created + * time + 3 days < current time * order create time + 90 days < current time * Either + * `algoId` or `clientAlgoId` must be sent. * `algoId` is + * self-increment for each specific `symbol` Weight: 1 + * + * @throws ApiException if the Api call fails + */ + public void queryAlgoOrderExample() throws ApiException { + Long algoId = 1L; + String clientAlgoId = "1"; + Long recvWindow = 5000L; + ApiResponse response = + getApi().queryAlgoOrder(algoId, clientAlgoId, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/QueryAllAlgoOrdersExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/QueryAllAlgoOrdersExample.java new file mode 100644 index 00000000..696902af --- /dev/null +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/QueryAllAlgoOrdersExample.java @@ -0,0 +1,65 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.rest.trade; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.DerivativesTradingUsdsFuturesRestApiUtil; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.api.DerivativesTradingUsdsFuturesRestApi; +import com.binance.connector.client.derivatives_trading_usds_futures.rest.model.QueryAllAlgoOrdersResponse; + +/** API examples for TradeApi */ +public class QueryAllAlgoOrdersExample { + private DerivativesTradingUsdsFuturesRestApi api; + + public DerivativesTradingUsdsFuturesRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingUsdsFuturesRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingUsdsFuturesRestApi(clientConfiguration); + } + return api; + } + + /** + * Query All Algo Orders (USER_DATA) + * + *

Get all algo orders; active, CANCELED, TRIGGERED or FINISHED . * These orders will not be + * found: * order status is `CANCELED` or `EXPIRED` **AND** order has NO + * filled trade **AND** created time + 3 days < current time * order create time + 90 days + * < current time * If `algoId` is set, it will get orders >= that + * `algoId`. Otherwise most recent orders are returned. * The query time period must + * be less then 7 days( default as the recent 7 days). Weight: 5 + * + * @throws ApiException if the Api call fails + */ + public void queryAllAlgoOrdersExample() throws ApiException { + String symbol = ""; + Long algoId = 1L; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long page = 0L; + Long limit = 100L; + Long recvWindow = 5000L; + ApiResponse response = + getApi().queryAllAlgoOrders( + symbol, algoId, startTime, endTime, page, limit, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/OrderBookExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/OrderBookExample.java index f1c68d3e..c4b5fe2b 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/OrderBookExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/OrderBookExample.java @@ -47,7 +47,8 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { * to continuously monitor order book updates, please consider using Websocket Market Streams: * * `<symbol>@depth<levels>` * `<symbol>@depth` You can use * `depth` request together with `<symbol>@depth` streams to maintain - * a local order book. Weight: Adjusted based on the limit: | Limit | Weight | | ------------- | + * a local order book. Retail Price Improvement(RPI) orders are not visible and excluded in the + * response message. Weight: Adjusted based on the limit: | Limit | Weight | | ------------- | * ------ | | 5, 10, 20, 50 | 2 | | 100 | 5 | | 500 | 10 | | 1000 | 20 | */ public void orderBookExampleAsync() { @@ -71,7 +72,8 @@ public void orderBookExampleAsync() { * to continuously monitor order book updates, please consider using Websocket Market Streams: * * `<symbol>@depth<levels>` * `<symbol>@depth` You can use * `depth` request together with `<symbol>@depth` streams to maintain - * a local order book. Weight: Adjusted based on the limit: | Limit | Weight | | ------------- | + * a local order book. Retail Price Improvement(RPI) orders are not visible and excluded in the + * response message. Weight: Adjusted based on the limit: | Limit | Weight | | ------------- | * ------ | | 5, 10, 20, 50 | 2 | | 100 | 5 | | 500 | 10 | | 1000 | 20 | */ public void orderBookExampleSync() { diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolOrderBookTickerExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolOrderBookTickerExample.java index 0eccac50..63d50601 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolOrderBookTickerExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/marketdata/SymbolOrderBookTickerExample.java @@ -43,7 +43,8 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { /** * Symbol Order Book Ticker * - *

Best price/qty on the order book for a symbol or symbols. * If the symbol is not sent, + *

Best price/qty on the order book for a symbol or symbols. Retail Price Improvement(RPI) + * orders are not visible and excluded in the response message. * If the symbol is not sent, * bookTickers for all symbols will be returned in an array. * The field * `X-MBX-USED-WEIGHT-1M` in response header is not accurate from this endpoint, * please ignore. Weight: 2 for a single symbol; 5 when the symbol parameter is omitted @@ -66,7 +67,8 @@ public void symbolOrderBookTickerExampleAsync() { /** * Symbol Order Book Ticker * - *

Best price/qty on the order book for a symbol or symbols. * If the symbol is not sent, + *

Best price/qty on the order book for a symbol or symbols. Retail Price Improvement(RPI) + * orders are not visible and excluded in the response message. * If the symbol is not sent, * bookTickers for all symbols will be returned in an array. * The field * `X-MBX-USED-WEIGHT-1M` in response header is not accurate from this endpoint, * please ignore. Weight: 2 for a single symbol; 5 when the symbol parameter is omitted diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/CancelAlgoOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/CancelAlgoOrderExample.java new file mode 100644 index 00000000..a4cc6e73 --- /dev/null +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/CancelAlgoOrderExample.java @@ -0,0 +1,76 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.trade; + +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.DerivativesTradingUsdsFuturesWebSocketApiUtil; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.api.DerivativesTradingUsdsFuturesWebSocketApi; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.CancelAlgoOrderRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.CancelAlgoOrderResponse; +import java.util.concurrent.CompletableFuture; + +/** API examples for TradeApi */ +public class CancelAlgoOrderExample { + private DerivativesTradingUsdsFuturesWebSocketApi api; + + public DerivativesTradingUsdsFuturesWebSocketApi getApi() { + if (api == null) { + WebSocketClientConfiguration clientConfiguration = + DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("/path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingUsdsFuturesWebSocketApi(clientConfiguration); + } + return api; + } + + /** + * Cancel Algo Order (TRADE) + * + *

Cancel an active algo order. * Either `algoid` or `clientalgoid` must + * be sent. Weight: 1 + */ + public void cancelAlgoOrderExampleAsync() { + CancelAlgoOrderRequest cancelAlgoOrderRequest = new CancelAlgoOrderRequest(); + CompletableFuture future = + getApi().cancelAlgoOrder(cancelAlgoOrderRequest); + future.handle( + (response, error) -> { + if (error != null) { + System.err.println(error); + } + System.out.println(response); + return response; + }); + } + + /** + * Cancel Algo Order (TRADE) + * + *

Cancel an active algo order. * Either `algoid` or `clientalgoid` must + * be sent. Weight: 1 + */ + public void cancelAlgoOrderExampleSync() { + CancelAlgoOrderRequest cancelAlgoOrderRequest = new CancelAlgoOrderRequest(); + CompletableFuture future = + getApi().cancelAlgoOrder(cancelAlgoOrderRequest); + CancelAlgoOrderResponse response = future.join(); + System.out.println(response); + } +} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/NewAlgoOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/NewAlgoOrderExample.java new file mode 100644 index 00000000..5f1330cc --- /dev/null +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/NewAlgoOrderExample.java @@ -0,0 +1,139 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.trade; + +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.DerivativesTradingUsdsFuturesWebSocketApiUtil; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.api.DerivativesTradingUsdsFuturesWebSocketApi; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.NewAlgoOrderRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.NewAlgoOrderResponse; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.Side; +import java.util.concurrent.CompletableFuture; + +/** API examples for TradeApi */ +public class NewAlgoOrderExample { + private DerivativesTradingUsdsFuturesWebSocketApi api; + + public DerivativesTradingUsdsFuturesWebSocketApi getApi() { + if (api == null) { + WebSocketClientConfiguration clientConfiguration = + DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); + // if you want the connection to be auto logged on: + // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests + clientConfiguration.setAutoLogon(true); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("/path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingUsdsFuturesWebSocketApi(clientConfiguration); + } + return api; + } + + /** + * New Algo Order(TRADE) + * + *

Send in a new algo order. * Condition orders will be triggered when: * If + * parameter`priceProtect`is sent as true: * when price reaches the + * `triggerPrice` ,the difference rate between \"MARK_PRICE\" and + * \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the + * symbol * \"triggerProtect\" of a symbol can be got from `GET + * /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * BUY: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * SELL: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `triggerPrice` * `TAKE_PROFIT`, + * `TAKE_PROFIT_MARKET`: * BUY: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after + * order placed <= `activationPrice`, and the latest price >= the + * lowest price * (1 + `callbackRate`) * SELL: the highest price after order placed + * >= `activationPrice`, and the latest price <= the highest price * + * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error + * code. ``{\"code\": -2021, \"msg\": \"Order would + * immediately trigger.\"}`` means that the parameters you send do not meet the + * following requirements: * BUY: `activationPrice` should be smaller than latest + * price. * SELL: `activationPrice` should be larger than latest price. * + * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with + * `closePosition`=`true`: * Follow the same rules for condition + * orders. * If triggered,**close all** current long position( if `SELL`) or current + * short position( if `BUY`). * Cannot be used with `quantity` paremeter * + * Cannot be used with `reduceOnly` parameter * In Hedge Mode,cannot be used with + * `BUY` orders in `LONG` position side. and cannot be used with + * `SELL` orders in `SHORT` position side * + * `selfTradePreventionMode` is only effective when `timeInForce` set to + * `IOC` or `GTC` or `GTD`. Weight: 0 + */ + public void newAlgoOrderExampleAsync() { + NewAlgoOrderRequest newAlgoOrderRequest = new NewAlgoOrderRequest(); + newAlgoOrderRequest.algoType(""); + newAlgoOrderRequest.symbol(""); + newAlgoOrderRequest.side(Side.BUY); + newAlgoOrderRequest.type(""); + CompletableFuture future = getApi().newAlgoOrder(newAlgoOrderRequest); + future.handle( + (response, error) -> { + if (error != null) { + System.err.println(error); + } + System.out.println(response); + return response; + }); + } + + /** + * New Algo Order(TRADE) + * + *

Send in a new algo order. * Condition orders will be triggered when: * If + * parameter`priceProtect`is sent as true: * when price reaches the + * `triggerPrice` ,the difference rate between \"MARK_PRICE\" and + * \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the + * symbol * \"triggerProtect\" of a symbol can be got from `GET + * /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * BUY: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * SELL: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `triggerPrice` * `TAKE_PROFIT`, + * `TAKE_PROFIT_MARKET`: * BUY: latest price (\"MARK_PRICE\" or + * \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price + * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= + * `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after + * order placed <= `activationPrice`, and the latest price >= the + * lowest price * (1 + `callbackRate`) * SELL: the highest price after order placed + * >= `activationPrice`, and the latest price <= the highest price * + * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error + * code. ``{\"code\": -2021, \"msg\": \"Order would + * immediately trigger.\"}`` means that the parameters you send do not meet the + * following requirements: * BUY: `activationPrice` should be smaller than latest + * price. * SELL: `activationPrice` should be larger than latest price. * + * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with + * `closePosition`=`true`: * Follow the same rules for condition + * orders. * If triggered,**close all** current long position( if `SELL`) or current + * short position( if `BUY`). * Cannot be used with `quantity` paremeter * + * Cannot be used with `reduceOnly` parameter * In Hedge Mode,cannot be used with + * `BUY` orders in `LONG` position side. and cannot be used with + * `SELL` orders in `SHORT` position side * + * `selfTradePreventionMode` is only effective when `timeInForce` set to + * `IOC` or `GTC` or `GTD`. Weight: 0 + */ + public void newAlgoOrderExampleSync() { + NewAlgoOrderRequest newAlgoOrderRequest = new NewAlgoOrderRequest(); + newAlgoOrderRequest.algoType(""); + newAlgoOrderRequest.symbol(""); + newAlgoOrderRequest.side(Side.BUY); + newAlgoOrderRequest.type(""); + CompletableFuture future = getApi().newAlgoOrder(newAlgoOrderRequest); + NewAlgoOrderResponse response = future.join(); + System.out.println(response); + } +} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AggregateTradeStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AggregateTradeStreamsExample.java index 64a84287..7c719c71 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AggregateTradeStreamsExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AggregateTradeStreamsExample.java @@ -39,7 +39,8 @@ public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { *

The Aggregate Trade Streams push market trade information that is aggregated for fills * with same price and taking side every 100 milliseconds. Only market trades will be * aggregated, which means the insurance fund trades and ADL trades won't be aggregated. - * Update Speed: 100ms + * Retail Price Improvement(RPI) orders are aggregated and without special tags to be + * distinguished. Update Speed: 100ms * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllBookTickersStreamExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllBookTickersStreamExample.java index 6adb33a8..db07a025 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllBookTickersStreamExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllBookTickersStreamExample.java @@ -37,7 +37,8 @@ public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { * All Book Tickers Stream * *

Pushes any update to the best bid or ask's price or quantity in real-time for all - * symbols. Update Speed: 5s + * symbols. Retail Price Improvement(RPI) orders are not visible and excluded in the response + * message. Update Speed: 5s * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/DiffBookDepthStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/DiffBookDepthStreamsExample.java index 1438c487..6d3eedcb 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/DiffBookDepthStreamsExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/DiffBookDepthStreamsExample.java @@ -37,7 +37,8 @@ public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { * Diff. Book Depth Streams * *

Bids and asks, pushed every 250 milliseconds, 500 milliseconds, 100 milliseconds (if - * existing) Update Speed: 250ms, 500ms, 100ms + * existing) Retail Price Improvement(RPI) orders are not visible and excluded in the response + * message. Update Speed: 250ms, 500ms, 100ms * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/IndividualSymbolBookTickerStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/IndividualSymbolBookTickerStreamsExample.java index b1be6177..249e72ce 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/IndividualSymbolBookTickerStreamsExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/IndividualSymbolBookTickerStreamsExample.java @@ -37,7 +37,8 @@ public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { * Individual Symbol Book Ticker Streams * *

Pushes any update to the best bid or ask's price or quantity in real-time for a - * specified symbol. Update Speed: Real-time + * specified symbol. Retail Price Improvement(RPI) orders are not visible and excluded in the + * response message. Update Speed: Real-time * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MarkPriceStreamForAllMarketExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MarkPriceStreamForAllMarketExample.java index 40ef1959..f6ef451e 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MarkPriceStreamForAllMarketExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MarkPriceStreamForAllMarketExample.java @@ -36,8 +36,8 @@ public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { /** * Mark Price Stream for All market * - *

Mark price and funding rate for all symbols pushed every 3 seconds or every second. Update - * Speed: 3000ms or 1000ms + *

Mark price and funding rate for all symbols pushed every 3 seconds or every second. + * **Note**: This stream does not cover TradFi Perps. Update Speed: 3000ms or 1000ms * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/PartialBookDepthStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/PartialBookDepthStreamsExample.java index 149a229c..4efdd432 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/PartialBookDepthStreamsExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/PartialBookDepthStreamsExample.java @@ -37,6 +37,7 @@ public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { * Partial Book Depth Streams * *

Top **<levels\\>** bids and asks, Valid **<levels\\>** are 5, 10, or 20. + * Retail Price Improvement(RPI) orders are not visible and excluded in the response message. * Update Speed: 250ms, 500ms or 100ms * * @throws ApiException if the Api call fails diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/RpiDiffBookDepthStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/RpiDiffBookDepthStreamsExample.java new file mode 100644 index 00000000..19df770c --- /dev/null +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/RpiDiffBookDepthStreamsExample.java @@ -0,0 +1,57 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; +import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.RpiDiffBookDepthStreamsRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.RpiDiffBookDepthStreamsResponse; + +/** API examples for WebsocketMarketStreamsApi */ +public class RpiDiffBookDepthStreamsExample { + private DerivativesTradingUsdsFuturesWebSocketStreams api; + + public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { + if (api == null) { + WebSocketClientConfiguration clientConfiguration = + DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); + api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); + } + return api; + } + + /** + * RPI Diff. Book Depth Streams + * + *

Bids and asks including RPI orders, pushed every 500 milliseconds RPI(Retail Price + * Improvement) orders are included and aggreated in the response message. When the quantity of + * a price level to be updated is equal to 0, it means either all quotations for this price have + * been filled/canceled, or the quantity of crossed RPI orders for this price are hidden Update + * Speed: 500ms + * + * @throws ApiException if the Api call fails + */ + public void rpiDiffBookDepthStreamsExample() throws ApiException, InterruptedException { + RpiDiffBookDepthStreamsRequest rpiDiffBookDepthStreamsRequest = + new RpiDiffBookDepthStreamsRequest(); + rpiDiffBookDepthStreamsRequest.symbol("btcusdt"); + StreamBlockingQueueWrapper response = + getApi().rpiDiffBookDepthStreams(rpiDiffBookDepthStreamsRequest); + while (true) { + System.out.println(response.take()); + } + } +} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/TradingSessionStreamExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/TradingSessionStreamExample.java new file mode 100644 index 00000000..d1c4ca8e --- /dev/null +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/TradingSessionStreamExample.java @@ -0,0 +1,56 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; +import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.TradingSessionStreamRequest; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.TradingSessionStreamResponse; + +/** API examples for WebsocketMarketStreamsApi */ +public class TradingSessionStreamExample { + private DerivativesTradingUsdsFuturesWebSocketStreams api; + + public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { + if (api == null) { + WebSocketClientConfiguration clientConfiguration = + DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); + api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); + } + return api; + } + + /** + * Trading Session Stream + * + *

Trading session information of U.S. equity market and commodity market which updates every + * second. Trading session information of different markets is pushed in seperate messages. + * Session types of equity market include \"PRE_MARKET\", \"REGULAR\", + * \"AFTER_MARKET\", \"OVERNIGHT\" and \"NO_TRADING\". And session + * types of commodity market include \"REGULAR\" and \"NO_TRADING\". Update + * Speed: 1s + * + * @throws ApiException if the Api call fails + */ + public void tradingSessionStreamExample() throws ApiException, InterruptedException { + TradingSessionStreamRequest tradingSessionStreamRequest = new TradingSessionStreamRequest(); + StreamBlockingQueueWrapper response = + getApi().tradingSessionStream(tradingSessionStreamRequest); + while (true) { + System.out.println(response.take()); + } + } +} diff --git a/examples/fiat/pom.xml b/examples/fiat/pom.xml index cec7b446..82aa34aa 100644 --- a/examples/fiat/pom.xml +++ b/examples/fiat/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-fiat - 1.2.1 + 2.0.0 \ No newline at end of file diff --git a/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/DepositExample.java b/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/DepositExample.java new file mode 100644 index 00000000..2a842926 --- /dev/null +++ b/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/DepositExample.java @@ -0,0 +1,58 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.fiat.rest.fiat; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.fiat.rest.FiatRestApiUtil; +import com.binance.connector.client.fiat.rest.api.FiatRestApi; +import com.binance.connector.client.fiat.rest.model.DepositRequest; +import com.binance.connector.client.fiat.rest.model.DepositResponse; + +/** API examples for FiatApi */ +public class DepositExample { + private FiatRestApi api; + + public FiatRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = FiatRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new FiatRestApi(clientConfiguration); + } + return api; + } + + /** + * Deposit(TRADE) + * + *

Submit deposit request, in this version, we only support BRL deposit via pix. For BRL + * deposit via pix, you need to place an order before making a transfer from your bank. Before + * calling this api, please make sure you have already completed your KYC or KYB, and already + * activated your fiat service on our website. Weight: 45000 + * + * @throws ApiException if the Api call fails + */ + public void depositExample() throws ApiException { + DepositRequest depositRequest = new DepositRequest(); + depositRequest.currency(""); + depositRequest.apiPaymentMethod(""); + depositRequest.amount(0L); + ApiResponse response = getApi().deposit(depositRequest); + System.out.println(response.getData()); + } +} diff --git a/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/FiatWithdrawExample.java b/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/FiatWithdrawExample.java new file mode 100644 index 00000000..b58f2ae9 --- /dev/null +++ b/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/FiatWithdrawExample.java @@ -0,0 +1,62 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.fiat.rest.fiat; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.fiat.rest.FiatRestApiUtil; +import com.binance.connector.client.fiat.rest.api.FiatRestApi; +import com.binance.connector.client.fiat.rest.model.AccountInfo; +import com.binance.connector.client.fiat.rest.model.FiatWithdrawRequest; +import com.binance.connector.client.fiat.rest.model.FiatWithdrawResponse; + +/** API examples for FiatApi */ +public class FiatWithdrawExample { + private FiatRestApi api; + + public FiatRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = FiatRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new FiatRestApi(clientConfiguration); + } + return api; + } + + /** + * Fiat Withdraw(WITHDRAW) + * + *

Submit withdraw request, in this version, we only support BRL withdrawal via + * bank_transfer. You need to call this api first, and call query order detail api in a loop to + * get the status of the order until this order is successful. Before calling this api, please + * make sure you have already completed your KYC or KYB, and already activated your fiat service + * on our website. you need to bind your bank account on web/app before using the corresponding + * account number Weight: 45000 + * + * @throws ApiException if the Api call fails + */ + public void fiatWithdrawExample() throws ApiException { + FiatWithdrawRequest fiatWithdrawRequest = new FiatWithdrawRequest(); + fiatWithdrawRequest.currency(""); + fiatWithdrawRequest.apiPaymentMethod(""); + fiatWithdrawRequest.amount(0L); + fiatWithdrawRequest.accountInfo(new AccountInfo()); + ApiResponse response = getApi().fiatWithdraw(fiatWithdrawRequest); + System.out.println(response.getData()); + } +} diff --git a/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/GetFiatDepositWithdrawHistoryExample.java b/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/GetFiatDepositWithdrawHistoryExample.java index de36754e..cfa27163 100644 --- a/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/GetFiatDepositWithdrawHistoryExample.java +++ b/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/GetFiatDepositWithdrawHistoryExample.java @@ -40,7 +40,7 @@ public FiatRestApi getApi() { * Get Fiat Deposit/Withdraw History (USER_DATA) * *

Get Fiat Deposit/Withdraw History * If beginTime and endTime are not sent, the recent - * 30-day data will be returned. Weight: 90000 + * 30-day data will be returned. Weight: 45000 * * @throws ApiException if the Api call fails */ diff --git a/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/GetOrderDetailExample.java b/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/GetOrderDetailExample.java new file mode 100644 index 00000000..4cc94eb7 --- /dev/null +++ b/examples/fiat/src/main/java/com/binance/connector/client/fiat/rest/fiat/GetOrderDetailExample.java @@ -0,0 +1,53 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.fiat.rest.fiat; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.fiat.rest.FiatRestApiUtil; +import com.binance.connector.client.fiat.rest.api.FiatRestApi; +import com.binance.connector.client.fiat.rest.model.GetOrderDetailResponse; + +/** API examples for FiatApi */ +public class GetOrderDetailExample { + private FiatRestApi api; + + public FiatRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = FiatRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new FiatRestApi(clientConfiguration); + } + return api; + } + + /** + * Get Order Detail(USER_DATA) + * + *

Get Order Detail Before calling this api, please make sure you have already completed your + * KYC or KYB, and already activated your fiat service on our website. Weight: 1 + * + * @throws ApiException if the Api call fails + */ + public void getOrderDetailExample() throws ApiException { + String orderNo = ""; + Long recvWindow = 5000L; + ApiResponse response = getApi().getOrderDetail(orderNo, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/margin-trading/pom.xml b/examples/margin-trading/pom.xml index c20d8754..684d9dac 100644 --- a/examples/margin-trading/pom.xml +++ b/examples/margin-trading/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-margin-trading - 4.0.0 + 5.0.0 \ No newline at end of file diff --git a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/CreateSpecialKeyExample.java b/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/CreateSpecialKeyExample.java index 8bf64d6f..75e5a0a5 100644 --- a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/CreateSpecialKeyExample.java +++ b/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/CreateSpecialKeyExample.java @@ -41,21 +41,18 @@ public MarginTradingRestApi getApi() { /** * Create Special Key(Low-Latency Trading)(TRADE) * - *

**Binance Margin offers low-latency trading through a [special + *

- Binance Margin offers low-latency trading through a [special * key](https://www.binance.com/en/support/faq/frequently-asked-questions-on-margin-special-api-key-3208663e900d4d2e9fec4140e1832f4e), - * available exclusively to users with VIP level 4 or higher. ** **If you are VIP level 3 or - * below, please contact your VIP manager for eligibility criterias.** We support several types - * of API keys: * Ed25519 (recommended) * HMAC * RSA We recommend to **use Ed25519 API keys** as - * it should provide the best performance and security out of all supported key types. We accept - * PKCS#8 (BEGIN PUBLIC KEY). For how to generate an RSA key pair to send API requests on - * Binance. Please refer to the document below + * available exclusively to users with VIP level 4 or higher. - If you are VIP level 3 or below, + * please contact your VIP manager for eligibility criterias.** **Supported Products:** - Cross + * Margin - Isolated Margin - Portfolio Margin Pro - Cross Margin Pro (Additional agreement + * required and subject to meeting eligibility criteria) **Unsupported Products:** - Portfolio + * Margin We support several types of API keys: * Ed25519 (recommended) * HMAC * RSA We + * recommend to **use Ed25519 API keys** as it should provide the best performance and security + * out of all supported key types. We accept PKCS#8 (BEGIN PUBLIC KEY). For how to generate an + * RSA key pair to send API requests on Binance. Please refer to the document below * [FAQ](https://www.binance.com/en/support/faq/how-to-generate-an-rsa-key-pair-to-send-api-requests-on-binance-2b79728f331e43079b27440d9d15c5db) - * . Read [REST - * API](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#signed-trade-and-user_data-endpoint-security) - * or [WebSocket - * API](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md#request-security) - * documentation to learn how to use different API keys You need to enable Permits “Enable Spot - * & Margin Trading” option for the API Key which requests this endpoint. Weight: 1(UID) + * . Weight: 1(UID) * * @throws ApiException if the Api call fails */ diff --git a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/KeepaliveIsolatedMarginUserDataStreamExample.java b/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/KeepaliveIsolatedMarginUserDataStreamExample.java deleted file mode 100644 index 0e5b1c01..00000000 --- a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/KeepaliveIsolatedMarginUserDataStreamExample.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.margin_trading.rest.tradedatastream; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.margin_trading.rest.MarginTradingRestApiUtil; -import com.binance.connector.client.margin_trading.rest.api.MarginTradingRestApi; -import com.binance.connector.client.margin_trading.rest.model.KeepaliveIsolatedMarginUserDataStreamRequest; - -/** API examples for TradeDataStreamApi */ -public class KeepaliveIsolatedMarginUserDataStreamExample { - private MarginTradingRestApi api; - - public MarginTradingRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - MarginTradingRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new MarginTradingRestApi(clientConfiguration); - } - return api; - } - - /** - * Keepalive Isolated Margin User Data Stream (USER_STREAM) - * - *

Keepalive an isolated margin user data stream to prevent a time out. Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void keepaliveIsolatedMarginUserDataStreamExample() throws ApiException { - KeepaliveIsolatedMarginUserDataStreamRequest keepaliveIsolatedMarginUserDataStreamRequest = - new KeepaliveIsolatedMarginUserDataStreamRequest(); - keepaliveIsolatedMarginUserDataStreamRequest.symbol(""); - keepaliveIsolatedMarginUserDataStreamRequest.listenKey(""); - getApi().keepaliveIsolatedMarginUserDataStream( - keepaliveIsolatedMarginUserDataStreamRequest); - } -} diff --git a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/KeepaliveMarginUserDataStreamExample.java b/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/KeepaliveMarginUserDataStreamExample.java deleted file mode 100644 index cc625d5f..00000000 --- a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/KeepaliveMarginUserDataStreamExample.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.margin_trading.rest.tradedatastream; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.margin_trading.rest.MarginTradingRestApiUtil; -import com.binance.connector.client.margin_trading.rest.api.MarginTradingRestApi; -import com.binance.connector.client.margin_trading.rest.model.KeepaliveMarginUserDataStreamRequest; - -/** API examples for TradeDataStreamApi */ -public class KeepaliveMarginUserDataStreamExample { - private MarginTradingRestApi api; - - public MarginTradingRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - MarginTradingRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new MarginTradingRestApi(clientConfiguration); - } - return api; - } - - /** - * Keepalive Margin User Data Stream (USER_STREAM) - * - *

Keepalive a margin user data stream to prevent a time out. Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void keepaliveMarginUserDataStreamExample() throws ApiException { - KeepaliveMarginUserDataStreamRequest keepaliveMarginUserDataStreamRequest = - new KeepaliveMarginUserDataStreamRequest(); - keepaliveMarginUserDataStreamRequest.listenKey(""); - getApi().keepaliveMarginUserDataStream(keepaliveMarginUserDataStreamRequest); - } -} diff --git a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/StartIsolatedMarginUserDataStreamExample.java b/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/StartIsolatedMarginUserDataStreamExample.java deleted file mode 100644 index bf9d6d00..00000000 --- a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/StartIsolatedMarginUserDataStreamExample.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.margin_trading.rest.tradedatastream; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.margin_trading.rest.MarginTradingRestApiUtil; -import com.binance.connector.client.margin_trading.rest.api.MarginTradingRestApi; -import com.binance.connector.client.margin_trading.rest.model.StartIsolatedMarginUserDataStreamRequest; -import com.binance.connector.client.margin_trading.rest.model.StartIsolatedMarginUserDataStreamResponse; - -/** API examples for TradeDataStreamApi */ -public class StartIsolatedMarginUserDataStreamExample { - private MarginTradingRestApi api; - - public MarginTradingRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - MarginTradingRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new MarginTradingRestApi(clientConfiguration); - } - return api; - } - - /** - * Start Isolated Margin User Data Stream (USER_STREAM) - * - *

Start a new isolated margin user data stream. The stream will close after 60 minutes - * unless a keepalive is sent. If the account has an active listenKey, that listenKey will be - * returned and its validity will be extended for 60 minutes. Weight: 1 - * - * @throws ApiException if the Api call fails - */ - public void startIsolatedMarginUserDataStreamExample() throws ApiException { - StartIsolatedMarginUserDataStreamRequest startIsolatedMarginUserDataStreamRequest = - new StartIsolatedMarginUserDataStreamRequest(); - startIsolatedMarginUserDataStreamRequest.symbol(""); - ApiResponse response = - getApi().startIsolatedMarginUserDataStream( - startIsolatedMarginUserDataStreamRequest); - System.out.println(response.getData()); - } -} diff --git a/examples/simple-earn/pom.xml b/examples/simple-earn/pom.xml index 9c9074b4..5aa40d37 100644 --- a/examples/simple-earn/pom.xml +++ b/examples/simple-earn/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-simple-earn - 3.0.0 + 4.0.0 \ No newline at end of file diff --git a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/CloseMarginUserDataStreamExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdAccountExample.java similarity index 57% rename from examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/CloseMarginUserDataStreamExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdAccountExample.java index b21968a3..36410b63 100644 --- a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/CloseMarginUserDataStreamExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdAccountExample.java @@ -10,40 +10,43 @@ * Do not edit the class manually. */ -package com.binance.connector.client.margin_trading.rest.tradedatastream; +package com.binance.connector.client.simple_earn.rest.bfusd; import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; import com.binance.connector.client.common.configuration.ClientConfiguration; import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.margin_trading.rest.MarginTradingRestApiUtil; -import com.binance.connector.client.margin_trading.rest.api.MarginTradingRestApi; +import com.binance.connector.client.simple_earn.rest.SimpleEarnRestApiUtil; +import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdAccountResponse; -/** API examples for TradeDataStreamApi */ -public class CloseMarginUserDataStreamExample { - private MarginTradingRestApi api; +/** API examples for BfusdApi */ +public class GetBfusdAccountExample { + private SimpleEarnRestApi api; - public MarginTradingRestApi getApi() { + public SimpleEarnRestApi getApi() { if (api == null) { ClientConfiguration clientConfiguration = - MarginTradingRestApiUtil.getClientConfiguration(); + SimpleEarnRestApiUtil.getClientConfiguration(); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("path/to/private.key"); clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new MarginTradingRestApi(clientConfiguration); + api = new SimpleEarnRestApi(clientConfiguration); } return api; } /** - * Close Margin User Data Stream (USER_STREAM) + * Get BFUSD Account (USER_DATA) * - *

Close out a Margin user data stream. Weight: 3000 + *

Get BFUSD account information. Weight: 150 * * @throws ApiException if the Api call fails */ - public void closeMarginUserDataStreamExample() throws ApiException { - String listenkey = ""; - getApi().closeMarginUserDataStream(listenkey); + public void getBfusdAccountExample() throws ApiException { + Long recvWindow = 5000L; + ApiResponse response = getApi().getBfusdAccount(recvWindow); + System.out.println(response.getData()); } } diff --git a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/CloseIsolatedMarginUserDataStreamExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdQuotaDetailsExample.java similarity index 55% rename from examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/CloseIsolatedMarginUserDataStreamExample.java rename to examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdQuotaDetailsExample.java index df5518cd..8f3068ff 100644 --- a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/tradedatastream/CloseIsolatedMarginUserDataStreamExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdQuotaDetailsExample.java @@ -10,41 +10,45 @@ * Do not edit the class manually. */ -package com.binance.connector.client.margin_trading.rest.tradedatastream; +package com.binance.connector.client.simple_earn.rest.bfusd; import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; import com.binance.connector.client.common.configuration.ClientConfiguration; import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.margin_trading.rest.MarginTradingRestApiUtil; -import com.binance.connector.client.margin_trading.rest.api.MarginTradingRestApi; +import com.binance.connector.client.simple_earn.rest.SimpleEarnRestApiUtil; +import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdQuotaDetailsResponse; -/** API examples for TradeDataStreamApi */ -public class CloseIsolatedMarginUserDataStreamExample { - private MarginTradingRestApi api; +/** API examples for BfusdApi */ +public class GetBfusdQuotaDetailsExample { + private SimpleEarnRestApi api; - public MarginTradingRestApi getApi() { + public SimpleEarnRestApi getApi() { if (api == null) { ClientConfiguration clientConfiguration = - MarginTradingRestApiUtil.getClientConfiguration(); + SimpleEarnRestApiUtil.getClientConfiguration(); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); signatureConfiguration.setPrivateKey("path/to/private.key"); clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new MarginTradingRestApi(clientConfiguration); + api = new SimpleEarnRestApi(clientConfiguration); } return api; } /** - * Close Isolated Margin User Data Stream (USER_STREAM) + * Get BFUSD Quota Details (USER_DATA) * - *

Close out a isolated margin user data stream. Weight: 3000 + *

Get BFUSD quota details including fast redemption quota and standard redemption quota. + * Weight: 150 * * @throws ApiException if the Api call fails */ - public void closeIsolatedMarginUserDataStreamExample() throws ApiException { - String symbol = ""; - String listenkey = ""; - getApi().closeIsolatedMarginUserDataStream(symbol, listenkey); + public void getBfusdQuotaDetailsExample() throws ApiException { + Long recvWindow = 5000L; + ApiResponse response = + getApi().getBfusdQuotaDetails(recvWindow); + System.out.println(response.getData()); } } diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdRateHistoryExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdRateHistoryExample.java new file mode 100644 index 00000000..6fd200f6 --- /dev/null +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdRateHistoryExample.java @@ -0,0 +1,65 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.bfusd; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.simple_earn.rest.SimpleEarnRestApiUtil; +import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdRateHistoryResponse; + +/** API examples for BfusdApi */ +public class GetBfusdRateHistoryExample { + private SimpleEarnRestApi api; + + public SimpleEarnRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + SimpleEarnRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new SimpleEarnRestApi(clientConfiguration); + } + return api; + } + + /** + * Get BFUSD Rate History (USER_DATA) + * + *

Get BFUSD rate history sorted by descending order. * The time between + * `startTime` and `endTime` cannot be longer than 6 months. * If + * `startTime` and `endTime` are both not sent, then the last 30 days' + * data will be returned. * If `startTime` is sent but `endTime` is not + * sent, `endTime` will default to current time, and results from + * `startTime` onward will be returned. * If `endTime` is sent but + * `startTime` is not sent, `startTime` defaults to the current time minus + * one month, and data between `startTime` and `endTime` will be returned. + * Weight: 150 + * + * @throws ApiException if the Api call fails + */ + public void getBfusdRateHistoryExample() throws ApiException { + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + getApi().getBfusdRateHistory(startTime, endTime, current, size, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdRedemptionHistoryExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdRedemptionHistoryExample.java new file mode 100644 index 00000000..213ae8dc --- /dev/null +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdRedemptionHistoryExample.java @@ -0,0 +1,64 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.bfusd; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.simple_earn.rest.SimpleEarnRestApiUtil; +import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdRedemptionHistoryResponse; + +/** API examples for BfusdApi */ +public class GetBfusdRedemptionHistoryExample { + private SimpleEarnRestApi api; + + public SimpleEarnRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + SimpleEarnRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new SimpleEarnRestApi(clientConfiguration); + } + return api; + } + + /** + * Get BFUSD Redemption History (USER_DATA) + * + *

Get BFUSD redemption history. * The time between `startTime` and + * `endTime` cannot be longer than 6 months. * If `startTime` and + * `endTime` are both not sent, then the last 30 days' data will be returned. * If + * `startTime` is sent but `endTime` is not sent, `endTime` will + * default to current time, and results from `startTime` onward will be returned. * If + * `endTime` is sent but `startTime` is not sent, `startTime` + * defaults to the current time minus one month, and data between `startTime` and + * `endTime` will be returned. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + public void getBfusdRedemptionHistoryExample() throws ApiException { + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + getApi().getBfusdRedemptionHistory(startTime, endTime, current, size, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdRewardsHistoryExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdRewardsHistoryExample.java new file mode 100644 index 00000000..0680754e --- /dev/null +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdRewardsHistoryExample.java @@ -0,0 +1,64 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.bfusd; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.simple_earn.rest.SimpleEarnRestApiUtil; +import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdRewardsHistoryResponse; + +/** API examples for BfusdApi */ +public class GetBfusdRewardsHistoryExample { + private SimpleEarnRestApi api; + + public SimpleEarnRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + SimpleEarnRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new SimpleEarnRestApi(clientConfiguration); + } + return api; + } + + /** + * Get BFUSD Rewards History (USER_DATA) + * + *

Get BFUSD rewards history. * The time between `startTime` and + * `endTime` cannot be longer than 6 months. * If `startTime` and + * `endTime` are both not sent, then the last 30 days' data will be returned. * If + * `startTime` is sent but `endTime` is not sent, `endTime` will + * default to current time, and results from `startTime` onward will be returned. * If + * `endTime` is sent but `startTime` is not sent, `startTime` + * defaults to the current time minus one month, and data between `startTime` and + * `endTime` will be returned. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + public void getBfusdRewardsHistoryExample() throws ApiException { + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + getApi().getBfusdRewardsHistory(startTime, endTime, current, size, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdSubscriptionHistoryExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdSubscriptionHistoryExample.java new file mode 100644 index 00000000..1d7c5855 --- /dev/null +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/GetBfusdSubscriptionHistoryExample.java @@ -0,0 +1,66 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.bfusd; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.simple_earn.rest.SimpleEarnRestApiUtil; +import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; +import com.binance.connector.client.simple_earn.rest.model.GetBfusdSubscriptionHistoryResponse; + +/** API examples for BfusdApi */ +public class GetBfusdSubscriptionHistoryExample { + private SimpleEarnRestApi api; + + public SimpleEarnRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + SimpleEarnRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new SimpleEarnRestApi(clientConfiguration); + } + return api; + } + + /** + * Get BFUSD subscription history(USER_DATA) + * + *

Get BFUSD subscription history * The time between `startTime` and + * `endTime` cannot be longer than 6 months. * If `startTime` and + * `endTime` are both not sent, then the last 30 days' data will be returned. * If + * `startTime` is sent but `endTime` is not sent, `endTime` will + * default to current time, and results from `startTime` onward will be returned. * If + * `endTime` is sent but `startTime` is not sent, `startTime` + * defaults to the current time advanced by one month, and data between `startTime` + * and `endTime` will be returned. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + public void getBfusdSubscriptionHistoryExample() throws ApiException { + String asset = ""; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long size = 10L; + Long recvWindow = 5000L; + ApiResponse response = + getApi().getBfusdSubscriptionHistory( + asset, startTime, endTime, current, size, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/RedeemBfusdExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/RedeemBfusdExample.java new file mode 100644 index 00000000..b0e270fe --- /dev/null +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/RedeemBfusdExample.java @@ -0,0 +1,56 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.bfusd; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.simple_earn.rest.SimpleEarnRestApiUtil; +import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; +import com.binance.connector.client.simple_earn.rest.model.RedeemBfusdRequest; +import com.binance.connector.client.simple_earn.rest.model.RedeemBfusdResponse; + +/** API examples for BfusdApi */ +public class RedeemBfusdExample { + private SimpleEarnRestApi api; + + public SimpleEarnRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + SimpleEarnRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new SimpleEarnRestApi(clientConfiguration); + } + return api; + } + + /** + * Redeem BFUSD(TRADE) + * + *

Redeem BFUSD to USDT * You need to open Enable Spot & Margin Trading permission for + * the API Key which requests this endpoint. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + public void redeemBfusdExample() throws ApiException { + RedeemBfusdRequest redeemBfusdRequest = new RedeemBfusdRequest(); + redeemBfusdRequest.amount(1.0d); + redeemBfusdRequest.type("s"); + ApiResponse response = getApi().redeemBfusd(redeemBfusdRequest); + System.out.println(response.getData()); + } +} diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/SubscribeBfusdExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/SubscribeBfusdExample.java new file mode 100644 index 00000000..34ab3365 --- /dev/null +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/bfusd/SubscribeBfusdExample.java @@ -0,0 +1,57 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.simple_earn.rest.bfusd; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.simple_earn.rest.SimpleEarnRestApiUtil; +import com.binance.connector.client.simple_earn.rest.api.SimpleEarnRestApi; +import com.binance.connector.client.simple_earn.rest.model.SubscribeBfusdRequest; +import com.binance.connector.client.simple_earn.rest.model.SubscribeBfusdResponse; + +/** API examples for BfusdApi */ +public class SubscribeBfusdExample { + private SimpleEarnRestApi api; + + public SimpleEarnRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + SimpleEarnRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new SimpleEarnRestApi(clientConfiguration); + } + return api; + } + + /** + * Subscribe BFUSD(TRADE) + * + *

Subscribe BFUSD * You need to open Enable Spot & Margin Trading permission for the API + * Key which requests this endpoint. Weight: 150 + * + * @throws ApiException if the Api call fails + */ + public void subscribeBfusdExample() throws ApiException { + SubscribeBfusdRequest subscribeBfusdRequest = new SubscribeBfusdRequest(); + subscribeBfusdRequest.asset(""); + subscribeBfusdRequest.amount(1.0d); + ApiResponse response = + getApi().subscribeBfusd(subscribeBfusdRequest); + System.out.println(response.getData()); + } +} diff --git a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SetLockedProductRedeemOptionExample.java b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SetLockedProductRedeemOptionExample.java index 74b6c3ac..e778b392 100644 --- a/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SetLockedProductRedeemOptionExample.java +++ b/examples/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/flexiblelocked/SetLockedProductRedeemOptionExample.java @@ -49,7 +49,7 @@ public void setLockedProductRedeemOptionExample() throws ApiException { SetLockedProductRedeemOptionRequest setLockedProductRedeemOptionRequest = new SetLockedProductRedeemOptionRequest(); setLockedProductRedeemOptionRequest.positionId("1"); - setLockedProductRedeemOptionRequest.redeemTo(""); + setLockedProductRedeemOptionRequest.redeemTo("SPOT"); ApiResponse response = getApi().setLockedProductRedeemOption(setLockedProductRedeemOptionRequest); System.out.println(response.getData()); diff --git a/examples/staking/pom.xml b/examples/staking/pom.xml index 1c61c1d6..3f3ffa9d 100644 --- a/examples/staking/pom.xml +++ b/examples/staking/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-staking - 3.0.0 + 4.0.0 \ No newline at end of file