diff --git a/MIGRATION.md b/MIGRATION.md index def08b03..0a048fb8 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -37,7 +37,7 @@ For Spot (Spot package): io.github.binance binance-spot - 2.0.0 + 3.0.0 ``` diff --git a/README.md b/README.md index 009656a7..b3931c93 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Each connector is published as a separate maven dependency. For example: io.github.binance binance-spot - 2.0.0 + 3.0.0 ``` diff --git a/clients/derivatives-trading-coin-futures/CHANGELOG.md b/clients/derivatives-trading-coin-futures/CHANGELOG.md index 0e9fdc59..c5914da1 100644 --- a/clients/derivatives-trading-coin-futures/CHANGELOG.md +++ b/clients/derivatives-trading-coin-futures/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.2.1 - 2025-06-24 + +### Changed (1) + +- Fixed cases where the response can be an object or an array + ## 1.2.0 - 2025-05-13 - Add proxy authentication for websocket diff --git a/clients/derivatives-trading-coin-futures/docs/GetFuturesOrderHistoryDownloadLinkByIdResponse1.md b/clients/derivatives-trading-coin-futures/docs/GetFuturesOrderHistoryDownloadLinkByIdResponse1.md deleted file mode 100644 index ec6522df..00000000 --- a/clients/derivatives-trading-coin-futures/docs/GetFuturesOrderHistoryDownloadLinkByIdResponse1.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# GetFuturesOrderHistoryDownloadLinkByIdResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-coin-futures/docs/GetFuturesOrderHistoryDownloadLinkByIdResponse2.md b/clients/derivatives-trading-coin-futures/docs/GetFuturesOrderHistoryDownloadLinkByIdResponse2.md deleted file mode 100644 index f17059fb..00000000 --- a/clients/derivatives-trading-coin-futures/docs/GetFuturesOrderHistoryDownloadLinkByIdResponse2.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# GetFuturesOrderHistoryDownloadLinkByIdResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-coin-futures/docs/GetFuturesTradeDownloadLinkByIdResponse1.md b/clients/derivatives-trading-coin-futures/docs/GetFuturesTradeDownloadLinkByIdResponse1.md deleted file mode 100644 index b213369d..00000000 --- a/clients/derivatives-trading-coin-futures/docs/GetFuturesTradeDownloadLinkByIdResponse1.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# GetFuturesTradeDownloadLinkByIdResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-coin-futures/docs/GetFuturesTradeDownloadLinkByIdResponse2.md b/clients/derivatives-trading-coin-futures/docs/GetFuturesTradeDownloadLinkByIdResponse2.md deleted file mode 100644 index 1fd77926..00000000 --- a/clients/derivatives-trading-coin-futures/docs/GetFuturesTradeDownloadLinkByIdResponse2.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# GetFuturesTradeDownloadLinkByIdResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-coin-futures/docs/GetFuturesTransactionHistoryDownloadLinkByIdResponse1.md b/clients/derivatives-trading-coin-futures/docs/GetFuturesTransactionHistoryDownloadLinkByIdResponse1.md deleted file mode 100644 index db16b7cf..00000000 --- a/clients/derivatives-trading-coin-futures/docs/GetFuturesTransactionHistoryDownloadLinkByIdResponse1.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# GetFuturesTransactionHistoryDownloadLinkByIdResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-coin-futures/docs/GetFuturesTransactionHistoryDownloadLinkByIdResponse2.md b/clients/derivatives-trading-coin-futures/docs/GetFuturesTransactionHistoryDownloadLinkByIdResponse2.md deleted file mode 100644 index cb07e5b4..00000000 --- a/clients/derivatives-trading-coin-futures/docs/GetFuturesTransactionHistoryDownloadLinkByIdResponse2.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# GetFuturesTransactionHistoryDownloadLinkByIdResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **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 95f5c1b9..0a881229 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 - 1.2.0 + 1.2.1 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-coin-futures - 1.2.0 + 1.2.1 ``` diff --git a/clients/derivatives-trading-coin-futures/example_rest.md b/clients/derivatives-trading-coin-futures/example_rest.md index 3003e6a8..1c584837 100644 --- a/clients/derivatives-trading-coin-futures/example_rest.md +++ b/clients/derivatives-trading-coin-futures/example_rest.md @@ -114,7 +114,7 @@ [PUT /dapi/v1/batchOrders](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Multiple-Orders) - modifyMultipleOrders - [ModifyMultipleOrdersExample.java:52](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/ModifyMultipleOrdersExample.java#L52) -[PUT /dapi/v1/order](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Order) - modifyOrder - [ModifyOrderExample.java:59](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/ModifyOrderExample.java#L59) +[PUT /dapi/v1/order](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Order) - modifyOrder - [ModifyOrderExample.java:58](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/ModifyOrderExample.java#L58) [POST /dapi/v1/order](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/New-Order) - newOrder - [NewOrderExample.java:85](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/NewOrderExample.java#L85) diff --git a/clients/derivatives-trading-coin-futures/pom.xml b/clients/derivatives-trading-coin-futures/pom.xml index 6c4befce..2d504ea1 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 - 1.2.0 + 1.2.1 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 1.2.0 + 1.2.1 \ No newline at end of file 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 be910074..e7e87373 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/1.2.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/1.2.1 (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/DerivativesTradingCoinFuturesRestApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/DerivativesTradingCoinFuturesRestApi.java index da781d93..0e21723a 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/DerivativesTradingCoinFuturesRestApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/DerivativesTradingCoinFuturesRestApi.java @@ -1721,8 +1721,8 @@ public ApiResponse modifyMultipleOrders( * However the order will be cancelled by the amendment in the following situations: * when the * order is in partially filled status and the new `quantity` <= * `executedQty` * When the order is `GTX` and the new price will cause it - * to be executed immediately * One order can only be modfied for less than 10000 times * Modify - * order will set `selfTradePreventionMode` to `NONE` Weight: 1 + * to be executed immediately * One order can only be modfied for less than 10000 times Weight: + * 1 * * @param modifyOrderRequest (required) * @return ApiResponse<ModifyOrderResponse> 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 b504a06f..a10fbf58 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/1.2.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/1.2.1 (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 7834735b..acf7d21d 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/1.2.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/1.2.1 (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 7b8a05f0..51b6d7ff 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/1.2.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/1.2.1 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -2692,8 +2692,8 @@ private okhttp3.Call modifyOrderValidateBeforeCall(ModifyOrderRequest modifyOrde * However the order will be cancelled by the amendment in the following situations: * when the * order is in partially filled status and the new `quantity` <= * `executedQty` * When the order is `GTX` and the new price will cause it - * to be executed immediately * One order can only be modfied for less than 10000 times * Modify - * order will set `selfTradePreventionMode` to `NONE` Weight: 1 + * to be executed immediately * One order can only be modfied for less than 10000 times Weight: + * 1 * * @param modifyOrderRequest (required) * @return ApiResponse<ModifyOrderResponse> 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 933d0b06..0d3eb2a9 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/1.2.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/1.2.1 (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/AccountInformationResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountInformationResponse.java index 3247fa3b..43c22eb5 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountInformationResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountInformationResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -383,18 +381,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AccountInformationResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountInformationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountInformationResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("assets") != null && !jsonObj.get("assets").isJsonNull()) { JsonArray jsonArrayassets = jsonObj.getAsJsonArray("assets"); diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountInformationResponseAssetsInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountInformationResponseAssetsInner.java index aa043bbe..69bb16a3 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountInformationResponseAssetsInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountInformationResponseAssetsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AccountInformationResponseAssetsInner */ @@ -594,19 +592,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountInformationResponseAssetsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountInformationResponseAssetsInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) && !jsonObj.get("asset").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountInformationResponsePositionsInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountInformationResponsePositionsInner.java index a05611c9..0b63b378 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountInformationResponsePositionsInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountInformationResponsePositionsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AccountInformationResponsePositionsInner */ @@ -656,19 +654,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountInformationResponsePositionsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountInformationResponsePositionsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountTradeListResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountTradeListResponse.java index 15a1195e..5f21076e 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountTradeListResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountTradeListResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** AccountTradeListResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to AccountTradeListResponse */ 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) { + AccountTradeListResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!AccountTradeListResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AccountTradeListResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountTradeListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountTradeListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/AccountTradeListResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountTradeListResponseInner.java index 29e60ec3..2f605157 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountTradeListResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AccountTradeListResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AccountTradeListResponseInner */ @@ -653,18 +651,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AccountTradeListResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountTradeListResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountTradeListResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AllOrdersResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AllOrdersResponse.java index 36d4abb8..1b28dbf0 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AllOrdersResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AllOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** AllOrdersResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to AllOrdersResponse */ 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) { + AllOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!AllOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AllOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AllOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AllOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/AllOrdersResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AllOrdersResponseInner.java index dbc392f6..b3152809 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AllOrdersResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AllOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AllOrdersResponseInner */ @@ -985,18 +983,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AllOrdersResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AllOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AllOrdersResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AutoCancelAllOpenOrdersRequest.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AutoCancelAllOpenOrdersRequest.java index a70fd7f6..2c2da98c 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AutoCancelAllOpenOrdersRequest.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AutoCancelAllOpenOrdersRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AutoCancelAllOpenOrdersRequest */ @@ -221,18 +219,6 @@ 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 (!AutoCancelAllOpenOrdersRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AutoCancelAllOpenOrdersRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AutoCancelAllOpenOrdersRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BasisResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BasisResponse.java index 564fce94..41403e8e 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BasisResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BasisResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** BasisResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to BasisResponse */ 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) { + BasisResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!BasisResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti BasisResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!BasisResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `BasisResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/BasisResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BasisResponseInner.java index d24cf7e6..0106f097 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BasisResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BasisResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** BasisResponseInner */ @@ -386,18 +384,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti BasisResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!BasisResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `BasisResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("indexPrice") != null && !jsonObj.get("indexPrice").isJsonNull()) && !jsonObj.get("indexPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BatchOrders.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BatchOrders.java index 6acb5a3b..38627f40 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BatchOrders.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BatchOrders.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** BatchOrders */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to BatchOrders */ 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) { + BatchOrdersInner.validateJsonElement(element); + } if (jsonElement == null) { if (!BatchOrders.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti BatchOrders.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!BatchOrders.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `BatchOrders` properties. JSON: %s", - entry.getKey(), jsonElement.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/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 10cba3c8..3009619d 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 @@ -30,9 +30,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** BatchOrdersInner */ @@ -399,18 +397,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti BatchOrdersInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!BatchOrdersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `BatchOrdersInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("origClientOrderId") != null && !jsonObj.get("origClientOrderId").isJsonNull()) diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelAllOpenOrdersResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelAllOpenOrdersResponse.java index 40c7e793..e8892fac 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelAllOpenOrdersResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelAllOpenOrdersResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelAllOpenOrdersResponse */ @@ -182,18 +180,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CancelAllOpenOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelAllOpenOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelAllOpenOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelMultipleOrdersResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelMultipleOrdersResponse.java index 2a611e45..c130929f 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelMultipleOrdersResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelMultipleOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** CancelMultipleOrdersResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * CancelMultipleOrdersResponse */ 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) { + CancelMultipleOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!CancelMultipleOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CancelMultipleOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelMultipleOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelMultipleOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/CancelMultipleOrdersResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelMultipleOrdersResponseInner.java index f7d155be..334de5f1 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelMultipleOrdersResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelMultipleOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelMultipleOrdersResponseInner */ @@ -1038,18 +1036,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelMultipleOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelMultipleOrdersResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelOrderResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelOrderResponse.java index d4b4d389..ae4c1b0e 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelOrderResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelOrderResponse */ @@ -983,18 +981,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CancelOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangeInitialLeverageRequest.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangeInitialLeverageRequest.java index 9ef89dda..8b749d87 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangeInitialLeverageRequest.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangeInitialLeverageRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeInitialLeverageRequest */ @@ -220,18 +218,6 @@ 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 (!ChangeInitialLeverageRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeInitialLeverageRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ChangeInitialLeverageRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangeInitialLeverageResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangeInitialLeverageResponse.java index 95dda0b5..1b104258 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangeInitialLeverageResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangeInitialLeverageResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeInitialLeverageResponse */ @@ -215,18 +213,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ChangeInitialLeverageResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ChangeInitialLeverageResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeInitialLeverageResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("maxQty") != null && !jsonObj.get("maxQty").isJsonNull()) && !jsonObj.get("maxQty").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangeMarginTypeRequest.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangeMarginTypeRequest.java index 426c508c..9901ef95 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangeMarginTypeRequest.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangeMarginTypeRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeMarginTypeRequest */ @@ -220,18 +218,6 @@ 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 (!ChangeMarginTypeRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeMarginTypeRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ChangeMarginTypeRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangeMarginTypeResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangeMarginTypeResponse.java index 30db4d15..15459354 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangeMarginTypeResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangeMarginTypeResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeMarginTypeResponse */ @@ -181,18 +179,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ChangeMarginTypeResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ChangeMarginTypeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeMarginTypeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangePositionModeRequest.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangePositionModeRequest.java index f84df9cb..25a5f732 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangePositionModeRequest.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangePositionModeRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangePositionModeRequest */ @@ -185,18 +183,6 @@ 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 (!ChangePositionModeRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangePositionModeRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ChangePositionModeRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangePositionModeResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangePositionModeResponse.java index b445cfa1..28aac343 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangePositionModeResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ChangePositionModeResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangePositionModeResponse */ @@ -181,18 +179,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ChangePositionModeResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ChangePositionModeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangePositionModeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CheckServerTimeResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CheckServerTimeResponse.java index 99792861..31222732 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CheckServerTimeResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CheckServerTimeResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CheckServerTimeResponse */ @@ -149,18 +147,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CheckServerTimeResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CheckServerTimeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CheckServerTimeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ClassicPortfolioMarginAccountInformationResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ClassicPortfolioMarginAccountInformationResponse.java index 6ec989f1..7c2de1b7 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ClassicPortfolioMarginAccountInformationResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ClassicPortfolioMarginAccountInformationResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ClassicPortfolioMarginAccountInformationResponse */ @@ -233,20 +231,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ClassicPortfolioMarginAccountInformationResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ClassicPortfolioMarginAccountInformationResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("maxWithdrawAmountUSD") != null && !jsonObj.get("maxWithdrawAmountUSD").isJsonNull()) diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CompressedAggregateTradesListResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CompressedAggregateTradesListResponse.java index f1225672..48585a8d 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CompressedAggregateTradesListResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CompressedAggregateTradesListResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** CompressedAggregateTradesListResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * CompressedAggregateTradesListResponse */ 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) { + CompressedAggregateTradesListResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!CompressedAggregateTradesListResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,19 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CompressedAggregateTradesListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CompressedAggregateTradesListResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.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/rest/model/CompressedAggregateTradesListResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CompressedAggregateTradesListResponseInner.java index 4c75d767..51b668b7 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CompressedAggregateTradesListResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CompressedAggregateTradesListResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CompressedAggregateTradesListResponseInner */ @@ -358,20 +356,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CompressedAggregateTradesListResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CompressedAggregateTradesListResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) && !jsonObj.get("p").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ContinuousContractKlineCandlestickDataResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ContinuousContractKlineCandlestickDataResponse.java index 129c7662..87d8fe3c 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ContinuousContractKlineCandlestickDataResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ContinuousContractKlineCandlestickDataResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** ContinuousContractKlineCandlestickDataResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * ContinuousContractKlineCandlestickDataResponse */ 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) { + ContinuousContractKlineCandlestickDataResponseItem.validateJsonElement(element); + } if (jsonElement == null) { if (!ContinuousContractKlineCandlestickDataResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -122,20 +133,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ContinuousContractKlineCandlestickDataResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ContinuousContractKlineCandlestickDataResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/ContinuousContractKlineCandlestickDataResponseItem.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ContinuousContractKlineCandlestickDataResponseItem.java index 4b8d54db..4245d65c 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ContinuousContractKlineCandlestickDataResponseItem.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ContinuousContractKlineCandlestickDataResponseItem.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** ContinuousContractKlineCandlestickDataResponseItem */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * ContinuousContractKlineCandlestickDataResponseItem */ 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) { + ContinuousContractKlineCandlestickDataResponseItemInner.validateJsonElement(element); + } if (jsonElement == null) { if (!ContinuousContractKlineCandlestickDataResponseItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -122,20 +133,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ContinuousContractKlineCandlestickDataResponseItem.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ContinuousContractKlineCandlestickDataResponseItem`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/CurrentAllOpenOrdersResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CurrentAllOpenOrdersResponse.java index 56466f81..3ba95827 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CurrentAllOpenOrdersResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CurrentAllOpenOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** CurrentAllOpenOrdersResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * CurrentAllOpenOrdersResponse */ 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) { + CurrentAllOpenOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!CurrentAllOpenOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CurrentAllOpenOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CurrentAllOpenOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CurrentAllOpenOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/CurrentAllOpenOrdersResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CurrentAllOpenOrdersResponseInner.java index 4e8f5ce4..28dd3b70 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CurrentAllOpenOrdersResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CurrentAllOpenOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CurrentAllOpenOrdersResponseInner */ @@ -972,18 +970,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CurrentAllOpenOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CurrentAllOpenOrdersResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponse.java index 8d3eaa0f..fd996a4b 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -330,18 +328,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ExchangeInformationResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeInformationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeInformationResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the optional json data is an array if present if (jsonObj.get("exchangeFilters") != null diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponseRateLimitsInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponseRateLimitsInner.java index 3cb40145..efd425bb 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponseRateLimitsInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponseRateLimitsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ExchangeInformationResponseRateLimitsInner */ @@ -256,20 +254,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeInformationResponseRateLimitsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeInformationResponseRateLimitsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) && !jsonObj.get("interval").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponseSymbolsInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponseSymbolsInner.java index 485eceeb..2c529d7d 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponseSymbolsInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponseSymbolsInner.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -1072,19 +1070,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeInformationResponseSymbolsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeInformationResponseSymbolsInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("filters") != null && !jsonObj.get("filters").isJsonNull()) { JsonArray jsonArrayfilters = jsonObj.getAsJsonArray("filters"); diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponseSymbolsInnerFiltersInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponseSymbolsInnerFiltersInner.java index 2e5e56bf..4b1695b5 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponseSymbolsInnerFiltersInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ExchangeInformationResponseSymbolsInnerFiltersInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ExchangeInformationResponseSymbolsInnerFiltersInner */ @@ -514,20 +512,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeInformationResponseSymbolsInnerFiltersInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeInformationResponseSymbolsInnerFiltersInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) && !jsonObj.get("filterType").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/FuturesAccountBalanceResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/FuturesAccountBalanceResponse.java index 5d79eea5..698505ca 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/FuturesAccountBalanceResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/FuturesAccountBalanceResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** FuturesAccountBalanceResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * FuturesAccountBalanceResponse */ 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) { + FuturesAccountBalanceResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!FuturesAccountBalanceResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti FuturesAccountBalanceResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FuturesAccountBalanceResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `FuturesAccountBalanceResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/FuturesAccountBalanceResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/FuturesAccountBalanceResponseInner.java index 6f2591af..3abd4458 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/FuturesAccountBalanceResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/FuturesAccountBalanceResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** FuturesAccountBalanceResponseInner */ @@ -401,18 +399,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FuturesAccountBalanceResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `FuturesAccountBalanceResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("accountAlias") != null && !jsonObj.get("accountAlias").isJsonNull()) && !jsonObj.get("accountAlias").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetCurrentPositionModeResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetCurrentPositionModeResponse.java index a97a03b1..4a5893a6 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetCurrentPositionModeResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetCurrentPositionModeResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetCurrentPositionModeResponse */ @@ -153,18 +151,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetCurrentPositionModeResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetCurrentPositionModeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetCurrentPositionModeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetDownloadIdForFuturesOrderHistoryResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetDownloadIdForFuturesOrderHistoryResponse.java index fba94f57..47ef0758 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetDownloadIdForFuturesOrderHistoryResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetDownloadIdForFuturesOrderHistoryResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetDownloadIdForFuturesOrderHistoryResponse */ @@ -196,20 +194,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetDownloadIdForFuturesOrderHistoryResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetDownloadIdForFuturesOrderHistoryResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetDownloadIdForFuturesTradeHistoryResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetDownloadIdForFuturesTradeHistoryResponse.java index 05f6312e..a922cd79 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetDownloadIdForFuturesTradeHistoryResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetDownloadIdForFuturesTradeHistoryResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetDownloadIdForFuturesTradeHistoryResponse */ @@ -196,20 +194,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetDownloadIdForFuturesTradeHistoryResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetDownloadIdForFuturesTradeHistoryResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetDownloadIdForFuturesTransactionHistoryResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetDownloadIdForFuturesTransactionHistoryResponse.java index 2ac1c71b..f76e1fcc 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetDownloadIdForFuturesTransactionHistoryResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetDownloadIdForFuturesTransactionHistoryResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetDownloadIdForFuturesTransactionHistoryResponse */ @@ -199,20 +197,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetDownloadIdForFuturesTransactionHistoryResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetDownloadIdForFuturesTransactionHistoryResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFundingRateHistoryOfPerpetualFuturesResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFundingRateHistoryOfPerpetualFuturesResponse.java index 2cdf852a..4d55b540 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFundingRateHistoryOfPerpetualFuturesResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFundingRateHistoryOfPerpetualFuturesResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** GetFundingRateHistoryOfPerpetualFuturesResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * GetFundingRateHistoryOfPerpetualFuturesResponse */ 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) { + GetFundingRateHistoryOfPerpetualFuturesResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!GetFundingRateHistoryOfPerpetualFuturesResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -123,20 +134,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetFundingRateHistoryOfPerpetualFuturesResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetFundingRateHistoryOfPerpetualFuturesResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/GetFundingRateHistoryOfPerpetualFuturesResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFundingRateHistoryOfPerpetualFuturesResponseInner.java index 89b9f6f8..0c83719e 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFundingRateHistoryOfPerpetualFuturesResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFundingRateHistoryOfPerpetualFuturesResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetFundingRateHistoryOfPerpetualFuturesResponseInner */ @@ -227,20 +225,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetFundingRateHistoryOfPerpetualFuturesResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetFundingRateHistoryOfPerpetualFuturesResponseInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFundingRateInfoResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFundingRateInfoResponse.java index 3c37ac00..4d0c41a8 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFundingRateInfoResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFundingRateInfoResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** GetFundingRateInfoResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to GetFundingRateInfoResponse */ 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) { + GetFundingRateInfoResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!GetFundingRateInfoResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetFundingRateInfoResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetFundingRateInfoResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetFundingRateInfoResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/GetFundingRateInfoResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFundingRateInfoResponseInner.java index cc818769..7a3f7937 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFundingRateInfoResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFundingRateInfoResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetFundingRateInfoResponseInner */ @@ -309,18 +307,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetFundingRateInfoResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetFundingRateInfoResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetFundingRateInfoResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFuturesOrderHistoryDownloadLinkByIdResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFuturesOrderHistoryDownloadLinkByIdResponse.java index b87b191c..f1e54b48 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFuturesOrderHistoryDownloadLinkByIdResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFuturesOrderHistoryDownloadLinkByIdResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetFuturesOrderHistoryDownloadLinkByIdResponse */ @@ -330,20 +328,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetFuturesOrderHistoryDownloadLinkByIdResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetFuturesOrderHistoryDownloadLinkByIdResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFuturesTradeDownloadLinkByIdResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFuturesTradeDownloadLinkByIdResponse.java index 016deba4..e71ca2a1 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFuturesTradeDownloadLinkByIdResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFuturesTradeDownloadLinkByIdResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetFuturesTradeDownloadLinkByIdResponse */ @@ -325,19 +323,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetFuturesTradeDownloadLinkByIdResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetFuturesTradeDownloadLinkByIdResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFuturesTransactionHistoryDownloadLinkByIdResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFuturesTransactionHistoryDownloadLinkByIdResponse.java index 7dd6b893..97dabcff 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFuturesTransactionHistoryDownloadLinkByIdResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetFuturesTransactionHistoryDownloadLinkByIdResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetFuturesTransactionHistoryDownloadLinkByIdResponse */ @@ -335,20 +333,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetFuturesTransactionHistoryDownloadLinkByIdResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetFuturesTransactionHistoryDownloadLinkByIdResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetIncomeHistoryResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetIncomeHistoryResponse.java index ef251656..c5ccceab 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetIncomeHistoryResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetIncomeHistoryResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** GetIncomeHistoryResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to GetIncomeHistoryResponse */ 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) { + GetIncomeHistoryResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!GetIncomeHistoryResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetIncomeHistoryResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetIncomeHistoryResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetIncomeHistoryResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/GetIncomeHistoryResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetIncomeHistoryResponseInner.java index 3a730a35..eeddfe82 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetIncomeHistoryResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetIncomeHistoryResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetIncomeHistoryResponseInner */ @@ -376,18 +374,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetIncomeHistoryResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetIncomeHistoryResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetIncomeHistoryResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponse.java index 01a746aa..65bbed99 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** GetOrderModifyHistoryResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * GetOrderModifyHistoryResponse */ 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) { + GetOrderModifyHistoryResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!GetOrderModifyHistoryResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetOrderModifyHistoryResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetOrderModifyHistoryResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetOrderModifyHistoryResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/GetOrderModifyHistoryResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponseInner.java index a9b82a7f..5500f4b4 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponseInner.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetOrderModifyHistoryResponseInner */ @@ -351,18 +349,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetOrderModifyHistoryResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetOrderModifyHistoryResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendment.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendment.java index 37ddeff1..0538cb9f 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendment.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendment.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetOrderModifyHistoryResponseInnerAmendment */ @@ -227,20 +225,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetOrderModifyHistoryResponseInnerAmendment.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetOrderModifyHistoryResponseInnerAmendment` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `price` if (jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendmentOrigQty.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendmentOrigQty.java index 239e8981..b540ee9b 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendmentOrigQty.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendmentOrigQty.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetOrderModifyHistoryResponseInnerAmendmentOrigQty */ @@ -191,20 +189,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetOrderModifyHistoryResponseInnerAmendmentOrigQty.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetOrderModifyHistoryResponseInnerAmendmentOrigQty`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("before") != null && !jsonObj.get("before").isJsonNull()) && !jsonObj.get("before").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendmentPrice.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendmentPrice.java index 911b0968..204c4f0b 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendmentPrice.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendmentPrice.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetOrderModifyHistoryResponseInnerAmendmentPrice */ @@ -190,20 +188,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetOrderModifyHistoryResponseInnerAmendmentPrice.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetOrderModifyHistoryResponseInnerAmendmentPrice`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("before") != null && !jsonObj.get("before").isJsonNull()) && !jsonObj.get("before").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetPositionMarginChangeHistoryResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetPositionMarginChangeHistoryResponse.java index fb195eaa..636be908 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetPositionMarginChangeHistoryResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetPositionMarginChangeHistoryResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** GetPositionMarginChangeHistoryResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * GetPositionMarginChangeHistoryResponse */ 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) { + GetPositionMarginChangeHistoryResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!GetPositionMarginChangeHistoryResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,19 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetPositionMarginChangeHistoryResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetPositionMarginChangeHistoryResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.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/rest/model/GetPositionMarginChangeHistoryResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetPositionMarginChangeHistoryResponseInner.java index d98731f3..3a19ede9 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetPositionMarginChangeHistoryResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/GetPositionMarginChangeHistoryResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetPositionMarginChangeHistoryResponseInner */ @@ -321,20 +319,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetPositionMarginChangeHistoryResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetPositionMarginChangeHistoryResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonNull()) && !jsonObj.get("amount").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/IndexPriceAndMarkPriceResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/IndexPriceAndMarkPriceResponse.java index ca04ebe9..8d4be985 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/IndexPriceAndMarkPriceResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/IndexPriceAndMarkPriceResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** IndexPriceAndMarkPriceResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * IndexPriceAndMarkPriceResponse */ 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) { + IndexPriceAndMarkPriceResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!IndexPriceAndMarkPriceResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti IndexPriceAndMarkPriceResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IndexPriceAndMarkPriceResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `IndexPriceAndMarkPriceResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/IndexPriceAndMarkPriceResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/IndexPriceAndMarkPriceResponseInner.java index a09e81a4..3251af49 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/IndexPriceAndMarkPriceResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/IndexPriceAndMarkPriceResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** IndexPriceAndMarkPriceResponseInner */ @@ -432,18 +430,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IndexPriceAndMarkPriceResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `IndexPriceAndMarkPriceResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/IndexPriceKlineCandlestickDataResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/IndexPriceKlineCandlestickDataResponse.java index 67fafcbe..0ebe937b 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/IndexPriceKlineCandlestickDataResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/IndexPriceKlineCandlestickDataResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** IndexPriceKlineCandlestickDataResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * IndexPriceKlineCandlestickDataResponse */ 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) { + IndexPriceKlineCandlestickDataResponseItem.validateJsonElement(element); + } if (jsonElement == null) { if (!IndexPriceKlineCandlestickDataResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,19 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IndexPriceKlineCandlestickDataResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `IndexPriceKlineCandlestickDataResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.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/rest/model/IndexPriceKlineCandlestickDataResponseItem.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/IndexPriceKlineCandlestickDataResponseItem.java index fc81cc72..ddcc59b1 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/IndexPriceKlineCandlestickDataResponseItem.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/IndexPriceKlineCandlestickDataResponseItem.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** IndexPriceKlineCandlestickDataResponseItem */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * IndexPriceKlineCandlestickDataResponseItem */ 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) { + IndexPriceKlineCandlestickDataResponseItemInner.validateJsonElement(element); + } if (jsonElement == null) { if (!IndexPriceKlineCandlestickDataResponseItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,20 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IndexPriceKlineCandlestickDataResponseItem.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `IndexPriceKlineCandlestickDataResponseItem` properties." - + " JSON: %s", - entry.getKey(), jsonElement.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/rest/model/KlineCandlestickDataResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/KlineCandlestickDataResponse.java index 2d952822..2eb5d611 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/KlineCandlestickDataResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/KlineCandlestickDataResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** KlineCandlestickDataResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * KlineCandlestickDataResponse */ 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) { + KlineCandlestickDataResponseItem.validateJsonElement(element); + } if (jsonElement == null) { if (!KlineCandlestickDataResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti KlineCandlestickDataResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!KlineCandlestickDataResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `KlineCandlestickDataResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/KlineCandlestickDataResponseItem.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/KlineCandlestickDataResponseItem.java index c2b63e29..938d721f 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/KlineCandlestickDataResponseItem.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/KlineCandlestickDataResponseItem.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** KlineCandlestickDataResponseItem */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * KlineCandlestickDataResponseItem */ 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) { + ContinuousContractKlineCandlestickDataResponseItemInner.validateJsonElement(element); + } if (jsonElement == null) { if (!KlineCandlestickDataResponseItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti KlineCandlestickDataResponseItem.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!KlineCandlestickDataResponseItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `KlineCandlestickDataResponseItem` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/LongShortRatioResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/LongShortRatioResponse.java index a34bb77c..daac0e53 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/LongShortRatioResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/LongShortRatioResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** LongShortRatioResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to LongShortRatioResponse */ 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) { + LongShortRatioResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!LongShortRatioResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti LongShortRatioResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!LongShortRatioResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `LongShortRatioResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/LongShortRatioResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/LongShortRatioResponseInner.java index ac9111d6..3ad557e8 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/LongShortRatioResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/LongShortRatioResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** LongShortRatioResponseInner */ @@ -281,18 +279,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti LongShortRatioResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!LongShortRatioResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `LongShortRatioResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("pair") != null && !jsonObj.get("pair").isJsonNull()) && !jsonObj.get("pair").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/MarkPriceKlineCandlestickDataResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/MarkPriceKlineCandlestickDataResponse.java index 0ad85697..6aea1a94 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/MarkPriceKlineCandlestickDataResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/MarkPriceKlineCandlestickDataResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** MarkPriceKlineCandlestickDataResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * MarkPriceKlineCandlestickDataResponse */ 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) { + MarkPriceKlineCandlestickDataResponseItem.validateJsonElement(element); + } if (jsonElement == null) { if (!MarkPriceKlineCandlestickDataResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,19 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MarkPriceKlineCandlestickDataResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarkPriceKlineCandlestickDataResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.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/rest/model/MarkPriceKlineCandlestickDataResponseItem.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/MarkPriceKlineCandlestickDataResponseItem.java index 90ae161a..0acd55d9 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/MarkPriceKlineCandlestickDataResponseItem.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/MarkPriceKlineCandlestickDataResponseItem.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** MarkPriceKlineCandlestickDataResponseItem */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * MarkPriceKlineCandlestickDataResponseItem */ 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) { + MarkPriceKlineCandlestickDataResponseItemInner.validateJsonElement(element); + } if (jsonElement == null) { if (!MarkPriceKlineCandlestickDataResponseItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,19 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MarkPriceKlineCandlestickDataResponseItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarkPriceKlineCandlestickDataResponseItem` properties." - + " JSON: %s", - entry.getKey(), jsonElement.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/rest/model/ModifyIsolatedPositionMarginRequest.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyIsolatedPositionMarginRequest.java index d3b09145..0c1b62a9 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyIsolatedPositionMarginRequest.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyIsolatedPositionMarginRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ModifyIsolatedPositionMarginRequest */ @@ -294,18 +292,6 @@ 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 (!ModifyIsolatedPositionMarginRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyIsolatedPositionMarginRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ModifyIsolatedPositionMarginRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyIsolatedPositionMarginResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyIsolatedPositionMarginResponse.java index 933d1d32..e73cb582 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyIsolatedPositionMarginResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyIsolatedPositionMarginResponse.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ModifyIsolatedPositionMarginResponse */ @@ -250,19 +248,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ModifyIsolatedPositionMarginResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyIsolatedPositionMarginResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyMultipleOrdersRequest.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyMultipleOrdersRequest.java index 2e77b62c..278eebcf 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyMultipleOrdersRequest.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyMultipleOrdersRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ModifyMultipleOrdersRequest */ @@ -188,18 +186,6 @@ 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 (!ModifyMultipleOrdersRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyMultipleOrdersRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ModifyMultipleOrdersRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyMultipleOrdersResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyMultipleOrdersResponse.java index 4e64b7c8..232b3fc6 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyMultipleOrdersResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyMultipleOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** ModifyMultipleOrdersResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * ModifyMultipleOrdersResponse */ 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) { + ModifyMultipleOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!ModifyMultipleOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ModifyMultipleOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ModifyMultipleOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyMultipleOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/ModifyMultipleOrdersResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyMultipleOrdersResponseInner.java index 6671fa03..7b3282bc 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyMultipleOrdersResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyMultipleOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ModifyMultipleOrdersResponseInner */ @@ -1002,18 +1000,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ModifyMultipleOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyMultipleOrdersResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyOrderRequest.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyOrderRequest.java index 69ffb3ac..227b502a 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyOrderRequest.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyOrderRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ModifyOrderRequest */ @@ -387,18 +385,6 @@ 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 (!ModifyOrderRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyOrderRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ModifyOrderRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyOrderResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyOrderResponse.java index 8aea19e7..752895a7 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyOrderResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/ModifyOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ModifyOrderResponse */ @@ -917,18 +915,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ModifyOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ModifyOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NewOrderRequest.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NewOrderRequest.java index d26ea344..e2d5a881 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NewOrderRequest.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NewOrderRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NewOrderRequest */ @@ -775,18 +773,6 @@ 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 (!NewOrderRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewOrderRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : NewOrderRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NewOrderResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NewOrderResponse.java index 030dff07..c9f583ba 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NewOrderResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NewOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NewOrderResponse */ @@ -983,18 +981,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti NewOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NewOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) && !jsonObj.get("clientOrderId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForPairResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForPairResponse.java index ec797260..7ad8ee89 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForPairResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForPairResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** NotionalBracketForPairResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * NotionalBracketForPairResponse */ 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) { + NotionalBracketForPairResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!NotionalBracketForPairResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti NotionalBracketForPairResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NotionalBracketForPairResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NotionalBracketForPairResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/NotionalBracketForPairResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForPairResponseInner.java index d1ab2805..2687f9ae 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForPairResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForPairResponseInner.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -207,18 +205,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NotionalBracketForPairResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NotionalBracketForPairResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("pair") != null && !jsonObj.get("pair").isJsonNull()) && !jsonObj.get("pair").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForPairResponseInnerBracketsInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForPairResponseInnerBracketsInner.java index 6ac505e8..c3401260 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForPairResponseInnerBracketsInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForPairResponseInnerBracketsInner.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NotionalBracketForPairResponseInnerBracketsInner */ @@ -331,20 +329,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NotionalBracketForPairResponseInnerBracketsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NotionalBracketForPairResponseInnerBracketsInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForSymbolResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForSymbolResponse.java index e59976a1..5ca98df4 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForSymbolResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForSymbolResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** NotionalBracketForSymbolResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * NotionalBracketForSymbolResponse */ 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) { + NotionalBracketForSymbolResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!NotionalBracketForSymbolResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -120,18 +131,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti NotionalBracketForSymbolResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NotionalBracketForSymbolResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NotionalBracketForSymbolResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/NotionalBracketForSymbolResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForSymbolResponseInner.java index ba54faf8..25cbd458 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForSymbolResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/NotionalBracketForSymbolResponseInner.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -243,19 +241,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NotionalBracketForSymbolResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NotionalBracketForSymbolResponseInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OldTradesLookupResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OldTradesLookupResponse.java index e29dd7f6..ba8a6bf0 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OldTradesLookupResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OldTradesLookupResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** OldTradesLookupResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to OldTradesLookupResponse */ 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) { + OldTradesLookupResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!OldTradesLookupResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OldTradesLookupResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OldTradesLookupResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OldTradesLookupResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/OldTradesLookupResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OldTradesLookupResponseInner.java index c41114d2..03c5cdbf 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OldTradesLookupResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OldTradesLookupResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OldTradesLookupResponseInner */ @@ -312,18 +310,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OldTradesLookupResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OldTradesLookupResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OldTradesLookupResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) && !jsonObj.get("price").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OpenInterestResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OpenInterestResponse.java index 25661434..46beffe8 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OpenInterestResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OpenInterestResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OpenInterestResponse */ @@ -277,18 +275,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OpenInterestResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OpenInterestResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OpenInterestResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OpenInterestStatisticsResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OpenInterestStatisticsResponse.java index 01e0ba46..d5ad5c59 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OpenInterestStatisticsResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OpenInterestStatisticsResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** OpenInterestStatisticsResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * OpenInterestStatisticsResponse */ 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) { + OpenInterestStatisticsResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!OpenInterestStatisticsResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OpenInterestStatisticsResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OpenInterestStatisticsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OpenInterestStatisticsResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/OpenInterestStatisticsResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OpenInterestStatisticsResponseInner.java index 2296d234..32938d0a 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OpenInterestStatisticsResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OpenInterestStatisticsResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OpenInterestStatisticsResponseInner */ @@ -292,18 +290,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OpenInterestStatisticsResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OpenInterestStatisticsResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("pair") != null && !jsonObj.get("pair").isJsonNull()) && !jsonObj.get("pair").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OrderBookResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OrderBookResponse.java index 97f1500e..6b4b309a 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OrderBookResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OrderBookResponse.java @@ -32,9 +32,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -372,18 +370,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderBookResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderBookResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderBookResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OrderBookResponseAsksItem.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OrderBookResponseAsksItem.java index 89eefb65..c1c04c5a 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OrderBookResponseAsksItem.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OrderBookResponseAsksItem.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** OrderBookResponseAsksItem */ @@ -108,6 +107,24 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to OrderBookResponseAsksItem */ 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 (!OrderBookResponseAsksItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +135,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderBookResponseAsksItem.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderBookResponseAsksItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderBookResponseAsksItem` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/OrderBookResponseBidsItem.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OrderBookResponseBidsItem.java index 88cf3db7..f3c05c41 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OrderBookResponseBidsItem.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OrderBookResponseBidsItem.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** OrderBookResponseBidsItem */ @@ -108,6 +107,24 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to OrderBookResponseBidsItem */ 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 (!OrderBookResponseBidsItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +135,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderBookResponseBidsItem.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderBookResponseBidsItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderBookResponseBidsItem` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/OrderIdList.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OrderIdList.java index c41bd91d..48161f48 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OrderIdList.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OrderIdList.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** OrderIdList */ @@ -108,6 +107,24 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to OrderIdList */ 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().isNumber()) { + throw new IllegalArgumentException( + String.format( + "Expected array items to be of type Number in the JSON string but" + + " got `%s`", + jsonElement.toString())); + } + } if (jsonElement == null) { if (!OrderIdList.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +135,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderIdList.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderIdList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderIdList` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/OrigClientOrderIdList.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OrigClientOrderIdList.java index a159bacc..ddf3503f 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OrigClientOrderIdList.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/OrigClientOrderIdList.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** OrigClientOrderIdList */ @@ -108,6 +107,24 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to OrigClientOrderIdList */ 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 (!OrigClientOrderIdList.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +135,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrigClientOrderIdList.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrigClientOrderIdList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrigClientOrderIdList` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/PositionAdlQuantileEstimationResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PositionAdlQuantileEstimationResponse.java index e42bdc12..8b3ac21b 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PositionAdlQuantileEstimationResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PositionAdlQuantileEstimationResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** PositionAdlQuantileEstimationResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * PositionAdlQuantileEstimationResponse */ 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) { + PositionAdlQuantileEstimationResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!PositionAdlQuantileEstimationResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,19 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PositionAdlQuantileEstimationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PositionAdlQuantileEstimationResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.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/rest/model/PositionAdlQuantileEstimationResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PositionAdlQuantileEstimationResponseInner.java index 2bcd20d2..d1c0ea0d 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PositionAdlQuantileEstimationResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PositionAdlQuantileEstimationResponseInner.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** PositionAdlQuantileEstimationResponseInner */ @@ -193,20 +191,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PositionAdlQuantileEstimationResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PositionAdlQuantileEstimationResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PositionAdlQuantileEstimationResponseInnerAdlQuantile.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PositionAdlQuantileEstimationResponseInnerAdlQuantile.java index 402ff72b..eb1349b5 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PositionAdlQuantileEstimationResponseInnerAdlQuantile.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PositionAdlQuantileEstimationResponseInnerAdlQuantile.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** PositionAdlQuantileEstimationResponseInnerAdlQuantile */ @@ -258,20 +256,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PositionAdlQuantileEstimationResponseInnerAdlQuantile.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PositionAdlQuantileEstimationResponseInnerAdlQuantile`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PositionInformationResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PositionInformationResponse.java index a8fbb138..bb44c179 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PositionInformationResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PositionInformationResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** PositionInformationResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * PositionInformationResponse */ 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) { + PositionInformationResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!PositionInformationResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti PositionInformationResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PositionInformationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PositionInformationResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/PositionInformationResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PositionInformationResponseInner.java index 73f36107..d075d835 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PositionInformationResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PositionInformationResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** PositionInformationResponseInner */ @@ -597,18 +595,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti PositionInformationResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PositionInformationResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PositionInformationResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PremiumIndexKlineDataResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PremiumIndexKlineDataResponse.java index e49cd056..2ceb21bf 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PremiumIndexKlineDataResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PremiumIndexKlineDataResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** PremiumIndexKlineDataResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * PremiumIndexKlineDataResponse */ 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) { + PremiumIndexKlineDataResponseItem.validateJsonElement(element); + } if (jsonElement == null) { if (!PremiumIndexKlineDataResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti PremiumIndexKlineDataResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PremiumIndexKlineDataResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PremiumIndexKlineDataResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/PremiumIndexKlineDataResponseItem.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PremiumIndexKlineDataResponseItem.java index da0dab67..b0eaa4a9 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PremiumIndexKlineDataResponseItem.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PremiumIndexKlineDataResponseItem.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** PremiumIndexKlineDataResponseItem */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * PremiumIndexKlineDataResponseItem */ 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) { + PremiumIndexKlineDataResponseItemInner.validateJsonElement(element); + } if (jsonElement == null) { if (!PremiumIndexKlineDataResponseItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -120,18 +131,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PremiumIndexKlineDataResponseItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PremiumIndexKlineDataResponseItem` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/QueryCurrentOpenOrderResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryCurrentOpenOrderResponse.java index 665bf6f9..dfc42920 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryCurrentOpenOrderResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryCurrentOpenOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryCurrentOpenOrderResponse */ @@ -996,18 +994,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryCurrentOpenOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryCurrentOpenOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryCurrentOpenOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryIndexPriceConstituentsResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryIndexPriceConstituentsResponse.java index 4f47f567..9530a89e 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryIndexPriceConstituentsResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryIndexPriceConstituentsResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -242,18 +240,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryIndexPriceConstituentsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryIndexPriceConstituentsResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryIndexPriceConstituentsResponseConstituentsInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryIndexPriceConstituentsResponseConstituentsInner.java index 531d804e..745dbf49 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryIndexPriceConstituentsResponseConstituentsInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryIndexPriceConstituentsResponseConstituentsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryIndexPriceConstituentsResponseConstituentsInner */ @@ -192,20 +190,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryIndexPriceConstituentsResponseConstituentsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryIndexPriceConstituentsResponseConstituentsInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("exchange") != null && !jsonObj.get("exchange").isJsonNull()) && !jsonObj.get("exchange").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryOrderResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryOrderResponse.java index 1a112432..92630c79 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryOrderResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/QueryOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryOrderResponse */ @@ -950,18 +948,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/RecentTradesListResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/RecentTradesListResponse.java index 7b32859e..87c0e7e0 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/RecentTradesListResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/RecentTradesListResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** RecentTradesListResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to RecentTradesListResponse */ 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) { + RecentTradesListResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!RecentTradesListResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti RecentTradesListResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RecentTradesListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RecentTradesListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/RecentTradesListResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/RecentTradesListResponseInner.java index a430249a..fcbcd826 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/RecentTradesListResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/RecentTradesListResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** RecentTradesListResponseInner */ @@ -312,18 +310,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti RecentTradesListResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RecentTradesListResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RecentTradesListResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) && !jsonObj.get("price").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/StartUserDataStreamResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/StartUserDataStreamResponse.java index 5be85740..53a6edd6 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/StartUserDataStreamResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/StartUserDataStreamResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** StartUserDataStreamResponse */ @@ -150,18 +148,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti StartUserDataStreamResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!StartUserDataStreamResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `StartUserDataStreamResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("listenKey") != null && !jsonObj.get("listenKey").isJsonNull()) && !jsonObj.get("listenKey").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/SymbolOrderBookTickerResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/SymbolOrderBookTickerResponse.java index 6c35a3cf..3e3a2eba 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/SymbolOrderBookTickerResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/SymbolOrderBookTickerResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** SymbolOrderBookTickerResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * SymbolOrderBookTickerResponse */ 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) { + SymbolOrderBookTickerResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!SymbolOrderBookTickerResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti SymbolOrderBookTickerResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SymbolOrderBookTickerResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SymbolOrderBookTickerResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/SymbolOrderBookTickerResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/SymbolOrderBookTickerResponseInner.java index 739f6db4..c2fc23a2 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/SymbolOrderBookTickerResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/SymbolOrderBookTickerResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** SymbolOrderBookTickerResponseInner */ @@ -379,18 +377,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SymbolOrderBookTickerResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SymbolOrderBookTickerResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/SymbolPriceTickerResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/SymbolPriceTickerResponse.java index 2b80fd50..6a1fdf2b 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/SymbolPriceTickerResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/SymbolPriceTickerResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** SymbolPriceTickerResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to SymbolPriceTickerResponse */ 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) { + SymbolPriceTickerResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!SymbolPriceTickerResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti SymbolPriceTickerResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SymbolPriceTickerResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SymbolPriceTickerResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/SymbolPriceTickerResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/SymbolPriceTickerResponseInner.java index d96feb9b..f340ae45 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/SymbolPriceTickerResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/SymbolPriceTickerResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** SymbolPriceTickerResponseInner */ @@ -247,18 +245,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti SymbolPriceTickerResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SymbolPriceTickerResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SymbolPriceTickerResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TakerBuySellVolumeResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TakerBuySellVolumeResponse.java index 1ed45163..2baaf19a 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TakerBuySellVolumeResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TakerBuySellVolumeResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** TakerBuySellVolumeResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to TakerBuySellVolumeResponse */ 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) { + TakerBuySellVolumeResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!TakerBuySellVolumeResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TakerBuySellVolumeResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TakerBuySellVolumeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TakerBuySellVolumeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/TakerBuySellVolumeResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TakerBuySellVolumeResponseInner.java index 76b88adc..085be271 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TakerBuySellVolumeResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TakerBuySellVolumeResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** TakerBuySellVolumeResponseInner */ @@ -359,18 +357,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TakerBuySellVolumeResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TakerBuySellVolumeResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TakerBuySellVolumeResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("pair") != null && !jsonObj.get("pair").isJsonNull()) && !jsonObj.get("pair").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/Ticker24hrPriceChangeStatisticsResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/Ticker24hrPriceChangeStatisticsResponse.java index d2cb34a4..7ff4cb5d 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/Ticker24hrPriceChangeStatisticsResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/Ticker24hrPriceChangeStatisticsResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** Ticker24hrPriceChangeStatisticsResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * Ticker24hrPriceChangeStatisticsResponse */ 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) { + Ticker24hrPriceChangeStatisticsResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!Ticker24hrPriceChangeStatisticsResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -122,19 +133,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Ticker24hrPriceChangeStatisticsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Ticker24hrPriceChangeStatisticsResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.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/rest/model/Ticker24hrPriceChangeStatisticsResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/Ticker24hrPriceChangeStatisticsResponseInner.java index 533f90d9..62678125 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/Ticker24hrPriceChangeStatisticsResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/Ticker24hrPriceChangeStatisticsResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** Ticker24hrPriceChangeStatisticsResponseInner */ @@ -717,20 +715,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Ticker24hrPriceChangeStatisticsResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Ticker24hrPriceChangeStatisticsResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TopTraderLongShortRatioAccountsResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TopTraderLongShortRatioAccountsResponse.java index b166c267..97bdef30 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TopTraderLongShortRatioAccountsResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TopTraderLongShortRatioAccountsResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** TopTraderLongShortRatioAccountsResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * TopTraderLongShortRatioAccountsResponse */ 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) { + TopTraderLongShortRatioAccountsResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!TopTraderLongShortRatioAccountsResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -122,19 +133,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TopTraderLongShortRatioAccountsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TopTraderLongShortRatioAccountsResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.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/rest/model/TopTraderLongShortRatioAccountsResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TopTraderLongShortRatioAccountsResponseInner.java index eed97f03..18ea32f6 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TopTraderLongShortRatioAccountsResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TopTraderLongShortRatioAccountsResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** TopTraderLongShortRatioAccountsResponseInner */ @@ -292,20 +290,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TopTraderLongShortRatioAccountsResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TopTraderLongShortRatioAccountsResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("pair") != null && !jsonObj.get("pair").isJsonNull()) && !jsonObj.get("pair").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TopTraderLongShortRatioPositionsResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TopTraderLongShortRatioPositionsResponse.java index e05ca67b..1f650be6 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TopTraderLongShortRatioPositionsResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TopTraderLongShortRatioPositionsResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** TopTraderLongShortRatioPositionsResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * TopTraderLongShortRatioPositionsResponse */ 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) { + TopTraderLongShortRatioPositionsResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!TopTraderLongShortRatioPositionsResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -122,19 +133,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TopTraderLongShortRatioPositionsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TopTraderLongShortRatioPositionsResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.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/rest/model/TopTraderLongShortRatioPositionsResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TopTraderLongShortRatioPositionsResponseInner.java index 583b34ed..6341972a 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TopTraderLongShortRatioPositionsResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/TopTraderLongShortRatioPositionsResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** TopTraderLongShortRatioPositionsResponseInner */ @@ -294,20 +292,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TopTraderLongShortRatioPositionsResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TopTraderLongShortRatioPositionsResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("pair") != null && !jsonObj.get("pair").isJsonNull()) && !jsonObj.get("pair").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/UserCommissionRateResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/UserCommissionRateResponse.java index c5c37b4e..35c7ec29 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/UserCommissionRateResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/UserCommissionRateResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** UserCommissionRateResponse */ @@ -225,18 +223,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti UserCommissionRateResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserCommissionRateResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UserCommissionRateResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/UsersForceOrdersResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/UsersForceOrdersResponse.java index be870d74..b88fc3c3 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/UsersForceOrdersResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/UsersForceOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_coin_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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** UsersForceOrdersResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to UsersForceOrdersResponse */ 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) { + UsersForceOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!UsersForceOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti UsersForceOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UsersForceOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UsersForceOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/rest/model/UsersForceOrdersResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/UsersForceOrdersResponseInner.java index 3593be6e..29ef36be 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/UsersForceOrdersResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/UsersForceOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** UsersForceOrdersResponseInner */ @@ -853,18 +851,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti UsersForceOrdersResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UsersForceOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UsersForceOrdersResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { 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 be26f524..bee63d2c 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 @@ -32,7 +32,7 @@ public class DerivativesTradingCoinFuturesWebSocketApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/1.2.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/1.2.1 (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 707e2208..bed03663 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 @@ -50,7 +50,7 @@ public class DerivativesTradingCoinFuturesWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/1.2.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/1.2.1 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private WebsocketMarketStreamsApi websocketMarketStreamsApi; diff --git a/clients/derivatives-trading-portfolio-margin/CHANGELOG.md b/clients/derivatives-trading-portfolio-margin/CHANGELOG.md index 1e7ccf76..be99e2e7 100644 --- a/clients/derivatives-trading-portfolio-margin/CHANGELOG.md +++ b/clients/derivatives-trading-portfolio-margin/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 1.2.0 - 2025-06-24 + +### Changed (1) + +- Update `binance/common` module to version `1.2.1`. +- Fixed cases where the response can be an object or an array + ## 1.1.0 - 2025-05-02 - Update `binance/common` module to version `1.1.0`. diff --git a/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesOrderDownloadLinkByIdResponse1.md b/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesOrderDownloadLinkByIdResponse1.md deleted file mode 100644 index 64be812b..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesOrderDownloadLinkByIdResponse1.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# GetUmFuturesOrderDownloadLinkByIdResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**s3Link** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesOrderDownloadLinkByIdResponse2.md b/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesOrderDownloadLinkByIdResponse2.md deleted file mode 100644 index f09edd53..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesOrderDownloadLinkByIdResponse2.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# GetUmFuturesOrderDownloadLinkByIdResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**s3Link** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesTradeDownloadLinkByIdResponse1.md b/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesTradeDownloadLinkByIdResponse1.md deleted file mode 100644 index fc822ce8..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesTradeDownloadLinkByIdResponse1.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# GetUmFuturesTradeDownloadLinkByIdResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**s3Link** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesTradeDownloadLinkByIdResponse2.md b/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesTradeDownloadLinkByIdResponse2.md deleted file mode 100644 index 70c996f2..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesTradeDownloadLinkByIdResponse2.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# GetUmFuturesTradeDownloadLinkByIdResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**s3Link** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesTransactionDownloadLinkByIdResponse1.md b/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesTransactionDownloadLinkByIdResponse1.md deleted file mode 100644 index 8284ef1c..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesTransactionDownloadLinkByIdResponse1.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# GetUmFuturesTransactionDownloadLinkByIdResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**s3Link** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesTransactionDownloadLinkByIdResponse2.md b/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesTransactionDownloadLinkByIdResponse2.md deleted file mode 100644 index a47254ad..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/GetUmFuturesTransactionDownloadLinkByIdResponse2.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# GetUmFuturesTransactionDownloadLinkByIdResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**s3Link** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse1.md b/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse1.md deleted file mode 100644 index 670f4d0b..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse1.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**indicators** | [**PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse1Indicators**](PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse1Indicators.md) | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse1Indicators.md b/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse1Indicators.md deleted file mode 100644 index f1d44c5a..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse1Indicators.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse1Indicators - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**BTCUSDT** | [**List<PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse1IndicatorsBTCUSDTInner>**](PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse1IndicatorsBTCUSDTInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse1IndicatorsBTCUSDTInner.md b/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse1IndicatorsBTCUSDTInner.md deleted file mode 100644 index cd5d51b4..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse1IndicatorsBTCUSDTInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse1IndicatorsBTCUSDTInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**isLocked** | **Boolean** | | [optional] | -|**plannedRecoverTime** | **Long** | | [optional] | -|**indicator** | **String** | | [optional] | -|**value** | **Double** | | [optional] | -|**triggerValue** | **Double** | | [optional] | - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse2.md b/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse2.md deleted file mode 100644 index 95cfadf3..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse2.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**indicators** | [**PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse2Indicators**](PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse2Indicators.md) | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse2Indicators.md b/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse2Indicators.md deleted file mode 100644 index 50e13cd6..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse2Indicators.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse2Indicators - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**ACCOUNT** | [**List<PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse2IndicatorsACCOUNTInner>**](PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse2IndicatorsACCOUNTInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse2IndicatorsACCOUNTInner.md b/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse2IndicatorsACCOUNTInner.md deleted file mode 100644 index dfcabfcf..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse2IndicatorsACCOUNTInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse2IndicatorsACCOUNTInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**indicator** | **String** | | [optional] | -|**value** | **Long** | | [optional] | -|**triggerValue** | **Long** | | [optional] | -|**plannedRecoverTime** | **Long** | | [optional] | -|**isLocked** | **Boolean** | | [optional] | - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/QueryCmPositionInformationResponse1.md b/clients/derivatives-trading-portfolio-margin/docs/QueryCmPositionInformationResponse1.md deleted file mode 100644 index 1004c4ad..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/QueryCmPositionInformationResponse1.md +++ /dev/null @@ -1,12 +0,0 @@ - - -# QueryCmPositionInformationResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/QueryCmPositionInformationResponse1Inner.md b/clients/derivatives-trading-portfolio-margin/docs/QueryCmPositionInformationResponse1Inner.md deleted file mode 100644 index 5c148a06..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/QueryCmPositionInformationResponse1Inner.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# QueryCmPositionInformationResponse1Inner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**positionAmt** | **String** | | [optional] | -|**entryPrice** | **String** | | [optional] | -|**markPrice** | **String** | | [optional] | -|**unRealizedProfit** | **String** | | [optional] | -|**liquidationPrice** | **String** | | [optional] | -|**leverage** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | -|**maxQty** | **String** | | [optional] | -|**notionalValue** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/QueryCmPositionInformationResponse2.md b/clients/derivatives-trading-portfolio-margin/docs/QueryCmPositionInformationResponse2.md deleted file mode 100644 index f473f7d1..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/QueryCmPositionInformationResponse2.md +++ /dev/null @@ -1,12 +0,0 @@ - - -# QueryCmPositionInformationResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/QueryUmPositionInformationResponse1.md b/clients/derivatives-trading-portfolio-margin/docs/QueryUmPositionInformationResponse1.md deleted file mode 100644 index a8bd48ca..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/QueryUmPositionInformationResponse1.md +++ /dev/null @@ -1,12 +0,0 @@ - - -# QueryUmPositionInformationResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/QueryUmPositionInformationResponse1Inner.md b/clients/derivatives-trading-portfolio-margin/docs/QueryUmPositionInformationResponse1Inner.md deleted file mode 100644 index 09229188..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/QueryUmPositionInformationResponse1Inner.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# QueryUmPositionInformationResponse1Inner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**entryPrice** | **String** | | [optional] | -|**leverage** | **String** | | [optional] | -|**markPrice** | **String** | | [optional] | -|**maxNotionalValue** | **String** | | [optional] | -|**positionAmt** | **String** | | [optional] | -|**notional** | **String** | | [optional] | -|**symbol** | **String** | | [optional] | -|**unRealizedProfit** | **String** | | [optional] | -|**liquidationPrice** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/QueryUmPositionInformationResponse2.md b/clients/derivatives-trading-portfolio-margin/docs/QueryUmPositionInformationResponse2.md deleted file mode 100644 index 8c0df2ae..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/QueryUmPositionInformationResponse2.md +++ /dev/null @@ -1,12 +0,0 @@ - - -# QueryUmPositionInformationResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| - - - diff --git a/clients/derivatives-trading-portfolio-margin/docs/QueryUmPositionInformationResponse2Inner.md b/clients/derivatives-trading-portfolio-margin/docs/QueryUmPositionInformationResponse2Inner.md deleted file mode 100644 index 86077900..00000000 --- a/clients/derivatives-trading-portfolio-margin/docs/QueryUmPositionInformationResponse2Inner.md +++ /dev/null @@ -1,23 +0,0 @@ - - -# QueryUmPositionInformationResponse2Inner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**positionAmt** | **String** | | [optional] | -|**entryPrice** | **String** | | [optional] | -|**markPrice** | **String** | | [optional] | -|**unRealizedProfit** | **String** | | [optional] | -|**liquidationPrice** | **String** | | [optional] | -|**leverage** | **String** | | [optional] | -|**maxNotionalValue** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**notional** | **String** | | [optional] | -|**updateTime** | **Long** | | [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 b988b773..7f792c9a 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 - 1.1.0 + 1.2.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-portfolio-margin - 1.1.0 + 1.2.0 ``` diff --git a/clients/derivatives-trading-portfolio-margin/pom.xml b/clients/derivatives-trading-portfolio-margin/pom.xml index 91796b51..43c8d499 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 - 1.1.0 + 1.2.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 1.1.0 + 1.2.1 \ No newline at end of file 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 bedbbbb2..f4009b09 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/1.1.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/1.2.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 dd2851ac..014a2f0c 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/1.1.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/1.2.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 dcb93060..e886fed8 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/1.1.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/1.2.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 bd4caa26..3b1dff7e 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/1.1.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/1.2.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/model/AccountBalanceResponse1.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/AccountBalanceResponse1.java index d14a305e..f04bf50f 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/AccountBalanceResponse1.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/AccountBalanceResponse1.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** AccountBalanceResponse1 */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to AccountBalanceResponse1 */ 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) { + AccountBalanceResponse1Inner.validateJsonElement(element); + } if (jsonElement == null) { if (!AccountBalanceResponse1.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AccountBalanceResponse1.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountBalanceResponse1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountBalanceResponse1` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/AccountBalanceResponse1Inner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/AccountBalanceResponse1Inner.java index c6717b44..27d0e3f3 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/AccountBalanceResponse1Inner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/AccountBalanceResponse1Inner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AccountBalanceResponse1Inner */ @@ -584,18 +582,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AccountBalanceResponse1Inner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountBalanceResponse1Inner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountBalanceResponse1Inner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) && !jsonObj.get("asset").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/AccountBalanceResponse2.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/AccountBalanceResponse2.java index aeb618c6..9d615d71 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/AccountBalanceResponse2.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/AccountBalanceResponse2.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AccountBalanceResponse2 */ @@ -540,18 +538,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AccountBalanceResponse2.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountBalanceResponse2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountBalanceResponse2` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) && !jsonObj.get("asset").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/AccountInformationResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/AccountInformationResponse.java index 1ff49b20..5cb741a2 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/AccountInformationResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/AccountInformationResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AccountInformationResponse */ @@ -485,18 +483,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AccountInformationResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountInformationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountInformationResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("uniMMR") != null && !jsonObj.get("uniMMR").isJsonNull()) && !jsonObj.get("uniMMR").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/BnbTransferRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/BnbTransferRequest.java index e9ea0147..df4ac3c4 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/BnbTransferRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/BnbTransferRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** BnbTransferRequest */ @@ -220,18 +218,6 @@ 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 (!BnbTransferRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `BnbTransferRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : BnbTransferRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/BnbTransferResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/BnbTransferResponse.java index f40afb4b..05b4ff85 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/BnbTransferResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/BnbTransferResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** BnbTransferResponse */ @@ -149,18 +147,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti BnbTransferResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!BnbTransferResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `BnbTransferResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllCmOpenConditionalOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllCmOpenConditionalOrdersResponse.java index ef2992e5..02edca9c 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllCmOpenConditionalOrdersResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllCmOpenConditionalOrdersResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelAllCmOpenConditionalOrdersResponse */ @@ -185,19 +183,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelAllCmOpenConditionalOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelAllCmOpenConditionalOrdersResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllCmOpenOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllCmOpenOrdersResponse.java index 96b4bde4..0e91a77e 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllCmOpenOrdersResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllCmOpenOrdersResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelAllCmOpenOrdersResponse */ @@ -183,18 +181,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CancelAllCmOpenOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelAllCmOpenOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelAllCmOpenOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllUmOpenConditionalOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllUmOpenConditionalOrdersResponse.java index 4dc8ec24..9bbc5b51 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllUmOpenConditionalOrdersResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllUmOpenConditionalOrdersResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelAllUmOpenConditionalOrdersResponse */ @@ -185,19 +183,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelAllUmOpenConditionalOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelAllUmOpenConditionalOrdersResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllUmOpenOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllUmOpenOrdersResponse.java index ce23e096..869b7350 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllUmOpenOrdersResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelAllUmOpenOrdersResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelAllUmOpenOrdersResponse */ @@ -183,18 +181,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CancelAllUmOpenOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelAllUmOpenOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelAllUmOpenOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelCmConditionalOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelCmConditionalOrderResponse.java index 8a5378cc..0507f3f0 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelCmConditionalOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelCmConditionalOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelCmConditionalOrderResponse */ @@ -734,18 +732,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CancelCmConditionalOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelCmConditionalOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelCmConditionalOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("newClientStrategyId") != null && !jsonObj.get("newClientStrategyId").isJsonNull()) diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelCmOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelCmOrderResponse.java index 4dc10339..b6e1e399 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelCmOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelCmOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelCmOrderResponse */ @@ -678,18 +676,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CancelCmOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelCmOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelCmOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountAllOpenOrdersOnASymbolResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountAllOpenOrdersOnASymbolResponse.java index abbaf6f3..a879ef6b 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountAllOpenOrdersOnASymbolResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountAllOpenOrdersOnASymbolResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** CancelMarginAccountAllOpenOrdersOnASymbolResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * CancelMarginAccountAllOpenOrdersOnASymbolResponse */ 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) { + CancelMarginAccountAllOpenOrdersOnASymbolResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!CancelMarginAccountAllOpenOrdersOnASymbolResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -123,20 +134,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelMarginAccountAllOpenOrdersOnASymbolResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelMarginAccountAllOpenOrdersOnASymbolResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountAllOpenOrdersOnASymbolResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountAllOpenOrdersOnASymbolResponseInner.java index a5f09759..065f1b7c 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountAllOpenOrdersOnASymbolResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountAllOpenOrdersOnASymbolResponseInner.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -895,20 +893,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelMarginAccountAllOpenOrdersOnASymbolResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelMarginAccountAllOpenOrdersOnASymbolResponseInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountAllOpenOrdersOnASymbolResponseInnerOrderReportsInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountAllOpenOrdersOnASymbolResponseInnerOrderReportsInner.java index 4164cfb9..b4184d16 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountAllOpenOrdersOnASymbolResponseInnerOrderReportsInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountAllOpenOrdersOnASymbolResponseInnerOrderReportsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelMarginAccountAllOpenOrdersOnASymbolResponseInnerOrderReportsInner */ @@ -687,21 +685,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelMarginAccountAllOpenOrdersOnASymbolResponseInnerOrderReportsInner - .openapiFields - .contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelMarginAccountAllOpenOrdersOnASymbolResponseInnerOrderReportsInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountAllOpenOrdersOnASymbolResponseInnerOrdersInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountAllOpenOrdersOnASymbolResponseInnerOrdersInner.java index d7f2b7f3..00d4aab4 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountAllOpenOrdersOnASymbolResponseInnerOrdersInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountAllOpenOrdersOnASymbolResponseInnerOrdersInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelMarginAccountAllOpenOrdersOnASymbolResponseInnerOrdersInner */ @@ -230,20 +228,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelMarginAccountAllOpenOrdersOnASymbolResponseInnerOrdersInner.openapiFields - .contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelMarginAccountAllOpenOrdersOnASymbolResponseInnerOrdersInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountOcoOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountOcoOrdersResponse.java index e19dc278..02edcdc9 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountOcoOrdersResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountOcoOrdersResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -474,19 +472,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelMarginAccountOcoOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelMarginAccountOcoOrdersResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) && !jsonObj.get("contingencyType").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountOcoOrdersResponseOrderReportsInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountOcoOrdersResponseOrderReportsInner.java index b69dd392..70c33c45 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountOcoOrdersResponseOrderReportsInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountOcoOrdersResponseOrderReportsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelMarginAccountOcoOrdersResponseOrderReportsInner */ @@ -626,20 +624,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelMarginAccountOcoOrdersResponseOrderReportsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelMarginAccountOcoOrdersResponseOrderReportsInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountOcoOrdersResponseOrdersInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountOcoOrdersResponseOrdersInner.java index d653ef9e..f49d5208 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountOcoOrdersResponseOrdersInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountOcoOrdersResponseOrdersInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelMarginAccountOcoOrdersResponseOrdersInner */ @@ -225,20 +223,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelMarginAccountOcoOrdersResponseOrdersInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelMarginAccountOcoOrdersResponseOrdersInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountOrderResponse.java index fbc9703d..6b72766b 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelMarginAccountOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelMarginAccountOrderResponse */ @@ -530,18 +528,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CancelMarginAccountOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelMarginAccountOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelMarginAccountOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelUmConditionalOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelUmConditionalOrderResponse.java index 9fe433bd..f2d61a96 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelUmConditionalOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelUmConditionalOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelUmConditionalOrderResponse */ @@ -844,18 +842,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CancelUmConditionalOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelUmConditionalOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelUmConditionalOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("newClientStrategyId") != null && !jsonObj.get("newClientStrategyId").isJsonNull()) diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelUmOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelUmOrderResponse.java index 8eb179ec..b40a0725 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelUmOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CancelUmOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelUmOrderResponse */ @@ -752,18 +750,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CancelUmOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelUmOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelUmOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeAutoRepayFuturesStatusRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeAutoRepayFuturesStatusRequest.java index d682fd50..f09932f5 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeAutoRepayFuturesStatusRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeAutoRepayFuturesStatusRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeAutoRepayFuturesStatusRequest */ @@ -189,18 +187,6 @@ 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 (!ChangeAutoRepayFuturesStatusRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeAutoRepayFuturesStatusRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ChangeAutoRepayFuturesStatusRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeAutoRepayFuturesStatusResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeAutoRepayFuturesStatusResponse.java index 8797dbba..8391f133 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeAutoRepayFuturesStatusResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeAutoRepayFuturesStatusResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeAutoRepayFuturesStatusResponse */ @@ -152,19 +150,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ChangeAutoRepayFuturesStatusResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeAutoRepayFuturesStatusResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeCmInitialLeverageRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeCmInitialLeverageRequest.java index 7a1d46cc..1518f73f 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeCmInitialLeverageRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeCmInitialLeverageRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeCmInitialLeverageRequest */ @@ -220,18 +218,6 @@ 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 (!ChangeCmInitialLeverageRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeCmInitialLeverageRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ChangeCmInitialLeverageRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeCmInitialLeverageResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeCmInitialLeverageResponse.java index e17b0eed..855c1322 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeCmInitialLeverageResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeCmInitialLeverageResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeCmInitialLeverageResponse */ @@ -215,18 +213,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ChangeCmInitialLeverageResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ChangeCmInitialLeverageResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeCmInitialLeverageResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("maxQty") != null && !jsonObj.get("maxQty").isJsonNull()) && !jsonObj.get("maxQty").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeCmPositionModeRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeCmPositionModeRequest.java index 7f72355d..9fc56afb 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeCmPositionModeRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeCmPositionModeRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeCmPositionModeRequest */ @@ -186,18 +184,6 @@ 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 (!ChangeCmPositionModeRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeCmPositionModeRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ChangeCmPositionModeRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeCmPositionModeResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeCmPositionModeResponse.java index dc117d5f..ffcf8a7e 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeCmPositionModeResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeCmPositionModeResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeCmPositionModeResponse */ @@ -183,18 +181,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ChangeCmPositionModeResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ChangeCmPositionModeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeCmPositionModeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeUmInitialLeverageRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeUmInitialLeverageRequest.java index 1754f313..679e3c83 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeUmInitialLeverageRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeUmInitialLeverageRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeUmInitialLeverageRequest */ @@ -220,18 +218,6 @@ 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 (!ChangeUmInitialLeverageRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeUmInitialLeverageRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ChangeUmInitialLeverageRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeUmInitialLeverageResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeUmInitialLeverageResponse.java index 4ae7d77e..5c8505ce 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeUmInitialLeverageResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeUmInitialLeverageResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeUmInitialLeverageResponse */ @@ -217,18 +215,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ChangeUmInitialLeverageResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ChangeUmInitialLeverageResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeUmInitialLeverageResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("maxNotionalValue") != null && !jsonObj.get("maxNotionalValue").isJsonNull()) diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeUmPositionModeRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeUmPositionModeRequest.java index 4223c942..ad4a8fec 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeUmPositionModeRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeUmPositionModeRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeUmPositionModeRequest */ @@ -186,18 +184,6 @@ 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 (!ChangeUmPositionModeRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeUmPositionModeRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ChangeUmPositionModeRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeUmPositionModeResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeUmPositionModeResponse.java index c17ccec6..1b1c75ef 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeUmPositionModeResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ChangeUmPositionModeResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeUmPositionModeResponse */ @@ -183,18 +181,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ChangeUmPositionModeResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ChangeUmPositionModeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeUmPositionModeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmAccountTradeListResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmAccountTradeListResponse.java index 53b0e13d..5c4d2439 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmAccountTradeListResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmAccountTradeListResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** CmAccountTradeListResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to CmAccountTradeListResponse */ 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) { + CmAccountTradeListResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!CmAccountTradeListResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CmAccountTradeListResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CmAccountTradeListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CmAccountTradeListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmAccountTradeListResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmAccountTradeListResponseInner.java index b0d5882c..da2f7672 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmAccountTradeListResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmAccountTradeListResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CmAccountTradeListResponseInner */ @@ -653,18 +651,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CmAccountTradeListResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CmAccountTradeListResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CmAccountTradeListResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmNotionalAndLeverageBracketsResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmNotionalAndLeverageBracketsResponse.java index 46b64c2c..07f90206 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmNotionalAndLeverageBracketsResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmNotionalAndLeverageBracketsResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** CmNotionalAndLeverageBracketsResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * CmNotionalAndLeverageBracketsResponse */ 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) { + CmNotionalAndLeverageBracketsResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!CmNotionalAndLeverageBracketsResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,19 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CmNotionalAndLeverageBracketsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CmNotionalAndLeverageBracketsResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmNotionalAndLeverageBracketsResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmNotionalAndLeverageBracketsResponseInner.java index 5e3ccfc2..a9e01af5 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmNotionalAndLeverageBracketsResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmNotionalAndLeverageBracketsResponseInner.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -210,20 +208,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CmNotionalAndLeverageBracketsResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CmNotionalAndLeverageBracketsResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmNotionalAndLeverageBracketsResponseInnerBracketsInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmNotionalAndLeverageBracketsResponseInnerBracketsInner.java index b4b79613..de8cc3f9 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmNotionalAndLeverageBracketsResponseInnerBracketsInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmNotionalAndLeverageBracketsResponseInnerBracketsInner.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CmNotionalAndLeverageBracketsResponseInnerBracketsInner */ @@ -334,20 +332,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CmNotionalAndLeverageBracketsResponseInnerBracketsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CmNotionalAndLeverageBracketsResponseInnerBracketsInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmPositionAdlQuantileEstimationResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmPositionAdlQuantileEstimationResponse.java index e9de9bb1..cf3d3e4f 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmPositionAdlQuantileEstimationResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmPositionAdlQuantileEstimationResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** CmPositionAdlQuantileEstimationResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * CmPositionAdlQuantileEstimationResponse */ 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) { + CmPositionAdlQuantileEstimationResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!CmPositionAdlQuantileEstimationResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -122,19 +133,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CmPositionAdlQuantileEstimationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CmPositionAdlQuantileEstimationResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmPositionAdlQuantileEstimationResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmPositionAdlQuantileEstimationResponseInner.java index 8b7cac61..2e657b22 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmPositionAdlQuantileEstimationResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmPositionAdlQuantileEstimationResponseInner.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CmPositionAdlQuantileEstimationResponseInner */ @@ -193,20 +191,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CmPositionAdlQuantileEstimationResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CmPositionAdlQuantileEstimationResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmPositionAdlQuantileEstimationResponseInnerAdlQuantile.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmPositionAdlQuantileEstimationResponseInnerAdlQuantile.java index 0b6d2cd0..4c2e4559 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmPositionAdlQuantileEstimationResponseInnerAdlQuantile.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/CmPositionAdlQuantileEstimationResponseInnerAdlQuantile.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CmPositionAdlQuantileEstimationResponseInnerAdlQuantile */ @@ -259,20 +257,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CmPositionAdlQuantileEstimationResponseInnerAdlQuantile.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CmPositionAdlQuantileEstimationResponseInnerAdlQuantile`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FundAutoCollectionRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FundAutoCollectionRequest.java index 3a62f715..07466e95 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FundAutoCollectionRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FundAutoCollectionRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** FundAutoCollectionRequest */ @@ -149,18 +147,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti FundAutoCollectionRequest.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FundAutoCollectionRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `FundAutoCollectionRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FundAutoCollectionResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FundAutoCollectionResponse.java index f389c011..48249680 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FundAutoCollectionResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FundAutoCollectionResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** FundAutoCollectionResponse */ @@ -149,18 +147,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti FundAutoCollectionResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FundAutoCollectionResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `FundAutoCollectionResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FundCollectionByAssetRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FundCollectionByAssetRequest.java index 5e0116e5..02c8611e 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FundCollectionByAssetRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FundCollectionByAssetRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** FundCollectionByAssetRequest */ @@ -186,18 +184,6 @@ 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 (!FundCollectionByAssetRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `FundCollectionByAssetRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : FundCollectionByAssetRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FundCollectionByAssetResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FundCollectionByAssetResponse.java index 8b7b8ba8..7ec78e02 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FundCollectionByAssetResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/FundCollectionByAssetResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** FundCollectionByAssetResponse */ @@ -151,18 +149,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti FundCollectionByAssetResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FundCollectionByAssetResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `FundCollectionByAssetResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetAutoRepayFuturesStatusResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetAutoRepayFuturesStatusResponse.java index 85d66e64..66bf9b78 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetAutoRepayFuturesStatusResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetAutoRepayFuturesStatusResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetAutoRepayFuturesStatusResponse */ @@ -153,18 +151,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetAutoRepayFuturesStatusResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetAutoRepayFuturesStatusResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmAccountDetailResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmAccountDetailResponse.java index b53852c0..bbe64626 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmAccountDetailResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmAccountDetailResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -221,18 +219,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetCmAccountDetailResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetCmAccountDetailResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetCmAccountDetailResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("assets") != null && !jsonObj.get("assets").isJsonNull()) { JsonArray jsonArrayassets = jsonObj.getAsJsonArray("assets"); diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmAccountDetailResponseAssetsInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmAccountDetailResponseAssetsInner.java index 151de8dc..db40c737 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmAccountDetailResponseAssetsInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmAccountDetailResponseAssetsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetCmAccountDetailResponseAssetsInner */ @@ -414,19 +412,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetCmAccountDetailResponseAssetsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetCmAccountDetailResponseAssetsInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) && !jsonObj.get("asset").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmAccountDetailResponsePositionsInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmAccountDetailResponsePositionsInner.java index 7c03f00b..2713c111 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmAccountDetailResponsePositionsInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmAccountDetailResponsePositionsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetCmAccountDetailResponsePositionsInner */ @@ -551,19 +549,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetCmAccountDetailResponsePositionsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetCmAccountDetailResponsePositionsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmCurrentPositionModeResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmCurrentPositionModeResponse.java index ca8112af..9877a653 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmCurrentPositionModeResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmCurrentPositionModeResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetCmCurrentPositionModeResponse */ @@ -153,18 +151,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetCmCurrentPositionModeResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetCmCurrentPositionModeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetCmCurrentPositionModeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmIncomeHistoryResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmIncomeHistoryResponse.java index c4dd9013..15e426fc 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmIncomeHistoryResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmIncomeHistoryResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** GetCmIncomeHistoryResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to GetCmIncomeHistoryResponse */ 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) { + GetCmIncomeHistoryResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!GetCmIncomeHistoryResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetCmIncomeHistoryResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetCmIncomeHistoryResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetCmIncomeHistoryResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmIncomeHistoryResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmIncomeHistoryResponseInner.java index 96d52e14..bf2012f0 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmIncomeHistoryResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetCmIncomeHistoryResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetCmIncomeHistoryResponseInner */ @@ -376,18 +374,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetCmIncomeHistoryResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetCmIncomeHistoryResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetCmIncomeHistoryResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetDownloadIdForUmFuturesOrderHistoryResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetDownloadIdForUmFuturesOrderHistoryResponse.java index c6166f1e..17adf726 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetDownloadIdForUmFuturesOrderHistoryResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetDownloadIdForUmFuturesOrderHistoryResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetDownloadIdForUmFuturesOrderHistoryResponse */ @@ -197,20 +195,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetDownloadIdForUmFuturesOrderHistoryResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetDownloadIdForUmFuturesOrderHistoryResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetDownloadIdForUmFuturesTradeHistoryResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetDownloadIdForUmFuturesTradeHistoryResponse.java index 38e04414..24c0452b 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetDownloadIdForUmFuturesTradeHistoryResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetDownloadIdForUmFuturesTradeHistoryResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetDownloadIdForUmFuturesTradeHistoryResponse */ @@ -197,20 +195,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetDownloadIdForUmFuturesTradeHistoryResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetDownloadIdForUmFuturesTradeHistoryResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetDownloadIdForUmFuturesTransactionHistoryResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetDownloadIdForUmFuturesTransactionHistoryResponse.java index cba8de5b..5657ed63 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetDownloadIdForUmFuturesTransactionHistoryResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetDownloadIdForUmFuturesTransactionHistoryResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetDownloadIdForUmFuturesTransactionHistoryResponse */ @@ -200,20 +198,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetDownloadIdForUmFuturesTransactionHistoryResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetDownloadIdForUmFuturesTransactionHistoryResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetMarginBorrowLoanInterestHistoryResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetMarginBorrowLoanInterestHistoryResponse.java index ac51975b..ebf9459f 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetMarginBorrowLoanInterestHistoryResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetMarginBorrowLoanInterestHistoryResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -209,20 +207,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetMarginBorrowLoanInterestHistoryResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetMarginBorrowLoanInterestHistoryResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetMarginBorrowLoanInterestHistoryResponseRowsInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetMarginBorrowLoanInterestHistoryResponseRowsInner.java index 7562565f..7c6736ed 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetMarginBorrowLoanInterestHistoryResponseRowsInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetMarginBorrowLoanInterestHistoryResponseRowsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetMarginBorrowLoanInterestHistoryResponseRowsInner */ @@ -409,20 +407,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetMarginBorrowLoanInterestHistoryResponseRowsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetMarginBorrowLoanInterestHistoryResponseRowsInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) && !jsonObj.get("asset").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailResponse.java index d07e8f70..6348c8f8 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -221,18 +219,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetUmAccountDetailResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetUmAccountDetailResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetUmAccountDetailResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("assets") != null && !jsonObj.get("assets").isJsonNull()) { JsonArray jsonArrayassets = jsonObj.getAsJsonArray("assets"); diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailResponsePositionsInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailResponsePositionsInner.java index c4fe795b..fead1d8a 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailResponsePositionsInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailResponsePositionsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetUmAccountDetailResponsePositionsInner */ @@ -622,19 +620,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetUmAccountDetailResponsePositionsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetUmAccountDetailResponsePositionsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailV2Response.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailV2Response.java index 95c7a0cb..c4316933 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailV2Response.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailV2Response.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -223,18 +221,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetUmAccountDetailV2Response.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetUmAccountDetailV2Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetUmAccountDetailV2Response` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("assets") != null && !jsonObj.get("assets").isJsonNull()) { JsonArray jsonArrayassets = jsonObj.getAsJsonArray("assets"); diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailV2ResponseAssetsInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailV2ResponseAssetsInner.java index 3d372a32..ac3c0fd5 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailV2ResponseAssetsInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailV2ResponseAssetsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetUmAccountDetailV2ResponseAssetsInner */ @@ -417,19 +415,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetUmAccountDetailV2ResponseAssetsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetUmAccountDetailV2ResponseAssetsInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) && !jsonObj.get("asset").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailV2ResponsePositionsInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailV2ResponsePositionsInner.java index b0411c15..d504536a 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailV2ResponsePositionsInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmAccountDetailV2ResponsePositionsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetUmAccountDetailV2ResponsePositionsInner */ @@ -402,20 +400,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetUmAccountDetailV2ResponsePositionsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetUmAccountDetailV2ResponsePositionsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmCurrentPositionModeResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmCurrentPositionModeResponse.java index b67f2544..f99eb538 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmCurrentPositionModeResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmCurrentPositionModeResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetUmCurrentPositionModeResponse */ @@ -153,18 +151,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetUmCurrentPositionModeResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetUmCurrentPositionModeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetUmCurrentPositionModeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmFuturesBnbBurnStatusResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmFuturesBnbBurnStatusResponse.java index a3f12eb8..2625ce2d 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmFuturesBnbBurnStatusResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmFuturesBnbBurnStatusResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetUmFuturesBnbBurnStatusResponse */ @@ -152,18 +150,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetUmFuturesBnbBurnStatusResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetUmFuturesBnbBurnStatusResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmFuturesOrderDownloadLinkByIdResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmFuturesOrderDownloadLinkByIdResponse.java index 25542d91..7d4ff00c 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmFuturesOrderDownloadLinkByIdResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmFuturesOrderDownloadLinkByIdResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetUmFuturesOrderDownloadLinkByIdResponse */ @@ -359,19 +357,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetUmFuturesOrderDownloadLinkByIdResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetUmFuturesOrderDownloadLinkByIdResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmFuturesTradeDownloadLinkByIdResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmFuturesTradeDownloadLinkByIdResponse.java index 3a226b1c..051c5c05 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmFuturesTradeDownloadLinkByIdResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmFuturesTradeDownloadLinkByIdResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetUmFuturesTradeDownloadLinkByIdResponse */ @@ -359,19 +357,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetUmFuturesTradeDownloadLinkByIdResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetUmFuturesTradeDownloadLinkByIdResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmFuturesTransactionDownloadLinkByIdResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmFuturesTransactionDownloadLinkByIdResponse.java index 9fad7fbf..eddc783d 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmFuturesTransactionDownloadLinkByIdResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmFuturesTransactionDownloadLinkByIdResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetUmFuturesTransactionDownloadLinkByIdResponse */ @@ -366,20 +364,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetUmFuturesTransactionDownloadLinkByIdResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetUmFuturesTransactionDownloadLinkByIdResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmIncomeHistoryResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmIncomeHistoryResponse.java index ff299b0b..aa4b9f2a 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmIncomeHistoryResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmIncomeHistoryResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** GetUmIncomeHistoryResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to GetUmIncomeHistoryResponse */ 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) { + GetUmIncomeHistoryResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!GetUmIncomeHistoryResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetUmIncomeHistoryResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetUmIncomeHistoryResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetUmIncomeHistoryResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmIncomeHistoryResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmIncomeHistoryResponseInner.java index c1cd4cae..992b8527 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmIncomeHistoryResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUmIncomeHistoryResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetUmIncomeHistoryResponseInner */ @@ -376,18 +374,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetUmIncomeHistoryResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetUmIncomeHistoryResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetUmIncomeHistoryResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUserCommissionRateForCmResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUserCommissionRateForCmResponse.java index f7a69f36..7ad0c87a 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUserCommissionRateForCmResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUserCommissionRateForCmResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetUserCommissionRateForCmResponse */ @@ -230,18 +228,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetUserCommissionRateForCmResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetUserCommissionRateForCmResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUserCommissionRateForUmResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUserCommissionRateForUmResponse.java index 4d400d58..b999cb6e 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUserCommissionRateForUmResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/GetUserCommissionRateForUmResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetUserCommissionRateForUmResponse */ @@ -230,18 +228,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetUserCommissionRateForUmResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetUserCommissionRateForUmResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountBorrowRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountBorrowRequest.java index d8221d15..b21873c7 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountBorrowRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountBorrowRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** MarginAccountBorrowRequest */ @@ -220,18 +218,6 @@ 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 (!MarginAccountBorrowRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarginAccountBorrowRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : MarginAccountBorrowRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountBorrowResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountBorrowResponse.java index 2742dd03..41e224bd 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountBorrowResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountBorrowResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** MarginAccountBorrowResponse */ @@ -150,18 +148,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti MarginAccountBorrowResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MarginAccountBorrowResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarginAccountBorrowResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountNewOcoRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountNewOcoRequest.java index 1043f77c..8cbd7aa2 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountNewOcoRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountNewOcoRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** MarginAccountNewOcoRequest */ @@ -662,18 +660,6 @@ 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 (!MarginAccountNewOcoRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarginAccountNewOcoRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : MarginAccountNewOcoRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountNewOcoResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountNewOcoResponse.java index c9d4f805..b6c930df 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountNewOcoResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountNewOcoResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -543,18 +541,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti MarginAccountNewOcoResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MarginAccountNewOcoResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarginAccountNewOcoResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) && !jsonObj.get("contingencyType").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountNewOcoResponseOrderReportsInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountNewOcoResponseOrderReportsInner.java index 0c5f72ca..88a4c6d6 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountNewOcoResponseOrderReportsInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountNewOcoResponseOrderReportsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** MarginAccountNewOcoResponseOrderReportsInner */ @@ -613,20 +611,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MarginAccountNewOcoResponseOrderReportsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarginAccountNewOcoResponseOrderReportsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountNewOcoResponseOrdersInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountNewOcoResponseOrdersInner.java index a98c9234..93901c94 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountNewOcoResponseOrdersInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountNewOcoResponseOrdersInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** MarginAccountNewOcoResponseOrdersInner */ @@ -220,19 +218,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MarginAccountNewOcoResponseOrdersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarginAccountNewOcoResponseOrdersInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountRepayDebtRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountRepayDebtRequest.java index 5e67493d..3a027d21 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountRepayDebtRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountRepayDebtRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** MarginAccountRepayDebtRequest */ @@ -258,18 +256,6 @@ 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 (!MarginAccountRepayDebtRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarginAccountRepayDebtRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : MarginAccountRepayDebtRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountRepayDebtResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountRepayDebtResponse.java index acab4a77..6714b48f 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountRepayDebtResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountRepayDebtResponse.java @@ -31,9 +31,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -301,18 +299,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti MarginAccountRepayDebtResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MarginAccountRepayDebtResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarginAccountRepayDebtResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonNull()) && !jsonObj.get("amount").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountRepayRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountRepayRequest.java index 88a52f77..710049a0 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountRepayRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountRepayRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** MarginAccountRepayRequest */ @@ -220,18 +218,6 @@ 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 (!MarginAccountRepayRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarginAccountRepayRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : MarginAccountRepayRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountRepayResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountRepayResponse.java index f47888a3..1e7b484f 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountRepayResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountRepayResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** MarginAccountRepayResponse */ @@ -149,18 +147,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti MarginAccountRepayResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MarginAccountRepayResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarginAccountRepayResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountTradeListResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountTradeListResponse.java index 59a5f11a..0556b47e 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountTradeListResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountTradeListResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** MarginAccountTradeListResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * MarginAccountTradeListResponse */ 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) { + MarginAccountTradeListResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!MarginAccountTradeListResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti MarginAccountTradeListResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MarginAccountTradeListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarginAccountTradeListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountTradeListResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountTradeListResponseInner.java index b91a34f3..cabb4ee3 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountTradeListResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginAccountTradeListResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** MarginAccountTradeListResponseInner */ @@ -489,18 +487,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MarginAccountTradeListResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarginAccountTradeListResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("commission") != null && !jsonObj.get("commission").isJsonNull()) && !jsonObj.get("commission").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginMaxBorrowResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginMaxBorrowResponse.java index fd171186..efefe671 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginMaxBorrowResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/MarginMaxBorrowResponse.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** MarginMaxBorrowResponse */ @@ -183,18 +181,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti MarginMaxBorrowResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MarginMaxBorrowResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarginMaxBorrowResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ModifyCmOrderRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ModifyCmOrderRequest.java index c632a399..c59b59be 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ModifyCmOrderRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ModifyCmOrderRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ModifyCmOrderRequest */ @@ -391,18 +389,6 @@ 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 (!ModifyCmOrderRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyCmOrderRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ModifyCmOrderRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ModifyCmOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ModifyCmOrderResponse.java index 4b89d5d4..349292f0 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ModifyCmOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ModifyCmOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ModifyCmOrderResponse */ @@ -711,18 +709,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ModifyCmOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ModifyCmOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyCmOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ModifyUmOrderRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ModifyUmOrderRequest.java index 8ee808f7..3c23c33c 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ModifyUmOrderRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ModifyUmOrderRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ModifyUmOrderRequest */ @@ -391,18 +389,6 @@ 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 (!ModifyUmOrderRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyUmOrderRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ModifyUmOrderRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ModifyUmOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ModifyUmOrderResponse.java index 67fb6889..65b72a9f 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ModifyUmOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ModifyUmOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ModifyUmOrderResponse */ @@ -785,18 +783,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ModifyUmOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ModifyUmOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyUmOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewCmConditionalOrderRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewCmConditionalOrderRequest.java index d0236c1f..3b2b35a3 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewCmConditionalOrderRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewCmConditionalOrderRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NewCmConditionalOrderRequest */ @@ -646,18 +644,6 @@ 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 (!NewCmConditionalOrderRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewCmConditionalOrderRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : NewCmConditionalOrderRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewCmConditionalOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewCmConditionalOrderResponse.java index 84dbba57..5106457c 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewCmConditionalOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewCmConditionalOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NewCmConditionalOrderResponse */ @@ -760,18 +758,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti NewCmConditionalOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NewCmConditionalOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewCmConditionalOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("newClientStrategyId") != null && !jsonObj.get("newClientStrategyId").isJsonNull()) diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewCmOrderRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewCmOrderRequest.java index 99bffd60..884513c1 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewCmOrderRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewCmOrderRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NewCmOrderRequest */ @@ -532,18 +530,6 @@ 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 (!NewCmOrderRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewCmOrderRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : NewCmOrderRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewCmOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewCmOrderResponse.java index c5458c17..694769c2 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewCmOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewCmOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NewCmOrderResponse */ @@ -678,18 +676,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti NewCmOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NewCmOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewCmOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) && !jsonObj.get("clientOrderId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewMarginOrderRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewMarginOrderRequest.java index b8b14a81..72b0fd64 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewMarginOrderRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewMarginOrderRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NewMarginOrderRequest */ @@ -646,18 +644,6 @@ 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 (!NewMarginOrderRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewMarginOrderRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : NewMarginOrderRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewMarginOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewMarginOrderResponse.java index 98fa4d5f..43d8d15e 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewMarginOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewMarginOrderResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -650,18 +648,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti NewMarginOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NewMarginOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewMarginOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewMarginOrderResponseFillsInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewMarginOrderResponseFillsInner.java index 81d2998d..18aa0cbb 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewMarginOrderResponseFillsInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewMarginOrderResponseFillsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NewMarginOrderResponseFillsInner */ @@ -250,18 +248,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti NewMarginOrderResponseFillsInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NewMarginOrderResponseFillsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewMarginOrderResponseFillsInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) && !jsonObj.get("price").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmConditionalOrderRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmConditionalOrderRequest.java index fdedd459..d5d3643d 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmConditionalOrderRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmConditionalOrderRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NewUmConditionalOrderRequest */ @@ -758,18 +756,6 @@ 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 (!NewUmConditionalOrderRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewUmConditionalOrderRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : NewUmConditionalOrderRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmConditionalOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmConditionalOrderResponse.java index c19949a3..6059a9a9 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmConditionalOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmConditionalOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NewUmConditionalOrderResponse */ @@ -837,18 +835,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti NewUmConditionalOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NewUmConditionalOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewUmConditionalOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("newClientStrategyId") != null && !jsonObj.get("newClientStrategyId").isJsonNull()) diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmOrderRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmOrderRequest.java index e6038d84..15f88935 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmOrderRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmOrderRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NewUmOrderRequest */ @@ -607,18 +605,6 @@ 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 (!NewUmOrderRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewUmOrderRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : NewUmOrderRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmOrderResponse.java index 2a124560..f0c09e49 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/NewUmOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NewUmOrderResponse */ @@ -752,18 +750,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti NewUmOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NewUmOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewUmOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) && !jsonObj.get("clientOrderId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse.java index ab280438..623d1f5e 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse */ @@ -200,20 +198,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `indicators` if (jsonObj.get("indicators") != null && !jsonObj.get("indicators").isJsonNull()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicators.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicators.java index 61e90c89..aab9b6f1 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicators.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicators.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -261,20 +259,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicators.openapiFields - .contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicators`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("BTCUSDT") != null && !jsonObj.get("BTCUSDT").isJsonNull()) { JsonArray jsonArrayBTCUSDT = jsonObj.getAsJsonArray("BTCUSDT"); diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicatorsACCOUNTInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicatorsACCOUNTInner.java index ba89a24c..50caaeb3 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicatorsACCOUNTInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicatorsACCOUNTInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicatorsACCOUNTInner */ @@ -312,21 +310,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicatorsACCOUNTInner - .openapiFields - .contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicatorsACCOUNTInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("indicator") != null && !jsonObj.get("indicator").isJsonNull()) && !jsonObj.get("indicator").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicatorsBTCUSDTInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicatorsBTCUSDTInner.java index 7a04e1c3..367eff27 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicatorsBTCUSDTInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicatorsBTCUSDTInner.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicatorsBTCUSDTInner */ @@ -315,21 +313,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicatorsBTCUSDTInner - .openapiFields - .contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PortfolioMarginUmTradingQuantitativeRulesIndicatorsResponseIndicatorsBTCUSDTInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("indicator") != null && !jsonObj.get("indicator").isJsonNull()) && !jsonObj.get("indicator").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCmConditionalOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCmConditionalOrdersResponse.java index 536d08b2..8190f3ca 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCmConditionalOrdersResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCmConditionalOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryAllCmConditionalOrdersResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * QueryAllCmConditionalOrdersResponse */ 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) { + QueryAllCmConditionalOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryAllCmConditionalOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,18 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryAllCmConditionalOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryAllCmConditionalOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCmConditionalOrdersResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCmConditionalOrdersResponseInner.java index 6f433d96..4771f144 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCmConditionalOrdersResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCmConditionalOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryAllCmConditionalOrdersResponseInner */ @@ -817,19 +815,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryAllCmConditionalOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryAllCmConditionalOrdersResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("newClientStrategyId") != null && !jsonObj.get("newClientStrategyId").isJsonNull()) diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCmOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCmOrdersResponse.java index f6c44eda..5da1e5c3 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCmOrdersResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCmOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryAllCmOrdersResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to QueryAllCmOrdersResponse */ 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) { + QueryAllCmOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryAllCmOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryAllCmOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryAllCmOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryAllCmOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCmOrdersResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCmOrdersResponseInner.java index 7d3f333f..a0e2d6c5 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCmOrdersResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCmOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryAllCmOrdersResponseInner */ @@ -718,18 +716,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryAllCmOrdersResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryAllCmOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryAllCmOrdersResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentCmOpenConditionalOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentCmOpenConditionalOrdersResponse.java index 28da1435..e653f00b 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentCmOpenConditionalOrdersResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentCmOpenConditionalOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryAllCurrentCmOpenConditionalOrdersResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * QueryAllCurrentCmOpenConditionalOrdersResponse */ 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) { + QueryAllCurrentCmOpenConditionalOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryAllCurrentCmOpenConditionalOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -122,20 +133,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryAllCurrentCmOpenConditionalOrdersResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryAllCurrentCmOpenConditionalOrdersResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentCmOpenConditionalOrdersResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentCmOpenConditionalOrdersResponseInner.java index d5154751..ebc606ce 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentCmOpenConditionalOrdersResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentCmOpenConditionalOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryAllCurrentCmOpenConditionalOrdersResponseInner */ @@ -698,20 +696,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryAllCurrentCmOpenConditionalOrdersResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryAllCurrentCmOpenConditionalOrdersResponseInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("newClientStrategyId") != null && !jsonObj.get("newClientStrategyId").isJsonNull()) diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentCmOpenOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentCmOpenOrdersResponse.java index 1f833bc5..30a0abcb 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentCmOpenOrdersResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentCmOpenOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryAllCurrentCmOpenOrdersResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * QueryAllCurrentCmOpenOrdersResponse */ 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) { + QueryAllCmOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryAllCurrentCmOpenOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -120,18 +131,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryAllCurrentCmOpenOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryAllCurrentCmOpenOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenConditionalOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenConditionalOrdersResponse.java index a5de708d..3ad16fe2 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenConditionalOrdersResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenConditionalOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryAllCurrentUmOpenConditionalOrdersResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * QueryAllCurrentUmOpenConditionalOrdersResponse */ 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) { + QueryAllCurrentUmOpenConditionalOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryAllCurrentUmOpenConditionalOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -122,20 +133,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryAllCurrentUmOpenConditionalOrdersResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryAllCurrentUmOpenConditionalOrdersResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenConditionalOrdersResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenConditionalOrdersResponseInner.java index 4afbaab3..deee5bc2 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenConditionalOrdersResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenConditionalOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryAllCurrentUmOpenConditionalOrdersResponseInner */ @@ -812,20 +810,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryAllCurrentUmOpenConditionalOrdersResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryAllCurrentUmOpenConditionalOrdersResponseInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("newClientStrategyId") != null && !jsonObj.get("newClientStrategyId").isJsonNull()) diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenOrdersResponse.java index 8e5b8e3c..47f4417d 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenOrdersResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryAllCurrentUmOpenOrdersResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * QueryAllCurrentUmOpenOrdersResponse */ 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) { + QueryAllCurrentUmOpenOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryAllCurrentUmOpenOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,18 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryAllCurrentUmOpenOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryAllCurrentUmOpenOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenOrdersResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenOrdersResponseInner.java index 183e46d0..74d0aba2 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenOrdersResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllCurrentUmOpenOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryAllCurrentUmOpenOrdersResponseInner */ @@ -814,19 +812,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryAllCurrentUmOpenOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryAllCurrentUmOpenOrdersResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllMarginAccountOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllMarginAccountOrdersResponse.java index 1079f095..fb556517 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllMarginAccountOrdersResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllMarginAccountOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryAllMarginAccountOrdersResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * QueryAllMarginAccountOrdersResponse */ 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) { + QueryAllMarginAccountOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryAllMarginAccountOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,18 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryAllMarginAccountOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryAllMarginAccountOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllMarginAccountOrdersResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllMarginAccountOrdersResponseInner.java index 28e548f3..336607dd 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllMarginAccountOrdersResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllMarginAccountOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryAllMarginAccountOrdersResponseInner */ @@ -826,19 +824,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryAllMarginAccountOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryAllMarginAccountOrdersResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) && !jsonObj.get("clientOrderId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllUmConditionalOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllUmConditionalOrdersResponse.java index f1b1f467..7d4a8f28 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllUmConditionalOrdersResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllUmConditionalOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryAllUmConditionalOrdersResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * QueryAllUmConditionalOrdersResponse */ 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) { + QueryAllUmConditionalOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryAllUmConditionalOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,18 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryAllUmConditionalOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryAllUmConditionalOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllUmConditionalOrdersResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllUmConditionalOrdersResponseInner.java index 605f7fff..38f27d8f 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllUmConditionalOrdersResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllUmConditionalOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryAllUmConditionalOrdersResponseInner */ @@ -929,19 +927,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryAllUmConditionalOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryAllUmConditionalOrdersResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("newClientStrategyId") != null && !jsonObj.get("newClientStrategyId").isJsonNull()) diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllUmOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllUmOrdersResponse.java index 032a9226..d340f122 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllUmOrdersResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryAllUmOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryAllUmOrdersResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to QueryAllUmOrdersResponse */ 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) { + QueryAllCurrentUmOpenOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryAllUmOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryAllUmOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryAllUmOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryAllUmOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmConditionalOrderHistoryResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmConditionalOrderHistoryResponse.java index 3477e085..631dd016 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmConditionalOrderHistoryResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmConditionalOrderHistoryResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryCmConditionalOrderHistoryResponse */ @@ -917,19 +915,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryCmConditionalOrderHistoryResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryCmConditionalOrderHistoryResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("newClientStrategyId") != null && !jsonObj.get("newClientStrategyId").isJsonNull()) diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponse.java index 209d7bf5..8d22318f 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryCmModifyOrderHistoryResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * QueryCmModifyOrderHistoryResponse */ 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) { + QueryCmModifyOrderHistoryResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryCmModifyOrderHistoryResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,18 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryCmModifyOrderHistoryResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryCmModifyOrderHistoryResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponseInner.java index 959dff25..e2a956d0 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponseInner.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryCmModifyOrderHistoryResponseInner */ @@ -355,19 +353,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryCmModifyOrderHistoryResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryCmModifyOrderHistoryResponseInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponseInnerAmendment.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponseInnerAmendment.java index f5edc0a6..c22e52e4 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponseInnerAmendment.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponseInnerAmendment.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryCmModifyOrderHistoryResponseInnerAmendment */ @@ -233,20 +231,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryCmModifyOrderHistoryResponseInnerAmendment.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryCmModifyOrderHistoryResponseInnerAmendment`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `price` if (jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponseInnerAmendmentOrigQty.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponseInnerAmendmentOrigQty.java index 63e295b3..6ddeff79 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponseInnerAmendmentOrigQty.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponseInnerAmendmentOrigQty.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryCmModifyOrderHistoryResponseInnerAmendmentOrigQty */ @@ -191,20 +189,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryCmModifyOrderHistoryResponseInnerAmendmentOrigQty.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryCmModifyOrderHistoryResponseInnerAmendmentOrigQty`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("before") != null && !jsonObj.get("before").isJsonNull()) && !jsonObj.get("before").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponseInnerAmendmentPrice.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponseInnerAmendmentPrice.java index da21a9dd..262c50a2 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponseInnerAmendmentPrice.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmModifyOrderHistoryResponseInnerAmendmentPrice.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryCmModifyOrderHistoryResponseInnerAmendmentPrice */ @@ -191,20 +189,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryCmModifyOrderHistoryResponseInnerAmendmentPrice.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryCmModifyOrderHistoryResponseInnerAmendmentPrice`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("before") != null && !jsonObj.get("before").isJsonNull()) && !jsonObj.get("before").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmOrderResponse.java index dc1595d4..d6e1551f 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryCmOrderResponse */ @@ -711,18 +709,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryCmOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryCmOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryCmOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmPositionInformationResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmPositionInformationResponse.java index 196dccca..573e4c6a 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmPositionInformationResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmPositionInformationResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryCmPositionInformationResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * QueryCmPositionInformationResponse */ 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) { + QueryCmPositionInformationResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryCmPositionInformationResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,18 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryCmPositionInformationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryCmPositionInformationResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmPositionInformationResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmPositionInformationResponseInner.java index 7f6bd6f6..db048892 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmPositionInformationResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCmPositionInformationResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryCmPositionInformationResponseInner */ @@ -504,19 +502,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryCmPositionInformationResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryCmPositionInformationResponseInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentCmOpenConditionalOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentCmOpenConditionalOrderResponse.java index 3dc3a6ed..9c03210a 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentCmOpenConditionalOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentCmOpenConditionalOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryCurrentCmOpenConditionalOrderResponse */ @@ -684,20 +682,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryCurrentCmOpenConditionalOrderResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryCurrentCmOpenConditionalOrderResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("newClientStrategyId") != null && !jsonObj.get("newClientStrategyId").isJsonNull()) diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentCmOpenOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentCmOpenOrderResponse.java index b53cf2fc..75a0062e 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentCmOpenOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentCmOpenOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryCurrentCmOpenOrderResponse */ @@ -719,18 +717,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryCurrentCmOpenOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryCurrentCmOpenOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryCurrentCmOpenOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentMarginOpenOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentMarginOpenOrderResponse.java index b857cde1..0c686f1c 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentMarginOpenOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentMarginOpenOrderResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryCurrentMarginOpenOrderResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * QueryCurrentMarginOpenOrderResponse */ 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) { + QueryCurrentMarginOpenOrderResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryCurrentMarginOpenOrderResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,18 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryCurrentMarginOpenOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryCurrentMarginOpenOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentMarginOpenOrderResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentMarginOpenOrderResponseInner.java index 72e5998a..43205791 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentMarginOpenOrderResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentMarginOpenOrderResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryCurrentMarginOpenOrderResponseInner */ @@ -826,19 +824,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryCurrentMarginOpenOrderResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryCurrentMarginOpenOrderResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) && !jsonObj.get("clientOrderId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentUmOpenConditionalOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentUmOpenConditionalOrderResponse.java index ab393c9a..8893cace 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentUmOpenConditionalOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentUmOpenConditionalOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryCurrentUmOpenConditionalOrderResponse */ @@ -796,20 +794,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryCurrentUmOpenConditionalOrderResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryCurrentUmOpenConditionalOrderResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("newClientStrategyId") != null && !jsonObj.get("newClientStrategyId").isJsonNull()) diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentUmOpenOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentUmOpenOrderResponse.java index 48d614da..abfb65c9 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentUmOpenOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentUmOpenOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryCurrentUmOpenOrderResponse */ @@ -796,18 +794,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryCurrentUmOpenOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryCurrentUmOpenOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryCurrentUmOpenOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountOrderResponse.java index ff5b7a68..43854e66 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryMarginAccountOrderResponse */ @@ -808,18 +806,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryMarginAccountOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryMarginAccountOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryMarginAccountOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) && !jsonObj.get("clientOrderId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsAllOcoResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsAllOcoResponse.java index 0670b6a1..96417ddf 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsAllOcoResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsAllOcoResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryMarginAccountsAllOcoResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * QueryMarginAccountsAllOcoResponse */ 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) { + QueryMarginAccountsAllOcoResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryMarginAccountsAllOcoResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,18 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryMarginAccountsAllOcoResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryMarginAccountsAllOcoResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsAllOcoResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsAllOcoResponseInner.java index 4f9de7aa..b7532e29 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsAllOcoResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsAllOcoResponseInner.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -425,19 +423,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryMarginAccountsAllOcoResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryMarginAccountsAllOcoResponseInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) && !jsonObj.get("contingencyType").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsAllOcoResponseInnerOrdersInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsAllOcoResponseInnerOrdersInner.java index 7bdb965e..f9694b4b 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsAllOcoResponseInnerOrdersInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsAllOcoResponseInnerOrdersInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryMarginAccountsAllOcoResponseInnerOrdersInner */ @@ -225,20 +223,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryMarginAccountsAllOcoResponseInnerOrdersInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryMarginAccountsAllOcoResponseInnerOrdersInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOcoResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOcoResponse.java index 85b171cf..8916f236 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOcoResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOcoResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -419,18 +417,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryMarginAccountsOcoResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryMarginAccountsOcoResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryMarginAccountsOcoResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) && !jsonObj.get("contingencyType").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOcoResponseOrdersInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOcoResponseOrdersInner.java index 0e1e8276..5ba2a7f4 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOcoResponseOrdersInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOcoResponseOrdersInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryMarginAccountsOcoResponseOrdersInner */ @@ -222,19 +220,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryMarginAccountsOcoResponseOrdersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryMarginAccountsOcoResponseOrdersInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOpenOcoResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOpenOcoResponse.java index 29d96694..02b23dcc 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOpenOcoResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOpenOcoResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryMarginAccountsOpenOcoResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * QueryMarginAccountsOpenOcoResponse */ 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) { + QueryMarginAccountsOpenOcoResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryMarginAccountsOpenOcoResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,18 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryMarginAccountsOpenOcoResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryMarginAccountsOpenOcoResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOpenOcoResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOpenOcoResponseInner.java index 0d83bc65..20102e47 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOpenOcoResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOpenOcoResponseInner.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -426,19 +424,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryMarginAccountsOpenOcoResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryMarginAccountsOpenOcoResponseInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) && !jsonObj.get("contingencyType").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOpenOcoResponseInnerOrdersInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOpenOcoResponseInnerOrdersInner.java index 21733245..dffbb305 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOpenOcoResponseInnerOrdersInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginAccountsOpenOcoResponseInnerOrdersInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryMarginAccountsOpenOcoResponseInnerOrdersInner */ @@ -226,20 +224,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryMarginAccountsOpenOcoResponseInnerOrdersInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryMarginAccountsOpenOcoResponseInnerOrdersInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginLoanRecordResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginLoanRecordResponse.java index 32141d40..4c9309cf 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginLoanRecordResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginLoanRecordResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -204,18 +202,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryMarginLoanRecordResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryMarginLoanRecordResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryMarginLoanRecordResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginLoanRecordResponseRowsInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginLoanRecordResponseRowsInner.java index 5caba7c8..9021c3fc 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginLoanRecordResponseRowsInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginLoanRecordResponseRowsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryMarginLoanRecordResponseRowsInner */ @@ -283,19 +281,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryMarginLoanRecordResponseRowsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryMarginLoanRecordResponseRowsInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) && !jsonObj.get("asset").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginMaxWithdrawResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginMaxWithdrawResponse.java index 0c469b6a..20d0272f 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginMaxWithdrawResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginMaxWithdrawResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryMarginMaxWithdrawResponse */ @@ -151,18 +149,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryMarginMaxWithdrawResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryMarginMaxWithdrawResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryMarginMaxWithdrawResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonNull()) && !jsonObj.get("amount").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginRepayRecordResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginRepayRecordResponse.java index 301ed98b..c55ef7cd 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginRepayRecordResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginRepayRecordResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -206,18 +204,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryMarginRepayRecordResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryMarginRepayRecordResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryMarginRepayRecordResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginRepayRecordResponseRowsInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginRepayRecordResponseRowsInner.java index a41e53d2..47a45f75 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginRepayRecordResponseRowsInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryMarginRepayRecordResponseRowsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryMarginRepayRecordResponseRowsInner */ @@ -351,19 +349,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryMarginRepayRecordResponseRowsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryMarginRepayRecordResponseRowsInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonNull()) && !jsonObj.get("amount").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryPortfolioMarginNegativeBalanceInterestHistoryResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryPortfolioMarginNegativeBalanceInterestHistoryResponse.java index c76c034e..347f79e6 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryPortfolioMarginNegativeBalanceInterestHistoryResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryPortfolioMarginNegativeBalanceInterestHistoryResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryPortfolioMarginNegativeBalanceInterestHistoryResponse */ @@ -110,6 +109,19 @@ private String toIndentedString(Object o) { * QueryPortfolioMarginNegativeBalanceInterestHistoryResponse */ 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) { + QueryPortfolioMarginNegativeBalanceInterestHistoryResponseInner.validateJsonElement( + element); + } if (jsonElement == null) { if (!QueryPortfolioMarginNegativeBalanceInterestHistoryResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -123,20 +135,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryPortfolioMarginNegativeBalanceInterestHistoryResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryPortfolioMarginNegativeBalanceInterestHistoryResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryPortfolioMarginNegativeBalanceInterestHistoryResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryPortfolioMarginNegativeBalanceInterestHistoryResponseInner.java index 75827e85..5445e6d1 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryPortfolioMarginNegativeBalanceInterestHistoryResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryPortfolioMarginNegativeBalanceInterestHistoryResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryPortfolioMarginNegativeBalanceInterestHistoryResponseInner */ @@ -305,20 +303,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryPortfolioMarginNegativeBalanceInterestHistoryResponseInner.openapiFields - .contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryPortfolioMarginNegativeBalanceInterestHistoryResponseInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) && !jsonObj.get("asset").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmConditionalOrderHistoryResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmConditionalOrderHistoryResponse.java index a9e4a6b4..9efee7b9 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmConditionalOrderHistoryResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmConditionalOrderHistoryResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryUmConditionalOrderHistoryResponse */ @@ -959,19 +957,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUmConditionalOrderHistoryResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUmConditionalOrderHistoryResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("newClientStrategyId") != null && !jsonObj.get("newClientStrategyId").isJsonNull()) diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmModifyOrderHistoryResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmModifyOrderHistoryResponse.java index dba563a4..1468c78c 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmModifyOrderHistoryResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmModifyOrderHistoryResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryUmModifyOrderHistoryResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * QueryUmModifyOrderHistoryResponse */ 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) { + QueryUmModifyOrderHistoryResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryUmModifyOrderHistoryResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,18 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUmModifyOrderHistoryResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUmModifyOrderHistoryResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmModifyOrderHistoryResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmModifyOrderHistoryResponseInner.java index 00098c1e..8f96d742 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmModifyOrderHistoryResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmModifyOrderHistoryResponseInner.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryUmModifyOrderHistoryResponseInner */ @@ -390,19 +388,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUmModifyOrderHistoryResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUmModifyOrderHistoryResponseInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmOrderResponse.java index aede1702..40a941bc 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryUmOrderResponse */ @@ -785,18 +783,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryUmOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUmOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUmOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmPositionInformationResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmPositionInformationResponse.java index 7b4aa574..3d64f418 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmPositionInformationResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmPositionInformationResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryUmPositionInformationResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * QueryUmPositionInformationResponse */ 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) { + QueryUmPositionInformationResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryUmPositionInformationResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,18 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUmPositionInformationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUmPositionInformationResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmPositionInformationResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmPositionInformationResponseInner.java index 22ee8523..760fa4b1 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmPositionInformationResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUmPositionInformationResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryUmPositionInformationResponseInner */ @@ -504,19 +502,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUmPositionInformationResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUmPositionInformationResponseInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("entryPrice") != null && !jsonObj.get("entryPrice").isJsonNull()) && !jsonObj.get("entryPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserNegativeBalanceAutoExchangeRecordResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserNegativeBalanceAutoExchangeRecordResponse.java index 3b063477..721a030a 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserNegativeBalanceAutoExchangeRecordResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserNegativeBalanceAutoExchangeRecordResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -212,20 +210,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUserNegativeBalanceAutoExchangeRecordResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUserNegativeBalanceAutoExchangeRecordResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserNegativeBalanceAutoExchangeRecordResponseRowsInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserNegativeBalanceAutoExchangeRecordResponseRowsInner.java index cd6a1655..1d84b90e 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserNegativeBalanceAutoExchangeRecordResponseRowsInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserNegativeBalanceAutoExchangeRecordResponseRowsInner.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -258,20 +256,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUserNegativeBalanceAutoExchangeRecordResponseRowsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUserNegativeBalanceAutoExchangeRecordResponseRowsInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("details") != null && !jsonObj.get("details").isJsonNull()) { JsonArray jsonArraydetails = jsonObj.getAsJsonArray("details"); diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserNegativeBalanceAutoExchangeRecordResponseRowsInnerDetailsInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserNegativeBalanceAutoExchangeRecordResponseRowsInnerDetailsInner.java index f8b521ba..157c3708 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserNegativeBalanceAutoExchangeRecordResponseRowsInnerDetailsInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserNegativeBalanceAutoExchangeRecordResponseRowsInnerDetailsInner.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryUserNegativeBalanceAutoExchangeRecordResponseRowsInnerDetailsInner */ @@ -240,21 +238,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUserNegativeBalanceAutoExchangeRecordResponseRowsInnerDetailsInner - .openapiFields - .contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUserNegativeBalanceAutoExchangeRecordResponseRowsInnerDetailsInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) && !jsonObj.get("asset").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserRateLimitResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserRateLimitResponse.java index 73af29cb..3b14ac69 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserRateLimitResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserRateLimitResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryUserRateLimitResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to QueryUserRateLimitResponse */ 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) { + QueryUserRateLimitResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryUserRateLimitResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryUserRateLimitResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUserRateLimitResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUserRateLimitResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserRateLimitResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserRateLimitResponseInner.java index 53c1f20e..f6f161ac 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserRateLimitResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUserRateLimitResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryUserRateLimitResponseInner */ @@ -249,18 +247,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryUserRateLimitResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUserRateLimitResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUserRateLimitResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) && !jsonObj.get("rateLimitType").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersCmForceOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersCmForceOrdersResponse.java index 15077d21..af9c54d8 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersCmForceOrdersResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersCmForceOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryUsersCmForceOrdersResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * QueryUsersCmForceOrdersResponse */ 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) { + QueryUsersCmForceOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryUsersCmForceOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -120,18 +131,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryUsersCmForceOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUsersCmForceOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUsersCmForceOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersCmForceOrdersResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersCmForceOrdersResponseInner.java index 3ab9f4b2..4552bdfc 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersCmForceOrdersResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersCmForceOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryUsersCmForceOrdersResponseInner */ @@ -728,19 +726,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUsersCmForceOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUsersCmForceOrdersResponseInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersMarginForceOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersMarginForceOrdersResponse.java index b31c33fd..99e2848e 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersMarginForceOrdersResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersMarginForceOrdersResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -207,18 +205,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUsersMarginForceOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUsersMarginForceOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersMarginForceOrdersResponseRowsInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersMarginForceOrdersResponseRowsInner.java index 1e2d127b..3a20ce30 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersMarginForceOrdersResponseRowsInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersMarginForceOrdersResponseRowsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryUsersMarginForceOrdersResponseRowsInner */ @@ -423,20 +421,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUsersMarginForceOrdersResponseRowsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUsersMarginForceOrdersResponseRowsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersUmForceOrdersResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersUmForceOrdersResponse.java index 991e02ba..d97ed68c 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersUmForceOrdersResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersUmForceOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryUsersUmForceOrdersResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * QueryUsersUmForceOrdersResponse */ 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) { + QueryUsersUmForceOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryUsersUmForceOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -120,18 +131,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryUsersUmForceOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUsersUmForceOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUsersUmForceOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersUmForceOrdersResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersUmForceOrdersResponseInner.java index 02344e32..3fb2b16f 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersUmForceOrdersResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryUsersUmForceOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryUsersUmForceOrdersResponseInner */ @@ -695,19 +693,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUsersUmForceOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUsersUmForceOrdersResponseInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/RepayFuturesNegativeBalanceRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/RepayFuturesNegativeBalanceRequest.java index 14a13343..cff75118 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/RepayFuturesNegativeBalanceRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/RepayFuturesNegativeBalanceRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** RepayFuturesNegativeBalanceRequest */ @@ -153,18 +151,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RepayFuturesNegativeBalanceRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RepayFuturesNegativeBalanceRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/RepayFuturesNegativeBalanceResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/RepayFuturesNegativeBalanceResponse.java index eab6a031..9c24162c 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/RepayFuturesNegativeBalanceResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/RepayFuturesNegativeBalanceResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** RepayFuturesNegativeBalanceResponse */ @@ -152,18 +150,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RepayFuturesNegativeBalanceResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RepayFuturesNegativeBalanceResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/StartUserDataStreamResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/StartUserDataStreamResponse.java index d24db23d..5082919c 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/StartUserDataStreamResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/StartUserDataStreamResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** StartUserDataStreamResponse */ @@ -150,18 +148,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti StartUserDataStreamResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!StartUserDataStreamResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `StartUserDataStreamResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("listenKey") != null && !jsonObj.get("listenKey").isJsonNull()) && !jsonObj.get("listenKey").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ToggleBnbBurnOnUmFuturesTradeRequest.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ToggleBnbBurnOnUmFuturesTradeRequest.java index 149484a3..a8e87449 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ToggleBnbBurnOnUmFuturesTradeRequest.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ToggleBnbBurnOnUmFuturesTradeRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ToggleBnbBurnOnUmFuturesTradeRequest */ @@ -189,19 +187,6 @@ 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 (!ToggleBnbBurnOnUmFuturesTradeRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ToggleBnbBurnOnUmFuturesTradeRequest` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ToggleBnbBurnOnUmFuturesTradeRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ToggleBnbBurnOnUmFuturesTradeResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ToggleBnbBurnOnUmFuturesTradeResponse.java index ca8ce236..d4990be9 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ToggleBnbBurnOnUmFuturesTradeResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/ToggleBnbBurnOnUmFuturesTradeResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ToggleBnbBurnOnUmFuturesTradeResponse */ @@ -184,19 +182,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ToggleBnbBurnOnUmFuturesTradeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ToggleBnbBurnOnUmFuturesTradeResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmAccountTradeListResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmAccountTradeListResponse.java index 81651e97..1b499ca3 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmAccountTradeListResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmAccountTradeListResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** UmAccountTradeListResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to UmAccountTradeListResponse */ 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) { + UmAccountTradeListResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!UmAccountTradeListResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti UmAccountTradeListResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UmAccountTradeListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UmAccountTradeListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmAccountTradeListResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmAccountTradeListResponseInner.java index e56e361b..c4f263b2 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmAccountTradeListResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmAccountTradeListResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** UmAccountTradeListResponseInner */ @@ -586,18 +584,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti UmAccountTradeListResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UmAccountTradeListResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UmAccountTradeListResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmFuturesAccountConfigurationResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmFuturesAccountConfigurationResponse.java index 813750fb..8c837939 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmFuturesAccountConfigurationResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmFuturesAccountConfigurationResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** UmFuturesAccountConfigurationResponse */ @@ -400,19 +398,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UmFuturesAccountConfigurationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UmFuturesAccountConfigurationResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmFuturesSymbolConfigurationResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmFuturesSymbolConfigurationResponse.java index b277f574..f50d84c6 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmFuturesSymbolConfigurationResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmFuturesSymbolConfigurationResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** UmFuturesSymbolConfigurationResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * UmFuturesSymbolConfigurationResponse */ 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) { + UmFuturesSymbolConfigurationResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!UmFuturesSymbolConfigurationResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,19 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UmFuturesSymbolConfigurationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UmFuturesSymbolConfigurationResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmFuturesSymbolConfigurationResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmFuturesSymbolConfigurationResponseInner.java index f20b242f..a3737a16 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmFuturesSymbolConfigurationResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmFuturesSymbolConfigurationResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** UmFuturesSymbolConfigurationResponseInner */ @@ -291,19 +289,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UmFuturesSymbolConfigurationResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UmFuturesSymbolConfigurationResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmNotionalAndLeverageBracketsResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmNotionalAndLeverageBracketsResponse.java index 42c11f22..d33f4bf6 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmNotionalAndLeverageBracketsResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmNotionalAndLeverageBracketsResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** UmNotionalAndLeverageBracketsResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * UmNotionalAndLeverageBracketsResponse */ 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) { + UmNotionalAndLeverageBracketsResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!UmNotionalAndLeverageBracketsResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,19 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UmNotionalAndLeverageBracketsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UmNotionalAndLeverageBracketsResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmNotionalAndLeverageBracketsResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmNotionalAndLeverageBracketsResponseInner.java index 77e5d08b..e11812fb 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmNotionalAndLeverageBracketsResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmNotionalAndLeverageBracketsResponseInner.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -244,20 +242,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UmNotionalAndLeverageBracketsResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UmNotionalAndLeverageBracketsResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmNotionalAndLeverageBracketsResponseInnerBracketsInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmNotionalAndLeverageBracketsResponseInnerBracketsInner.java index d660b983..39c208f2 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmNotionalAndLeverageBracketsResponseInnerBracketsInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmNotionalAndLeverageBracketsResponseInnerBracketsInner.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** UmNotionalAndLeverageBracketsResponseInnerBracketsInner */ @@ -335,20 +333,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UmNotionalAndLeverageBracketsResponseInnerBracketsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UmNotionalAndLeverageBracketsResponseInnerBracketsInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmPositionAdlQuantileEstimationResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmPositionAdlQuantileEstimationResponse.java index 16413fdc..d0f7dc58 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmPositionAdlQuantileEstimationResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmPositionAdlQuantileEstimationResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** UmPositionAdlQuantileEstimationResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * UmPositionAdlQuantileEstimationResponse */ 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) { + UmPositionAdlQuantileEstimationResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!UmPositionAdlQuantileEstimationResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -122,19 +133,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UmPositionAdlQuantileEstimationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UmPositionAdlQuantileEstimationResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmPositionAdlQuantileEstimationResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmPositionAdlQuantileEstimationResponseInner.java index 337da23a..81907640 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmPositionAdlQuantileEstimationResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmPositionAdlQuantileEstimationResponseInner.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** UmPositionAdlQuantileEstimationResponseInner */ @@ -193,20 +191,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UmPositionAdlQuantileEstimationResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UmPositionAdlQuantileEstimationResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/CHANGELOG.md b/clients/derivatives-trading-usds-futures/CHANGELOG.md index cc6cbb66..b00d1f10 100644 --- a/clients/derivatives-trading-usds-futures/CHANGELOG.md +++ b/clients/derivatives-trading-usds-futures/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 3.0.0 - 2025-06-24 + +### Changed (1) + +#### REST API + +- Modified response for `exchangeInformation()` method (`GET /fapi/v1/exchangeInfo`): + - `assets`.`autoAssetExchange`: type `integer` → `string` + - `symbols`.`filters`.`multiplierDecimal`: type `integer` → `string` +- Fixed cases where the response can be an object or an array + ## 2.0.0 - 2025-06-02 ### Removed (1) diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse1.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse1.md deleted file mode 100644 index d466bd5b..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse1.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# AccountInformationResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**AccountInformationResponse1Result**](AccountInformationResponse1Result.md) | | [optional] | -|**rateLimits** | [**List<AccountInformationV2Response1RateLimitsInner>**](AccountInformationV2Response1RateLimitsInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse1Result.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse1Result.md deleted file mode 100644 index d5aecac7..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse1Result.md +++ /dev/null @@ -1,32 +0,0 @@ - - -# AccountInformationResponse1Result - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**feeTier** | **Long** | | [optional] | -|**canTrade** | **Boolean** | | [optional] | -|**canDeposit** | **Boolean** | | [optional] | -|**canWithdraw** | **Boolean** | | [optional] | -|**updateTime** | **Long** | | [optional] | -|**multiAssetsMargin** | **Boolean** | | [optional] | -|**tradeGroupId** | **Long** | | [optional] | -|**totalInitialMargin** | **String** | | [optional] | -|**totalMaintMargin** | **String** | | [optional] | -|**totalWalletBalance** | **String** | | [optional] | -|**totalUnrealizedProfit** | **String** | | [optional] | -|**totalMarginBalance** | **String** | | [optional] | -|**totalPositionInitialMargin** | **String** | | [optional] | -|**totalOpenOrderInitialMargin** | **String** | | [optional] | -|**totalCrossWalletBalance** | **String** | | [optional] | -|**totalCrossUnPnl** | **String** | | [optional] | -|**availableBalance** | **String** | | [optional] | -|**maxWithdrawAmount** | **String** | | [optional] | -|**assets** | [**List<AccountInformationResponse1ResultAssetsInner>**](AccountInformationResponse1ResultAssetsInner.md) | | [optional] | -|**positions** | [**List<AccountInformationResponse1ResultPositionsInner>**](AccountInformationResponse1ResultPositionsInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse1ResultAssetsInner.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse1ResultAssetsInner.md deleted file mode 100644 index 0df75783..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse1ResultAssetsInner.md +++ /dev/null @@ -1,26 +0,0 @@ - - -# AccountInformationResponse1ResultAssetsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**asset** | **String** | | [optional] | -|**walletBalance** | **String** | | [optional] | -|**unrealizedProfit** | **String** | | [optional] | -|**marginBalance** | **String** | | [optional] | -|**maintMargin** | **String** | | [optional] | -|**initialMargin** | **String** | | [optional] | -|**positionInitialMargin** | **String** | | [optional] | -|**openOrderInitialMargin** | **String** | | [optional] | -|**crossWalletBalance** | **String** | | [optional] | -|**crossUnPnl** | **String** | | [optional] | -|**availableBalance** | **String** | | [optional] | -|**maxWithdrawAmount** | **String** | | [optional] | -|**marginAvailable** | **Boolean** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse1ResultPositionsInner.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse1ResultPositionsInner.md deleted file mode 100644 index 142a7b1f..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse1ResultPositionsInner.md +++ /dev/null @@ -1,27 +0,0 @@ - - -# AccountInformationResponse1ResultPositionsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**initialMargin** | **String** | | [optional] | -|**maintMargin** | **String** | | [optional] | -|**unrealizedProfit** | **String** | | [optional] | -|**positionInitialMargin** | **String** | | [optional] | -|**openOrderInitialMargin** | **String** | | [optional] | -|**leverage** | **String** | | [optional] | -|**isolated** | **Boolean** | | [optional] | -|**entryPrice** | **String** | | [optional] | -|**maxNotional** | **String** | | [optional] | -|**bidNotional** | **String** | | [optional] | -|**askNotional** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**positionAmt** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse2.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse2.md deleted file mode 100644 index 8c6aa536..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse2.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# AccountInformationResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**AccountInformationResponse2Result**](AccountInformationResponse2Result.md) | | [optional] | -|**rateLimits** | [**List<AccountInformationV2Response1RateLimitsInner>**](AccountInformationV2Response1RateLimitsInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse2Result.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse2Result.md deleted file mode 100644 index 056722fa..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse2Result.md +++ /dev/null @@ -1,32 +0,0 @@ - - -# AccountInformationResponse2Result - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**feeTier** | **Long** | | [optional] | -|**canTrade** | **Boolean** | | [optional] | -|**canDeposit** | **Boolean** | | [optional] | -|**canWithdraw** | **Boolean** | | [optional] | -|**updateTime** | **Long** | | [optional] | -|**multiAssetsMargin** | **Boolean** | | [optional] | -|**tradeGroupId** | **Long** | | [optional] | -|**totalInitialMargin** | **String** | | [optional] | -|**totalMaintMargin** | **String** | | [optional] | -|**totalWalletBalance** | **String** | | [optional] | -|**totalUnrealizedProfit** | **String** | | [optional] | -|**totalMarginBalance** | **String** | | [optional] | -|**totalPositionInitialMargin** | **String** | | [optional] | -|**totalOpenOrderInitialMargin** | **String** | | [optional] | -|**totalCrossWalletBalance** | **String** | | [optional] | -|**totalCrossUnPnl** | **String** | | [optional] | -|**availableBalance** | **String** | | [optional] | -|**maxWithdrawAmount** | **String** | | [optional] | -|**assets** | [**List<AccountInformationV2Response2ResultAssetsInner>**](AccountInformationV2Response2ResultAssetsInner.md) | | [optional] | -|**positions** | [**List<AccountInformationResponse2ResultPositionsInner>**](AccountInformationResponse2ResultPositionsInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse2ResultPositionsInner.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse2ResultPositionsInner.md deleted file mode 100644 index d2a26c6e..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationResponse2ResultPositionsInner.md +++ /dev/null @@ -1,28 +0,0 @@ - - -# AccountInformationResponse2ResultPositionsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**initialMargin** | **String** | | [optional] | -|**maintMargin** | **String** | | [optional] | -|**unrealizedProfit** | **String** | | [optional] | -|**positionInitialMargin** | **String** | | [optional] | -|**openOrderInitialMargin** | **String** | | [optional] | -|**leverage** | **String** | | [optional] | -|**isolated** | **Boolean** | | [optional] | -|**entryPrice** | **String** | | [optional] | -|**breakEvenPrice** | **String** | | [optional] | -|**maxNotional** | **String** | | [optional] | -|**bidNotional** | **String** | | [optional] | -|**askNotional** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**positionAmt** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1.md deleted file mode 100644 index 978e110c..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# AccountInformationV2Response1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**AccountInformationV2Response1Result**](AccountInformationV2Response1Result.md) | | [optional] | -|**rateLimits** | [**List<AccountInformationV2Response1RateLimitsInner>**](AccountInformationV2Response1RateLimitsInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1AssetsInner.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1AssetsInner.md deleted file mode 100644 index fa7d0424..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1AssetsInner.md +++ /dev/null @@ -1,26 +0,0 @@ - - -# AccountInformationV2Response1AssetsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**asset** | **String** | | [optional] | -|**walletBalance** | **String** | | [optional] | -|**unrealizedProfit** | **String** | | [optional] | -|**marginBalance** | **String** | | [optional] | -|**maintMargin** | **String** | | [optional] | -|**initialMargin** | **String** | | [optional] | -|**positionInitialMargin** | **String** | | [optional] | -|**openOrderInitialMargin** | **String** | | [optional] | -|**crossWalletBalance** | **String** | | [optional] | -|**crossUnPnl** | **String** | | [optional] | -|**availableBalance** | **String** | | [optional] | -|**maxWithdrawAmount** | **String** | | [optional] | -|**marginAvailable** | **Boolean** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1PositionsInner.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1PositionsInner.md deleted file mode 100644 index 7a41c2b0..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1PositionsInner.md +++ /dev/null @@ -1,27 +0,0 @@ - - -# AccountInformationV2Response1PositionsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**initialMargin** | **String** | | [optional] | -|**maintMargin** | **String** | | [optional] | -|**unrealizedProfit** | **String** | | [optional] | -|**positionInitialMargin** | **String** | | [optional] | -|**openOrderInitialMargin** | **String** | | [optional] | -|**leverage** | **String** | | [optional] | -|**isolated** | **Boolean** | | [optional] | -|**entryPrice** | **String** | | [optional] | -|**maxNotional** | **String** | | [optional] | -|**bidNotional** | **String** | | [optional] | -|**askNotional** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**positionAmt** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1RateLimitsInner.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1RateLimitsInner.md deleted file mode 100644 index 7e5282a7..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1RateLimitsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# AccountInformationV2Response1RateLimitsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rateLimitType** | **String** | | [optional] | -|**interval** | **String** | | [optional] | -|**intervalNum** | **Long** | | [optional] | -|**limit** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1Result.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1Result.md deleted file mode 100644 index b6c2ba87..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1Result.md +++ /dev/null @@ -1,25 +0,0 @@ - - -# AccountInformationV2Response1Result - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**totalInitialMargin** | **String** | | [optional] | -|**totalMaintMargin** | **String** | | [optional] | -|**totalWalletBalance** | **String** | | [optional] | -|**totalUnrealizedProfit** | **String** | | [optional] | -|**totalMarginBalance** | **String** | | [optional] | -|**totalPositionInitialMargin** | **String** | | [optional] | -|**totalOpenOrderInitialMargin** | **String** | | [optional] | -|**totalCrossWalletBalance** | **String** | | [optional] | -|**totalCrossUnPnl** | **String** | | [optional] | -|**availableBalance** | **String** | | [optional] | -|**maxWithdrawAmount** | **String** | | [optional] | -|**assets** | [**List<AccountInformationV2Response1ResultAssetsInner>**](AccountInformationV2Response1ResultAssetsInner.md) | | [optional] | -|**positions** | [**List<AccountInformationV2Response1ResultPositionsInner>**](AccountInformationV2Response1ResultPositionsInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1ResultAssetsInner.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1ResultAssetsInner.md deleted file mode 100644 index 045d6101..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1ResultAssetsInner.md +++ /dev/null @@ -1,25 +0,0 @@ - - -# AccountInformationV2Response1ResultAssetsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**asset** | **String** | | [optional] | -|**walletBalance** | **String** | | [optional] | -|**unrealizedProfit** | **String** | | [optional] | -|**marginBalance** | **String** | | [optional] | -|**maintMargin** | **String** | | [optional] | -|**initialMargin** | **String** | | [optional] | -|**positionInitialMargin** | **String** | | [optional] | -|**openOrderInitialMargin** | **String** | | [optional] | -|**crossWalletBalance** | **String** | | [optional] | -|**crossUnPnl** | **String** | | [optional] | -|**availableBalance** | **String** | | [optional] | -|**maxWithdrawAmount** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1ResultPositionsInner.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1ResultPositionsInner.md deleted file mode 100644 index fee2f4b5..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response1ResultPositionsInner.md +++ /dev/null @@ -1,22 +0,0 @@ - - -# AccountInformationV2Response1ResultPositionsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**positionAmt** | **String** | | [optional] | -|**unrealizedProfit** | **String** | | [optional] | -|**isolatedMargin** | **String** | | [optional] | -|**notional** | **String** | | [optional] | -|**isolatedWallet** | **String** | | [optional] | -|**initialMargin** | **String** | | [optional] | -|**maintMargin** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response2.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response2.md deleted file mode 100644 index a03e9678..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response2.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# AccountInformationV2Response2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**AccountInformationV2Response2Result**](AccountInformationV2Response2Result.md) | | [optional] | -|**rateLimits** | [**List<AccountInformationV2Response1RateLimitsInner>**](AccountInformationV2Response1RateLimitsInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response2AssetsInner.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response2AssetsInner.md deleted file mode 100644 index 6c9d04d5..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response2AssetsInner.md +++ /dev/null @@ -1,26 +0,0 @@ - - -# AccountInformationV2Response2AssetsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**asset** | **String** | | [optional] | -|**walletBalance** | **String** | | [optional] | -|**unrealizedProfit** | **String** | | [optional] | -|**marginBalance** | **String** | | [optional] | -|**maintMargin** | **String** | | [optional] | -|**initialMargin** | **String** | | [optional] | -|**positionInitialMargin** | **String** | | [optional] | -|**openOrderInitialMargin** | **String** | | [optional] | -|**crossWalletBalance** | **String** | | [optional] | -|**crossUnPnl** | **String** | | [optional] | -|**availableBalance** | **String** | | [optional] | -|**maxWithdrawAmount** | **String** | | [optional] | -|**marginAvailable** | **Boolean** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response2Result.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response2Result.md deleted file mode 100644 index b89a52d3..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response2Result.md +++ /dev/null @@ -1,25 +0,0 @@ - - -# AccountInformationV2Response2Result - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**totalInitialMargin** | **String** | | [optional] | -|**totalMaintMargin** | **String** | | [optional] | -|**totalWalletBalance** | **String** | | [optional] | -|**totalUnrealizedProfit** | **String** | | [optional] | -|**totalMarginBalance** | **String** | | [optional] | -|**totalPositionInitialMargin** | **String** | | [optional] | -|**totalOpenOrderInitialMargin** | **String** | | [optional] | -|**totalCrossWalletBalance** | **String** | | [optional] | -|**totalCrossUnPnl** | **String** | | [optional] | -|**availableBalance** | **String** | | [optional] | -|**maxWithdrawAmount** | **String** | | [optional] | -|**assets** | [**List<AccountInformationV2Response2ResultAssetsInner>**](AccountInformationV2Response2ResultAssetsInner.md) | | [optional] | -|**positions** | [**List<AccountInformationV2Response1ResultPositionsInner>**](AccountInformationV2Response1ResultPositionsInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response2ResultAssetsInner.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response2ResultAssetsInner.md deleted file mode 100644 index a348503a..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationV2Response2ResultAssetsInner.md +++ /dev/null @@ -1,26 +0,0 @@ - - -# AccountInformationV2Response2ResultAssetsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**asset** | **String** | | [optional] | -|**walletBalance** | **String** | | [optional] | -|**unrealizedProfit** | **String** | | [optional] | -|**marginBalance** | **String** | | [optional] | -|**maintMargin** | **String** | | [optional] | -|**initialMargin** | **String** | | [optional] | -|**positionInitialMargin** | **String** | | [optional] | -|**openOrderInitialMargin** | **String** | | [optional] | -|**crossWalletBalance** | **String** | | [optional] | -|**crossUnPnl** | **String** | | [optional] | -|**availableBalance** | **String** | | [optional] | -|**maxWithdrawAmount** | **String** | | [optional] | -|**marginAvailable** | **Boolean** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationV3Response1.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationV3Response1.md deleted file mode 100644 index 35fe2e37..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationV3Response1.md +++ /dev/null @@ -1,25 +0,0 @@ - - -# AccountInformationV3Response1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**totalInitialMargin** | **String** | | [optional] | -|**totalMaintMargin** | **String** | | [optional] | -|**totalWalletBalance** | **String** | | [optional] | -|**totalUnrealizedProfit** | **String** | | [optional] | -|**totalMarginBalance** | **String** | | [optional] | -|**totalPositionInitialMargin** | **String** | | [optional] | -|**totalOpenOrderInitialMargin** | **String** | | [optional] | -|**totalCrossWalletBalance** | **String** | | [optional] | -|**totalCrossUnPnl** | **String** | | [optional] | -|**availableBalance** | **String** | | [optional] | -|**maxWithdrawAmount** | **String** | | [optional] | -|**assets** | [**List<AccountInformationV3Response1AssetsInner>**](AccountInformationV3Response1AssetsInner.md) | | [optional] | -|**positions** | [**List<AccountInformationV3Response1PositionsInner>**](AccountInformationV3Response1PositionsInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationV3Response1AssetsInner.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationV3Response1AssetsInner.md deleted file mode 100644 index 1ecdc797..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationV3Response1AssetsInner.md +++ /dev/null @@ -1,25 +0,0 @@ - - -# AccountInformationV3Response1AssetsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**asset** | **String** | | [optional] | -|**walletBalance** | **String** | | [optional] | -|**unrealizedProfit** | **String** | | [optional] | -|**marginBalance** | **String** | | [optional] | -|**maintMargin** | **String** | | [optional] | -|**initialMargin** | **String** | | [optional] | -|**positionInitialMargin** | **String** | | [optional] | -|**openOrderInitialMargin** | **String** | | [optional] | -|**crossWalletBalance** | **String** | | [optional] | -|**crossUnPnl** | **String** | | [optional] | -|**availableBalance** | **String** | | [optional] | -|**maxWithdrawAmount** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationV3Response1PositionsInner.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationV3Response1PositionsInner.md deleted file mode 100644 index 964c9ba5..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationV3Response1PositionsInner.md +++ /dev/null @@ -1,22 +0,0 @@ - - -# AccountInformationV3Response1PositionsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**positionAmt** | **String** | | [optional] | -|**unrealizedProfit** | **String** | | [optional] | -|**isolatedMargin** | **String** | | [optional] | -|**notional** | **String** | | [optional] | -|**isolatedWallet** | **String** | | [optional] | -|**initialMargin** | **String** | | [optional] | -|**maintMargin** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/AccountInformationV3Response2.md b/clients/derivatives-trading-usds-futures/docs/AccountInformationV3Response2.md deleted file mode 100644 index 54ea9615..00000000 --- a/clients/derivatives-trading-usds-futures/docs/AccountInformationV3Response2.md +++ /dev/null @@ -1,25 +0,0 @@ - - -# AccountInformationV3Response2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**totalInitialMargin** | **String** | | [optional] | -|**totalMaintMargin** | **String** | | [optional] | -|**totalWalletBalance** | **String** | | [optional] | -|**totalUnrealizedProfit** | **String** | | [optional] | -|**totalMarginBalance** | **String** | | [optional] | -|**totalPositionInitialMargin** | **String** | | [optional] | -|**totalOpenOrderInitialMargin** | **String** | | [optional] | -|**totalCrossWalletBalance** | **String** | | [optional] | -|**totalCrossUnPnl** | **String** | | [optional] | -|**availableBalance** | **String** | | [optional] | -|**maxWithdrawAmount** | **String** | | [optional] | -|**assets** | [**List<AccountInformationV2Response2AssetsInner>**](AccountInformationV2Response2AssetsInner.md) | | [optional] | -|**positions** | [**List<AccountInformationV3Response1PositionsInner>**](AccountInformationV3Response1PositionsInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/ExchangeInformationResponseAssetsInner.md b/clients/derivatives-trading-usds-futures/docs/ExchangeInformationResponseAssetsInner.md index 6db8721d..a0c1878f 100644 --- a/clients/derivatives-trading-usds-futures/docs/ExchangeInformationResponseAssetsInner.md +++ b/clients/derivatives-trading-usds-futures/docs/ExchangeInformationResponseAssetsInner.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**asset** | **String** | | [optional] | |**marginAvailable** | **Boolean** | | [optional] | -|**autoAssetExchange** | **Long** | | [optional] | +|**autoAssetExchange** | **String** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/ExchangeInformationResponseSymbolsInnerFiltersInner.md b/clients/derivatives-trading-usds-futures/docs/ExchangeInformationResponseSymbolsInnerFiltersInner.md index 3999d8c3..7c82b4d6 100644 --- a/clients/derivatives-trading-usds-futures/docs/ExchangeInformationResponseSymbolsInnerFiltersInner.md +++ b/clients/derivatives-trading-usds-futures/docs/ExchangeInformationResponseSymbolsInnerFiltersInner.md @@ -18,7 +18,7 @@ |**notional** | **String** | | [optional] | |**multiplierUp** | **String** | | [optional] | |**multiplierDown** | **String** | | [optional] | -|**multiplierDecimal** | **Long** | | [optional] | +|**multiplierDecimal** | **String** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse1.md b/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse1.md deleted file mode 100644 index d3020487..00000000 --- a/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse1.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# FuturesTradingQuantitativeRulesIndicatorsResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**indicators** | [**FuturesTradingQuantitativeRulesIndicatorsResponse1Indicators**](FuturesTradingQuantitativeRulesIndicatorsResponse1Indicators.md) | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse1Indicators.md b/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse1Indicators.md deleted file mode 100644 index 6388a9c9..00000000 --- a/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse1Indicators.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# FuturesTradingQuantitativeRulesIndicatorsResponse1Indicators - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**BTCUSDT** | [**List<FuturesTradingQuantitativeRulesIndicatorsResponse1IndicatorsBTCUSDTInner>**](FuturesTradingQuantitativeRulesIndicatorsResponse1IndicatorsBTCUSDTInner.md) | | [optional] | -|**ETHUSDT** | [**List<FuturesTradingQuantitativeRulesIndicatorsResponse1IndicatorsBTCUSDTInner>**](FuturesTradingQuantitativeRulesIndicatorsResponse1IndicatorsBTCUSDTInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse1IndicatorsBTCUSDTInner.md b/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse1IndicatorsBTCUSDTInner.md deleted file mode 100644 index 792af83d..00000000 --- a/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse1IndicatorsBTCUSDTInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# FuturesTradingQuantitativeRulesIndicatorsResponse1IndicatorsBTCUSDTInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**isLocked** | **Boolean** | | [optional] | -|**plannedRecoverTime** | **Long** | | [optional] | -|**indicator** | **String** | | [optional] | -|**value** | **Double** | | [optional] | -|**triggerValue** | **Double** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse2.md b/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse2.md deleted file mode 100644 index d333eac6..00000000 --- a/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse2.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# FuturesTradingQuantitativeRulesIndicatorsResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**indicators** | [**FuturesTradingQuantitativeRulesIndicatorsResponse2Indicators**](FuturesTradingQuantitativeRulesIndicatorsResponse2Indicators.md) | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse2Indicators.md b/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse2Indicators.md deleted file mode 100644 index 61e29a60..00000000 --- a/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse2Indicators.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# FuturesTradingQuantitativeRulesIndicatorsResponse2Indicators - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**ACCOUNT** | [**List<FuturesTradingQuantitativeRulesIndicatorsResponse2IndicatorsACCOUNTInner>**](FuturesTradingQuantitativeRulesIndicatorsResponse2IndicatorsACCOUNTInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse2IndicatorsACCOUNTInner.md b/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse2IndicatorsACCOUNTInner.md deleted file mode 100644 index 95bd564b..00000000 --- a/clients/derivatives-trading-usds-futures/docs/FuturesTradingQuantitativeRulesIndicatorsResponse2IndicatorsACCOUNTInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# FuturesTradingQuantitativeRulesIndicatorsResponse2IndicatorsACCOUNTInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**indicator** | **String** | | [optional] | -|**value** | **Long** | | [optional] | -|**triggerValue** | **Long** | | [optional] | -|**plannedRecoverTime** | **Long** | | [optional] | -|**isLocked** | **Boolean** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/GetFuturesOrderHistoryDownloadLinkByIdResponse1.md b/clients/derivatives-trading-usds-futures/docs/GetFuturesOrderHistoryDownloadLinkByIdResponse1.md deleted file mode 100644 index ec6522df..00000000 --- a/clients/derivatives-trading-usds-futures/docs/GetFuturesOrderHistoryDownloadLinkByIdResponse1.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# GetFuturesOrderHistoryDownloadLinkByIdResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/GetFuturesOrderHistoryDownloadLinkByIdResponse2.md b/clients/derivatives-trading-usds-futures/docs/GetFuturesOrderHistoryDownloadLinkByIdResponse2.md deleted file mode 100644 index f17059fb..00000000 --- a/clients/derivatives-trading-usds-futures/docs/GetFuturesOrderHistoryDownloadLinkByIdResponse2.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# GetFuturesOrderHistoryDownloadLinkByIdResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/GetFuturesTradeDownloadLinkByIdResponse1.md b/clients/derivatives-trading-usds-futures/docs/GetFuturesTradeDownloadLinkByIdResponse1.md deleted file mode 100644 index b213369d..00000000 --- a/clients/derivatives-trading-usds-futures/docs/GetFuturesTradeDownloadLinkByIdResponse1.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# GetFuturesTradeDownloadLinkByIdResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/GetFuturesTradeDownloadLinkByIdResponse2.md b/clients/derivatives-trading-usds-futures/docs/GetFuturesTradeDownloadLinkByIdResponse2.md deleted file mode 100644 index 1fd77926..00000000 --- a/clients/derivatives-trading-usds-futures/docs/GetFuturesTradeDownloadLinkByIdResponse2.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# GetFuturesTradeDownloadLinkByIdResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/GetFuturesTransactionHistoryDownloadLinkByIdResponse1.md b/clients/derivatives-trading-usds-futures/docs/GetFuturesTransactionHistoryDownloadLinkByIdResponse1.md deleted file mode 100644 index db16b7cf..00000000 --- a/clients/derivatives-trading-usds-futures/docs/GetFuturesTransactionHistoryDownloadLinkByIdResponse1.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# GetFuturesTransactionHistoryDownloadLinkByIdResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/GetFuturesTransactionHistoryDownloadLinkByIdResponse2.md b/clients/derivatives-trading-usds-futures/docs/GetFuturesTransactionHistoryDownloadLinkByIdResponse2.md deleted file mode 100644 index cb07e5b4..00000000 --- a/clients/derivatives-trading-usds-futures/docs/GetFuturesTransactionHistoryDownloadLinkByIdResponse2.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# GetFuturesTransactionHistoryDownloadLinkByIdResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**downloadId** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**url** | **String** | | [optional] | -|**notified** | **Boolean** | | [optional] | -|**expirationTimestamp** | **Long** | | [optional] | -|**isExpired** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/HistoricalBlvtNavKlineCandlestickResponse.md b/clients/derivatives-trading-usds-futures/docs/HistoricalBlvtNavKlineCandlestickResponse.md deleted file mode 100644 index 699ba8f4..00000000 --- a/clients/derivatives-trading-usds-futures/docs/HistoricalBlvtNavKlineCandlestickResponse.md +++ /dev/null @@ -1,12 +0,0 @@ - - -# HistoricalBlvtNavKlineCandlestickResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| - - - diff --git a/clients/derivatives-trading-usds-futures/docs/HistoricalBlvtNavKlineCandlestickResponseItem.md b/clients/derivatives-trading-usds-futures/docs/HistoricalBlvtNavKlineCandlestickResponseItem.md deleted file mode 100644 index 36fd46b9..00000000 --- a/clients/derivatives-trading-usds-futures/docs/HistoricalBlvtNavKlineCandlestickResponseItem.md +++ /dev/null @@ -1,12 +0,0 @@ - - -# HistoricalBlvtNavKlineCandlestickResponseItem - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| - - - diff --git a/clients/derivatives-trading-usds-futures/docs/HistoricalBlvtNavKlineCandlestickResponseItemInner.md b/clients/derivatives-trading-usds-futures/docs/HistoricalBlvtNavKlineCandlestickResponseItemInner.md deleted file mode 100644 index 0d98592c..00000000 --- a/clients/derivatives-trading-usds-futures/docs/HistoricalBlvtNavKlineCandlestickResponseItemInner.md +++ /dev/null @@ -1,12 +0,0 @@ - - -# HistoricalBlvtNavKlineCandlestickResponseItemInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| - - - diff --git a/clients/derivatives-trading-usds-futures/docs/PositionInformationResponse1.md b/clients/derivatives-trading-usds-futures/docs/PositionInformationResponse1.md deleted file mode 100644 index 7c8c6e32..00000000 --- a/clients/derivatives-trading-usds-futures/docs/PositionInformationResponse1.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# PositionInformationResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**List<PositionInformationResponse1ResultInner>**](PositionInformationResponse1ResultInner.md) | | [optional] | -|**rateLimits** | [**List<AccountInformationV2Response1RateLimitsInner>**](AccountInformationV2Response1RateLimitsInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/PositionInformationResponse1ResultInner.md b/clients/derivatives-trading-usds-futures/docs/PositionInformationResponse1ResultInner.md deleted file mode 100644 index 5447edcd..00000000 --- a/clients/derivatives-trading-usds-futures/docs/PositionInformationResponse1ResultInner.md +++ /dev/null @@ -1,28 +0,0 @@ - - -# PositionInformationResponse1ResultInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**entryPrice** | **String** | | [optional] | -|**breakEvenPrice** | **String** | | [optional] | -|**marginType** | **String** | | [optional] | -|**isAutoAddMargin** | **String** | | [optional] | -|**isolatedMargin** | **String** | | [optional] | -|**leverage** | **String** | | [optional] | -|**liquidationPrice** | **String** | | [optional] | -|**markPrice** | **String** | | [optional] | -|**maxNotionalValue** | **String** | | [optional] | -|**positionAmt** | **String** | | [optional] | -|**notional** | **String** | | [optional] | -|**isolatedWallet** | **String** | | [optional] | -|**symbol** | **String** | | [optional] | -|**unRealizedProfit** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/PositionInformationResponse2.md b/clients/derivatives-trading-usds-futures/docs/PositionInformationResponse2.md deleted file mode 100644 index bb3a3d35..00000000 --- a/clients/derivatives-trading-usds-futures/docs/PositionInformationResponse2.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# PositionInformationResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**List<PositionInformationResponse2ResultInner>**](PositionInformationResponse2ResultInner.md) | | [optional] | -|**rateLimits** | [**List<AccountInformationV2Response1RateLimitsInner>**](AccountInformationV2Response1RateLimitsInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/PositionInformationResponse2ResultInner.md b/clients/derivatives-trading-usds-futures/docs/PositionInformationResponse2ResultInner.md deleted file mode 100644 index 7cd0dc4c..00000000 --- a/clients/derivatives-trading-usds-futures/docs/PositionInformationResponse2ResultInner.md +++ /dev/null @@ -1,28 +0,0 @@ - - -# PositionInformationResponse2ResultInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**positionAmt** | **String** | | [optional] | -|**entryPrice** | **String** | | [optional] | -|**breakEvenPrice** | **String** | | [optional] | -|**markPrice** | **String** | | [optional] | -|**unRealizedProfit** | **String** | | [optional] | -|**liquidationPrice** | **String** | | [optional] | -|**leverage** | **String** | | [optional] | -|**maxNotionalValue** | **String** | | [optional] | -|**marginType** | **String** | | [optional] | -|**isolatedMargin** | **String** | | [optional] | -|**isAutoAddMargin** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**notional** | **String** | | [optional] | -|**isolatedWallet** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response1.md b/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response1.md deleted file mode 100644 index 4b346940..00000000 --- a/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response1.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# PositionInformationV2Response1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**List<PositionInformationV2Response1ResultInner>**](PositionInformationV2Response1ResultInner.md) | | [optional] | -|**rateLimits** | [**List<AccountInformationV2Response1RateLimitsInner>**](AccountInformationV2Response1RateLimitsInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response1Inner.md b/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response1Inner.md deleted file mode 100644 index 5499c487..00000000 --- a/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response1Inner.md +++ /dev/null @@ -1,28 +0,0 @@ - - -# PositionInformationV2Response1Inner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**entryPrice** | **String** | | [optional] | -|**breakEvenPrice** | **String** | | [optional] | -|**marginType** | **String** | | [optional] | -|**isAutoAddMargin** | **String** | | [optional] | -|**isolatedMargin** | **String** | | [optional] | -|**leverage** | **String** | | [optional] | -|**liquidationPrice** | **String** | | [optional] | -|**markPrice** | **String** | | [optional] | -|**maxNotionalValue** | **String** | | [optional] | -|**positionAmt** | **String** | | [optional] | -|**notional** | **String** | | [optional] | -|**isolatedWallet** | **String** | | [optional] | -|**symbol** | **String** | | [optional] | -|**unRealizedProfit** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response1ResultInner.md b/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response1ResultInner.md deleted file mode 100644 index 8b714536..00000000 --- a/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response1ResultInner.md +++ /dev/null @@ -1,32 +0,0 @@ - - -# PositionInformationV2Response1ResultInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**positionAmt** | **String** | | [optional] | -|**entryPrice** | **String** | | [optional] | -|**breakEvenPrice** | **String** | | [optional] | -|**markPrice** | **String** | | [optional] | -|**unrealizedProfit** | **String** | | [optional] | -|**liquidationPrice** | **String** | | [optional] | -|**isolatedMargin** | **String** | | [optional] | -|**notional** | **String** | | [optional] | -|**marginAsset** | **String** | | [optional] | -|**isolatedWallet** | **String** | | [optional] | -|**initialMargin** | **String** | | [optional] | -|**maintMargin** | **String** | | [optional] | -|**positionInitialMargin** | **String** | | [optional] | -|**openOrderInitialMargin** | **String** | | [optional] | -|**adl** | **Long** | | [optional] | -|**bidNotional** | **String** | | [optional] | -|**askNotional** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response2.md b/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response2.md deleted file mode 100644 index 14fb3939..00000000 --- a/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response2.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# PositionInformationV2Response2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**List<PositionInformationV2Response2ResultInner>**](PositionInformationV2Response2ResultInner.md) | | [optional] | -|**rateLimits** | [**List<AccountInformationV2Response1RateLimitsInner>**](AccountInformationV2Response1RateLimitsInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response2Inner.md b/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response2Inner.md deleted file mode 100644 index 3009e342..00000000 --- a/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response2Inner.md +++ /dev/null @@ -1,28 +0,0 @@ - - -# PositionInformationV2Response2Inner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**positionAmt** | **String** | | [optional] | -|**entryPrice** | **String** | | [optional] | -|**breakEvenPrice** | **String** | | [optional] | -|**markPrice** | **String** | | [optional] | -|**unRealizedProfit** | **String** | | [optional] | -|**liquidationPrice** | **String** | | [optional] | -|**leverage** | **String** | | [optional] | -|**maxNotionalValue** | **String** | | [optional] | -|**marginType** | **String** | | [optional] | -|**isolatedMargin** | **String** | | [optional] | -|**isAutoAddMargin** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**notional** | **String** | | [optional] | -|**isolatedWallet** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response2ResultInner.md b/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response2ResultInner.md deleted file mode 100644 index 076998f0..00000000 --- a/clients/derivatives-trading-usds-futures/docs/PositionInformationV2Response2ResultInner.md +++ /dev/null @@ -1,32 +0,0 @@ - - -# PositionInformationV2Response2ResultInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**positionAmt** | **String** | | [optional] | -|**entryPrice** | **String** | | [optional] | -|**breakEvenPrice** | **String** | | [optional] | -|**markPrice** | **String** | | [optional] | -|**unrealizedProfit** | **String** | | [optional] | -|**liquidationPrice** | **String** | | [optional] | -|**isolatedMargin** | **String** | | [optional] | -|**notional** | **String** | | [optional] | -|**marginAsset** | **String** | | [optional] | -|**isolatedWallet** | **String** | | [optional] | -|**initialMargin** | **String** | | [optional] | -|**maintMargin** | **String** | | [optional] | -|**positionInitialMargin** | **String** | | [optional] | -|**openOrderInitialMargin** | **String** | | [optional] | -|**adl** | **Long** | | [optional] | -|**bidNotional** | **String** | | [optional] | -|**askNotional** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/PositionInformationV3Response1Inner.md b/clients/derivatives-trading-usds-futures/docs/PositionInformationV3Response1Inner.md deleted file mode 100644 index d6aa3d5a..00000000 --- a/clients/derivatives-trading-usds-futures/docs/PositionInformationV3Response1Inner.md +++ /dev/null @@ -1,32 +0,0 @@ - - -# PositionInformationV3Response1Inner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**positionAmt** | **String** | | [optional] | -|**entryPrice** | **String** | | [optional] | -|**breakEvenPrice** | **String** | | [optional] | -|**markPrice** | **String** | | [optional] | -|**unRealizedProfit** | **String** | | [optional] | -|**liquidationPrice** | **String** | | [optional] | -|**isolatedMargin** | **String** | | [optional] | -|**notional** | **String** | | [optional] | -|**marginAsset** | **String** | | [optional] | -|**isolatedWallet** | **String** | | [optional] | -|**initialMargin** | **String** | | [optional] | -|**maintMargin** | **String** | | [optional] | -|**positionInitialMargin** | **String** | | [optional] | -|**openOrderInitialMargin** | **String** | | [optional] | -|**adl** | **Long** | | [optional] | -|**bidNotional** | **String** | | [optional] | -|**askNotional** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-usds-futures/docs/PositionInformationV3Response2Inner.md b/clients/derivatives-trading-usds-futures/docs/PositionInformationV3Response2Inner.md deleted file mode 100644 index f2e3745e..00000000 --- a/clients/derivatives-trading-usds-futures/docs/PositionInformationV3Response2Inner.md +++ /dev/null @@ -1,32 +0,0 @@ - - -# PositionInformationV3Response2Inner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**positionAmt** | **String** | | [optional] | -|**entryPrice** | **String** | | [optional] | -|**breakEvenPrice** | **String** | | [optional] | -|**markPrice** | **String** | | [optional] | -|**unRealizedProfit** | **String** | | [optional] | -|**liquidationPrice** | **String** | | [optional] | -|**isolatedMargin** | **String** | | [optional] | -|**notional** | **String** | | [optional] | -|**marginAsset** | **String** | | [optional] | -|**isolatedWallet** | **String** | | [optional] | -|**initialMargin** | **String** | | [optional] | -|**maintMargin** | **String** | | [optional] | -|**positionInitialMargin** | **String** | | [optional] | -|**openOrderInitialMargin** | **String** | | [optional] | -|**adl** | **Long** | | [optional] | -|**bidNotional** | **String** | | [optional] | -|**askNotional** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | - - - 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 b307f166..1b81dcb0 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 - 2.0.0 + 3.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-usds-futures - 2.0.0 + 3.0.0 ``` diff --git a/clients/derivatives-trading-usds-futures/pom.xml b/clients/derivatives-trading-usds-futures/pom.xml index 74434fbd..3c1e126c 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 - 2.0.0 + 3.0.0 jar 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 4d8feefd..6b2f614f 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/2.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/3.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 27b27226..d136f756 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/2.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/3.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/MarketDataApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java index e6d1a33c..79fe9ba7 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 @@ -74,7 +74,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/2.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/3.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/PortfolioMarginEndpointsApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java index df00f43e..b1e4eb9f 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/2.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/3.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 9e5a0dce..590525c9 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 @@ -83,7 +83,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/2.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/3.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/UserDataStreamsApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java index 249dc7e0..0e38aabb 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/2.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/3.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/AcceptTheOfferedQuoteRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AcceptTheOfferedQuoteRequest.java index b65e1359..7af562ac 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AcceptTheOfferedQuoteRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AcceptTheOfferedQuoteRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AcceptTheOfferedQuoteRequest */ @@ -186,18 +184,6 @@ 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 (!AcceptTheOfferedQuoteRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AcceptTheOfferedQuoteRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AcceptTheOfferedQuoteRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AcceptTheOfferedQuoteResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AcceptTheOfferedQuoteResponse.java index 6eda1943..b5a29c87 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AcceptTheOfferedQuoteResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AcceptTheOfferedQuoteResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AcceptTheOfferedQuoteResponse */ @@ -216,18 +214,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AcceptTheOfferedQuoteResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AcceptTheOfferedQuoteResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AcceptTheOfferedQuoteResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("orderId") != null && !jsonObj.get("orderId").isJsonNull()) && !jsonObj.get("orderId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV2Response.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV2Response.java index ffb71e2c..0247d24e 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV2Response.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV2Response.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -922,18 +920,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AccountInformationV2Response.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountInformationV2Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountInformationV2Response` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("totalInitialMargin") != null && !jsonObj.get("totalInitialMargin").isJsonNull()) diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV2ResponseAssetsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV2ResponseAssetsInner.java index 36aac496..ad0d8a1e 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV2ResponseAssetsInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV2ResponseAssetsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AccountInformationV2ResponseAssetsInner */ @@ -633,19 +631,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountInformationV2ResponseAssetsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountInformationV2ResponseAssetsInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) && !jsonObj.get("asset").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV2ResponsePositionsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV2ResponsePositionsInner.java index 44c8a84b..f6e4df24 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV2ResponsePositionsInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV2ResponsePositionsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AccountInformationV2ResponsePositionsInner */ @@ -659,20 +657,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountInformationV2ResponsePositionsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountInformationV2ResponsePositionsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV3Response.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV3Response.java index cd286b5a..97d7ecec 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV3Response.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV3Response.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -651,18 +649,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AccountInformationV3Response.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountInformationV3Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountInformationV3Response` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("totalInitialMargin") != null && !jsonObj.get("totalInitialMargin").isJsonNull()) diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV3ResponseAssetsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV3ResponseAssetsInner.java index 8f183b17..ea961b90 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV3ResponseAssetsInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV3ResponseAssetsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AccountInformationV3ResponseAssetsInner */ @@ -633,19 +631,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountInformationV3ResponseAssetsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountInformationV3ResponseAssetsInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) && !jsonObj.get("asset").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV3ResponsePositionsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV3ResponsePositionsInner.java index b9fa1c8a..a236ec66 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV3ResponsePositionsInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountInformationV3ResponsePositionsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AccountInformationV3ResponsePositionsInner */ @@ -474,20 +472,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountInformationV3ResponsePositionsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountInformationV3ResponsePositionsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountTradeListResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountTradeListResponse.java index 9eb70813..1e39eca5 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountTradeListResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountTradeListResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** AccountTradeListResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to AccountTradeListResponse */ 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) { + AccountTradeListResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!AccountTradeListResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AccountTradeListResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountTradeListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountTradeListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/AccountTradeListResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountTradeListResponseInner.java index 99b8f4df..f70a11bd 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountTradeListResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AccountTradeListResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AccountTradeListResponseInner */ @@ -586,18 +584,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AccountTradeListResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountTradeListResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountTradeListResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("commission") != null && !jsonObj.get("commission").isJsonNull()) && !jsonObj.get("commission").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AllOrdersResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AllOrdersResponse.java index 64dc0296..774b4fa8 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AllOrdersResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AllOrdersResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** AllOrdersResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to AllOrdersResponse */ 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) { + AllOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!AllOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AllOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AllOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AllOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/AllOrdersResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AllOrdersResponseInner.java index 968ad1ba..7b94b335 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AllOrdersResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AllOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AllOrdersResponseInner */ @@ -985,18 +983,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AllOrdersResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AllOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AllOrdersResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AutoCancelAllOpenOrdersRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AutoCancelAllOpenOrdersRequest.java index 2e3059b6..ddedb828 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AutoCancelAllOpenOrdersRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AutoCancelAllOpenOrdersRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AutoCancelAllOpenOrdersRequest */ @@ -221,18 +219,6 @@ 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 (!AutoCancelAllOpenOrdersRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AutoCancelAllOpenOrdersRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AutoCancelAllOpenOrdersRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AutoCancelAllOpenOrdersResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AutoCancelAllOpenOrdersResponse.java index c1b4cda3..ee34ea77 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AutoCancelAllOpenOrdersResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/AutoCancelAllOpenOrdersResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AutoCancelAllOpenOrdersResponse */ @@ -185,18 +183,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AutoCancelAllOpenOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AutoCancelAllOpenOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AutoCancelAllOpenOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BasisResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BasisResponse.java index 6b92334e..6d220e27 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BasisResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BasisResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** BasisResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to BasisResponse */ 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) { + BasisResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!BasisResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti BasisResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!BasisResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `BasisResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/BasisResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BasisResponseInner.java index 765c0dbc..dd62e331 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BasisResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BasisResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** BasisResponseInner */ @@ -386,18 +384,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti BasisResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!BasisResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `BasisResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("indexPrice") != null && !jsonObj.get("indexPrice").isJsonNull()) && !jsonObj.get("indexPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrders.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrders.java index baaa86f6..0f087e19 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrders.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrders.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** BatchOrders */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to BatchOrders */ 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) { + BatchOrdersInner.validateJsonElement(element); + } if (jsonElement == null) { if (!BatchOrders.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti BatchOrders.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!BatchOrders.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `BatchOrders` properties. JSON: %s", - entry.getKey(), jsonElement.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/BatchOrdersInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersInner.java index adcd2d25..221b1761 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 @@ -30,9 +30,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** BatchOrdersInner */ @@ -1112,18 +1110,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti BatchOrdersInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!BatchOrdersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `BatchOrdersInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelAllOpenOrdersResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelAllOpenOrdersResponse.java index c88e5253..5ac8ed73 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelAllOpenOrdersResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelAllOpenOrdersResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelAllOpenOrdersResponse */ @@ -182,18 +180,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CancelAllOpenOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelAllOpenOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelAllOpenOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelMultipleOrdersResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelMultipleOrdersResponse.java index e5b52bc4..84f04317 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelMultipleOrdersResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelMultipleOrdersResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** CancelMultipleOrdersResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * CancelMultipleOrdersResponse */ 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) { + CancelMultipleOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!CancelMultipleOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CancelMultipleOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelMultipleOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelMultipleOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/CancelMultipleOrdersResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelMultipleOrdersResponseInner.java index 8f812f6b..9e19f43f 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelMultipleOrdersResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelMultipleOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelMultipleOrdersResponseInner */ @@ -1038,18 +1036,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelMultipleOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelMultipleOrdersResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) && !jsonObj.get("clientOrderId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelOrderResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelOrderResponse.java index 7be551a0..735ded40 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelOrderResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CancelOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CancelOrderResponse */ @@ -950,18 +948,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CancelOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) && !jsonObj.get("clientOrderId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeInitialLeverageRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeInitialLeverageRequest.java index 95e50d55..b2f86a1c 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeInitialLeverageRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeInitialLeverageRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeInitialLeverageRequest */ @@ -220,18 +218,6 @@ 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 (!ChangeInitialLeverageRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeInitialLeverageRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ChangeInitialLeverageRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeInitialLeverageResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeInitialLeverageResponse.java index c9d37ed7..8717dde0 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeInitialLeverageResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeInitialLeverageResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeInitialLeverageResponse */ @@ -217,18 +215,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ChangeInitialLeverageResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ChangeInitialLeverageResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeInitialLeverageResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("maxNotionalValue") != null && !jsonObj.get("maxNotionalValue").isJsonNull()) diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeMarginTypeRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeMarginTypeRequest.java index ea68d830..f5748681 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeMarginTypeRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeMarginTypeRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeMarginTypeRequest */ @@ -220,18 +218,6 @@ 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 (!ChangeMarginTypeRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeMarginTypeRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ChangeMarginTypeRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeMarginTypeResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeMarginTypeResponse.java index 14042c75..d5038cb2 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeMarginTypeResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeMarginTypeResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeMarginTypeResponse */ @@ -181,18 +179,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ChangeMarginTypeResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ChangeMarginTypeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeMarginTypeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeMultiAssetsModeRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeMultiAssetsModeRequest.java index c7a05e61..bd130191 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeMultiAssetsModeRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeMultiAssetsModeRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeMultiAssetsModeRequest */ @@ -190,18 +188,6 @@ 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 (!ChangeMultiAssetsModeRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeMultiAssetsModeRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ChangeMultiAssetsModeRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeMultiAssetsModeResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeMultiAssetsModeResponse.java index d5f9b4c2..6a1df4bb 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeMultiAssetsModeResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangeMultiAssetsModeResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangeMultiAssetsModeResponse */ @@ -183,18 +181,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ChangeMultiAssetsModeResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ChangeMultiAssetsModeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangeMultiAssetsModeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangePositionModeRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangePositionModeRequest.java index 54e9ddda..22ca7ece 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangePositionModeRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangePositionModeRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangePositionModeRequest */ @@ -185,18 +183,6 @@ 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 (!ChangePositionModeRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangePositionModeRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ChangePositionModeRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangePositionModeResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangePositionModeResponse.java index 3be3211d..3d750f95 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangePositionModeResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ChangePositionModeResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ChangePositionModeResponse */ @@ -181,18 +179,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ChangePositionModeResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ChangePositionModeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ChangePositionModeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CheckServerTimeResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CheckServerTimeResponse.java index 84f25f61..7dfde269 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CheckServerTimeResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CheckServerTimeResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CheckServerTimeResponse */ @@ -149,18 +147,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CheckServerTimeResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CheckServerTimeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CheckServerTimeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ClassicPortfolioMarginAccountInformationResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ClassicPortfolioMarginAccountInformationResponse.java index cba9e69d..94aa4a12 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ClassicPortfolioMarginAccountInformationResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ClassicPortfolioMarginAccountInformationResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ClassicPortfolioMarginAccountInformationResponse */ @@ -233,20 +231,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ClassicPortfolioMarginAccountInformationResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ClassicPortfolioMarginAccountInformationResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("maxWithdrawAmountUSD") != null && !jsonObj.get("maxWithdrawAmountUSD").isJsonNull()) diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompositeIndexSymbolInformationResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompositeIndexSymbolInformationResponse.java index bd222d5a..12bbcd62 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompositeIndexSymbolInformationResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompositeIndexSymbolInformationResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** CompositeIndexSymbolInformationResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * CompositeIndexSymbolInformationResponse */ 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) { + CompositeIndexSymbolInformationResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!CompositeIndexSymbolInformationResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -122,19 +133,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CompositeIndexSymbolInformationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CompositeIndexSymbolInformationResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.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/CompositeIndexSymbolInformationResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompositeIndexSymbolInformationResponseInner.java index 47580598..777b526d 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompositeIndexSymbolInformationResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompositeIndexSymbolInformationResponseInner.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -282,20 +280,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CompositeIndexSymbolInformationResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CompositeIndexSymbolInformationResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompositeIndexSymbolInformationResponseInnerBaseAssetListInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompositeIndexSymbolInformationResponseInnerBaseAssetListInner.java index 087063dc..8cd255b6 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompositeIndexSymbolInformationResponseInnerBaseAssetListInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompositeIndexSymbolInformationResponseInnerBaseAssetListInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CompositeIndexSymbolInformationResponseInnerBaseAssetListInner */ @@ -270,20 +268,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CompositeIndexSymbolInformationResponseInnerBaseAssetListInner.openapiFields - .contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CompositeIndexSymbolInformationResponseInnerBaseAssetListInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("baseAsset") != null && !jsonObj.get("baseAsset").isJsonNull()) && !jsonObj.get("baseAsset").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompressedAggregateTradesListResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompressedAggregateTradesListResponse.java index 77efd22a..498c6f7e 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompressedAggregateTradesListResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompressedAggregateTradesListResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** CompressedAggregateTradesListResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * CompressedAggregateTradesListResponse */ 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) { + CompressedAggregateTradesListResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!CompressedAggregateTradesListResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,19 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CompressedAggregateTradesListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CompressedAggregateTradesListResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.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/CompressedAggregateTradesListResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompressedAggregateTradesListResponseInner.java index 9f87eddb..b90c6483 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompressedAggregateTradesListResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CompressedAggregateTradesListResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** CompressedAggregateTradesListResponseInner */ @@ -358,20 +356,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CompressedAggregateTradesListResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CompressedAggregateTradesListResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) && !jsonObj.get("p").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ContinuousContractKlineCandlestickDataResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ContinuousContractKlineCandlestickDataResponse.java index e2396a1e..461376cb 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ContinuousContractKlineCandlestickDataResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ContinuousContractKlineCandlestickDataResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** ContinuousContractKlineCandlestickDataResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * ContinuousContractKlineCandlestickDataResponse */ 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) { + ContinuousContractKlineCandlestickDataResponseItem.validateJsonElement(element); + } if (jsonElement == null) { if (!ContinuousContractKlineCandlestickDataResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -122,20 +133,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ContinuousContractKlineCandlestickDataResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ContinuousContractKlineCandlestickDataResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.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/ContinuousContractKlineCandlestickDataResponseItem.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ContinuousContractKlineCandlestickDataResponseItem.java index e1cba768..eb8f7259 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ContinuousContractKlineCandlestickDataResponseItem.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ContinuousContractKlineCandlestickDataResponseItem.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** ContinuousContractKlineCandlestickDataResponseItem */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * ContinuousContractKlineCandlestickDataResponseItem */ 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) { + ContinuousContractKlineCandlestickDataResponseItemInner.validateJsonElement(element); + } if (jsonElement == null) { if (!ContinuousContractKlineCandlestickDataResponseItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -122,20 +133,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ContinuousContractKlineCandlestickDataResponseItem.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ContinuousContractKlineCandlestickDataResponseItem`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.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/CurrentAllOpenOrdersResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CurrentAllOpenOrdersResponse.java index 497e075c..40c4558d 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CurrentAllOpenOrdersResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/CurrentAllOpenOrdersResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** CurrentAllOpenOrdersResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * CurrentAllOpenOrdersResponse */ 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) { + AllOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!CurrentAllOpenOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti CurrentAllOpenOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CurrentAllOpenOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CurrentAllOpenOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/ExchangeInformationResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponse.java index d06a3058..b002386b 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -379,18 +377,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ExchangeInformationResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeInformationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeInformationResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the optional json data is an array if present if (jsonObj.get("exchangeFilters") != null diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponseAssetsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponseAssetsInner.java index b4ff5963..9891fd5e 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponseAssetsInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponseAssetsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ExchangeInformationResponseAssetsInner */ @@ -54,7 +52,7 @@ public class ExchangeInformationResponseAssetsInner { @SerializedName(SERIALIZED_NAME_AUTO_ASSET_EXCHANGE) @jakarta.annotation.Nullable - private Long autoAssetExchange; + private String autoAssetExchange; public ExchangeInformationResponseAssetsInner() {} @@ -98,7 +96,7 @@ public void setMarginAvailable(@jakarta.annotation.Nullable Boolean marginAvaila } public ExchangeInformationResponseAssetsInner autoAssetExchange( - @jakarta.annotation.Nullable Long autoAssetExchange) { + @jakarta.annotation.Nullable String autoAssetExchange) { this.autoAssetExchange = autoAssetExchange; return this; } @@ -109,11 +107,11 @@ public ExchangeInformationResponseAssetsInner autoAssetExchange( * @return autoAssetExchange */ @jakarta.annotation.Nullable - public Long getAutoAssetExchange() { + public String getAutoAssetExchange() { return autoAssetExchange; } - public void setAutoAssetExchange(@jakarta.annotation.Nullable Long autoAssetExchange) { + public void setAutoAssetExchange(@jakarta.annotation.Nullable String autoAssetExchange) { this.autoAssetExchange = autoAssetExchange; } @@ -224,19 +222,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeInformationResponseAssetsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeInformationResponseAssetsInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) && !jsonObj.get("asset").isJsonPrimitive()) { @@ -246,6 +231,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("asset").toString())); } + if ((jsonObj.get("autoAssetExchange") != null + && !jsonObj.get("autoAssetExchange").isJsonNull()) + && !jsonObj.get("autoAssetExchange").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `autoAssetExchange` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("autoAssetExchange").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/ExchangeInformationResponseRateLimitsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponseRateLimitsInner.java index dfc2a68a..d951d551 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponseRateLimitsInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponseRateLimitsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ExchangeInformationResponseRateLimitsInner */ @@ -256,20 +254,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeInformationResponseRateLimitsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeInformationResponseRateLimitsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) && !jsonObj.get("interval").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponseSymbolsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponseSymbolsInner.java index 49c42baa..d2edec73 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponseSymbolsInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponseSymbolsInner.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -1033,19 +1031,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeInformationResponseSymbolsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeInformationResponseSymbolsInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponseSymbolsInnerFiltersInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponseSymbolsInnerFiltersInner.java index 127065fb..93f3ed82 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponseSymbolsInnerFiltersInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ExchangeInformationResponseSymbolsInnerFiltersInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ExchangeInformationResponseSymbolsInnerFiltersInner */ @@ -108,7 +106,7 @@ public class ExchangeInformationResponseSymbolsInnerFiltersInner { @SerializedName(SERIALIZED_NAME_MULTIPLIER_DECIMAL) @jakarta.annotation.Nullable - private Long multiplierDecimal; + private String multiplierDecimal; public ExchangeInformationResponseSymbolsInnerFiltersInner() {} @@ -333,7 +331,7 @@ public void setMultiplierDown(@jakarta.annotation.Nullable String multiplierDown } public ExchangeInformationResponseSymbolsInnerFiltersInner multiplierDecimal( - @jakarta.annotation.Nullable Long multiplierDecimal) { + @jakarta.annotation.Nullable String multiplierDecimal) { this.multiplierDecimal = multiplierDecimal; return this; } @@ -344,11 +342,11 @@ public ExchangeInformationResponseSymbolsInnerFiltersInner multiplierDecimal( * @return multiplierDecimal */ @jakarta.annotation.Nullable - public Long getMultiplierDecimal() { + public String getMultiplierDecimal() { return multiplierDecimal; } - public void setMultiplierDecimal(@jakarta.annotation.Nullable Long multiplierDecimal) { + public void setMultiplierDecimal(@jakarta.annotation.Nullable String multiplierDecimal) { this.multiplierDecimal = multiplierDecimal; } @@ -549,20 +547,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeInformationResponseSymbolsInnerFiltersInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeInformationResponseSymbolsInnerFiltersInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) && !jsonObj.get("filterType").isJsonPrimitive()) { @@ -644,6 +628,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("multiplierDown").toString())); } + if ((jsonObj.get("multiplierDecimal") != null + && !jsonObj.get("multiplierDecimal").isJsonNull()) + && !jsonObj.get("multiplierDecimal").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `multiplierDecimal` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("multiplierDecimal").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/FuturesAccountBalanceV2Response.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesAccountBalanceV2Response.java index 6b0a4615..8168b3cd 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesAccountBalanceV2Response.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesAccountBalanceV2Response.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** FuturesAccountBalanceV2Response */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * FuturesAccountBalanceV2Response */ 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) { + FuturesAccountBalanceV2ResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!FuturesAccountBalanceV2Response.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -120,18 +131,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti FuturesAccountBalanceV2Response.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FuturesAccountBalanceV2Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `FuturesAccountBalanceV2Response` properties. JSON: %s", - entry.getKey(), jsonElement.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/FuturesAccountBalanceV2ResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesAccountBalanceV2ResponseInner.java index d9f2173d..5fca5a98 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesAccountBalanceV2ResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesAccountBalanceV2ResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** FuturesAccountBalanceV2ResponseInner */ @@ -438,19 +436,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FuturesAccountBalanceV2ResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `FuturesAccountBalanceV2ResponseInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("accountAlias") != null && !jsonObj.get("accountAlias").isJsonNull()) && !jsonObj.get("accountAlias").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesAccountBalanceV3Response.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesAccountBalanceV3Response.java index f125db86..c7ee03bf 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesAccountBalanceV3Response.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesAccountBalanceV3Response.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** FuturesAccountBalanceV3Response */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * FuturesAccountBalanceV3Response */ 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) { + FuturesAccountBalanceV2ResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!FuturesAccountBalanceV3Response.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -120,18 +131,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti FuturesAccountBalanceV3Response.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FuturesAccountBalanceV3Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `FuturesAccountBalanceV3Response` properties. JSON: %s", - entry.getKey(), jsonElement.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/FuturesAccountConfigurationResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesAccountConfigurationResponse.java index c7486b85..51a13f60 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesAccountConfigurationResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesAccountConfigurationResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** FuturesAccountConfigurationResponse */ @@ -397,18 +395,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FuturesAccountConfigurationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `FuturesAccountConfigurationResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradingQuantitativeRulesIndicatorsResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradingQuantitativeRulesIndicatorsResponse.java index 145efc1f..461b66fa 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradingQuantitativeRulesIndicatorsResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradingQuantitativeRulesIndicatorsResponse.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** FuturesTradingQuantitativeRulesIndicatorsResponse */ @@ -198,20 +196,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FuturesTradingQuantitativeRulesIndicatorsResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `FuturesTradingQuantitativeRulesIndicatorsResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `indicators` if (jsonObj.get("indicators") != null && !jsonObj.get("indicators").isJsonNull()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradingQuantitativeRulesIndicatorsResponseIndicators.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradingQuantitativeRulesIndicatorsResponseIndicators.java index 82e89ce5..7d21ca3e 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradingQuantitativeRulesIndicatorsResponseIndicators.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradingQuantitativeRulesIndicatorsResponseIndicators.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -306,20 +304,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FuturesTradingQuantitativeRulesIndicatorsResponseIndicators.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `FuturesTradingQuantitativeRulesIndicatorsResponseIndicators`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("BTCUSDT") != null && !jsonObj.get("BTCUSDT").isJsonNull()) { JsonArray jsonArrayBTCUSDT = jsonObj.getAsJsonArray("BTCUSDT"); diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradingQuantitativeRulesIndicatorsResponseIndicatorsACCOUNTInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradingQuantitativeRulesIndicatorsResponseIndicatorsACCOUNTInner.java index 24c39762..92bb88fc 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradingQuantitativeRulesIndicatorsResponseIndicatorsACCOUNTInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradingQuantitativeRulesIndicatorsResponseIndicatorsACCOUNTInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** FuturesTradingQuantitativeRulesIndicatorsResponseIndicatorsACCOUNTInner */ @@ -310,21 +308,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FuturesTradingQuantitativeRulesIndicatorsResponseIndicatorsACCOUNTInner - .openapiFields - .contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `FuturesTradingQuantitativeRulesIndicatorsResponseIndicatorsACCOUNTInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("indicator") != null && !jsonObj.get("indicator").isJsonNull()) && !jsonObj.get("indicator").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradingQuantitativeRulesIndicatorsResponseIndicatorsBTCUSDTInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradingQuantitativeRulesIndicatorsResponseIndicatorsBTCUSDTInner.java index 8baf8655..7a660c57 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradingQuantitativeRulesIndicatorsResponseIndicatorsBTCUSDTInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/FuturesTradingQuantitativeRulesIndicatorsResponseIndicatorsBTCUSDTInner.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** FuturesTradingQuantitativeRulesIndicatorsResponseIndicatorsBTCUSDTInner */ @@ -313,21 +311,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FuturesTradingQuantitativeRulesIndicatorsResponseIndicatorsBTCUSDTInner - .openapiFields - .contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `FuturesTradingQuantitativeRulesIndicatorsResponseIndicatorsBTCUSDTInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("indicator") != null && !jsonObj.get("indicator").isJsonNull()) && !jsonObj.get("indicator").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetBnbBurnStatusResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetBnbBurnStatusResponse.java index 0f92c592..b6d9c39e 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetBnbBurnStatusResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetBnbBurnStatusResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetBnbBurnStatusResponse */ @@ -149,18 +147,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetBnbBurnStatusResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetBnbBurnStatusResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetBnbBurnStatusResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetCurrentMultiAssetsModeResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetCurrentMultiAssetsModeResponse.java index 27b30a44..e43c9a43 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetCurrentMultiAssetsModeResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetCurrentMultiAssetsModeResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetCurrentMultiAssetsModeResponse */ @@ -156,18 +154,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetCurrentMultiAssetsModeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetCurrentMultiAssetsModeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetCurrentPositionModeResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetCurrentPositionModeResponse.java index fb25cab0..69917fb3 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetCurrentPositionModeResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetCurrentPositionModeResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetCurrentPositionModeResponse */ @@ -153,18 +151,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetCurrentPositionModeResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetCurrentPositionModeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetCurrentPositionModeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetDownloadIdForFuturesOrderHistoryResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetDownloadIdForFuturesOrderHistoryResponse.java index fd0e52b2..66e562a0 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetDownloadIdForFuturesOrderHistoryResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetDownloadIdForFuturesOrderHistoryResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetDownloadIdForFuturesOrderHistoryResponse */ @@ -196,20 +194,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetDownloadIdForFuturesOrderHistoryResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetDownloadIdForFuturesOrderHistoryResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetDownloadIdForFuturesTradeHistoryResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetDownloadIdForFuturesTradeHistoryResponse.java index 0dbfae10..b0a33eda 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetDownloadIdForFuturesTradeHistoryResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetDownloadIdForFuturesTradeHistoryResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetDownloadIdForFuturesTradeHistoryResponse */ @@ -196,20 +194,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetDownloadIdForFuturesTradeHistoryResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetDownloadIdForFuturesTradeHistoryResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetDownloadIdForFuturesTransactionHistoryResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetDownloadIdForFuturesTransactionHistoryResponse.java index e90d1bb0..535d2d46 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetDownloadIdForFuturesTransactionHistoryResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetDownloadIdForFuturesTransactionHistoryResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetDownloadIdForFuturesTransactionHistoryResponse */ @@ -199,20 +197,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetDownloadIdForFuturesTransactionHistoryResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetDownloadIdForFuturesTransactionHistoryResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFundingRateHistoryResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFundingRateHistoryResponse.java index 2dc6fa56..baade4b4 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFundingRateHistoryResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFundingRateHistoryResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** GetFundingRateHistoryResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * GetFundingRateHistoryResponse */ 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) { + GetFundingRateHistoryResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!GetFundingRateHistoryResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetFundingRateHistoryResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetFundingRateHistoryResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetFundingRateHistoryResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/GetFundingRateHistoryResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFundingRateHistoryResponseInner.java index 96f1b244..96c85151 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFundingRateHistoryResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFundingRateHistoryResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetFundingRateHistoryResponseInner */ @@ -251,18 +249,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetFundingRateHistoryResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetFundingRateHistoryResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFundingRateInfoResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFundingRateInfoResponse.java index 767015cc..926cc421 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFundingRateInfoResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFundingRateInfoResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** GetFundingRateInfoResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to GetFundingRateInfoResponse */ 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) { + GetFundingRateInfoResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!GetFundingRateInfoResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetFundingRateInfoResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetFundingRateInfoResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetFundingRateInfoResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/GetFundingRateInfoResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFundingRateInfoResponseInner.java index 82d9aa92..9815dcae 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFundingRateInfoResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFundingRateInfoResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetFundingRateInfoResponseInner */ @@ -309,18 +307,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetFundingRateInfoResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetFundingRateInfoResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetFundingRateInfoResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFuturesOrderHistoryDownloadLinkByIdResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFuturesOrderHistoryDownloadLinkByIdResponse.java index 1294152c..cacc315c 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFuturesOrderHistoryDownloadLinkByIdResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFuturesOrderHistoryDownloadLinkByIdResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetFuturesOrderHistoryDownloadLinkByIdResponse */ @@ -330,20 +328,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetFuturesOrderHistoryDownloadLinkByIdResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetFuturesOrderHistoryDownloadLinkByIdResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFuturesTradeDownloadLinkByIdResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFuturesTradeDownloadLinkByIdResponse.java index ce9adb6b..b86c1c0a 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFuturesTradeDownloadLinkByIdResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFuturesTradeDownloadLinkByIdResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetFuturesTradeDownloadLinkByIdResponse */ @@ -325,19 +323,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetFuturesTradeDownloadLinkByIdResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetFuturesTradeDownloadLinkByIdResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFuturesTransactionHistoryDownloadLinkByIdResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFuturesTransactionHistoryDownloadLinkByIdResponse.java index 0291bc90..cb28d5a0 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFuturesTransactionHistoryDownloadLinkByIdResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetFuturesTransactionHistoryDownloadLinkByIdResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetFuturesTransactionHistoryDownloadLinkByIdResponse */ @@ -335,20 +333,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetFuturesTransactionHistoryDownloadLinkByIdResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetFuturesTransactionHistoryDownloadLinkByIdResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) && !jsonObj.get("downloadId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetIncomeHistoryResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetIncomeHistoryResponse.java index ed8627c4..a810ad0f 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetIncomeHistoryResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetIncomeHistoryResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** GetIncomeHistoryResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to GetIncomeHistoryResponse */ 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) { + GetIncomeHistoryResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!GetIncomeHistoryResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetIncomeHistoryResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetIncomeHistoryResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetIncomeHistoryResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/GetIncomeHistoryResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetIncomeHistoryResponseInner.java index 048eaae4..ad61cbe7 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetIncomeHistoryResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetIncomeHistoryResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetIncomeHistoryResponseInner */ @@ -376,18 +374,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetIncomeHistoryResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetIncomeHistoryResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetIncomeHistoryResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponse.java index a63723da..3e2ac7c5 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** GetOrderModifyHistoryResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * GetOrderModifyHistoryResponse */ 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) { + GetOrderModifyHistoryResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!GetOrderModifyHistoryResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetOrderModifyHistoryResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetOrderModifyHistoryResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetOrderModifyHistoryResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/GetOrderModifyHistoryResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponseInner.java index 65168fed..d6a264dc 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponseInner.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetOrderModifyHistoryResponseInner */ @@ -351,18 +349,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetOrderModifyHistoryResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetOrderModifyHistoryResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendment.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendment.java index db7289e2..3b52fc70 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendment.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendment.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetOrderModifyHistoryResponseInnerAmendment */ @@ -227,20 +225,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetOrderModifyHistoryResponseInnerAmendment.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetOrderModifyHistoryResponseInnerAmendment` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `price` if (jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendmentOrigQty.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendmentOrigQty.java index 82af6c03..63f42ac7 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendmentOrigQty.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendmentOrigQty.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetOrderModifyHistoryResponseInnerAmendmentOrigQty */ @@ -191,20 +189,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetOrderModifyHistoryResponseInnerAmendmentOrigQty.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetOrderModifyHistoryResponseInnerAmendmentOrigQty`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("before") != null && !jsonObj.get("before").isJsonNull()) && !jsonObj.get("before").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendmentPrice.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendmentPrice.java index 6701a345..d8555968 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendmentPrice.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetOrderModifyHistoryResponseInnerAmendmentPrice.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetOrderModifyHistoryResponseInnerAmendmentPrice */ @@ -190,20 +188,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetOrderModifyHistoryResponseInnerAmendmentPrice.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetOrderModifyHistoryResponseInnerAmendmentPrice`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("before") != null && !jsonObj.get("before").isJsonNull()) && !jsonObj.get("before").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetPositionMarginChangeHistoryResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetPositionMarginChangeHistoryResponse.java index 4863039e..180fc706 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetPositionMarginChangeHistoryResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetPositionMarginChangeHistoryResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** GetPositionMarginChangeHistoryResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * GetPositionMarginChangeHistoryResponse */ 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) { + GetPositionMarginChangeHistoryResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!GetPositionMarginChangeHistoryResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,19 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetPositionMarginChangeHistoryResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetPositionMarginChangeHistoryResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.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/GetPositionMarginChangeHistoryResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetPositionMarginChangeHistoryResponseInner.java index a4f423a9..e5b986ff 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetPositionMarginChangeHistoryResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/GetPositionMarginChangeHistoryResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetPositionMarginChangeHistoryResponseInner */ @@ -355,20 +353,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetPositionMarginChangeHistoryResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetPositionMarginChangeHistoryResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/IndexPriceKlineCandlestickDataResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/IndexPriceKlineCandlestickDataResponse.java index 75e70f49..04abcfd5 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/IndexPriceKlineCandlestickDataResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/IndexPriceKlineCandlestickDataResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** IndexPriceKlineCandlestickDataResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * IndexPriceKlineCandlestickDataResponse */ 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) { + IndexPriceKlineCandlestickDataResponseItem.validateJsonElement(element); + } if (jsonElement == null) { if (!IndexPriceKlineCandlestickDataResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,19 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IndexPriceKlineCandlestickDataResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `IndexPriceKlineCandlestickDataResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.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/IndexPriceKlineCandlestickDataResponseItem.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/IndexPriceKlineCandlestickDataResponseItem.java index 07fad124..94f19695 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/IndexPriceKlineCandlestickDataResponseItem.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/IndexPriceKlineCandlestickDataResponseItem.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** IndexPriceKlineCandlestickDataResponseItem */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * IndexPriceKlineCandlestickDataResponseItem */ 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) { + IndexPriceKlineCandlestickDataResponseItemInner.validateJsonElement(element); + } if (jsonElement == null) { if (!IndexPriceKlineCandlestickDataResponseItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,20 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IndexPriceKlineCandlestickDataResponseItem.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `IndexPriceKlineCandlestickDataResponseItem` properties." - + " JSON: %s", - entry.getKey(), jsonElement.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/KeepaliveUserDataStreamResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/KeepaliveUserDataStreamResponse.java index 94d72ec4..633f8a6d 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/KeepaliveUserDataStreamResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/KeepaliveUserDataStreamResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** KeepaliveUserDataStreamResponse */ @@ -152,18 +150,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti KeepaliveUserDataStreamResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!KeepaliveUserDataStreamResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `KeepaliveUserDataStreamResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("listenKey") != null && !jsonObj.get("listenKey").isJsonNull()) && !jsonObj.get("listenKey").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/KlineCandlestickDataResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/KlineCandlestickDataResponse.java index f045f6ea..8e429d03 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/KlineCandlestickDataResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/KlineCandlestickDataResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** KlineCandlestickDataResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * KlineCandlestickDataResponse */ 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) { + KlineCandlestickDataResponseItem.validateJsonElement(element); + } if (jsonElement == null) { if (!KlineCandlestickDataResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti KlineCandlestickDataResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!KlineCandlestickDataResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `KlineCandlestickDataResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/KlineCandlestickDataResponseItem.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/KlineCandlestickDataResponseItem.java index cc21e537..93ec4100 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/KlineCandlestickDataResponseItem.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/KlineCandlestickDataResponseItem.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** KlineCandlestickDataResponseItem */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * KlineCandlestickDataResponseItem */ 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) { + KlineCandlestickDataResponseItemInner.validateJsonElement(element); + } if (jsonElement == null) { if (!KlineCandlestickDataResponseItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti KlineCandlestickDataResponseItem.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!KlineCandlestickDataResponseItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `KlineCandlestickDataResponseItem` properties. JSON: %s", - entry.getKey(), jsonElement.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/ListAllConvertPairsResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ListAllConvertPairsResponse.java index 859201a5..81c2bcce 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ListAllConvertPairsResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ListAllConvertPairsResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** ListAllConvertPairsResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * ListAllConvertPairsResponse */ 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) { + ListAllConvertPairsResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!ListAllConvertPairsResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ListAllConvertPairsResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ListAllConvertPairsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListAllConvertPairsResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/ListAllConvertPairsResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ListAllConvertPairsResponseInner.java index 93d92a4c..682c0a95 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ListAllConvertPairsResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ListAllConvertPairsResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ListAllConvertPairsResponseInner */ @@ -336,18 +334,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ListAllConvertPairsResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ListAllConvertPairsResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListAllConvertPairsResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("fromAsset") != null && !jsonObj.get("fromAsset").isJsonNull()) && !jsonObj.get("fromAsset").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/LongShortRatioResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/LongShortRatioResponse.java index 9b024c8d..9f612268 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/LongShortRatioResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/LongShortRatioResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** LongShortRatioResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to LongShortRatioResponse */ 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) { + LongShortRatioResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!LongShortRatioResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti LongShortRatioResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!LongShortRatioResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `LongShortRatioResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/LongShortRatioResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/LongShortRatioResponseInner.java index 986d5aab..c7859a1f 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/LongShortRatioResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/LongShortRatioResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** LongShortRatioResponseInner */ @@ -281,18 +279,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti LongShortRatioResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!LongShortRatioResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `LongShortRatioResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MarkPriceKlineCandlestickDataResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MarkPriceKlineCandlestickDataResponse.java index 35d11084..a6db4308 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MarkPriceKlineCandlestickDataResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MarkPriceKlineCandlestickDataResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** MarkPriceKlineCandlestickDataResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * MarkPriceKlineCandlestickDataResponse */ 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) { + MarkPriceKlineCandlestickDataResponseItem.validateJsonElement(element); + } if (jsonElement == null) { if (!MarkPriceKlineCandlestickDataResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,19 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MarkPriceKlineCandlestickDataResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarkPriceKlineCandlestickDataResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.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/MarkPriceKlineCandlestickDataResponseItem.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MarkPriceKlineCandlestickDataResponseItem.java index 84b96d68..be649618 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MarkPriceKlineCandlestickDataResponseItem.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MarkPriceKlineCandlestickDataResponseItem.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** MarkPriceKlineCandlestickDataResponseItem */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * MarkPriceKlineCandlestickDataResponseItem */ 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) { + MarkPriceKlineCandlestickDataResponseItemInner.validateJsonElement(element); + } if (jsonElement == null) { if (!MarkPriceKlineCandlestickDataResponseItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,19 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MarkPriceKlineCandlestickDataResponseItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarkPriceKlineCandlestickDataResponseItem` properties." - + " JSON: %s", - entry.getKey(), jsonElement.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/MarkPriceResponse1.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MarkPriceResponse1.java index 081df22b..96e35c0b 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MarkPriceResponse1.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MarkPriceResponse1.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** MarkPriceResponse1 */ @@ -387,18 +385,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti MarkPriceResponse1.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MarkPriceResponse1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarkPriceResponse1` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MarkPriceResponse2.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MarkPriceResponse2.java index 1ba21173..992ee7a8 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MarkPriceResponse2.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MarkPriceResponse2.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** MarkPriceResponse2 */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to MarkPriceResponse2 */ 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) { + MarkPriceResponse2Inner.validateJsonElement(element); + } if (jsonElement == null) { if (!MarkPriceResponse2.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti MarkPriceResponse2.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MarkPriceResponse2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarkPriceResponse2` properties. JSON: %s", - entry.getKey(), jsonElement.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/MarkPriceResponse2Inner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MarkPriceResponse2Inner.java index 28d9510b..52f3a31f 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MarkPriceResponse2Inner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MarkPriceResponse2Inner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** MarkPriceResponse2Inner */ @@ -389,18 +387,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti MarkPriceResponse2Inner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MarkPriceResponse2Inner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MarkPriceResponse2Inner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyIsolatedPositionMarginRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyIsolatedPositionMarginRequest.java index 4f4c76bc..17671953 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyIsolatedPositionMarginRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyIsolatedPositionMarginRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ModifyIsolatedPositionMarginRequest */ @@ -293,18 +291,6 @@ 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 (!ModifyIsolatedPositionMarginRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyIsolatedPositionMarginRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ModifyIsolatedPositionMarginRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyIsolatedPositionMarginResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyIsolatedPositionMarginResponse.java index 0bd010c3..a8f57ada 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyIsolatedPositionMarginResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyIsolatedPositionMarginResponse.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ModifyIsolatedPositionMarginResponse */ @@ -250,19 +248,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ModifyIsolatedPositionMarginResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyIsolatedPositionMarginResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyMultipleOrdersRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyMultipleOrdersRequest.java index 8eced96e..d559d9ad 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyMultipleOrdersRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyMultipleOrdersRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ModifyMultipleOrdersRequest */ @@ -188,18 +186,6 @@ 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 (!ModifyMultipleOrdersRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyMultipleOrdersRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ModifyMultipleOrdersRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyMultipleOrdersResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyMultipleOrdersResponse.java index 365e5c29..504f6515 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyMultipleOrdersResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyMultipleOrdersResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** ModifyMultipleOrdersResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * ModifyMultipleOrdersResponse */ 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) { + ModifyMultipleOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!ModifyMultipleOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ModifyMultipleOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ModifyMultipleOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyMultipleOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/ModifyMultipleOrdersResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyMultipleOrdersResponseInner.java index 31a370ce..f2743831 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyMultipleOrdersResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyMultipleOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ModifyMultipleOrdersResponseInner */ @@ -1036,18 +1034,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ModifyMultipleOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyMultipleOrdersResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyOrderRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyOrderRequest.java index fcd17e08..a1c627a2 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyOrderRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyOrderRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ModifyOrderRequest */ @@ -391,18 +389,6 @@ 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 (!ModifyOrderRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyOrderRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ModifyOrderRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyOrderResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyOrderResponse.java index dcb90e01..31842c05 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyOrderResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ModifyOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ModifyOrderResponse */ @@ -950,18 +948,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ModifyOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ModifyOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ModifyOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MultiAssetsModeAssetIndexResponse1.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MultiAssetsModeAssetIndexResponse1.java index f57bdc36..70abcf0b 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MultiAssetsModeAssetIndexResponse1.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MultiAssetsModeAssetIndexResponse1.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** MultiAssetsModeAssetIndexResponse1 */ @@ -515,18 +513,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MultiAssetsModeAssetIndexResponse1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MultiAssetsModeAssetIndexResponse1` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MultiAssetsModeAssetIndexResponse2.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MultiAssetsModeAssetIndexResponse2.java index 4c016bdd..184cacd6 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MultiAssetsModeAssetIndexResponse2.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MultiAssetsModeAssetIndexResponse2.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** MultiAssetsModeAssetIndexResponse2 */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * MultiAssetsModeAssetIndexResponse2 */ 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) { + MultiAssetsModeAssetIndexResponse2Inner.validateJsonElement(element); + } if (jsonElement == null) { if (!MultiAssetsModeAssetIndexResponse2.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,18 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MultiAssetsModeAssetIndexResponse2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MultiAssetsModeAssetIndexResponse2` properties. JSON: %s", - entry.getKey(), jsonElement.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/MultiAssetsModeAssetIndexResponse2Inner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MultiAssetsModeAssetIndexResponse2Inner.java index 9f293216..6ef0d089 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MultiAssetsModeAssetIndexResponse2Inner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/MultiAssetsModeAssetIndexResponse2Inner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** MultiAssetsModeAssetIndexResponse2Inner */ @@ -520,19 +518,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MultiAssetsModeAssetIndexResponse2Inner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MultiAssetsModeAssetIndexResponse2Inner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewOrderRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewOrderRequest.java index b8a3b97c..a595f2a7 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewOrderRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewOrderRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NewOrderRequest */ @@ -807,18 +805,6 @@ 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 (!NewOrderRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewOrderRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : NewOrderRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewOrderResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewOrderResponse.java index e8ca9027..f998c7c4 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewOrderResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NewOrderResponse */ @@ -983,18 +981,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti NewOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NewOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) && !jsonObj.get("clientOrderId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse1.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse1.java index 50e4f84c..c827e37e 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse1.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse1.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** NotionalAndLeverageBracketsResponse1 */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * NotionalAndLeverageBracketsResponse1 */ 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) { + NotionalAndLeverageBracketsResponse1Inner.validateJsonElement(element); + } if (jsonElement == null) { if (!NotionalAndLeverageBracketsResponse1.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,19 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NotionalAndLeverageBracketsResponse1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NotionalAndLeverageBracketsResponse1` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.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/NotionalAndLeverageBracketsResponse1Inner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse1Inner.java index d2539742..5a4bec81 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse1Inner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse1Inner.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -245,19 +243,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NotionalAndLeverageBracketsResponse1Inner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NotionalAndLeverageBracketsResponse1Inner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse1InnerBracketsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse1InnerBracketsInner.java index d5d705be..e8d4a2a0 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse1InnerBracketsInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse1InnerBracketsInner.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NotionalAndLeverageBracketsResponse1InnerBracketsInner */ @@ -335,20 +333,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NotionalAndLeverageBracketsResponse1InnerBracketsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NotionalAndLeverageBracketsResponse1InnerBracketsInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse2.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse2.java index f0d8f486..60ed17db 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse2.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NotionalAndLeverageBracketsResponse2.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -242,19 +240,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NotionalAndLeverageBracketsResponse2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NotionalAndLeverageBracketsResponse2` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OldTradesLookupResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OldTradesLookupResponse.java index 1d2526aa..4ac5afe5 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OldTradesLookupResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OldTradesLookupResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** OldTradesLookupResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to OldTradesLookupResponse */ 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) { + OldTradesLookupResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!OldTradesLookupResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OldTradesLookupResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OldTradesLookupResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OldTradesLookupResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/OldTradesLookupResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OldTradesLookupResponseInner.java index 55cc6747..5e235cf3 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 @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OldTradesLookupResponseInner */ @@ -312,18 +310,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OldTradesLookupResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OldTradesLookupResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OldTradesLookupResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) && !jsonObj.get("price").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OpenInterestResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OpenInterestResponse.java index cfd88dbb..34221bb2 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OpenInterestResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OpenInterestResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OpenInterestResponse */ @@ -213,18 +211,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OpenInterestResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OpenInterestResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OpenInterestResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("openInterest") != null && !jsonObj.get("openInterest").isJsonNull()) && !jsonObj.get("openInterest").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OpenInterestStatisticsResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OpenInterestStatisticsResponse.java index e2eb9a79..b439a441 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OpenInterestStatisticsResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OpenInterestStatisticsResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** OpenInterestStatisticsResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * OpenInterestStatisticsResponse */ 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) { + OpenInterestStatisticsResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!OpenInterestStatisticsResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OpenInterestStatisticsResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OpenInterestStatisticsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OpenInterestStatisticsResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/OpenInterestStatisticsResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OpenInterestStatisticsResponseInner.java index bdaf6eb2..589e5cef 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OpenInterestStatisticsResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OpenInterestStatisticsResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OpenInterestStatisticsResponseInner */ @@ -258,18 +256,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OpenInterestStatisticsResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OpenInterestStatisticsResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrderBookResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrderBookResponse.java index 25542ee5..2e5f6267 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrderBookResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrderBookResponse.java @@ -32,9 +32,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -308,18 +306,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderBookResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderBookResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderBookResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the optional json data is an array if present if (jsonObj.get("bids") != null diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrderBookResponseAsksItem.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrderBookResponseAsksItem.java index 0b1afc14..1e1c9d9b 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrderBookResponseAsksItem.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrderBookResponseAsksItem.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** OrderBookResponseAsksItem */ @@ -108,6 +107,24 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to OrderBookResponseAsksItem */ 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 (!OrderBookResponseAsksItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +135,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderBookResponseAsksItem.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderBookResponseAsksItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderBookResponseAsksItem` properties. JSON: %s", - entry.getKey(), jsonElement.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/OrderBookResponseBidsItem.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrderBookResponseBidsItem.java index c2f9049c..6e7cf63d 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrderBookResponseBidsItem.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrderBookResponseBidsItem.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** OrderBookResponseBidsItem */ @@ -108,6 +107,24 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to OrderBookResponseBidsItem */ 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 (!OrderBookResponseBidsItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +135,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderBookResponseBidsItem.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderBookResponseBidsItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderBookResponseBidsItem` properties. JSON: %s", - entry.getKey(), jsonElement.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/OrderIdList.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrderIdList.java index b803c1c3..d12e152d 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrderIdList.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrderIdList.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** OrderIdList */ @@ -108,6 +107,24 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to OrderIdList */ 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().isNumber()) { + throw new IllegalArgumentException( + String.format( + "Expected array items to be of type Number in the JSON string but" + + " got `%s`", + jsonElement.toString())); + } + } if (jsonElement == null) { if (!OrderIdList.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +135,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderIdList.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderIdList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderIdList` properties. JSON: %s", - entry.getKey(), jsonElement.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/OrderStatusResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrderStatusResponse.java index 5fd423f7..671f43eb 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrderStatusResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrderStatusResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderStatusResponse */ @@ -414,18 +412,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderStatusResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderStatusResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderStatusResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("orderStatus") != null && !jsonObj.get("orderStatus").isJsonNull()) && !jsonObj.get("orderStatus").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrigClientOrderIdList.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrigClientOrderIdList.java index 5ec7ee50..1b155fe2 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrigClientOrderIdList.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/OrigClientOrderIdList.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** OrigClientOrderIdList */ @@ -108,6 +107,24 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to OrigClientOrderIdList */ 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 (!OrigClientOrderIdList.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +135,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrigClientOrderIdList.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrigClientOrderIdList.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrigClientOrderIdList` properties. JSON: %s", - entry.getKey(), jsonElement.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/PlaceMultipleOrdersRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersRequest.java index bf715885..237e60b9 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** PlaceMultipleOrdersRequest */ @@ -187,18 +185,6 @@ 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 (!PlaceMultipleOrdersRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PlaceMultipleOrdersRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PlaceMultipleOrdersRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersResponse.java index 49ad3371..0d532b42 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** PlaceMultipleOrdersResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * PlaceMultipleOrdersResponse */ 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) { + PlaceMultipleOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!PlaceMultipleOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti PlaceMultipleOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PlaceMultipleOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PlaceMultipleOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/PlaceMultipleOrdersResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersResponseInner.java index 7526e30f..90683a53 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** PlaceMultipleOrdersResponseInner */ @@ -1033,18 +1031,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti PlaceMultipleOrdersResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PlaceMultipleOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PlaceMultipleOrdersResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) && !jsonObj.get("clientOrderId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionAdlQuantileEstimationResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionAdlQuantileEstimationResponse.java index 5dea93c4..b4c5b5cc 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionAdlQuantileEstimationResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionAdlQuantileEstimationResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** PositionAdlQuantileEstimationResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * PositionAdlQuantileEstimationResponse */ 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) { + PositionAdlQuantileEstimationResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!PositionAdlQuantileEstimationResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -121,19 +132,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PositionAdlQuantileEstimationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PositionAdlQuantileEstimationResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.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/PositionAdlQuantileEstimationResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionAdlQuantileEstimationResponseInner.java index 8f09c4aa..50a91a40 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionAdlQuantileEstimationResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionAdlQuantileEstimationResponseInner.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** PositionAdlQuantileEstimationResponseInner */ @@ -193,20 +191,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PositionAdlQuantileEstimationResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PositionAdlQuantileEstimationResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionAdlQuantileEstimationResponseInnerAdlQuantile.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionAdlQuantileEstimationResponseInnerAdlQuantile.java index 3cf0315e..61f8d496 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionAdlQuantileEstimationResponseInnerAdlQuantile.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionAdlQuantileEstimationResponseInnerAdlQuantile.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** PositionAdlQuantileEstimationResponseInnerAdlQuantile */ @@ -258,20 +256,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PositionAdlQuantileEstimationResponseInnerAdlQuantile.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PositionAdlQuantileEstimationResponseInnerAdlQuantile`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionInformationV2Response.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionInformationV2Response.java index 97b9f66c..935f5689 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionInformationV2Response.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionInformationV2Response.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** PositionInformationV2Response */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * PositionInformationV2Response */ 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) { + PositionInformationV2ResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!PositionInformationV2Response.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti PositionInformationV2Response.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PositionInformationV2Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PositionInformationV2Response` properties. JSON: %s", - entry.getKey(), jsonElement.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/PositionInformationV2ResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionInformationV2ResponseInner.java index e567e43b..2a4e4c1a 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionInformationV2ResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionInformationV2ResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** PositionInformationV2ResponseInner */ @@ -671,18 +669,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PositionInformationV2ResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PositionInformationV2ResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("entryPrice") != null && !jsonObj.get("entryPrice").isJsonNull()) && !jsonObj.get("entryPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionInformationV3Response.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionInformationV3Response.java index 0216c540..41f5d9db 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionInformationV3Response.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionInformationV3Response.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** PositionInformationV3Response */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * PositionInformationV3Response */ 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) { + PositionInformationV3ResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!PositionInformationV3Response.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti PositionInformationV3Response.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PositionInformationV3Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PositionInformationV3Response` properties. JSON: %s", - entry.getKey(), jsonElement.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/PositionInformationV3ResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionInformationV3ResponseInner.java index c5804330..e8f8828b 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionInformationV3ResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PositionInformationV3ResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** PositionInformationV3ResponseInner */ @@ -819,18 +817,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PositionInformationV3ResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PositionInformationV3ResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PremiumIndexKlineDataResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PremiumIndexKlineDataResponse.java index 5ea15f33..98f72ba9 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PremiumIndexKlineDataResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PremiumIndexKlineDataResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** PremiumIndexKlineDataResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * PremiumIndexKlineDataResponse */ 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) { + PremiumIndexKlineDataResponseItem.validateJsonElement(element); + } if (jsonElement == null) { if (!PremiumIndexKlineDataResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti PremiumIndexKlineDataResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PremiumIndexKlineDataResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PremiumIndexKlineDataResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/PremiumIndexKlineDataResponseItem.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PremiumIndexKlineDataResponseItem.java index 1f193056..e88da239 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PremiumIndexKlineDataResponseItem.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PremiumIndexKlineDataResponseItem.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** PremiumIndexKlineDataResponseItem */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * PremiumIndexKlineDataResponseItem */ 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) { + PremiumIndexKlineDataResponseItemInner.validateJsonElement(element); + } if (jsonElement == null) { if (!PremiumIndexKlineDataResponseItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -120,18 +131,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PremiumIndexKlineDataResponseItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PremiumIndexKlineDataResponseItem` properties. JSON: %s", - entry.getKey(), jsonElement.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/QuarterlyContractSettlementPriceResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QuarterlyContractSettlementPriceResponse.java index 803d3343..e2ca13d0 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QuarterlyContractSettlementPriceResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QuarterlyContractSettlementPriceResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QuarterlyContractSettlementPriceResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * QuarterlyContractSettlementPriceResponse */ 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) { + QuarterlyContractSettlementPriceResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QuarterlyContractSettlementPriceResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -122,19 +133,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QuarterlyContractSettlementPriceResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QuarterlyContractSettlementPriceResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.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/QuarterlyContractSettlementPriceResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QuarterlyContractSettlementPriceResponseInner.java index 430bb1da..6ed50039 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QuarterlyContractSettlementPriceResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QuarterlyContractSettlementPriceResponseInner.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QuarterlyContractSettlementPriceResponseInner */ @@ -194,20 +192,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QuarterlyContractSettlementPriceResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QuarterlyContractSettlementPriceResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryCurrentOpenOrderResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryCurrentOpenOrderResponse.java index b7271024..cffbfefa 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryCurrentOpenOrderResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryCurrentOpenOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryCurrentOpenOrderResponse */ @@ -997,18 +995,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryCurrentOpenOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryCurrentOpenOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryCurrentOpenOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryIndexPriceConstituentsResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryIndexPriceConstituentsResponse.java index c400e11d..501235c5 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryIndexPriceConstituentsResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryIndexPriceConstituentsResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -242,18 +240,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryIndexPriceConstituentsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryIndexPriceConstituentsResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryIndexPriceConstituentsResponseConstituentsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryIndexPriceConstituentsResponseConstituentsInner.java index 1d185ec5..d3443492 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryIndexPriceConstituentsResponseConstituentsInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryIndexPriceConstituentsResponseConstituentsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryIndexPriceConstituentsResponseConstituentsInner */ @@ -260,20 +258,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryIndexPriceConstituentsResponseConstituentsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryIndexPriceConstituentsResponseConstituentsInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("exchange") != null && !jsonObj.get("exchange").isJsonNull()) && !jsonObj.get("exchange").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse1.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse1.java index 6248e9ef..6e1a858d 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse1.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse1.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -220,20 +218,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryInsuranceFundBalanceSnapshotResponse1.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryInsuranceFundBalanceSnapshotResponse1` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the optional json data is an array if present if (jsonObj.get("symbols") != null diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse1AssetsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse1AssetsInner.java index fca67f15..3a55faba 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse1AssetsInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse1AssetsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryInsuranceFundBalanceSnapshotResponse1AssetsInner */ @@ -227,20 +225,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryInsuranceFundBalanceSnapshotResponse1AssetsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryInsuranceFundBalanceSnapshotResponse1AssetsInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) && !jsonObj.get("asset").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse2.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse2.java index c1c2287c..0e7ef998 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse2.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse2.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryInsuranceFundBalanceSnapshotResponse2 */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * QueryInsuranceFundBalanceSnapshotResponse2 */ 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) { + QueryInsuranceFundBalanceSnapshotResponse2Inner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryInsuranceFundBalanceSnapshotResponse2.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -122,20 +133,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryInsuranceFundBalanceSnapshotResponse2.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryInsuranceFundBalanceSnapshotResponse2` properties." - + " JSON: %s", - entry.getKey(), jsonElement.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/QueryInsuranceFundBalanceSnapshotResponse2Inner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse2Inner.java index 1653ff0b..e87ba4d5 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse2Inner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse2Inner.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -225,20 +223,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryInsuranceFundBalanceSnapshotResponse2Inner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryInsuranceFundBalanceSnapshotResponse2Inner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the optional json data is an array if present if (jsonObj.get("symbols") != null diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse2InnerAssetsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse2InnerAssetsInner.java index 6d150abf..3bc4b292 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse2InnerAssetsInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryInsuranceFundBalanceSnapshotResponse2InnerAssetsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryInsuranceFundBalanceSnapshotResponse2InnerAssetsInner */ @@ -228,20 +226,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryInsuranceFundBalanceSnapshotResponse2InnerAssetsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryInsuranceFundBalanceSnapshotResponse2InnerAssetsInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) && !jsonObj.get("asset").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryOrderResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryOrderResponse.java index 4e885697..76775e75 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryOrderResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryOrderResponse */ @@ -983,18 +981,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryUserRateLimitResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryUserRateLimitResponse.java index 7088b747..81ba723e 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryUserRateLimitResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryUserRateLimitResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** QueryUserRateLimitResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to QueryUserRateLimitResponse */ 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) { + QueryUserRateLimitResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryUserRateLimitResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryUserRateLimitResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUserRateLimitResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUserRateLimitResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/QueryUserRateLimitResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryUserRateLimitResponseInner.java index cf9ea1cd..f4dedfce 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryUserRateLimitResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryUserRateLimitResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** QueryUserRateLimitResponseInner */ @@ -249,18 +247,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryUserRateLimitResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!QueryUserRateLimitResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `QueryUserRateLimitResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) && !jsonObj.get("rateLimitType").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RecentTradesListResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RecentTradesListResponse.java index f7b6e134..4afa00e9 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RecentTradesListResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RecentTradesListResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** RecentTradesListResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to RecentTradesListResponse */ 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) { + RecentTradesListResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!RecentTradesListResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti RecentTradesListResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RecentTradesListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RecentTradesListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/RecentTradesListResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/RecentTradesListResponseInner.java index 2e72f98a..377935bb 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 @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** RecentTradesListResponseInner */ @@ -312,18 +310,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti RecentTradesListResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RecentTradesListResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RecentTradesListResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) && !jsonObj.get("price").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SendQuoteRequestRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SendQuoteRequestRequest.java index 73f4d29a..61101a9c 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SendQuoteRequestRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SendQuoteRequestRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** SendQuoteRequestRequest */ @@ -317,18 +315,6 @@ 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 (!SendQuoteRequestRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SendQuoteRequestRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : SendQuoteRequestRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SendQuoteRequestResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SendQuoteRequestResponse.java index 713a7024..fef6b438 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SendQuoteRequestResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SendQuoteRequestResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** SendQuoteRequestResponse */ @@ -310,18 +308,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti SendQuoteRequestResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SendQuoteRequestResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SendQuoteRequestResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("quoteId") != null && !jsonObj.get("quoteId").isJsonNull()) && !jsonObj.get("quoteId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/StartUserDataStreamResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/StartUserDataStreamResponse.java index c12f0b38..62b71493 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/StartUserDataStreamResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/StartUserDataStreamResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** StartUserDataStreamResponse */ @@ -150,18 +148,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti StartUserDataStreamResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!StartUserDataStreamResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `StartUserDataStreamResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("listenKey") != null && !jsonObj.get("listenKey").isJsonNull()) && !jsonObj.get("listenKey").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolConfigurationResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolConfigurationResponse.java index a8aa1b74..ab5b1d9d 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolConfigurationResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolConfigurationResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** SymbolConfigurationResponse */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * SymbolConfigurationResponse */ 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) { + SymbolConfigurationResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!SymbolConfigurationResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti SymbolConfigurationResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SymbolConfigurationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SymbolConfigurationResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/SymbolConfigurationResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolConfigurationResponseInner.java index bb916bb5..86d9cb9c 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolConfigurationResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolConfigurationResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** SymbolConfigurationResponseInner */ @@ -284,18 +282,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti SymbolConfigurationResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SymbolConfigurationResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SymbolConfigurationResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolOrderBookTickerResponse1.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolOrderBookTickerResponse1.java index 7b8d5218..8b3c97cb 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolOrderBookTickerResponse1.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolOrderBookTickerResponse1.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** SymbolOrderBookTickerResponse1 */ @@ -311,18 +309,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti SymbolOrderBookTickerResponse1.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SymbolOrderBookTickerResponse1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SymbolOrderBookTickerResponse1` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolOrderBookTickerResponse2.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolOrderBookTickerResponse2.java index 5f398c5d..d064dbf9 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolOrderBookTickerResponse2.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolOrderBookTickerResponse2.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** SymbolOrderBookTickerResponse2 */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * SymbolOrderBookTickerResponse2 */ 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) { + SymbolOrderBookTickerResponse2Inner.validateJsonElement(element); + } if (jsonElement == null) { if (!SymbolOrderBookTickerResponse2.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti SymbolOrderBookTickerResponse2.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SymbolOrderBookTickerResponse2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SymbolOrderBookTickerResponse2` properties. JSON: %s", - entry.getKey(), jsonElement.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/SymbolOrderBookTickerResponse2Inner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolOrderBookTickerResponse2Inner.java index 41cce350..a9d809bd 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolOrderBookTickerResponse2Inner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolOrderBookTickerResponse2Inner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** SymbolOrderBookTickerResponse2Inner */ @@ -314,18 +312,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SymbolOrderBookTickerResponse2Inner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SymbolOrderBookTickerResponse2Inner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerResponse1.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerResponse1.java index be5b805f..bd95cda2 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerResponse1.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerResponse1.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** SymbolPriceTickerResponse1 */ @@ -213,18 +211,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti SymbolPriceTickerResponse1.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SymbolPriceTickerResponse1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SymbolPriceTickerResponse1` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerResponse2.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerResponse2.java index f9f5f8c0..967e2ca4 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerResponse2.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerResponse2.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** SymbolPriceTickerResponse2 */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to SymbolPriceTickerResponse2 */ 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) { + SymbolPriceTickerV2Response2Inner.validateJsonElement(element); + } if (jsonElement == null) { if (!SymbolPriceTickerResponse2.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti SymbolPriceTickerResponse2.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SymbolPriceTickerResponse2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SymbolPriceTickerResponse2` properties. JSON: %s", - entry.getKey(), jsonElement.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/SymbolPriceTickerV2Response1.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerV2Response1.java index 836e06e0..d315ead9 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerV2Response1.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerV2Response1.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** SymbolPriceTickerV2Response1 */ @@ -215,18 +213,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti SymbolPriceTickerV2Response1.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SymbolPriceTickerV2Response1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SymbolPriceTickerV2Response1` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerV2Response2.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerV2Response2.java index 2fdbca08..5c234ebc 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerV2Response2.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerV2Response2.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** SymbolPriceTickerV2Response2 */ @@ -109,6 +108,18 @@ private String toIndentedString(Object o) { * SymbolPriceTickerV2Response2 */ 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) { + SymbolPriceTickerV2Response2Inner.validateJsonElement(element); + } if (jsonElement == null) { if (!SymbolPriceTickerV2Response2.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -119,18 +130,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti SymbolPriceTickerV2Response2.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SymbolPriceTickerV2Response2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SymbolPriceTickerV2Response2` properties. JSON: %s", - entry.getKey(), jsonElement.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/SymbolPriceTickerV2Response2Inner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerV2Response2Inner.java index a44ce6e0..8e654350 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerV2Response2Inner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolPriceTickerV2Response2Inner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** SymbolPriceTickerV2Response2Inner */ @@ -216,18 +214,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SymbolPriceTickerV2Response2Inner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SymbolPriceTickerV2Response2Inner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TakerBuySellVolumeResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TakerBuySellVolumeResponse.java index ce20e019..58bcf96c 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TakerBuySellVolumeResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TakerBuySellVolumeResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** TakerBuySellVolumeResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to TakerBuySellVolumeResponse */ 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) { + TakerBuySellVolumeResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!TakerBuySellVolumeResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TakerBuySellVolumeResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TakerBuySellVolumeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TakerBuySellVolumeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/TakerBuySellVolumeResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TakerBuySellVolumeResponseInner.java index 9c303c21..3cb1702a 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TakerBuySellVolumeResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TakerBuySellVolumeResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** TakerBuySellVolumeResponseInner */ @@ -249,18 +247,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TakerBuySellVolumeResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TakerBuySellVolumeResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TakerBuySellVolumeResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("buySellRatio") != null && !jsonObj.get("buySellRatio").isJsonNull()) && !jsonObj.get("buySellRatio").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TestOrderRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TestOrderRequest.java index d541c7ef..033386e8 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TestOrderRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TestOrderRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** TestOrderRequest */ @@ -807,18 +805,6 @@ 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 (!TestOrderRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TestOrderRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : TestOrderRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TestOrderResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TestOrderResponse.java index c07161aa..b8b266f3 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TestOrderResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TestOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** TestOrderResponse */ @@ -983,18 +981,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TestOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TestOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TestOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) && !jsonObj.get("clientOrderId").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/Ticker24hrPriceChangeStatisticsResponse1.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/Ticker24hrPriceChangeStatisticsResponse1.java index 1f2b2ace..b59be3aa 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/Ticker24hrPriceChangeStatisticsResponse1.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/Ticker24hrPriceChangeStatisticsResponse1.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** Ticker24hrPriceChangeStatisticsResponse1 */ @@ -678,19 +676,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Ticker24hrPriceChangeStatisticsResponse1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Ticker24hrPriceChangeStatisticsResponse1` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/Ticker24hrPriceChangeStatisticsResponse2.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/Ticker24hrPriceChangeStatisticsResponse2.java index 2d1ecf8a..997e09b7 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/Ticker24hrPriceChangeStatisticsResponse2.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/Ticker24hrPriceChangeStatisticsResponse2.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** Ticker24hrPriceChangeStatisticsResponse2 */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * Ticker24hrPriceChangeStatisticsResponse2 */ 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) { + Ticker24hrPriceChangeStatisticsResponse2Inner.validateJsonElement(element); + } if (jsonElement == null) { if (!Ticker24hrPriceChangeStatisticsResponse2.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -122,19 +133,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Ticker24hrPriceChangeStatisticsResponse2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Ticker24hrPriceChangeStatisticsResponse2` properties." - + " JSON: %s", - entry.getKey(), jsonElement.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/Ticker24hrPriceChangeStatisticsResponse2Inner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/Ticker24hrPriceChangeStatisticsResponse2Inner.java index 8aa138b2..df7fd390 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/Ticker24hrPriceChangeStatisticsResponse2Inner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/Ticker24hrPriceChangeStatisticsResponse2Inner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** Ticker24hrPriceChangeStatisticsResponse2Inner */ @@ -684,20 +682,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Ticker24hrPriceChangeStatisticsResponse2Inner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Ticker24hrPriceChangeStatisticsResponse2Inner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ToggleBnbBurnOnFuturesTradeRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ToggleBnbBurnOnFuturesTradeRequest.java index 3d1f0848..b2b2b8a0 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ToggleBnbBurnOnFuturesTradeRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ToggleBnbBurnOnFuturesTradeRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ToggleBnbBurnOnFuturesTradeRequest */ @@ -188,18 +186,6 @@ 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 (!ToggleBnbBurnOnFuturesTradeRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ToggleBnbBurnOnFuturesTradeRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ToggleBnbBurnOnFuturesTradeRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ToggleBnbBurnOnFuturesTradeResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ToggleBnbBurnOnFuturesTradeResponse.java index 9724fb5e..5f764616 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ToggleBnbBurnOnFuturesTradeResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/ToggleBnbBurnOnFuturesTradeResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** ToggleBnbBurnOnFuturesTradeResponse */ @@ -184,18 +182,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ToggleBnbBurnOnFuturesTradeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ToggleBnbBurnOnFuturesTradeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TopTraderLongShortRatioAccountsResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TopTraderLongShortRatioAccountsResponse.java index e0b094d9..11b8549c 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TopTraderLongShortRatioAccountsResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TopTraderLongShortRatioAccountsResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** TopTraderLongShortRatioAccountsResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * TopTraderLongShortRatioAccountsResponse */ 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) { + TopTraderLongShortRatioAccountsResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!TopTraderLongShortRatioAccountsResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -122,19 +133,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TopTraderLongShortRatioAccountsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TopTraderLongShortRatioAccountsResponse` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.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/TopTraderLongShortRatioAccountsResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TopTraderLongShortRatioAccountsResponseInner.java index c0e42082..722ee628 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TopTraderLongShortRatioAccountsResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TopTraderLongShortRatioAccountsResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** TopTraderLongShortRatioAccountsResponseInner */ @@ -292,20 +290,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TopTraderLongShortRatioAccountsResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TopTraderLongShortRatioAccountsResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TopTraderLongShortRatioPositionsResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TopTraderLongShortRatioPositionsResponse.java index ba583e84..04af117a 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TopTraderLongShortRatioPositionsResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TopTraderLongShortRatioPositionsResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** TopTraderLongShortRatioPositionsResponse */ @@ -110,6 +109,18 @@ private String toIndentedString(Object o) { * TopTraderLongShortRatioPositionsResponse */ 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) { + TopTraderLongShortRatioPositionsResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!TopTraderLongShortRatioPositionsResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -122,19 +133,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TopTraderLongShortRatioPositionsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TopTraderLongShortRatioPositionsResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.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/TopTraderLongShortRatioPositionsResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TopTraderLongShortRatioPositionsResponseInner.java index 04cbddca..1928f80b 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TopTraderLongShortRatioPositionsResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/TopTraderLongShortRatioPositionsResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** TopTraderLongShortRatioPositionsResponseInner */ @@ -293,20 +291,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TopTraderLongShortRatioPositionsResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TopTraderLongShortRatioPositionsResponseInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { 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 36599ce3..700c5441 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 @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** UserCommissionRateResponse */ @@ -225,18 +223,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti UserCommissionRateResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserCommissionRateResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UserCommissionRateResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/UsersForceOrdersResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/UsersForceOrdersResponse.java index 7243d690..1d68054e 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/UsersForceOrdersResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/UsersForceOrdersResponse.java @@ -14,6 +14,7 @@ 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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** UsersForceOrdersResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to UsersForceOrdersResponse */ 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) { + UsersForceOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!UsersForceOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti UsersForceOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UsersForceOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UsersForceOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.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/UsersForceOrdersResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/UsersForceOrdersResponseInner.java index 297c3931..9c5a3d69 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/UsersForceOrdersResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/UsersForceOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** UsersForceOrdersResponseInner */ @@ -786,18 +784,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti UsersForceOrdersResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UsersForceOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UsersForceOrdersResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { 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 529833e0..10131105 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 @@ -44,7 +44,7 @@ public class DerivativesTradingUsdsFuturesWebSocketApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/2.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private AccountApi accountApi; 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 27331e76..26b84c9a 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 @@ -48,7 +48,7 @@ public class DerivativesTradingUsdsFuturesWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/2.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private WebsocketMarketStreamsApi websocketMarketStreamsApi; diff --git a/clients/spot/CHANGELOG.md b/clients/spot/CHANGELOG.md index 95d46702..59e0d235 100644 --- a/clients/spot/CHANGELOG.md +++ b/clients/spot/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## 3.0.0 - 2025-06-12 + +### Changed (2) + +#### REST API + +- Fixed cases where the response can be an object or an array +- rateLimits to be unified as a single object +- Modified response for `exchangeInfo()` method (`GET /api/v3/exchangeInfo`): + - `symbols`: item property `amendAllowed` added + - `symbols`: item property `allowAmend` deleted + + +#### WebSocket API + +- Modified response for `exchangeInfo()` method (`POST /exchangeInfo`): + - `result`.`symbols`: item property `amendAllowed` added + - `result`.`symbols`: item property `allowAmend` deleted + ## 2.0.0 - 2025-05-14 - Updated response types. @@ -17,4 +36,4 @@ ## 1.0.0 - 2025-04-24 -- Initial release \ No newline at end of file +- Initial release diff --git a/clients/spot/docs/AccountApi.md b/clients/spot/docs/AccountApi.md index 6374595d..619cba2c 100644 --- a/clients/spot/docs/AccountApi.md +++ b/clients/spot/docs/AccountApi.md @@ -7,12 +7,16 @@ All URIs are relative to *http://localhost* | [**accountCommission**](AccountApi.md#accountCommission) | **POST** /account.commission | WebSocket Account Commission Rates | | [**accountRateLimitsOrders**](AccountApi.md#accountRateLimitsOrders) | **POST** /account.rateLimits.orders | WebSocket Unfilled Order Count | | [**accountStatus**](AccountApi.md#accountStatus) | **POST** /account.status | WebSocket Account information | -| [**allOrderLists**](AccountApi.md#allOrderLists) | **POST** /allOrderLists | WebSocket Account Order list history | +| [**allOrderLists**](AccountApi.md#allOrderLists) | **POST** /allOrderLists | WebSocket Account order list history | | [**allOrders**](AccountApi.md#allOrders) | **POST** /allOrders | WebSocket Account order history | | [**myAllocations**](AccountApi.md#myAllocations) | **POST** /myAllocations | WebSocket Account allocations | | [**myPreventedMatches**](AccountApi.md#myPreventedMatches) | **POST** /myPreventedMatches | WebSocket Account prevented matches | | [**myTrades**](AccountApi.md#myTrades) | **POST** /myTrades | WebSocket Account trade history | +| [**openOrderListsStatus**](AccountApi.md#openOrderListsStatus) | **POST** /openOrderLists.status | WebSocket Current open Order lists | +| [**openOrdersStatus**](AccountApi.md#openOrdersStatus) | **POST** /openOrders.status | WebSocket Current open orders | | [**orderAmendments**](AccountApi.md#orderAmendments) | **POST** /order.amendments | WebSocket Query Order Amendments | +| [**orderListStatus**](AccountApi.md#orderListStatus) | **POST** /orderList.status | WebSocket Query Order list | +| [**orderStatus**](AccountApi.md#orderStatus) | **POST** /order.status | WebSocket Query order | @@ -205,7 +209,7 @@ No authorization required # **allOrderLists** > AllOrderListsResponse allOrderLists(allOrderListsRequest) -WebSocket Account Order list history +WebSocket Account order list history Query information about all your order lists, filtered by time range. Weight: 20 @@ -261,7 +265,7 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Account Order list history | - | +| **200** | Account order list history | - | # **allOrders** @@ -511,6 +515,130 @@ No authorization required |-------------|-------------|------------------| | **200** | Account trade history | - | + +# **openOrderListsStatus** +> OpenOrderListsStatusResponse openOrderListsStatus(openOrderListsStatusRequest) + +WebSocket Current open Order lists + +Query execution status of all open order lists. If you need to continuously monitor order status updates, please consider using WebSocket Streams: * `userDataStream.start` request * `executionReport` user data stream event Weight: 6 + +### Example +```java +// Import classes: +import com.binance.connector.client.spot.ApiClient; +import com.binance.connector.client.spot.ApiException; +import com.binance.connector.client.spot.Configuration; +import com.binance.connector.client.spot.models.*; +import com.binance.connector.client.spot.websocket.api.api.AccountApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + AccountApi apiInstance = new AccountApi(defaultClient); + OpenOrderListsStatusRequest openOrderListsStatusRequest = new OpenOrderListsStatusRequest(); // OpenOrderListsStatusRequest | + try { + OpenOrderListsStatusResponse result = apiInstance.openOrderListsStatus(openOrderListsStatusRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#openOrderListsStatus"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **openOrderListsStatusRequest** | [**OpenOrderListsStatusRequest**](OpenOrderListsStatusRequest.md)| | | + +### Return type + +[**OpenOrderListsStatusResponse**](OpenOrderListsStatusResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Current open Order lists | - | + + +# **openOrdersStatus** +> OpenOrdersStatusResponse openOrdersStatus(openOrdersStatusRequest) + +WebSocket Current open orders + +Query execution status of all open orders. If you need to continuously monitor order status updates, please consider using WebSocket Streams: * `userDataStream.start` request * `executionReport` user data stream event Weight: Adjusted based on the number of requested symbols: | Parameter | Weight | | --------- | ------ | | `symbol` | 6 | | none | 80 | + +### Example +```java +// Import classes: +import com.binance.connector.client.spot.ApiClient; +import com.binance.connector.client.spot.ApiException; +import com.binance.connector.client.spot.Configuration; +import com.binance.connector.client.spot.models.*; +import com.binance.connector.client.spot.websocket.api.api.AccountApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + AccountApi apiInstance = new AccountApi(defaultClient); + OpenOrdersStatusRequest openOrdersStatusRequest = new OpenOrdersStatusRequest(); // OpenOrdersStatusRequest | + try { + OpenOrdersStatusResponse result = apiInstance.openOrdersStatus(openOrdersStatusRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#openOrdersStatus"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **openOrdersStatusRequest** | [**OpenOrdersStatusRequest**](OpenOrdersStatusRequest.md)| | | + +### Return type + +[**OpenOrdersStatusResponse**](OpenOrdersStatusResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Current open orders | - | + # **orderAmendments** > OrderAmendmentsResponse orderAmendments(orderAmendmentsRequest) @@ -573,3 +701,127 @@ No authorization required |-------------|-------------|------------------| | **200** | Query Order Amendments | - | + +# **orderListStatus** +> OrderListStatusResponse orderListStatus(orderListStatusRequest) + +WebSocket Query Order list + +Check execution status of an Order list. For execution status of individual orders, use `order.status`. Weight: 4 + +### Example +```java +// Import classes: +import com.binance.connector.client.spot.ApiClient; +import com.binance.connector.client.spot.ApiException; +import com.binance.connector.client.spot.Configuration; +import com.binance.connector.client.spot.models.*; +import com.binance.connector.client.spot.websocket.api.api.AccountApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + AccountApi apiInstance = new AccountApi(defaultClient); + OrderListStatusRequest orderListStatusRequest = new OrderListStatusRequest(); // OrderListStatusRequest | + try { + OrderListStatusResponse result = apiInstance.orderListStatus(orderListStatusRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#orderListStatus"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **orderListStatusRequest** | [**OrderListStatusRequest**](OrderListStatusRequest.md)| | | + +### Return type + +[**OrderListStatusResponse**](OrderListStatusResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Query Order list | - | + + +# **orderStatus** +> OrderStatusResponse orderStatus(orderStatusRequest) + +WebSocket Query order + +Check execution status of an order. Weight: 4 + +### Example +```java +// Import classes: +import com.binance.connector.client.spot.ApiClient; +import com.binance.connector.client.spot.ApiException; +import com.binance.connector.client.spot.Configuration; +import com.binance.connector.client.spot.models.*; +import com.binance.connector.client.spot.websocket.api.api.AccountApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + AccountApi apiInstance = new AccountApi(defaultClient); + OrderStatusRequest orderStatusRequest = new OrderStatusRequest(); // OrderStatusRequest | + try { + OrderStatusResponse result = apiInstance.orderStatus(orderStatusRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#orderStatus"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **orderStatusRequest** | [**OrderStatusRequest**](OrderStatusRequest.md)| | | + +### Return type + +[**OrderStatusResponse**](OrderStatusResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Query order | - | + diff --git a/clients/spot/docs/AccountCommissionResponse.md b/clients/spot/docs/AccountCommissionResponse.md index d30661e6..57bcc800 100644 --- a/clients/spot/docs/AccountCommissionResponse.md +++ b/clients/spot/docs/AccountCommissionResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**AccountCommissionResponseResult**](AccountCommissionResponseResult.md) | | [optional] | -|**rateLimits** | [**List<AccountCommissionResponseRateLimitsInner>**](AccountCommissionResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/AccountCommissionResponseRateLimitsInner.md b/clients/spot/docs/AccountCommissionResponseRateLimitsInner.md deleted file mode 100644 index 9760a229..00000000 --- a/clients/spot/docs/AccountCommissionResponseRateLimitsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# AccountCommissionResponseRateLimitsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rateLimitType** | **String** | | [optional] | -|**interval** | **String** | | [optional] | -|**intervalNum** | **Long** | | [optional] | -|**limit** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/AccountRateLimitsOrdersResponse.md b/clients/spot/docs/AccountRateLimitsOrdersResponse.md index c8dad608..4ec2e96e 100644 --- a/clients/spot/docs/AccountRateLimitsOrdersResponse.md +++ b/clients/spot/docs/AccountRateLimitsOrdersResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<AccountRateLimitsOrdersResponseResultInner>**](AccountRateLimitsOrdersResponseResultInner.md) | | [optional] | -|**rateLimits** | [**List<AccountRateLimitsOrdersResponseRateLimitsInner>**](AccountRateLimitsOrdersResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/AccountRateLimitsOrdersResponseRateLimitsInner.md b/clients/spot/docs/AccountRateLimitsOrdersResponseRateLimitsInner.md deleted file mode 100644 index 840dca02..00000000 --- a/clients/spot/docs/AccountRateLimitsOrdersResponseRateLimitsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# AccountRateLimitsOrdersResponseRateLimitsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rateLimitType** | **String** | | [optional] | -|**interval** | **String** | | [optional] | -|**intervalNum** | **Long** | | [optional] | -|**limit** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/AccountStatusResponse.md b/clients/spot/docs/AccountStatusResponse.md index 1630779d..22c2668d 100644 --- a/clients/spot/docs/AccountStatusResponse.md +++ b/clients/spot/docs/AccountStatusResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**AccountStatusResponseResult**](AccountStatusResponseResult.md) | | [optional] | -|**rateLimits** | [**List<AccountCommissionResponseRateLimitsInner>**](AccountCommissionResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/AllOrderListsResponse.md b/clients/spot/docs/AllOrderListsResponse.md index e08fb7d7..fec4455b 100644 --- a/clients/spot/docs/AllOrderListsResponse.md +++ b/clients/spot/docs/AllOrderListsResponse.md @@ -9,8 +9,8 @@ |------------ | ------------- | ------------- | -------------| |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | -|**result** | [**List<OrderListStatusResponseResult>**](OrderListStatusResponseResult.md) | | [optional] | -|**rateLimits** | [**List<AccountCommissionResponseRateLimitsInner>**](AccountCommissionResponseRateLimitsInner.md) | | [optional] | +|**result** | [**List<AllOrderListsResponseResultInner>**](AllOrderListsResponseResultInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OrderListStatusResponseResult.md b/clients/spot/docs/AllOrderListsResponseResultInner.md similarity index 94% rename from clients/spot/docs/OrderListStatusResponseResult.md rename to clients/spot/docs/AllOrderListsResponseResultInner.md index 3a545062..3e3a85d8 100644 --- a/clients/spot/docs/OrderListStatusResponseResult.md +++ b/clients/spot/docs/AllOrderListsResponseResultInner.md @@ -1,6 +1,6 @@ -# OrderListStatusResponseResult +# AllOrderListsResponseResultInner ## Properties diff --git a/clients/spot/docs/AllOrdersResponse.md b/clients/spot/docs/AllOrdersResponse.md index a829b6f6..4d3b7322 100644 --- a/clients/spot/docs/AllOrdersResponse.md +++ b/clients/spot/docs/AllOrdersResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<AllOrdersResponseResultInner>**](AllOrdersResponseResultInner.md) | | [optional] | -|**rateLimits** | [**List<AccountCommissionResponseRateLimitsInner>**](AccountCommissionResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/AvgPriceResponseRateLimitsInner.md b/clients/spot/docs/AvgPriceResponseRateLimitsInner.md deleted file mode 100644 index 7cba899e..00000000 --- a/clients/spot/docs/AvgPriceResponseRateLimitsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# AvgPriceResponseRateLimitsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rateLimitType** | **String** | | [optional] | -|**interval** | **String** | | [optional] | -|**intervalNum** | **Long** | | [optional] | -|**limit** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/DeleteOpenOrdersResponseInner.md b/clients/spot/docs/DeleteOpenOrdersResponseInner.md index d6ecd912..25d246b1 100644 --- a/clients/spot/docs/DeleteOpenOrdersResponseInner.md +++ b/clients/spot/docs/DeleteOpenOrdersResponseInner.md @@ -16,6 +16,7 @@ |**price** | **String** | | [optional] | |**origQty** | **String** | | [optional] | |**executedQty** | **String** | | [optional] | +|**origQuoteOrderQty** | **String** | | [optional] | |**cummulativeQuoteQty** | **String** | | [optional] | |**status** | **String** | | [optional] | |**timeInForce** | **String** | | [optional] | diff --git a/clients/spot/docs/DeleteOrderResponse.md b/clients/spot/docs/DeleteOrderResponse.md index dc047228..84310b9b 100644 --- a/clients/spot/docs/DeleteOrderResponse.md +++ b/clients/spot/docs/DeleteOrderResponse.md @@ -16,6 +16,7 @@ |**price** | **String** | | [optional] | |**origQty** | **String** | | [optional] | |**executedQty** | **String** | | [optional] | +|**origQuoteOrderQty** | **String** | | [optional] | |**cummulativeQuoteQty** | **String** | | [optional] | |**status** | **String** | | [optional] | |**timeInForce** | **String** | | [optional] | diff --git a/clients/spot/docs/DepthResponse.md b/clients/spot/docs/DepthResponse.md index 3bf65f4e..2fd461f2 100644 --- a/clients/spot/docs/DepthResponse.md +++ b/clients/spot/docs/DepthResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**DepthResponseResult**](DepthResponseResult.md) | | [optional] | -|**rateLimits** | [**List<AvgPriceResponseRateLimitsInner>**](AvgPriceResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/PositionInformationV3Response1.md b/clients/spot/docs/ExchangeFilters.md similarity index 78% rename from clients/derivatives-trading-usds-futures/docs/PositionInformationV3Response1.md rename to clients/spot/docs/ExchangeFilters.md index 0bb9b363..7fbf8939 100644 --- a/clients/derivatives-trading-usds-futures/docs/PositionInformationV3Response1.md +++ b/clients/spot/docs/ExchangeFilters.md @@ -1,6 +1,6 @@ -# PositionInformationV3Response1 +# ExchangeFilters ## Properties diff --git a/clients/spot/docs/ExchangeInfoResponseExchangeFiltersInner.md b/clients/spot/docs/ExchangeFiltersInner.md similarity index 97% rename from clients/spot/docs/ExchangeInfoResponseExchangeFiltersInner.md rename to clients/spot/docs/ExchangeFiltersInner.md index 86949c4e..99b87826 100644 --- a/clients/spot/docs/ExchangeInfoResponseExchangeFiltersInner.md +++ b/clients/spot/docs/ExchangeFiltersInner.md @@ -1,6 +1,6 @@ -# ExchangeInfoResponseExchangeFiltersInner +# ExchangeFiltersInner ## Properties @@ -8,33 +8,33 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**filterType** | **String** | | [optional] | -|**maxNumIcebergOrders** | **Long** | | [optional] | -|**maxNumAlgoOrders** | **Long** | | [optional] | -|**maxNumOrders** | **Long** | | [optional] | -|**minTrailingAboveDelta** | **Long** | | [optional] | -|**maxTrailingAboveDelta** | **Long** | | [optional] | -|**minTrailingBelowDelta** | **Long** | | [optional] | -|**maxTrailingBelowDelta** | **Long** | | [optional] | -|**maxPosition** | **String** | | [optional] | +|**minPrice** | **String** | | [optional] | +|**maxPrice** | **String** | | [optional] | +|**tickSize** | **String** | | [optional] | +|**multiplierUp** | **String** | | [optional] | +|**multiplierDown** | **String** | | [optional] | +|**avgPriceMins** | **Long** | | [optional] | +|**bidMultiplierUp** | **String** | | [optional] | +|**bidMultiplierDown** | **String** | | [optional] | +|**askMultiplierUp** | **String** | | [optional] | +|**askMultiplierDown** | **String** | | [optional] | |**minQty** | **String** | | [optional] | |**maxQty** | **String** | | [optional] | |**stepSize** | **String** | | [optional] | -|**limit** | **Long** | | [optional] | |**minNotional** | **String** | | [optional] | +|**applyToMarket** | **Boolean** | | [optional] | |**applyMinToMarket** | **Boolean** | | [optional] | |**maxNotional** | **String** | | [optional] | |**applyMaxToMarket** | **Boolean** | | [optional] | -|**avgPriceMins** | **Long** | | [optional] | -|**applyToMarket** | **Boolean** | | [optional] | -|**bidMultiplierUp** | **String** | | [optional] | -|**bidMultiplierDown** | **String** | | [optional] | -|**askMultiplierUp** | **String** | | [optional] | -|**askMultiplierDown** | **String** | | [optional] | -|**multiplierUp** | **String** | | [optional] | -|**multiplierDown** | **String** | | [optional] | -|**minPrice** | **String** | | [optional] | -|**maxPrice** | **String** | | [optional] | -|**tickSize** | **String** | | [optional] | +|**limit** | **Long** | | [optional] | +|**maxNumOrders** | **Long** | | [optional] | +|**maxNumAlgoOrders** | **Long** | | [optional] | +|**maxNumIcebergOrders** | **Long** | | [optional] | +|**maxPosition** | **String** | | [optional] | +|**minTrailingAboveDelta** | **Long** | | [optional] | +|**maxTrailingAboveDelta** | **Long** | | [optional] | +|**minTrailingBelowDelta** | **Long** | | [optional] | +|**maxTrailingBelowDelta** | **Long** | | [optional] | diff --git a/clients/spot/docs/ExchangeInfoResponse.md b/clients/spot/docs/ExchangeInfoResponse.md index 5a6a3905..020aa39d 100644 --- a/clients/spot/docs/ExchangeInfoResponse.md +++ b/clients/spot/docs/ExchangeInfoResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**ExchangeInfoResponseResult**](ExchangeInfoResponseResult.md) | | [optional] | -|**rateLimits** | [**List<ExchangeInfoResponseResultRateLimitsInner>**](ExchangeInfoResponseResultRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/ExchangeInfoResponseRateLimitsInner.md b/clients/spot/docs/ExchangeInfoResponseRateLimitsInner.md deleted file mode 100644 index a57f65a5..00000000 --- a/clients/spot/docs/ExchangeInfoResponseRateLimitsInner.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# ExchangeInfoResponseRateLimitsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rateLimitType** | **String** | | [optional] | -|**interval** | **String** | | [optional] | -|**intervalNum** | **Long** | | [optional] | -|**limit** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/ExchangeInfoResponseResult.md b/clients/spot/docs/ExchangeInfoResponseResult.md index df6f8609..904ab60e 100644 --- a/clients/spot/docs/ExchangeInfoResponseResult.md +++ b/clients/spot/docs/ExchangeInfoResponseResult.md @@ -9,8 +9,8 @@ |------------ | ------------- | ------------- | -------------| |**timezone** | **String** | | [optional] | |**serverTime** | **Long** | | [optional] | -|**rateLimits** | [**List<ExchangeInfoResponseResultRateLimitsInner>**](ExchangeInfoResponseResultRateLimitsInner.md) | | [optional] | -|**exchangeFilters** | [**List<ExchangeInfoResponseResultExchangeFiltersInner>**](ExchangeInfoResponseResultExchangeFiltersInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | +|**exchangeFilters** | **ExchangeFilters** | | [optional] | |**symbols** | [**List<ExchangeInfoResponseResultSymbolsInner>**](ExchangeInfoResponseResultSymbolsInner.md) | | [optional] | |**sors** | [**List<ExchangeInfoResponseResultSorsInner>**](ExchangeInfoResponseResultSorsInner.md) | | [optional] | diff --git a/clients/spot/docs/ExchangeInfoResponseResultExchangeFiltersInner.md b/clients/spot/docs/ExchangeInfoResponseResultExchangeFiltersInner.md deleted file mode 100644 index 4b61f546..00000000 --- a/clients/spot/docs/ExchangeInfoResponseResultExchangeFiltersInner.md +++ /dev/null @@ -1,40 +0,0 @@ - - -# ExchangeInfoResponseResultExchangeFiltersInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**filterType** | **String** | | [optional] | -|**maxNumIcebergOrders** | **Long** | | [optional] | -|**maxNumAlgoOrders** | **Long** | | [optional] | -|**maxNumOrders** | **Long** | | [optional] | -|**minTrailingAboveDelta** | **Long** | | [optional] | -|**maxTrailingAboveDelta** | **Long** | | [optional] | -|**minTrailingBelowDelta** | **Long** | | [optional] | -|**maxTrailingBelowDelta** | **Long** | | [optional] | -|**maxPosition** | **String** | | [optional] | -|**minQty** | **String** | | [optional] | -|**maxQty** | **String** | | [optional] | -|**stepSize** | **String** | | [optional] | -|**limit** | **Long** | | [optional] | -|**minNotional** | **String** | | [optional] | -|**applyMinToMarket** | **Boolean** | | [optional] | -|**maxNotional** | **String** | | [optional] | -|**applyMaxToMarket** | **Boolean** | | [optional] | -|**avgPriceMins** | **Long** | | [optional] | -|**applyToMarket** | **Boolean** | | [optional] | -|**bidMultiplierUp** | **String** | | [optional] | -|**bidMultiplierDown** | **String** | | [optional] | -|**askMultiplierUp** | **String** | | [optional] | -|**askMultiplierDown** | **String** | | [optional] | -|**multiplierUp** | **String** | | [optional] | -|**multiplierDown** | **String** | | [optional] | -|**minPrice** | **String** | | [optional] | -|**maxPrice** | **String** | | [optional] | -|**tickSize** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/ExchangeInfoResponseResultRateLimitsInner.md b/clients/spot/docs/ExchangeInfoResponseResultRateLimitsInner.md deleted file mode 100644 index b6191512..00000000 --- a/clients/spot/docs/ExchangeInfoResponseResultRateLimitsInner.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# ExchangeInfoResponseResultRateLimitsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rateLimitType** | **String** | | [optional] | -|**interval** | **String** | | [optional] | -|**intervalNum** | **Long** | | [optional] | -|**limit** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/ExchangeInfoResponseResultSymbolsInner.md b/clients/spot/docs/ExchangeInfoResponseResultSymbolsInner.md index f14b0000..c2791773 100644 --- a/clients/spot/docs/ExchangeInfoResponseResultSymbolsInner.md +++ b/clients/spot/docs/ExchangeInfoResponseResultSymbolsInner.md @@ -23,10 +23,10 @@ |**quoteOrderQtyMarketAllowed** | **Boolean** | | [optional] | |**allowTrailingStop** | **Boolean** | | [optional] | |**cancelReplaceAllowed** | **Boolean** | | [optional] | -|**allowAmend** | **Boolean** | | [optional] | +|**amendAllowed** | **Boolean** | | [optional] | |**isSpotTradingAllowed** | **Boolean** | | [optional] | |**isMarginTradingAllowed** | **Boolean** | | [optional] | -|**filters** | [**List<ExchangeInfoResponseResultExchangeFiltersInner>**](ExchangeInfoResponseResultExchangeFiltersInner.md) | | [optional] | +|**filters** | **ExchangeFilters** | | [optional] | |**permissions** | **List<String>** | | [optional] | |**permissionSets** | **List<List<String>>** | | [optional] | |**defaultSelfTradePreventionMode** | **String** | | [optional] | diff --git a/clients/spot/docs/ExchangeInfoResponseResultSymbolsInnerFiltersInner.md b/clients/spot/docs/ExchangeInfoResponseResultSymbolsInnerFiltersInner.md deleted file mode 100644 index cbbe8902..00000000 --- a/clients/spot/docs/ExchangeInfoResponseResultSymbolsInnerFiltersInner.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# ExchangeInfoResponseResultSymbolsInnerFiltersInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**filterType** | **String** | | [optional] | -|**minPrice** | **String** | | [optional] | -|**maxPrice** | **String** | | [optional] | -|**tickSize** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/ExchangeInfoResponseSymbolsInner.md b/clients/spot/docs/ExchangeInfoResponseSymbolsInner.md index a7d5dcef..1811c52a 100644 --- a/clients/spot/docs/ExchangeInfoResponseSymbolsInner.md +++ b/clients/spot/docs/ExchangeInfoResponseSymbolsInner.md @@ -23,10 +23,10 @@ |**quoteOrderQtyMarketAllowed** | **Boolean** | | [optional] | |**allowTrailingStop** | **Boolean** | | [optional] | |**cancelReplaceAllowed** | **Boolean** | | [optional] | -|**allowAmend** | **Boolean** | | [optional] | +|**amendAllowed** | **Boolean** | | [optional] | |**isSpotTradingAllowed** | **Boolean** | | [optional] | |**isMarginTradingAllowed** | **Boolean** | | [optional] | -|**filters** | [**List<ExchangeInfoResponseExchangeFiltersInner>**](ExchangeInfoResponseExchangeFiltersInner.md) | | [optional] | +|**filters** | **ExchangeFilters** | | [optional] | |**permissions** | **List<String>** | | [optional] | |**permissionSets** | **List<List<String>>** | | [optional] | |**defaultSelfTradePreventionMode** | **String** | | [optional] | diff --git a/clients/spot/docs/ExchangeInfoResponseSymbolsInnerFiltersInner.md b/clients/spot/docs/ExchangeInfoResponseSymbolsInnerFiltersInner.md deleted file mode 100644 index 575a1a7c..00000000 --- a/clients/spot/docs/ExchangeInfoResponseSymbolsInnerFiltersInner.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# ExchangeInfoResponseSymbolsInnerFiltersInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**filterType** | **String** | | [optional] | -|**minPrice** | **String** | | [optional] | -|**maxPrice** | **String** | | [optional] | -|**tickSize** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/GeneralApi.md b/clients/spot/docs/GeneralApi.md index 53668811..6543cc25 100644 --- a/clients/spot/docs/GeneralApi.md +++ b/clients/spot/docs/GeneralApi.md @@ -73,7 +73,7 @@ No authorization required # **ping** -> ping() +> PingResponse ping() WebSocket Test connectivity @@ -95,7 +95,8 @@ public class Example { GeneralApi apiInstance = new GeneralApi(defaultClient); try { - apiInstance.ping(); + PingResponse result = apiInstance.ping(); + System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling GeneralApi#ping"); System.err.println("Status code: " + e.getCode()); @@ -112,7 +113,7 @@ This endpoint does not need any parameter. ### Return type -null (empty response body) +[**PingResponse**](PingResponse.md) ### Authorization @@ -121,12 +122,12 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | OK | - | +| **200** | Test connectivity | - | # **time** diff --git a/clients/spot/docs/KlinesResponse.md b/clients/spot/docs/KlinesResponse.md index 7b46d2e3..2db1485e 100644 --- a/clients/spot/docs/KlinesResponse.md +++ b/clients/spot/docs/KlinesResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | **List<KlinesItem>** | | [optional] | -|**rateLimits** | [**List<AvgPriceResponseRateLimitsInner>**](AvgPriceResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/MyAllocationsResponse.md b/clients/spot/docs/MyAllocationsResponse.md index 77a450cc..365bc863 100644 --- a/clients/spot/docs/MyAllocationsResponse.md +++ b/clients/spot/docs/MyAllocationsResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<MyAllocationsResponseResultInner>**](MyAllocationsResponseResultInner.md) | | [optional] | -|**rateLimits** | [**List<AccountCommissionResponseRateLimitsInner>**](AccountCommissionResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/MyPreventedMatchesResponse.md b/clients/spot/docs/MyPreventedMatchesResponse.md index 3272dc2a..1c31334e 100644 --- a/clients/spot/docs/MyPreventedMatchesResponse.md +++ b/clients/spot/docs/MyPreventedMatchesResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<MyPreventedMatchesResponseResultInner>**](MyPreventedMatchesResponseResultInner.md) | | [optional] | -|**rateLimits** | [**List<AccountCommissionResponseRateLimitsInner>**](AccountCommissionResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/MyTradesResponse.md b/clients/spot/docs/MyTradesResponse.md index da1b74e1..d897c716 100644 --- a/clients/spot/docs/MyTradesResponse.md +++ b/clients/spot/docs/MyTradesResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<MyTradesResponseResultInner>**](MyTradesResponseResultInner.md) | | [optional] | -|**rateLimits** | [**List<AccountCommissionResponseRateLimitsInner>**](AccountCommissionResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OpenOrderListsStatusResponse.md b/clients/spot/docs/OpenOrderListsStatusResponse.md index d86061b2..619db26d 100644 --- a/clients/spot/docs/OpenOrderListsStatusResponse.md +++ b/clients/spot/docs/OpenOrderListsStatusResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<OpenOrderListsStatusResponseResultInner>**](OpenOrderListsStatusResponseResultInner.md) | | [optional] | -|**rateLimits** | [**List<OpenOrderListsStatusResponseRateLimitsInner>**](OpenOrderListsStatusResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OpenOrderListsStatusResponseRateLimitsInner.md b/clients/spot/docs/OpenOrderListsStatusResponseRateLimitsInner.md deleted file mode 100644 index 717c98be..00000000 --- a/clients/spot/docs/OpenOrderListsStatusResponseRateLimitsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# OpenOrderListsStatusResponseRateLimitsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rateLimitType** | **String** | | [optional] | -|**interval** | **String** | | [optional] | -|**intervalNum** | **Long** | | [optional] | -|**limit** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/OpenOrdersCancelAllResponse.md b/clients/spot/docs/OpenOrdersCancelAllResponse.md index 1fb7b6bd..97668ff2 100644 --- a/clients/spot/docs/OpenOrdersCancelAllResponse.md +++ b/clients/spot/docs/OpenOrdersCancelAllResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<OpenOrdersCancelAllResponseResultInner>**](OpenOrdersCancelAllResponseResultInner.md) | | [optional] | -|**rateLimits** | [**List<TimeResponseRateLimitsInner>**](TimeResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OpenOrdersStatusResponse.md b/clients/spot/docs/OpenOrdersStatusResponse.md index 85b00604..7197b50a 100644 --- a/clients/spot/docs/OpenOrdersStatusResponse.md +++ b/clients/spot/docs/OpenOrdersStatusResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<OpenOrdersStatusResponseResultInner>**](OpenOrdersStatusResponseResultInner.md) | | [optional] | -|**rateLimits** | [**List<OpenOrderListsStatusResponseRateLimitsInner>**](OpenOrderListsStatusResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OrderAmendKeepPriorityResponse.md b/clients/spot/docs/OrderAmendKeepPriorityResponse.md index 5f377ccc..43dca457 100644 --- a/clients/spot/docs/OrderAmendKeepPriorityResponse.md +++ b/clients/spot/docs/OrderAmendKeepPriorityResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderAmendKeepPriorityResponseResult**](OrderAmendKeepPriorityResponseResult.md) | | [optional] | -|**rateLimits** | [**List<TimeResponseRateLimitsInner>**](TimeResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OrderAmendKeepPriorityResponse1.md b/clients/spot/docs/OrderAmendKeepPriorityResponse1.md deleted file mode 100644 index 2b6b917c..00000000 --- a/clients/spot/docs/OrderAmendKeepPriorityResponse1.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# OrderAmendKeepPriorityResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**OrderAmendKeepPriorityResponse1Result**](OrderAmendKeepPriorityResponse1Result.md) | | [optional] | -|**rateLimits** | [**List<TimeResponseRateLimitsInner>**](TimeResponseRateLimitsInner.md) | | [optional] | - - - diff --git a/clients/spot/docs/OrderAmendKeepPriorityResponse1AmendedOrder.md b/clients/spot/docs/OrderAmendKeepPriorityResponse1AmendedOrder.md deleted file mode 100644 index ed6631f3..00000000 --- a/clients/spot/docs/OrderAmendKeepPriorityResponse1AmendedOrder.md +++ /dev/null @@ -1,29 +0,0 @@ - - -# OrderAmendKeepPriorityResponse1AmendedOrder - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**orderId** | **Long** | | [optional] | -|**orderListId** | **Long** | | [optional] | -|**origClientOrderId** | **String** | | [optional] | -|**clientOrderId** | **String** | | [optional] | -|**price** | **String** | | [optional] | -|**qty** | **String** | | [optional] | -|**executedQty** | **String** | | [optional] | -|**preventedQty** | **String** | | [optional] | -|**quoteOrderQty** | **String** | | [optional] | -|**cumulativeQuoteQty** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**timeInForce** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**side** | **String** | | [optional] | -|**workingTime** | **Long** | | [optional] | -|**selfTradePreventionMode** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/OrderAmendKeepPriorityResponse1Result.md b/clients/spot/docs/OrderAmendKeepPriorityResponse1Result.md deleted file mode 100644 index da9044d6..00000000 --- a/clients/spot/docs/OrderAmendKeepPriorityResponse1Result.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# OrderAmendKeepPriorityResponse1Result - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**transactTime** | **Long** | | [optional] | -|**executionId** | **Long** | | [optional] | -|**amendedOrder** | [**OrderAmendKeepPriorityResponse1ResultAmendedOrder**](OrderAmendKeepPriorityResponse1ResultAmendedOrder.md) | | [optional] | - - - diff --git a/clients/spot/docs/OrderAmendKeepPriorityResponse1ResultAmendedOrder.md b/clients/spot/docs/OrderAmendKeepPriorityResponse1ResultAmendedOrder.md deleted file mode 100644 index 1330e652..00000000 --- a/clients/spot/docs/OrderAmendKeepPriorityResponse1ResultAmendedOrder.md +++ /dev/null @@ -1,29 +0,0 @@ - - -# OrderAmendKeepPriorityResponse1ResultAmendedOrder - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**orderId** | **Long** | | [optional] | -|**orderListId** | **Long** | | [optional] | -|**origClientOrderId** | **String** | | [optional] | -|**clientOrderId** | **String** | | [optional] | -|**price** | **String** | | [optional] | -|**qty** | **String** | | [optional] | -|**executedQty** | **String** | | [optional] | -|**preventedQty** | **String** | | [optional] | -|**quoteOrderQty** | **String** | | [optional] | -|**cumulativeQuoteQty** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**timeInForce** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**side** | **String** | | [optional] | -|**workingTime** | **Long** | | [optional] | -|**selfTradePreventionMode** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/OrderAmendKeepPriorityResponse2.md b/clients/spot/docs/OrderAmendKeepPriorityResponse2.md deleted file mode 100644 index 9f86e501..00000000 --- a/clients/spot/docs/OrderAmendKeepPriorityResponse2.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# OrderAmendKeepPriorityResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**OrderAmendKeepPriorityResponse2Result**](OrderAmendKeepPriorityResponse2Result.md) | | [optional] | -|**rateLimits** | [**List<TimeResponseRateLimitsInner>**](TimeResponseRateLimitsInner.md) | | [optional] | - - - diff --git a/clients/spot/docs/OrderAmendKeepPriorityResponse2AmendedOrder.md b/clients/spot/docs/OrderAmendKeepPriorityResponse2AmendedOrder.md deleted file mode 100644 index 08e68138..00000000 --- a/clients/spot/docs/OrderAmendKeepPriorityResponse2AmendedOrder.md +++ /dev/null @@ -1,28 +0,0 @@ - - -# OrderAmendKeepPriorityResponse2AmendedOrder - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**orderId** | **Long** | | [optional] | -|**orderListId** | **Long** | | [optional] | -|**origClientOrderId** | **String** | | [optional] | -|**clientOrderId** | **String** | | [optional] | -|**price** | **String** | | [optional] | -|**qty** | **String** | | [optional] | -|**executedQty** | **String** | | [optional] | -|**preventedQty** | **String** | | [optional] | -|**quoteOrderQty** | **String** | | [optional] | -|**cumulativeQuoteQty** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**timeInForce** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**side** | **String** | | [optional] | -|**selfTradePreventionMode** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/OrderAmendKeepPriorityResponse2ListStatus.md b/clients/spot/docs/OrderAmendKeepPriorityResponse2ListStatus.md deleted file mode 100644 index 58d38c09..00000000 --- a/clients/spot/docs/OrderAmendKeepPriorityResponse2ListStatus.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# OrderAmendKeepPriorityResponse2ListStatus - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**orderListId** | **Long** | | [optional] | -|**contingencyType** | **String** | | [optional] | -|**listOrderStatus** | **String** | | [optional] | -|**listClientOrderId** | **String** | | [optional] | -|**symbol** | **String** | | [optional] | -|**orders** | [**List<OrderAmendKeepPriorityResponse2ListStatusOrdersInner>**](OrderAmendKeepPriorityResponse2ListStatusOrdersInner.md) | | [optional] | - - - diff --git a/clients/spot/docs/OrderAmendKeepPriorityResponse2ListStatusOrdersInner.md b/clients/spot/docs/OrderAmendKeepPriorityResponse2ListStatusOrdersInner.md deleted file mode 100644 index ed0306f9..00000000 --- a/clients/spot/docs/OrderAmendKeepPriorityResponse2ListStatusOrdersInner.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# OrderAmendKeepPriorityResponse2ListStatusOrdersInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**orderId** | **Long** | | [optional] | -|**clientOrderId** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/OrderAmendKeepPriorityResponse2Result.md b/clients/spot/docs/OrderAmendKeepPriorityResponse2Result.md deleted file mode 100644 index b8ec1a14..00000000 --- a/clients/spot/docs/OrderAmendKeepPriorityResponse2Result.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# OrderAmendKeepPriorityResponse2Result - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**transactTime** | **Long** | | [optional] | -|**executionId** | **Long** | | [optional] | -|**amendedOrder** | [**OrderAmendKeepPriorityResponse2ResultAmendedOrder**](OrderAmendKeepPriorityResponse2ResultAmendedOrder.md) | | [optional] | -|**listStatus** | [**OrderAmendKeepPriorityResponse2ResultListStatus**](OrderAmendKeepPriorityResponse2ResultListStatus.md) | | [optional] | - - - diff --git a/clients/spot/docs/OrderAmendKeepPriorityResponse2ResultAmendedOrder.md b/clients/spot/docs/OrderAmendKeepPriorityResponse2ResultAmendedOrder.md deleted file mode 100644 index f30dda69..00000000 --- a/clients/spot/docs/OrderAmendKeepPriorityResponse2ResultAmendedOrder.md +++ /dev/null @@ -1,29 +0,0 @@ - - -# OrderAmendKeepPriorityResponse2ResultAmendedOrder - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**orderId** | **Long** | | [optional] | -|**orderListId** | **Long** | | [optional] | -|**origClientOrderId** | **String** | | [optional] | -|**clientOrderId** | **String** | | [optional] | -|**price** | **String** | | [optional] | -|**qty** | **String** | | [optional] | -|**executedQty** | **String** | | [optional] | -|**preventedQty** | **String** | | [optional] | -|**quoteOrderQty** | **String** | | [optional] | -|**cumulativeQuoteQty** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**timeInForce** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**side** | **String** | | [optional] | -|**workingTime** | **Long** | | [optional] | -|**selfTradePreventionMode** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/OrderAmendKeepPriorityResponse2ResultListStatus.md b/clients/spot/docs/OrderAmendKeepPriorityResponse2ResultListStatus.md deleted file mode 100644 index a2be1200..00000000 --- a/clients/spot/docs/OrderAmendKeepPriorityResponse2ResultListStatus.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# OrderAmendKeepPriorityResponse2ResultListStatus - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**orderListId** | **Long** | | [optional] | -|**contingencyType** | **String** | | [optional] | -|**listOrderStatus** | **String** | | [optional] | -|**listClientOrderId** | **String** | | [optional] | -|**symbol** | **String** | | [optional] | -|**orders** | [**List<OrderAmendKeepPriorityResponse2ResultListStatusOrdersInner>**](OrderAmendKeepPriorityResponse2ResultListStatusOrdersInner.md) | | [optional] | - - - diff --git a/clients/spot/docs/OrderAmendKeepPriorityResponse2ResultListStatusOrdersInner.md b/clients/spot/docs/OrderAmendKeepPriorityResponse2ResultListStatusOrdersInner.md deleted file mode 100644 index a52c1142..00000000 --- a/clients/spot/docs/OrderAmendKeepPriorityResponse2ResultListStatusOrdersInner.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# OrderAmendKeepPriorityResponse2ResultListStatusOrdersInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**orderId** | **Long** | | [optional] | -|**clientOrderId** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/OrderAmendmentsResponse.md b/clients/spot/docs/OrderAmendmentsResponse.md index 5bae3bfc..5ea5f327 100644 --- a/clients/spot/docs/OrderAmendmentsResponse.md +++ b/clients/spot/docs/OrderAmendmentsResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<OrderAmendmentsResponseResultInner>**](OrderAmendmentsResponseResultInner.md) | | [optional] | -|**rateLimits** | [**List<TickerResponse1RateLimitsInner>**](TickerResponse1RateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OrderCancelReplaceResponse.md b/clients/spot/docs/OrderCancelReplaceResponse.md index 09275993..32991ad0 100644 --- a/clients/spot/docs/OrderCancelReplaceResponse.md +++ b/clients/spot/docs/OrderCancelReplaceResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderCancelReplaceResponseResult**](OrderCancelReplaceResponseResult.md) | | [optional] | -|**rateLimits** | [**List<OrderCancelReplaceResponseRateLimitsInner>**](OrderCancelReplaceResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OrderCancelReplaceResponseRateLimitsInner.md b/clients/spot/docs/OrderCancelReplaceResponseRateLimitsInner.md deleted file mode 100644 index dbbc3967..00000000 --- a/clients/spot/docs/OrderCancelReplaceResponseRateLimitsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# OrderCancelReplaceResponseRateLimitsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rateLimitType** | **String** | | [optional] | -|**interval** | **String** | | [optional] | -|**intervalNum** | **Long** | | [optional] | -|**limit** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/OrderCancelResponse.md b/clients/spot/docs/OrderCancelResponse.md index 9ed68141..d64bb1cb 100644 --- a/clients/spot/docs/OrderCancelResponse.md +++ b/clients/spot/docs/OrderCancelResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderCancelResponseResult**](OrderCancelResponseResult.md) | | [optional] | -|**rateLimits** | [**List<TimeResponseRateLimitsInner>**](TimeResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OrderCancelResponse1.md b/clients/spot/docs/OrderCancelResponse1.md deleted file mode 100644 index e0cedfba..00000000 --- a/clients/spot/docs/OrderCancelResponse1.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# OrderCancelResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**OrderCancelResponse1Result**](OrderCancelResponse1Result.md) | | [optional] | -|**rateLimits** | [**List<TimeResponseRateLimitsInner>**](TimeResponseRateLimitsInner.md) | | [optional] | - - - diff --git a/clients/spot/docs/OrderCancelResponse1Result.md b/clients/spot/docs/OrderCancelResponse1Result.md deleted file mode 100644 index 8e6b1e0f..00000000 --- a/clients/spot/docs/OrderCancelResponse1Result.md +++ /dev/null @@ -1,33 +0,0 @@ - - -# OrderCancelResponse1Result - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**origClientOrderId** | **String** | | [optional] | -|**orderId** | **Long** | | [optional] | -|**orderListId** | **Long** | | [optional] | -|**clientOrderId** | **String** | | [optional] | -|**transactTime** | **Long** | | [optional] | -|**price** | **String** | | [optional] | -|**origQty** | **String** | | [optional] | -|**executedQty** | **String** | | [optional] | -|**origQuoteOrderQty** | **String** | | [optional] | -|**cummulativeQuoteQty** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**timeInForce** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**side** | **String** | | [optional] | -|**stopPrice** | **String** | | [optional] | -|**trailingDelta** | **Long** | | [optional] | -|**icebergQty** | **String** | | [optional] | -|**strategyId** | **Long** | | [optional] | -|**strategyType** | **Long** | | [optional] | -|**selfTradePreventionMode** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/OrderCancelResponse2.md b/clients/spot/docs/OrderCancelResponse2.md deleted file mode 100644 index f98046b5..00000000 --- a/clients/spot/docs/OrderCancelResponse2.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# OrderCancelResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**OrderCancelResponse2Result**](OrderCancelResponse2Result.md) | | [optional] | -|**rateLimits** | [**List<TimeResponseRateLimitsInner>**](TimeResponseRateLimitsInner.md) | | [optional] | - - - diff --git a/clients/spot/docs/OrderCancelResponse2Result.md b/clients/spot/docs/OrderCancelResponse2Result.md deleted file mode 100644 index 0c6ce84a..00000000 --- a/clients/spot/docs/OrderCancelResponse2Result.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# OrderCancelResponse2Result - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**orderListId** | **Long** | | [optional] | -|**contingencyType** | **String** | | [optional] | -|**listStatusType** | **String** | | [optional] | -|**listOrderStatus** | **String** | | [optional] | -|**listClientOrderId** | **String** | | [optional] | -|**transactionTime** | **Long** | | [optional] | -|**symbol** | **String** | | [optional] | -|**orders** | [**List<OrderCancelResponse2ResultOrdersInner>**](OrderCancelResponse2ResultOrdersInner.md) | | [optional] | -|**orderReports** | [**List<OrderCancelResponse2ResultOrderReportsInner>**](OrderCancelResponse2ResultOrderReportsInner.md) | | [optional] | - - - diff --git a/clients/spot/docs/OrderCancelResponse2ResultOrderReportsInner.md b/clients/spot/docs/OrderCancelResponse2ResultOrderReportsInner.md deleted file mode 100644 index 9aa6fe9a..00000000 --- a/clients/spot/docs/OrderCancelResponse2ResultOrderReportsInner.md +++ /dev/null @@ -1,29 +0,0 @@ - - -# OrderCancelResponse2ResultOrderReportsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**origClientOrderId** | **String** | | [optional] | -|**orderId** | **Long** | | [optional] | -|**orderListId** | **Long** | | [optional] | -|**clientOrderId** | **String** | | [optional] | -|**transactTime** | **Long** | | [optional] | -|**price** | **String** | | [optional] | -|**origQty** | **String** | | [optional] | -|**executedQty** | **String** | | [optional] | -|**origQuoteOrderQty** | **String** | | [optional] | -|**cummulativeQuoteQty** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**timeInForce** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**side** | **String** | | [optional] | -|**stopPrice** | **String** | | [optional] | -|**selfTradePreventionMode** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/OrderCancelResponse2ResultOrdersInner.md b/clients/spot/docs/OrderCancelResponse2ResultOrdersInner.md deleted file mode 100644 index 6892dd64..00000000 --- a/clients/spot/docs/OrderCancelResponse2ResultOrdersInner.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# OrderCancelResponse2ResultOrdersInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**orderId** | **Long** | | [optional] | -|**clientOrderId** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/OrderCancelResponseResult.md b/clients/spot/docs/OrderCancelResponseResult.md index b3c7cbe6..f2de337c 100644 --- a/clients/spot/docs/OrderCancelResponseResult.md +++ b/clients/spot/docs/OrderCancelResponseResult.md @@ -34,7 +34,7 @@ |**listClientOrderId** | **String** | | [optional] | |**transactionTime** | **Long** | | [optional] | |**orders** | [**List<OpenOrdersCancelAllResponseResultInnerOrdersInner>**](OpenOrdersCancelAllResponseResultInnerOrdersInner.md) | | [optional] | -|**orderReports** | [**List<OrderCancelResponseResultOrderReportsInner>**](OrderCancelResponseResultOrderReportsInner.md) | | [optional] | +|**orderReports** | [**List<OpenOrdersCancelAllResponseResultInnerOrderReportsInner>**](OpenOrdersCancelAllResponseResultInnerOrderReportsInner.md) | | [optional] | diff --git a/clients/spot/docs/OrderCancelResponseResultOrderReportsInner.md b/clients/spot/docs/OrderCancelResponseResultOrderReportsInner.md deleted file mode 100644 index e7f4bb98..00000000 --- a/clients/spot/docs/OrderCancelResponseResultOrderReportsInner.md +++ /dev/null @@ -1,29 +0,0 @@ - - -# OrderCancelResponseResultOrderReportsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**origClientOrderId** | **String** | | [optional] | -|**orderId** | **Long** | | [optional] | -|**orderListId** | **Long** | | [optional] | -|**clientOrderId** | **String** | | [optional] | -|**transactTime** | **Long** | | [optional] | -|**price** | **String** | | [optional] | -|**origQty** | **String** | | [optional] | -|**executedQty** | **String** | | [optional] | -|**cummulativeQuoteQty** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**timeInForce** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**side** | **String** | | [optional] | -|**selfTradePreventionMode** | **String** | | [optional] | -|**origQuoteOrderQty** | **String** | | [optional] | -|**stopPrice** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/OrderCancelResponseResultOrdersInner.md b/clients/spot/docs/OrderCancelResponseResultOrdersInner.md deleted file mode 100644 index bda81a21..00000000 --- a/clients/spot/docs/OrderCancelResponseResultOrdersInner.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# OrderCancelResponseResultOrdersInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**orderId** | **Long** | | [optional] | -|**clientOrderId** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/OrderListCancelResponse.md b/clients/spot/docs/OrderListCancelResponse.md index 24c0223f..aa58e514 100644 --- a/clients/spot/docs/OrderListCancelResponse.md +++ b/clients/spot/docs/OrderListCancelResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderListCancelResponseResult**](OrderListCancelResponseResult.md) | | [optional] | -|**rateLimits** | [**List<TimeResponseRateLimitsInner>**](TimeResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceOcoResponse.md b/clients/spot/docs/OrderListPlaceOcoResponse.md index 7762dc99..5e96c2a9 100644 --- a/clients/spot/docs/OrderListPlaceOcoResponse.md +++ b/clients/spot/docs/OrderListPlaceOcoResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderListPlaceOcoResponseResult**](OrderListPlaceOcoResponseResult.md) | | [optional] | -|**rateLimits** | [**List<OrderListPlaceResponseRateLimitsInner>**](OrderListPlaceResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceOtoResponse.md b/clients/spot/docs/OrderListPlaceOtoResponse.md index 17392fe9..7cf0899d 100644 --- a/clients/spot/docs/OrderListPlaceOtoResponse.md +++ b/clients/spot/docs/OrderListPlaceOtoResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderListPlaceOtoResponseResult**](OrderListPlaceOtoResponseResult.md) | | [optional] | -|**rateLimits** | [**List<OrderListPlaceOtoResponseRateLimitsInner>**](OrderListPlaceOtoResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceOtoResponseRateLimitsInner.md b/clients/spot/docs/OrderListPlaceOtoResponseRateLimitsInner.md deleted file mode 100644 index db789cd6..00000000 --- a/clients/spot/docs/OrderListPlaceOtoResponseRateLimitsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# OrderListPlaceOtoResponseRateLimitsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rateLimitType** | **String** | | [optional] | -|**interval** | **String** | | [optional] | -|**intervalNum** | **Long** | | [optional] | -|**limit** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/OrderListPlaceOtocoResponse.md b/clients/spot/docs/OrderListPlaceOtocoResponse.md index 890ce085..7383c3d6 100644 --- a/clients/spot/docs/OrderListPlaceOtocoResponse.md +++ b/clients/spot/docs/OrderListPlaceOtocoResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderListPlaceOtocoResponseResult**](OrderListPlaceOtocoResponseResult.md) | | [optional] | -|**rateLimits** | [**List<OrderListPlaceOtocoResponseRateLimitsInner>**](OrderListPlaceOtocoResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceOtocoResponseRateLimitsInner.md b/clients/spot/docs/OrderListPlaceOtocoResponseRateLimitsInner.md deleted file mode 100644 index 16502457..00000000 --- a/clients/spot/docs/OrderListPlaceOtocoResponseRateLimitsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# OrderListPlaceOtocoResponseRateLimitsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rateLimitType** | **String** | | [optional] | -|**interval** | **String** | | [optional] | -|**intervalNum** | **Long** | | [optional] | -|**limit** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/OrderListPlaceResponse.md b/clients/spot/docs/OrderListPlaceResponse.md index ce78e0b2..f8bc4858 100644 --- a/clients/spot/docs/OrderListPlaceResponse.md +++ b/clients/spot/docs/OrderListPlaceResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderListPlaceResponseResult**](OrderListPlaceResponseResult.md) | | [optional] | -|**rateLimits** | [**List<OrderListPlaceResponseRateLimitsInner>**](OrderListPlaceResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OrderListPlaceResponseRateLimitsInner.md b/clients/spot/docs/OrderListPlaceResponseRateLimitsInner.md deleted file mode 100644 index 839ceedc..00000000 --- a/clients/spot/docs/OrderListPlaceResponseRateLimitsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# OrderListPlaceResponseRateLimitsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rateLimitType** | **String** | | [optional] | -|**interval** | **String** | | [optional] | -|**intervalNum** | **Long** | | [optional] | -|**limit** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/OrderListStatusResponse.md b/clients/spot/docs/OrderListStatusResponse.md index a0d123b8..a2ed2f61 100644 --- a/clients/spot/docs/OrderListStatusResponse.md +++ b/clients/spot/docs/OrderListStatusResponse.md @@ -9,8 +9,8 @@ |------------ | ------------- | ------------- | -------------| |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | -|**result** | [**OrderListStatusResponseResult**](OrderListStatusResponseResult.md) | | [optional] | -|**rateLimits** | [**List<TickerResponse1RateLimitsInner>**](TickerResponse1RateLimitsInner.md) | | [optional] | +|**result** | [**AllOrderListsResponseResultInner**](AllOrderListsResponseResultInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OrderPlaceResponse.md b/clients/spot/docs/OrderPlaceResponse.md index 4503f9df..4316c73b 100644 --- a/clients/spot/docs/OrderPlaceResponse.md +++ b/clients/spot/docs/OrderPlaceResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderPlaceResponseResult**](OrderPlaceResponseResult.md) | | [optional] | -|**rateLimits** | [**List<OrderCancelReplaceResponseRateLimitsInner>**](OrderCancelReplaceResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OrderPlaceResponse1.md b/clients/spot/docs/OrderPlaceResponse1.md deleted file mode 100644 index 0360a4de..00000000 --- a/clients/spot/docs/OrderPlaceResponse1.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# OrderPlaceResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**OrderPlaceResponse1Result**](OrderPlaceResponse1Result.md) | | [optional] | -|**rateLimits** | [**List<OrderCancelReplaceResponseRateLimitsInner>**](OrderCancelReplaceResponseRateLimitsInner.md) | | [optional] | - - - diff --git a/clients/spot/docs/OrderPlaceResponse1Result.md b/clients/spot/docs/OrderPlaceResponse1Result.md deleted file mode 100644 index f4f2b70a..00000000 --- a/clients/spot/docs/OrderPlaceResponse1Result.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# OrderPlaceResponse1Result - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**orderId** | **Long** | | [optional] | -|**orderListId** | **Long** | | [optional] | -|**clientOrderId** | **String** | | [optional] | -|**transactTime** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/OrderPlaceResponse2.md b/clients/spot/docs/OrderPlaceResponse2.md deleted file mode 100644 index f6525574..00000000 --- a/clients/spot/docs/OrderPlaceResponse2.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# OrderPlaceResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**OrderPlaceResponse2Result**](OrderPlaceResponse2Result.md) | | [optional] | -|**rateLimits** | [**List<OrderCancelReplaceResponseRateLimitsInner>**](OrderCancelReplaceResponseRateLimitsInner.md) | | [optional] | - - - diff --git a/clients/spot/docs/OrderPlaceResponse2Result.md b/clients/spot/docs/OrderPlaceResponse2Result.md deleted file mode 100644 index 94cb0d65..00000000 --- a/clients/spot/docs/OrderPlaceResponse2Result.md +++ /dev/null @@ -1,28 +0,0 @@ - - -# OrderPlaceResponse2Result - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**orderId** | **Long** | | [optional] | -|**orderListId** | **Long** | | [optional] | -|**clientOrderId** | **String** | | [optional] | -|**transactTime** | **Long** | | [optional] | -|**price** | **String** | | [optional] | -|**origQty** | **String** | | [optional] | -|**executedQty** | **String** | | [optional] | -|**origQuoteOrderQty** | **String** | | [optional] | -|**cummulativeQuoteQty** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**timeInForce** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**side** | **String** | | [optional] | -|**workingTime** | **Long** | | [optional] | -|**selfTradePreventionMode** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/OrderPlaceResponse3.md b/clients/spot/docs/OrderPlaceResponse3.md deleted file mode 100644 index 237902af..00000000 --- a/clients/spot/docs/OrderPlaceResponse3.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# OrderPlaceResponse3 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**OrderPlaceResponse3Result**](OrderPlaceResponse3Result.md) | | [optional] | -|**rateLimits** | [**List<OrderCancelReplaceResponseRateLimitsInner>**](OrderCancelReplaceResponseRateLimitsInner.md) | | [optional] | - - - diff --git a/clients/spot/docs/OrderPlaceResponse3Result.md b/clients/spot/docs/OrderPlaceResponse3Result.md deleted file mode 100644 index 7bd36c4e..00000000 --- a/clients/spot/docs/OrderPlaceResponse3Result.md +++ /dev/null @@ -1,28 +0,0 @@ - - -# OrderPlaceResponse3Result - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**orderId** | **Long** | | [optional] | -|**orderListId** | **Long** | | [optional] | -|**clientOrderId** | **String** | | [optional] | -|**transactTime** | **Long** | | [optional] | -|**price** | **String** | | [optional] | -|**origQty** | **String** | | [optional] | -|**executedQty** | **String** | | [optional] | -|**origQuoteOrderQty** | **String** | | [optional] | -|**cummulativeQuoteQty** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**timeInForce** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**side** | **String** | | [optional] | -|**workingTime** | **Long** | | [optional] | -|**fills** | [**List<OrderPlaceResponse3ResultFillsInner>**](OrderPlaceResponse3ResultFillsInner.md) | | [optional] | - - - diff --git a/clients/spot/docs/OrderPlaceResponse3ResultFillsInner.md b/clients/spot/docs/OrderPlaceResponse3ResultFillsInner.md deleted file mode 100644 index ee8ecb69..00000000 --- a/clients/spot/docs/OrderPlaceResponse3ResultFillsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# OrderPlaceResponse3ResultFillsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**price** | **String** | | [optional] | -|**qty** | **String** | | [optional] | -|**commission** | **String** | | [optional] | -|**commissionAsset** | **String** | | [optional] | -|**tradeId** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/OrderStatusResponse.md b/clients/spot/docs/OrderStatusResponse.md index dcae391c..8319afb2 100644 --- a/clients/spot/docs/OrderStatusResponse.md +++ b/clients/spot/docs/OrderStatusResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderStatusResponseResult**](OrderStatusResponseResult.md) | | [optional] | -|**rateLimits** | [**List<TickerResponse1RateLimitsInner>**](TickerResponse1RateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OrderTestResponse.md b/clients/spot/docs/OrderTestResponse.md index db22ffdd..db626655 100644 --- a/clients/spot/docs/OrderTestResponse.md +++ b/clients/spot/docs/OrderTestResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderTestResponseResult**](OrderTestResponseResult.md) | | [optional] | -|**rateLimits** | [**List<TimeResponseRateLimitsInner>**](TimeResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/OrderTestResponse2.md b/clients/spot/docs/OrderTestResponse2.md deleted file mode 100644 index d64a1f56..00000000 --- a/clients/spot/docs/OrderTestResponse2.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# OrderTestResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**OrderTestResponse2Result**](OrderTestResponse2Result.md) | | [optional] | -|**rateLimits** | [**List<ExchangeInfoResponseRateLimitsInner>**](ExchangeInfoResponseRateLimitsInner.md) | | [optional] | - - - diff --git a/clients/spot/docs/OrderTestResponse2Discount.md b/clients/spot/docs/OrderTestResponse2Discount.md deleted file mode 100644 index 11217a54..00000000 --- a/clients/spot/docs/OrderTestResponse2Discount.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# OrderTestResponse2Discount - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**enabledForAccount** | **Boolean** | | [optional] | -|**enabledForSymbol** | **Boolean** | | [optional] | -|**discountAsset** | **String** | | [optional] | -|**discount** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/OrderTestResponse2Result.md b/clients/spot/docs/OrderTestResponse2Result.md deleted file mode 100644 index 81ff6ec3..00000000 --- a/clients/spot/docs/OrderTestResponse2Result.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# OrderTestResponse2Result - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**standardCommissionForOrder** | [**OrderTestResponse2ResultStandardCommissionForOrder**](OrderTestResponse2ResultStandardCommissionForOrder.md) | | [optional] | -|**taxCommissionForOrder** | [**OrderTestResponse2ResultStandardCommissionForOrder**](OrderTestResponse2ResultStandardCommissionForOrder.md) | | [optional] | -|**discount** | [**OrderTestResponse2ResultDiscount**](OrderTestResponse2ResultDiscount.md) | | [optional] | - - - diff --git a/clients/spot/docs/OrderTestResponse2ResultDiscount.md b/clients/spot/docs/OrderTestResponse2ResultDiscount.md deleted file mode 100644 index 8059760f..00000000 --- a/clients/spot/docs/OrderTestResponse2ResultDiscount.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# OrderTestResponse2ResultDiscount - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**enabledForAccount** | **Boolean** | | [optional] | -|**enabledForSymbol** | **Boolean** | | [optional] | -|**discountAsset** | **String** | | [optional] | -|**discount** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/OrderTestResponse2ResultStandardCommissionForOrder.md b/clients/spot/docs/OrderTestResponse2ResultStandardCommissionForOrder.md deleted file mode 100644 index c3b4865c..00000000 --- a/clients/spot/docs/OrderTestResponse2ResultStandardCommissionForOrder.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# OrderTestResponse2ResultStandardCommissionForOrder - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**maker** | **String** | | [optional] | -|**taker** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/OrderTestResponse2StandardCommissionForOrder.md b/clients/spot/docs/OrderTestResponse2StandardCommissionForOrder.md deleted file mode 100644 index 21064772..00000000 --- a/clients/spot/docs/OrderTestResponse2StandardCommissionForOrder.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# OrderTestResponse2StandardCommissionForOrder - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**maker** | **String** | | [optional] | -|**taker** | **String** | | [optional] | - - - diff --git a/clients/spot/docs/OrderTestResponse1.md b/clients/spot/docs/PingResponse.md similarity index 64% rename from clients/spot/docs/OrderTestResponse1.md rename to clients/spot/docs/PingResponse.md index 31b1108c..89193111 100644 --- a/clients/spot/docs/OrderTestResponse1.md +++ b/clients/spot/docs/PingResponse.md @@ -1,6 +1,6 @@ -# OrderTestResponse1 +# PingResponse ## Properties @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | **Object** | | [optional] | -|**rateLimits** | [**List<TimeResponseRateLimitsInner>**](TimeResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/PositionInformationV3Response2.md b/clients/spot/docs/RateLimits.md similarity index 78% rename from clients/derivatives-trading-usds-futures/docs/PositionInformationV3Response2.md rename to clients/spot/docs/RateLimits.md index 9d840f88..41497398 100644 --- a/clients/derivatives-trading-usds-futures/docs/PositionInformationV3Response2.md +++ b/clients/spot/docs/RateLimits.md @@ -1,6 +1,6 @@ -# PositionInformationV3Response2 +# RateLimits ## Properties diff --git a/clients/spot/docs/TimeResponseRateLimitsInner.md b/clients/spot/docs/RateLimitsInner.md similarity index 92% rename from clients/spot/docs/TimeResponseRateLimitsInner.md rename to clients/spot/docs/RateLimitsInner.md index b4d10ab3..3c6492ee 100644 --- a/clients/spot/docs/TimeResponseRateLimitsInner.md +++ b/clients/spot/docs/RateLimitsInner.md @@ -1,6 +1,6 @@ -# TimeResponseRateLimitsInner +# RateLimitsInner ## Properties diff --git a/clients/spot/docs/SorOrderPlaceResponse.md b/clients/spot/docs/SorOrderPlaceResponse.md index fa22cb1f..22c44ee9 100644 --- a/clients/spot/docs/SorOrderPlaceResponse.md +++ b/clients/spot/docs/SorOrderPlaceResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<SorOrderPlaceResponseResultInner>**](SorOrderPlaceResponseResultInner.md) | | [optional] | -|**rateLimits** | [**List<TimeResponseRateLimitsInner>**](TimeResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/SorOrderTestResponse.md b/clients/spot/docs/SorOrderTestResponse.md index e32049d4..a3ff2c88 100644 --- a/clients/spot/docs/SorOrderTestResponse.md +++ b/clients/spot/docs/SorOrderTestResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**OrderTestResponseResult**](OrderTestResponseResult.md) | | [optional] | -|**rateLimits** | [**List<TimeResponseRateLimitsInner>**](TimeResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/SorOrderTestResponse1.md b/clients/spot/docs/SorOrderTestResponse1.md deleted file mode 100644 index 23885d6a..00000000 --- a/clients/spot/docs/SorOrderTestResponse1.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# SorOrderTestResponse1 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | **Object** | | [optional] | -|**rateLimits** | [**List<TimeResponseRateLimitsInner>**](TimeResponseRateLimitsInner.md) | | [optional] | - - - diff --git a/clients/spot/docs/SorOrderTestResponse2.md b/clients/spot/docs/SorOrderTestResponse2.md deleted file mode 100644 index 03eb592c..00000000 --- a/clients/spot/docs/SorOrderTestResponse2.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# SorOrderTestResponse2 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**OrderTestResponse2Result**](OrderTestResponse2Result.md) | | [optional] | -|**rateLimits** | [**List<ExchangeInfoResponseRateLimitsInner>**](ExchangeInfoResponseRateLimitsInner.md) | | [optional] | - - - diff --git a/clients/spot/docs/Ticker24hrResponse.md b/clients/spot/docs/Ticker24hrResponse.md index 01ef09d0..411ce2bb 100644 --- a/clients/spot/docs/Ticker24hrResponse.md +++ b/clients/spot/docs/Ticker24hrResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<Ticker24hrResponse2ResultInner>**](Ticker24hrResponse2ResultInner.md) | | [optional] | -|**rateLimits** | [**List<AvgPriceResponseRateLimitsInner>**](AvgPriceResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/Ticker24hrResponse1.md b/clients/spot/docs/Ticker24hrResponse1.md index 3cae4be1..6fcd5e6b 100644 --- a/clients/spot/docs/Ticker24hrResponse1.md +++ b/clients/spot/docs/Ticker24hrResponse1.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**Ticker24hrResponse1Result**](Ticker24hrResponse1Result.md) | | [optional] | -|**rateLimits** | [**List<AvgPriceResponseRateLimitsInner>**](AvgPriceResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/Ticker24hrResponse2.md b/clients/spot/docs/Ticker24hrResponse2.md index 725ae026..b179eed2 100644 --- a/clients/spot/docs/Ticker24hrResponse2.md +++ b/clients/spot/docs/Ticker24hrResponse2.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<Ticker24hrResponse2ResultInner>**](Ticker24hrResponse2ResultInner.md) | | [optional] | -|**rateLimits** | [**List<AvgPriceResponseRateLimitsInner>**](AvgPriceResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/Ticker24hrResponse2Result.md b/clients/spot/docs/Ticker24hrResponse2Result.md deleted file mode 100644 index 597c998e..00000000 --- a/clients/spot/docs/Ticker24hrResponse2Result.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# Ticker24hrResponse2Result - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**openPrice** | **String** | | [optional] | -|**highPrice** | **String** | | [optional] | -|**lowPrice** | **String** | | [optional] | -|**lastPrice** | **String** | | [optional] | -|**volume** | **String** | | [optional] | -|**quoteVolume** | **String** | | [optional] | -|**openTime** | **Long** | | [optional] | -|**closeTime** | **Long** | | [optional] | -|**firstId** | **Long** | | [optional] | -|**lastId** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/Ticker24hrResponse3.md b/clients/spot/docs/Ticker24hrResponse3.md deleted file mode 100644 index 54e2f45a..00000000 --- a/clients/spot/docs/Ticker24hrResponse3.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# Ticker24hrResponse3 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**List<Ticker24hrResponse3ResultInner>**](Ticker24hrResponse3ResultInner.md) | | [optional] | -|**rateLimits** | [**List<AvgPriceResponseRateLimitsInner>**](AvgPriceResponseRateLimitsInner.md) | | [optional] | - - - diff --git a/clients/spot/docs/Ticker24hrResponse3ResultInner.md b/clients/spot/docs/Ticker24hrResponse3ResultInner.md deleted file mode 100644 index 46733174..00000000 --- a/clients/spot/docs/Ticker24hrResponse3ResultInner.md +++ /dev/null @@ -1,33 +0,0 @@ - - -# Ticker24hrResponse3ResultInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**priceChange** | **String** | | [optional] | -|**priceChangePercent** | **String** | | [optional] | -|**weightedAvgPrice** | **String** | | [optional] | -|**prevClosePrice** | **String** | | [optional] | -|**lastPrice** | **String** | | [optional] | -|**lastQty** | **String** | | [optional] | -|**bidPrice** | **String** | | [optional] | -|**bidQty** | **String** | | [optional] | -|**askPrice** | **String** | | [optional] | -|**askQty** | **String** | | [optional] | -|**openPrice** | **String** | | [optional] | -|**highPrice** | **String** | | [optional] | -|**lowPrice** | **String** | | [optional] | -|**volume** | **String** | | [optional] | -|**quoteVolume** | **String** | | [optional] | -|**openTime** | **Long** | | [optional] | -|**closeTime** | **Long** | | [optional] | -|**firstId** | **Long** | | [optional] | -|**lastId** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/TickerBookResponse.md b/clients/spot/docs/TickerBookResponse.md index ef31b898..3701a987 100644 --- a/clients/spot/docs/TickerBookResponse.md +++ b/clients/spot/docs/TickerBookResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TickerBookResponse1Result>**](TickerBookResponse1Result.md) | | [optional] | -|**rateLimits** | [**List<TickerResponse1RateLimitsInner>**](TickerResponse1RateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/TickerBookResponse1.md b/clients/spot/docs/TickerBookResponse1.md index 71519c1e..5c79f050 100644 --- a/clients/spot/docs/TickerBookResponse1.md +++ b/clients/spot/docs/TickerBookResponse1.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**TickerBookResponse1Result**](TickerBookResponse1Result.md) | | [optional] | -|**rateLimits** | [**List<AvgPriceResponseRateLimitsInner>**](AvgPriceResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/TickerBookResponse2.md b/clients/spot/docs/TickerBookResponse2.md index 49781b5f..d51b6a0f 100644 --- a/clients/spot/docs/TickerBookResponse2.md +++ b/clients/spot/docs/TickerBookResponse2.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TickerBookResponse1Result>**](TickerBookResponse1Result.md) | | [optional] | -|**rateLimits** | [**List<TickerResponse1RateLimitsInner>**](TickerResponse1RateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/TickerPriceResponse.md b/clients/spot/docs/TickerPriceResponse.md index 54aae919..151a88e9 100644 --- a/clients/spot/docs/TickerPriceResponse.md +++ b/clients/spot/docs/TickerPriceResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TickerPriceResponse2ResultInner>**](TickerPriceResponse2ResultInner.md) | | [optional] | -|**rateLimits** | [**List<TickerResponse1RateLimitsInner>**](TickerResponse1RateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/TickerPriceResponse1.md b/clients/spot/docs/TickerPriceResponse1.md index 09207529..7e61ba12 100644 --- a/clients/spot/docs/TickerPriceResponse1.md +++ b/clients/spot/docs/TickerPriceResponse1.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**TickerPriceResponse1Result**](TickerPriceResponse1Result.md) | | [optional] | -|**rateLimits** | [**List<AvgPriceResponseRateLimitsInner>**](AvgPriceResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/TickerPriceResponse2.md b/clients/spot/docs/TickerPriceResponse2.md index 0a023122..4444aa97 100644 --- a/clients/spot/docs/TickerPriceResponse2.md +++ b/clients/spot/docs/TickerPriceResponse2.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TickerPriceResponse2ResultInner>**](TickerPriceResponse2ResultInner.md) | | [optional] | -|**rateLimits** | [**List<TickerResponse1RateLimitsInner>**](TickerResponse1RateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/TickerResponse1.md b/clients/spot/docs/TickerResponse1.md index 1fc8793e..2866bb4b 100644 --- a/clients/spot/docs/TickerResponse1.md +++ b/clients/spot/docs/TickerResponse1.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**TickerResponse1Result**](TickerResponse1Result.md) | | [optional] | -|**rateLimits** | [**List<TickerResponse1RateLimitsInner>**](TickerResponse1RateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/TickerResponse1RateLimitsInner.md b/clients/spot/docs/TickerResponse1RateLimitsInner.md deleted file mode 100644 index 291350f9..00000000 --- a/clients/spot/docs/TickerResponse1RateLimitsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# TickerResponse1RateLimitsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rateLimitType** | **String** | | [optional] | -|**interval** | **String** | | [optional] | -|**intervalNum** | **Long** | | [optional] | -|**limit** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/TickerResponse2.md b/clients/spot/docs/TickerResponse2.md index 88086e4d..370cd800 100644 --- a/clients/spot/docs/TickerResponse2.md +++ b/clients/spot/docs/TickerResponse2.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TickerResponse2ResultInner>**](TickerResponse2ResultInner.md) | | [optional] | -|**rateLimits** | [**List<TickerResponse2RateLimitsInner>**](TickerResponse2RateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/TickerResponse2RateLimitsInner.md b/clients/spot/docs/TickerResponse2RateLimitsInner.md deleted file mode 100644 index a1361c22..00000000 --- a/clients/spot/docs/TickerResponse2RateLimitsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# TickerResponse2RateLimitsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rateLimitType** | **String** | | [optional] | -|**interval** | **String** | | [optional] | -|**intervalNum** | **Long** | | [optional] | -|**limit** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/TickerResponse2Result.md b/clients/spot/docs/TickerResponse2Result.md deleted file mode 100644 index 56c6008a..00000000 --- a/clients/spot/docs/TickerResponse2Result.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# TickerResponse2Result - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**openPrice** | **String** | | [optional] | -|**highPrice** | **String** | | [optional] | -|**lowPrice** | **String** | | [optional] | -|**lastPrice** | **String** | | [optional] | -|**volume** | **String** | | [optional] | -|**quoteVolume** | **String** | | [optional] | -|**openTime** | **Long** | | [optional] | -|**closeTime** | **Long** | | [optional] | -|**firstId** | **Long** | | [optional] | -|**lastId** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/TickerResponse3.md b/clients/spot/docs/TickerResponse3.md deleted file mode 100644 index e56c0049..00000000 --- a/clients/spot/docs/TickerResponse3.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# TickerResponse3 - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**status** | **Long** | | [optional] | -|**result** | [**List<TickerResponse3ResultInner>**](TickerResponse3ResultInner.md) | | [optional] | -|**rateLimits** | [**List<TickerResponse3RateLimitsInner>**](TickerResponse3RateLimitsInner.md) | | [optional] | - - - diff --git a/clients/spot/docs/TickerResponse3RateLimitsInner.md b/clients/spot/docs/TickerResponse3RateLimitsInner.md deleted file mode 100644 index e30961dc..00000000 --- a/clients/spot/docs/TickerResponse3RateLimitsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# TickerResponse3RateLimitsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rateLimitType** | **String** | | [optional] | -|**interval** | **String** | | [optional] | -|**intervalNum** | **Long** | | [optional] | -|**limit** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/TickerResponse3ResultInner.md b/clients/spot/docs/TickerResponse3ResultInner.md deleted file mode 100644 index dd4d5571..00000000 --- a/clients/spot/docs/TickerResponse3ResultInner.md +++ /dev/null @@ -1,27 +0,0 @@ - - -# TickerResponse3ResultInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | [optional] | -|**priceChange** | **String** | | [optional] | -|**priceChangePercent** | **String** | | [optional] | -|**weightedAvgPrice** | **String** | | [optional] | -|**openPrice** | **String** | | [optional] | -|**highPrice** | **String** | | [optional] | -|**lowPrice** | **String** | | [optional] | -|**lastPrice** | **String** | | [optional] | -|**volume** | **String** | | [optional] | -|**quoteVolume** | **String** | | [optional] | -|**openTime** | **Long** | | [optional] | -|**closeTime** | **Long** | | [optional] | -|**firstId** | **Long** | | [optional] | -|**lastId** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/TickerTradingDayResponse.md b/clients/spot/docs/TickerTradingDayResponse.md index 338db74d..dcb45d15 100644 --- a/clients/spot/docs/TickerTradingDayResponse.md +++ b/clients/spot/docs/TickerTradingDayResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TickerTradingDayResponseResultInner>**](TickerTradingDayResponseResultInner.md) | | [optional] | -|**rateLimits** | [**List<TickerResponse2RateLimitsInner>**](TickerResponse2RateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/TimeResponse.md b/clients/spot/docs/TimeResponse.md index a3db9007..406dc391 100644 --- a/clients/spot/docs/TimeResponse.md +++ b/clients/spot/docs/TimeResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**TimeResponseResult**](TimeResponseResult.md) | | [optional] | -|**rateLimits** | [**List<TimeResponseRateLimitsInner>**](TimeResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/TradeApi.md b/clients/spot/docs/TradeApi.md index 2b9dd520..568c3463 100644 --- a/clients/spot/docs/TradeApi.md +++ b/clients/spot/docs/TradeApi.md @@ -4,9 +4,7 @@ All URIs are relative to *http://localhost* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**openOrderListsStatus**](TradeApi.md#openOrderListsStatus) | **POST** /openOrderLists.status | WebSocket Current open Order lists | | [**openOrdersCancelAll**](TradeApi.md#openOrdersCancelAll) | **POST** /openOrders.cancelAll | WebSocket Cancel open orders | -| [**openOrdersStatus**](TradeApi.md#openOrdersStatus) | **POST** /openOrders.status | WebSocket Current open orders | | [**orderAmendKeepPriority**](TradeApi.md#orderAmendKeepPriority) | **POST** /order.amend.keepPriority | WebSocket Order Amend Keep Priority | | [**orderCancel**](TradeApi.md#orderCancel) | **POST** /order.cancel | WebSocket Cancel order | | [**orderCancelReplace**](TradeApi.md#orderCancelReplace) | **POST** /order.cancelReplace | WebSocket Cancel and replace order | @@ -15,76 +13,12 @@ All URIs are relative to *http://localhost* | [**orderListPlaceOco**](TradeApi.md#orderListPlaceOco) | **POST** /orderList.place.oco | WebSocket Place new Order list - OCO | | [**orderListPlaceOto**](TradeApi.md#orderListPlaceOto) | **POST** /orderList.place.oto | WebSocket Place new Order list - OTO | | [**orderListPlaceOtoco**](TradeApi.md#orderListPlaceOtoco) | **POST** /orderList.place.otoco | WebSocket Place new Order list - OTOCO | -| [**orderListStatus**](TradeApi.md#orderListStatus) | **POST** /orderList.status | WebSocket Query Order list | | [**orderPlace**](TradeApi.md#orderPlace) | **POST** /order.place | WebSocket Place new order | -| [**orderStatus**](TradeApi.md#orderStatus) | **POST** /order.status | WebSocket Query order | | [**orderTest**](TradeApi.md#orderTest) | **POST** /order.test | WebSocket Test new order | | [**sorOrderPlace**](TradeApi.md#sorOrderPlace) | **POST** /sor.order.place | WebSocket Place new order using SOR | | [**sorOrderTest**](TradeApi.md#sorOrderTest) | **POST** /sor.order.test | WebSocket Test new order using SOR | - -# **openOrderListsStatus** -> OpenOrderListsStatusResponse openOrderListsStatus(openOrderListsStatusRequest) - -WebSocket Current open Order lists - -Query execution status of all open order lists. If you need to continuously monitor order status updates, please consider using WebSocket Streams: * `userDataStream.start` request * `executionReport` user data stream event Weight: 6 - -### Example -```java -// Import classes: -import com.binance.connector.client.spot.ApiClient; -import com.binance.connector.client.spot.ApiException; -import com.binance.connector.client.spot.Configuration; -import com.binance.connector.client.spot.models.*; -import com.binance.connector.client.spot.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); - OpenOrderListsStatusRequest openOrderListsStatusRequest = new OpenOrderListsStatusRequest(); // OpenOrderListsStatusRequest | - try { - OpenOrderListsStatusResponse result = apiInstance.openOrderListsStatus(openOrderListsStatusRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TradeApi#openOrderListsStatus"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **openOrderListsStatusRequest** | [**OpenOrderListsStatusRequest**](OpenOrderListsStatusRequest.md)| | | - -### Return type - -[**OpenOrderListsStatusResponse**](OpenOrderListsStatusResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Current open Order lists | - | - # **openOrdersCancelAll** > OpenOrdersCancelAllResponse openOrdersCancelAll(openOrdersCancelAllRequest) @@ -147,68 +81,6 @@ No authorization required |-------------|-------------|------------------| | **200** | Cancel open orders | - | - -# **openOrdersStatus** -> OpenOrdersStatusResponse openOrdersStatus(openOrdersStatusRequest) - -WebSocket Current open orders - -Query execution status of all open orders. If you need to continuously monitor order status updates, please consider using WebSocket Streams: * `userDataStream.start` request * `executionReport` user data stream event Weight: Adjusted based on the number of requested symbols: | Parameter | Weight | | --------- | ------ | | `symbol` | 6 | | none | 80 | - -### Example -```java -// Import classes: -import com.binance.connector.client.spot.ApiClient; -import com.binance.connector.client.spot.ApiException; -import com.binance.connector.client.spot.Configuration; -import com.binance.connector.client.spot.models.*; -import com.binance.connector.client.spot.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); - OpenOrdersStatusRequest openOrdersStatusRequest = new OpenOrdersStatusRequest(); // OpenOrdersStatusRequest | - try { - OpenOrdersStatusResponse result = apiInstance.openOrdersStatus(openOrdersStatusRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TradeApi#openOrdersStatus"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **openOrdersStatusRequest** | [**OpenOrdersStatusRequest**](OpenOrdersStatusRequest.md)| | | - -### Return type - -[**OpenOrdersStatusResponse**](OpenOrdersStatusResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Current open orders | - | - # **orderAmendKeepPriority** > OrderAmendKeepPriorityResponse orderAmendKeepPriority(orderAmendKeepPriorityRequest) @@ -525,7 +397,7 @@ No authorization required WebSocket Place new Order list - OCO -Send in an one-cancels the other (OCO) pair, where activation of one order immediately cancels the other. * An OCO has 2 orders called the **above order** and **below order**. * One of the orders must be a `LIMIT_MAKER/TAKE_PROFIT/TAKE_PROFIT_LIMIT` order and the other must be `STOP_LOSS` or `STOP_LOSS_LIMIT` order. * Price restrictions: * If the OCO is on the `SELL` side: * `LIMIT_MAKER/TAKE_PROFIT_LIMIT` `price` > Last Traded Price > `STOP_LOSS/STOP_LOSS_LIMIT` `stopPrice` * `TAKE_PROFIT stopPrice` > Last Traded Price > `STOP_LOSS/STOP_LOSS_LIMIT stopPrice` * If the OCO is on the `BUY` side: * `LIMIT_MAKER` `price` < Last Traded Price < `STOP_LOSS/STOP_LOSS_LIMIT` `stopPrice` * `TAKE_PROFIT stopPrice` > Last Traded Price > `STOP_LOSS/STOP_LOSS_LIMIT stopPrice` * OCOs add **2 orders** to the `EXCHANGE_MAX_ORDERS` filter and `MAX_NUM_ORDERS` filter. Weight: 1 Unfilled Order Count: 2 +Send in an one-cancels-the-other (OCO) pair, where activation of one order immediately cancels the other. * An OCO has 2 orders called the **above order** and **below order**. * One of the orders must be a `LIMIT_MAKER/TAKE_PROFIT/TAKE_PROFIT_LIMIT` order and the other must be `STOP_LOSS` or `STOP_LOSS_LIMIT` order. * Price restrictions: * If the OCO is on the `SELL` side: * `LIMIT_MAKER/TAKE_PROFIT_LIMIT` `price` > Last Traded Price > `STOP_LOSS/STOP_LOSS_LIMIT` `stopPrice` * `TAKE_PROFIT stopPrice` > Last Traded Price > `STOP_LOSS/STOP_LOSS_LIMIT stopPrice` * If the OCO is on the `BUY` side: * `LIMIT_MAKER` `price` < Last Traded Price < `STOP_LOSS/STOP_LOSS_LIMIT` `stopPrice` * `TAKE_PROFIT stopPrice` > Last Traded Price > `STOP_LOSS/STOP_LOSS_LIMIT stopPrice` * OCOs add **2 orders** to the `EXCHANGE_MAX_ORDERS` filter and `MAX_NUM_ORDERS` filter. Weight: 1 Unfilled Order Count: 2 ### Example ```java @@ -587,7 +459,7 @@ No authorization required WebSocket Place new Order list - OTO -Places an OTO. * An OTO (One-Triggers-the-Other) is an order list comprised of 2 orders. * The first order is called the **working order** and must be `LIMIT` or `LIMIT_MAKER`. Initially, only the working order goes on the order book. * The second order is called the **pending order**. It can be any order type except for `MARKET` orders using parameter `quoteOrderQty`. The pending order is only placed on the order book when the working order gets **fully filled**. * If either the working order or the pending order is cancelled individually, the other order in the order list will also be canceled or expired. * OTOs add **2 orders** to the `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. Weight: 1 Unfilled Order Count: 2 +Places an OTO. * An OTO (One-Triggers-the-Other) is an order list comprised of 2 orders. * The first order is called the **working order** and must be `LIMIT` or `LIMIT_MAKER`. Initially, only the working order goes on the order book. * The second order is called the **pending order**. It can be any order type except for `MARKET` orders using parameter `quoteOrderQty`. The pending order is only placed on the order book when the working order gets **fully filled**. * If either the working order or the pending order is cancelled individually, the other order in the order list will also be canceled or expired. * When the order list is placed, if the working order gets **immediately fully filled**, the placement response will show the working order as `FILLED` but the pending order will still appear as `PENDING_NEW`. You need to query the status of the pending order again to see its updated status. * OTOs add **2 orders** to the `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. Weight: 1 Unfilled Order Count: 2 ### Example ```java @@ -649,7 +521,7 @@ No authorization required WebSocket Place new Order list - OTOCO -Place an OTOCO. * An OTOCO (One-Triggers-One-Cancels-the-Other) is an order list comprised of 3 orders. * The first order is called the **working order** and must be `LIMIT` or `LIMIT_MAKER`. Initially, only the working order goes on the order book. * The behavior of the working order is the same as the [OTO](#place-new-order-list---oto-trade). * OTOCO has 2 pending orders (pending above and pending below), forming an OCO pair. The pending orders are only placed on the order book when the working order gets **fully filled**. * OTOCOs add **3 orders** to the `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. Weight: 1 Unfilled Order Count: 3 +Place an OTOCO. * An OTOCO (One-Triggers-One-Cancels-the-Other) is an order list comprised of 3 orders. * The first order is called the **working order** and must be `LIMIT` or `LIMIT_MAKER`. Initially, only the working order goes on the order book. * The behavior of the working order is the same as the [OTO](#place-new-order-list---oto-trade). * OTOCO has 2 pending orders (pending above and pending below), forming an OCO pair. The pending orders are only placed on the order book when the working order gets **fully filled**. * The rules of the pending above and pending below follow the same rules as the [Order list OCO](#new-order-list---oco-trade). * OTOCOs add **3 orders** to the `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. Weight: 1 Unfilled Order Count: 3 ### Example ```java @@ -705,68 +577,6 @@ No authorization required |-------------|-------------|------------------| | **200** | Place new Order list - OTOCO | - | - -# **orderListStatus** -> OrderListStatusResponse orderListStatus(orderListStatusRequest) - -WebSocket Query Order list - -Check execution status of an Order list. For execution status of individual orders, use `order.status`. Weight: 4 - -### Example -```java -// Import classes: -import com.binance.connector.client.spot.ApiClient; -import com.binance.connector.client.spot.ApiException; -import com.binance.connector.client.spot.Configuration; -import com.binance.connector.client.spot.models.*; -import com.binance.connector.client.spot.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); - OrderListStatusRequest orderListStatusRequest = new OrderListStatusRequest(); // OrderListStatusRequest | - try { - OrderListStatusResponse result = apiInstance.orderListStatus(orderListStatusRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TradeApi#orderListStatus"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **orderListStatusRequest** | [**OrderListStatusRequest**](OrderListStatusRequest.md)| | | - -### Return type - -[**OrderListStatusResponse**](OrderListStatusResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Query Order list | - | - # **orderPlace** > OrderPlaceResponse orderPlace(orderPlaceRequest) @@ -829,68 +639,6 @@ No authorization required |-------------|-------------|------------------| | **200** | Place new order | - | - -# **orderStatus** -> OrderStatusResponse orderStatus(orderStatusRequest) - -WebSocket Query order - -Check execution status of an order. Weight: 4 - -### Example -```java -// Import classes: -import com.binance.connector.client.spot.ApiClient; -import com.binance.connector.client.spot.ApiException; -import com.binance.connector.client.spot.Configuration; -import com.binance.connector.client.spot.models.*; -import com.binance.connector.client.spot.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); - OrderStatusRequest orderStatusRequest = new OrderStatusRequest(); // OrderStatusRequest | - try { - OrderStatusResponse result = apiInstance.orderStatus(orderStatusRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TradeApi#orderStatus"); - 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 | -|------------- | ------------- | ------------- | -------------| -| **orderStatusRequest** | [**OrderStatusRequest**](OrderStatusRequest.md)| | | - -### Return type - -[**OrderStatusResponse**](OrderStatusResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Query order | - | - # **orderTest** > OrderTestResponse orderTest(orderTestRequest) @@ -959,7 +707,7 @@ No authorization required WebSocket Place new order using SOR -Places an order using smart order routing (SOR). This adds 1 order to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. Weight: 1 Unfilled Order Count: 1 +Places an order using smart order routing (SOR). This adds 1 order to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. Read [SOR FAQ](../faqs/sor_faq.md) to learn more. Weight: 1 Unfilled Order Count: 1 ### Example ```java diff --git a/clients/spot/docs/TradesAggregateResponse.md b/clients/spot/docs/TradesAggregateResponse.md index 3e558c13..485fbe70 100644 --- a/clients/spot/docs/TradesAggregateResponse.md +++ b/clients/spot/docs/TradesAggregateResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TradesAggregateResponseResultInner>**](TradesAggregateResponseResultInner.md) | | [optional] | -|**rateLimits** | [**List<AvgPriceResponseRateLimitsInner>**](AvgPriceResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/TradesHistoricalResponse.md b/clients/spot/docs/TradesHistoricalResponse.md index d7d38900..40d03c72 100644 --- a/clients/spot/docs/TradesHistoricalResponse.md +++ b/clients/spot/docs/TradesHistoricalResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TradesHistoricalResponseResultInner>**](TradesHistoricalResponseResultInner.md) | | [optional] | -|**rateLimits** | [**List<TradesHistoricalResponseRateLimitsInner>**](TradesHistoricalResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/TradesHistoricalResponseRateLimitsInner.md b/clients/spot/docs/TradesHistoricalResponseRateLimitsInner.md deleted file mode 100644 index 61c9dfce..00000000 --- a/clients/spot/docs/TradesHistoricalResponseRateLimitsInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# TradesHistoricalResponseRateLimitsInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**rateLimitType** | **String** | | [optional] | -|**interval** | **String** | | [optional] | -|**intervalNum** | **Long** | | [optional] | -|**limit** | **Long** | | [optional] | -|**count** | **Long** | | [optional] | - - - diff --git a/clients/spot/docs/TradesRecentResponse.md b/clients/spot/docs/TradesRecentResponse.md index 55eb9c00..28158ddc 100644 --- a/clients/spot/docs/TradesRecentResponse.md +++ b/clients/spot/docs/TradesRecentResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**List<TradesRecentResponseResultInner>**](TradesRecentResponseResultInner.md) | | [optional] | -|**rateLimits** | [**List<AvgPriceResponseRateLimitsInner>**](AvgPriceResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/UiKlinesResponse.md b/clients/spot/docs/UiKlinesResponse.md index f075beff..51c53c0d 100644 --- a/clients/spot/docs/UiKlinesResponse.md +++ b/clients/spot/docs/UiKlinesResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | **List<UiKlinesItem>** | | [optional] | -|**rateLimits** | [**List<AvgPriceResponseRateLimitsInner>**](AvgPriceResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/UserDataStreamPingResponse.md b/clients/spot/docs/UserDataStreamPingResponse.md index c4cf9b6e..a2f9e8a1 100644 --- a/clients/spot/docs/UserDataStreamPingResponse.md +++ b/clients/spot/docs/UserDataStreamPingResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**response** | **Object** | | [optional] | -|**rateLimits** | [**List<AvgPriceResponseRateLimitsInner>**](AvgPriceResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/UserDataStreamStartResponse.md b/clients/spot/docs/UserDataStreamStartResponse.md index 45b1e010..af480623 100644 --- a/clients/spot/docs/UserDataStreamStartResponse.md +++ b/clients/spot/docs/UserDataStreamStartResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**UserDataStreamStartResponseResult**](UserDataStreamStartResponseResult.md) | | [optional] | -|**rateLimits** | [**List<AvgPriceResponseRateLimitsInner>**](AvgPriceResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/UserDataStreamStopResponse.md b/clients/spot/docs/UserDataStreamStopResponse.md index ca4ad00e..a0f8115e 100644 --- a/clients/spot/docs/UserDataStreamStopResponse.md +++ b/clients/spot/docs/UserDataStreamStopResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**response** | **Object** | | [optional] | -|**rateLimits** | [**List<AvgPriceResponseRateLimitsInner>**](AvgPriceResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | **RateLimits** | | [optional] | diff --git a/clients/spot/docs/rest-api/migration-guide.md b/clients/spot/docs/rest-api/migration-guide.md index 982c63f6..74e521b5 100644 --- a/clients/spot/docs/rest-api/migration-guide.md +++ b/clients/spot/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-spot - 2.0.0 + 3.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-spot - 2.0.0 + 3.0.0 ``` diff --git a/clients/spot/example_rest.md b/clients/spot/example_rest.md index 926bfa73..dd6737b0 100644 --- a/clients/spot/example_rest.md +++ b/clients/spot/example_rest.md @@ -2,14 +2,26 @@ [GET /api/v3/account/commission](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-commission-rates-user_data) - accountCommission - [AccountCommissionExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/AccountCommissionExample.java#L46) +[GET /api/v3/allOrderList](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-all-order-lists-user_data) - allOrderList - [AllOrderListExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/AllOrderListExample.java#L48) + +[GET /api/v3/allOrders](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#all-orders-user_data) - allOrders - [AllOrdersExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/AllOrdersExample.java#L46) + [GET /api/v3/account](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#account-information-user_data) - getAccount - [GetAccountExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetAccountExample.java#L46) +[GET /api/v3/openOrders](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#current-open-orders-user_data) - getOpenOrders - [GetOpenOrdersExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOpenOrdersExample.java#L47) + +[GET /api/v3/order](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-order-user_data) - getOrder - [GetOrderExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOrderExample.java#L46) + +[GET /api/v3/orderList](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-order-list-user_data) - getOrderList - [GetOrderListExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOrderListExample.java#L46) + [GET /api/v3/myAllocations](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-allocations-user_data) - myAllocations - [MyAllocationsExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyAllocationsExample.java#L46) [GET /api/v3/myPreventedMatches](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-prevented-matches-user_data) - myPreventedMatches - [MyPreventedMatchesExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyPreventedMatchesExample.java#L52) [GET /api/v3/myTrades](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#account-trade-list-user_data) - myTrades - [MyTradesExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/MyTradesExample.java#L47) +[GET /api/v3/openOrderList](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-open-order-lists-user_data) - openOrderList - [OpenOrderListExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/OpenOrderListExample.java#L46) + [GET /api/v3/order/amendments](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-order-amendments-user_data) - orderAmendments - [OrderAmendmentsExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/OrderAmendmentsExample.java#L46) [GET /api/v3/rateLimit/order](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-unfilled-order-count-user_data) - rateLimitOrder - [RateLimitOrderExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/RateLimitOrderExample.java#L46) @@ -50,26 +62,14 @@ ## Trade -[GET /api/v3/allOrderList](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-all-order-lists-user_data) - allOrderList - [AllOrderListExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/AllOrderListExample.java#L48) - -[GET /api/v3/allOrders](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#all-orders-user_data) - allOrders - [AllOrdersExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/AllOrdersExample.java#L46) - [DELETE /api/v3/openOrders](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-all-open-orders-on-a-symbol-trade) - deleteOpenOrders - [DeleteOpenOrdersExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/DeleteOpenOrdersExample.java#L47) [DELETE /api/v3/order](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-order-trade) - deleteOrder - [DeleteOrderExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/DeleteOrderExample.java#L47) [DELETE /api/v3/orderList](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-order-list-trade) - deleteOrderList - [DeleteOrderListExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/DeleteOrderListExample.java#L46) -[GET /api/v3/openOrders](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#current-open-orders-user_data) - getOpenOrders - [GetOpenOrdersExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/GetOpenOrdersExample.java#L47) - -[GET /api/v3/order](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-order-user_data) - getOrder - [GetOrderExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/GetOrderExample.java#L46) - -[GET /api/v3/orderList](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-order-list-user_data) - getOrderList - [GetOrderListExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/GetOrderListExample.java#L46) - [POST /api/v3/order](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade) - newOrder - [NewOrderExample.java:50](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/NewOrderExample.java#L50) -[GET /api/v3/openOrderList](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-open-order-lists-user_data) - openOrderList - [OpenOrderListExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OpenOrderListExample.java#L46) - [PUT /api/v3/order/amend/keepPriority](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#order-amend-keep-priority-trade) - orderAmendKeepPriority - [OrderAmendKeepPriorityExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OrderAmendKeepPriorityExample.java#L49) [POST /api/v3/order/cancelReplace](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-an-existing-order-and-send-a-new-order-trade) - orderCancelReplace - [OrderCancelReplaceExample.java:53](/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OrderCancelReplaceExample.java#L53) diff --git a/clients/spot/example_websocket_api.md b/clients/spot/example_websocket_api.md index 9d3dda18..f964c54d 100644 --- a/clients/spot/example_websocket_api.md +++ b/clients/spot/example_websocket_api.md @@ -16,8 +16,16 @@ [myTrades](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-trade-history-user_data) - myTrades - [MyTradesExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/MyTradesExample.java#L47) +[openOrderLists.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#current-open-order-lists-user_data) - openOrderListsStatus - [OpenOrderListsStatusExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrderListsStatusExample.java#L48) + +[openOrders.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#current-open-orders-user_data) - openOrdersStatus - [OpenOrdersStatusExample.java:50](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrdersStatusExample.java#L50) + [order.amendments](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#query-order-amendments-user_data) - orderAmendments - [OrderAmendmentsExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderAmendmentsExample.java#L46) +[orderList.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#query-order-list-user_data) - orderListStatus - [OrderListStatusExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderListStatusExample.java#L47) + +[order.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#query-order-user_data) - orderStatus - [OrderStatusExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderStatusExample.java#L46) + ## Auth [session.logon](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests#log-in-with-api-key-signed) - sessionLogon - [SessionLogonExample.java:50](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/auth/SessionLogonExample.java#L50) @@ -30,7 +38,7 @@ [exchangeInfo](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests#exchange-information) - exchangeInfo - [ExchangeInfoExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/ExchangeInfoExample.java#L46) -[ping](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests#test-connectivity) - ping - [PingExample.java:43](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/PingExample.java#L43) +[ping](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests#test-connectivity) - ping - [PingExample.java:45](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/PingExample.java#L45) [time](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/general-requests#check-server-time) - time - [TimeExample.java:45](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/TimeExample.java#L45) @@ -62,12 +70,8 @@ ## Trade -[openOrderLists.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#current-open-order-lists-user_data) - openOrderListsStatus - [OpenOrderListsStatusExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OpenOrderListsStatusExample.java#L48) - [openOrders.cancelAll](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-open-orders-trade) - openOrdersCancelAll - [OpenOrdersCancelAllExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OpenOrdersCancelAllExample.java#L47) -[openOrders.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#current-open-orders-user_data) - openOrdersStatus - [OpenOrdersStatusExample.java:50](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OpenOrdersStatusExample.java#L50) - [order.amend.keepPriority](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#order-amend-keep-priority-trade) - orderAmendKeepPriority - [OrderAmendKeepPriorityExample.java:48](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderAmendKeepPriorityExample.java#L48) [order.cancel](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-order-trade) - orderCancel - [OrderCancelExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderCancelExample.java#L46) @@ -80,16 +84,12 @@ [orderList.place.oco](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-list---oco-trade) - orderListPlaceOco - [OrderListPlaceOcoExample.java:61](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOcoExample.java#L61) -[orderList.place.oto](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-list---oto-trade) - orderListPlaceOto - [OrderListPlaceOtoExample.java:59](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtoExample.java#L59) +[orderList.place.oto](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-list---oto-trade) - orderListPlaceOto - [OrderListPlaceOtoExample.java:62](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtoExample.java#L62) -[orderList.place.otoco](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-list---otoco-trade) - orderListPlaceOtoco - [OrderListPlaceOtocoExample.java:57](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtocoExample.java#L57) - -[orderList.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#query-order-list-user_data) - orderListStatus - [OrderListStatusExample.java:47](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListStatusExample.java#L47) +[orderList.place.otoco](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-list---otoco-trade) - orderListPlaceOtoco - [OrderListPlaceOtocoExample.java:59](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtocoExample.java#L59) [order.place](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-trade) - orderPlace - [OrderPlaceExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderPlaceExample.java#L49) -[order.status](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#query-order-user_data) - orderStatus - [OrderStatusExample.java:46](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderStatusExample.java#L46) - [order.test](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#test-new-order-trade) - orderTest - [OrderTestExample.java:49](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderTestExample.java#L49) [sor.order.place](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#place-new-order-using-sor-trade) - sorOrderPlace - [SorOrderPlaceExample.java:50](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/SorOrderPlaceExample.java#L50) diff --git a/clients/spot/pom.xml b/clients/spot/pom.xml index 6cb1dbad..c49c24ea 100644 --- a/clients/spot/pom.xml +++ b/clients/spot/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-spot spot - 2.0.0 + 3.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 1.2.0 + 1.2.1 \ No newline at end of file diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/JSON.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/JSON.java index 99b65e25..d8875fe5 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/JSON.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/JSON.java @@ -166,13 +166,13 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.spot.rest.model.DepthResponse .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.rest.model.ExchangeInfoResponse + new com.binance.connector.client.spot.rest.model.ExchangeFilters .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.rest.model - .ExchangeInfoResponseExchangeFiltersInner.CustomTypeAdapterFactory()); + new com.binance.connector.client.spot.rest.model.ExchangeFiltersInner + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.rest.model.ExchangeInfoResponseRateLimitsInner + new com.binance.connector.client.spot.rest.model.ExchangeInfoResponse .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.ExchangeInfoResponseSymbolsInner @@ -364,6 +364,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.RateLimitOrderResponseInner .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.RateLimits + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.rest.model.RateLimitsInner + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.rest.model.SorOrderRequest .CustomTypeAdapterFactory()); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/AccountApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/AccountApi.java index e69c24e0..dcbedcf5 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/AccountApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/AccountApi.java @@ -20,10 +20,16 @@ import com.binance.connector.client.common.configuration.ClientConfiguration; import com.binance.connector.client.common.exception.ConstraintViolationException; import com.binance.connector.client.spot.rest.model.AccountCommissionResponse; +import com.binance.connector.client.spot.rest.model.AllOrderListResponse; +import com.binance.connector.client.spot.rest.model.AllOrdersResponse; import com.binance.connector.client.spot.rest.model.GetAccountResponse; +import com.binance.connector.client.spot.rest.model.GetOpenOrdersResponse; +import com.binance.connector.client.spot.rest.model.GetOrderListResponse; +import com.binance.connector.client.spot.rest.model.GetOrderResponse; import com.binance.connector.client.spot.rest.model.MyAllocationsResponse; import com.binance.connector.client.spot.rest.model.MyPreventedMatchesResponse; import com.binance.connector.client.spot.rest.model.MyTradesResponse; +import com.binance.connector.client.spot.rest.model.OpenOrderListResponse; import com.binance.connector.client.spot.rest.model.OrderAmendmentsResponse; import com.binance.connector.client.spot.rest.model.RateLimitOrderResponse; import com.google.gson.reflect.TypeToken; @@ -48,7 +54,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-spot/2.0.0 (Java/%s; %s; %s)", + "binance-spot/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; @@ -221,11 +227,837 @@ public ApiResponse accountCommission(@NotNull String return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for allOrderList + * + * @param fromId ID to get aggregate trades from INCLUSIVE. (optional) + * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) + * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) + * @param limit Default: 500; Maximum: 1000. (optional) + * @param recvWindow The value cannot be greater than `60000` (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 Query all Order lists -
+ * + * @see Query + * all Order lists Documentation + */ + private okhttp3.Call allOrderListCall( + Long fromId, Long startTime, Long endTime, Integer 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 = "/api/v3/allOrderList"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (fromId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fromId", fromId)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + 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 (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + List localVarAuthNames = new ArrayList<>(); + localVarAuthNames.addAll( + Arrays.asList( + new String[] { + "binanceSignature", + })); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames.toArray(new String[0])); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call allOrderListValidateBeforeCall( + Long fromId, Long startTime, Long endTime, Integer limit, Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {fromId, startTime, endTime, limit, recvWindow}; + Method method = + this.getClass() + .getMethod( + "allOrderList", + Long.class, + Long.class, + Long.class, + Integer.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return allOrderListCall(fromId, startTime, endTime, 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 Order lists Retrieves all order lists based on provided optional parameters. Note + * that the time between `startTime` and `endTime` can't be longer than + * 24 hours. Weight: 20 + * + * @param fromId ID to get aggregate trades from INCLUSIVE. (optional) + * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) + * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) + * @param limit Default: 500; Maximum: 1000. (optional) + * @param recvWindow The value cannot be greater than `60000` (optional) + * @return ApiResponse<AllOrderListResponse> + * @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 Query all Order lists -
+ * + * @see Query + * all Order lists Documentation + */ + public ApiResponse allOrderList( + Long fromId, Long startTime, Long endTime, Integer limit, Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + allOrderListValidateBeforeCall(fromId, startTime, endTime, limit, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for allOrders + * + * @param symbol (required) + * @param orderId (optional) + * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) + * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) + * @param limit Default: 500; Maximum: 1000. (optional) + * @param recvWindow The value cannot be greater than `60000` (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 orders -
+ * + * @see All + * orders Documentation + */ + private okhttp3.Call allOrdersCall( + String symbol, + Long orderId, + Long startTime, + Long endTime, + Integer 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 = "/api/v3/allOrders"; + + 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 (orderId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("orderId", orderId)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + 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 (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + List localVarAuthNames = new ArrayList<>(); + localVarAuthNames.addAll( + Arrays.asList( + new String[] { + "binanceSignature", + })); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames.toArray(new String[0])); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call allOrdersValidateBeforeCall( + String symbol, + Long orderId, + Long startTime, + Long endTime, + Integer limit, + Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {symbol, orderId, startTime, endTime, limit, recvWindow}; + Method method = + this.getClass() + .getMethod( + "allOrders", + String.class, + Long.class, + Long.class, + Long.class, + Integer.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return allOrdersCall(symbol, orderId, startTime, endTime, 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()); + } + } + + /** + * All orders Get all account orders; active, canceled, or filled. Weight: 20 + * + * @param symbol (required) + * @param orderId (optional) + * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) + * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) + * @param limit Default: 500; Maximum: 1000. (optional) + * @param recvWindow The value cannot be greater than `60000` (optional) + * @return ApiResponse<AllOrdersResponse> + * @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 orders -
+ * + * @see All + * orders Documentation + */ + public ApiResponse allOrders( + @NotNull String symbol, + Long orderId, + Long startTime, + Long endTime, + Integer limit, + Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + allOrdersValidateBeforeCall(symbol, orderId, startTime, endTime, limit, recvWindow); + java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for getAccount * - * @param omitZeroBalances When set to `true`, emits only the non-zero balances of an - * account. <br>Default value: `false` (optional) + * @param omitZeroBalances When set to `true`, emits only the non-zero balances of an + * account. <br>Default value: `false` (optional) + * @param recvWindow The value cannot be greater than `60000` (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 Account information -
+ * + * @see Account + * information Documentation + */ + private okhttp3.Call getAccountCall(Boolean omitZeroBalances, 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 = "/api/v3/account"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (omitZeroBalances != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("omitZeroBalances", omitZeroBalances)); + } + + 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 (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + List localVarAuthNames = new ArrayList<>(); + localVarAuthNames.addAll( + Arrays.asList( + new String[] { + "binanceSignature", + })); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames.toArray(new String[0])); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAccountValidateBeforeCall(Boolean omitZeroBalances, Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {omitZeroBalances, recvWindow}; + Method method = this.getClass().getMethod("getAccount", Boolean.class, Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getAccountCall(omitZeroBalances, 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()); + } + } + + /** + * Account information Get current account information. Weight: 20 + * + * @param omitZeroBalances When set to `true`, emits only the non-zero balances of an + * account. <br>Default value: `false` (optional) + * @param recvWindow The value cannot be greater than `60000` (optional) + * @return ApiResponse<GetAccountResponse> + * @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 Account information -
+ * + * @see Account + * information Documentation + */ + public ApiResponse getAccount(Boolean omitZeroBalances, Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = getAccountValidateBeforeCall(omitZeroBalances, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getOpenOrders + * + * @param symbol Symbol to query (optional) + * @param recvWindow The value cannot be greater than `60000` (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 open orders -
+ * + * @see Current + * open orders Documentation + */ + private okhttp3.Call getOpenOrdersCall(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 = "/api/v3/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)); + } + + 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 (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + List localVarAuthNames = new ArrayList<>(); + localVarAuthNames.addAll( + Arrays.asList( + new String[] { + "binanceSignature", + })); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames.toArray(new String[0])); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOpenOrdersValidateBeforeCall(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("getOpenOrders", String.class, Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getOpenOrdersCall(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()); + } + } + + /** + * Current open orders Get all open orders on a symbol. **Careful** when accessing this with no + * symbol. Weight: 6 for a single symbol; **80** when the symbol parameter is omitted + * + * @param symbol Symbol to query (optional) + * @param recvWindow The value cannot be greater than `60000` (optional) + * @return ApiResponse<GetOpenOrdersResponse> + * @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 open orders -
+ * + * @see Current + * open orders Documentation + */ + public ApiResponse getOpenOrders(String symbol, Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = getOpenOrdersValidateBeforeCall(symbol, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getOrder + * + * @param symbol (required) + * @param orderId (optional) + * @param origClientOrderId (optional) + * @param recvWindow The value cannot be greater than `60000` (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 Query order -
+ * + * @see Query + * order Documentation + */ + private okhttp3.Call getOrderCall( + String symbol, Long orderId, String origClientOrderId, 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 = "/api/v3/order"; + + 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 (orderId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("orderId", orderId)); + } + + if (origClientOrderId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("origClientOrderId", origClientOrderId)); + } + + 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 (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + List localVarAuthNames = new ArrayList<>(); + localVarAuthNames.addAll( + Arrays.asList( + new String[] { + "binanceSignature", + })); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames.toArray(new String[0])); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrderValidateBeforeCall( + String symbol, Long orderId, String origClientOrderId, Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {symbol, orderId, origClientOrderId, recvWindow}; + Method method = + this.getClass() + .getMethod( + "getOrder", String.class, Long.class, String.class, Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getOrderCall(symbol, orderId, origClientOrderId, 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 order Check an order's status. Weight: 4 + * + * @param symbol (required) + * @param orderId (optional) + * @param origClientOrderId (optional) + * @param recvWindow The value cannot be greater than `60000` (optional) + * @return ApiResponse<GetOrderResponse> + * @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 Query order -
+ * + * @see Query + * order Documentation + */ + public ApiResponse getOrder( + @NotNull String symbol, Long orderId, String origClientOrderId, Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getOrderValidateBeforeCall(symbol, orderId, origClientOrderId, recvWindow); + java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for getOrderList + * + * @param orderListId Either `orderListId` or `listClientOrderId` must be + * provided (optional) + * @param origClientOrderId (optional) * @param recvWindow The value cannot be greater than `60000` (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -233,15 +1065,15 @@ public ApiResponse accountCommission(@NotNull String * * * - * + * *
Response Details
Status Code Description Response Headers
200 Account information -
200 Query Order list -
* * @see Account - * information Documentation + * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-order-list-user_data">Query + * Order list Documentation */ - private okhttp3.Call getAccountCall(Boolean omitZeroBalances, Long recvWindow) - throws ApiException { + private okhttp3.Call getOrderListCall( + Long orderListId, String origClientOrderId, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -258,7 +1090,7 @@ private okhttp3.Call getAccountCall(Boolean omitZeroBalances, Long recvWindow) Object localVarPostBody = null; // create path and map variables - String localVarPath = "/api/v3/account"; + String localVarPath = "/api/v3/orderList"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -266,9 +1098,14 @@ private okhttp3.Call getAccountCall(Boolean omitZeroBalances, Long recvWindow) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (omitZeroBalances != null) { + if (orderListId != null) { localVarQueryParams.addAll( - localVarApiClient.parameterToPair("omitZeroBalances", omitZeroBalances)); + localVarApiClient.parameterToPair("orderListId", orderListId)); + } + + if (origClientOrderId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("origClientOrderId", origClientOrderId)); } if (recvWindow != null) { @@ -310,8 +1147,8 @@ private okhttp3.Call getAccountCall(Boolean omitZeroBalances, Long recvWindow) } @SuppressWarnings("rawtypes") - private okhttp3.Call getAccountValidateBeforeCall(Boolean omitZeroBalances, Long recvWindow) - throws ApiException { + private okhttp3.Call getOrderListValidateBeforeCall( + Long orderListId, String origClientOrderId, Long recvWindow) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -321,13 +1158,14 @@ private okhttp3.Call getAccountValidateBeforeCall(Boolean omitZeroBalances, Long .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {omitZeroBalances, recvWindow}; - Method method = this.getClass().getMethod("getAccount", Boolean.class, Long.class); + Object[] parameterValues = {orderListId, origClientOrderId, recvWindow}; + Method method = + this.getClass().getMethod("getOrderList", Long.class, String.class, Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getAccountCall(omitZeroBalances, recvWindow); + return getOrderListCall(orderListId, origClientOrderId, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -341,30 +1179,33 @@ private okhttp3.Call getAccountValidateBeforeCall(Boolean omitZeroBalances, Long } /** - * Account information Get current account information. Weight: 20 + * Query Order list Retrieves a specific order list based on provided optional parameters. + * Weight: 4 * - * @param omitZeroBalances When set to `true`, emits only the non-zero balances of an - * account. <br>Default value: `false` (optional) + * @param orderListId Either `orderListId` or `listClientOrderId` must be + * provided (optional) + * @param origClientOrderId (optional) * @param recvWindow The value cannot be greater than `60000` (optional) - * @return ApiResponse<GetAccountResponse> + * @return ApiResponse<GetOrderListResponse> * @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 Account information -
200 Query Order list -
* * @see Account - * information Documentation + * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-order-list-user_data">Query + * Order list Documentation */ - public ApiResponse getAccount(Boolean omitZeroBalances, Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = getAccountValidateBeforeCall(omitZeroBalances, recvWindow); + public ApiResponse getOrderList( + Long orderListId, String origClientOrderId, Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = + getOrderListValidateBeforeCall(orderListId, origClientOrderId, recvWindow); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -997,6 +1838,141 @@ public ApiResponse myTrades( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for openOrderList + * + * @param recvWindow The value cannot be greater than `60000` (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 Query Open Order lists -
+ * + * @see Query + * Open Order lists Documentation + */ + private okhttp3.Call openOrderListCall(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 = "/api/v3/openOrderList"; + + 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 (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + List localVarAuthNames = new ArrayList<>(); + localVarAuthNames.addAll( + Arrays.asList( + new String[] { + "binanceSignature", + })); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames.toArray(new String[0])); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call openOrderListValidateBeforeCall(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("openOrderList", Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return openOrderListCall(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 Open Order lists Weight: 6 + * + * @param recvWindow The value cannot be greater than `60000` (optional) + * @return ApiResponse<OpenOrderListResponse> + * @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 Query Open Order lists -
+ * + * @see Query + * Open Order lists Documentation + */ + public ApiResponse openOrderList(Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = openOrderListValidateBeforeCall(recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for orderAmendments * diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/GeneralApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/GeneralApi.java index f64e979a..b3bedf56 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/GeneralApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/GeneralApi.java @@ -47,7 +47,7 @@ public class GeneralApi { private static final String USER_AGENT = String.format( - "binance-spot/2.0.0 (Java/%s; %s; %s)", + "binance-spot/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/MarketApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/MarketApi.java index e78697fd..533b9986 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/MarketApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/MarketApi.java @@ -58,7 +58,7 @@ public class MarketApi { private static final String USER_AGENT = String.format( - "binance-spot/2.0.0 (Java/%s; %s; %s)", + "binance-spot/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/SpotRestApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/SpotRestApi.java index d609e77c..0a541d33 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/SpotRestApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/SpotRestApi.java @@ -108,6 +108,70 @@ public ApiResponse accountCommission(String symbol) return accountApi.accountCommission(symbol); } + /** + * Query all Order lists Retrieves all order lists based on provided optional parameters. Note + * that the time between `startTime` and `endTime` can't be longer than + * 24 hours. Weight: 20 + * + * @param fromId ID to get aggregate trades from INCLUSIVE. (optional) + * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) + * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) + * @param limit Default: 500; Maximum: 1000. (optional) + * @param recvWindow The value cannot be greater than `60000` (optional) + * @return ApiResponse<AllOrderListResponse> + * @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 Query all Order lists -
+ * + * @see Query + * all Order lists Documentation + */ + public ApiResponse allOrderList( + Long fromId, Long startTime, Long endTime, Integer limit, Long recvWindow) + throws ApiException { + return accountApi.allOrderList(fromId, startTime, endTime, limit, recvWindow); + } + + /** + * All orders Get all account orders; active, canceled, or filled. Weight: 20 + * + * @param symbol (required) + * @param orderId (optional) + * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) + * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) + * @param limit Default: 500; Maximum: 1000. (optional) + * @param recvWindow The value cannot be greater than `60000` (optional) + * @return ApiResponse<AllOrdersResponse> + * @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 orders -
+ * + * @see All + * orders Documentation + */ + public ApiResponse allOrders( + String symbol, + Long orderId, + Long startTime, + Long endTime, + Integer limit, + Long recvWindow) + throws ApiException { + return accountApi.allOrders(symbol, orderId, startTime, endTime, limit, recvWindow); + } + /** * Account information Get current account information. Weight: 20 * @@ -133,6 +197,85 @@ public ApiResponse getAccount(Boolean omitZeroBalances, Long return accountApi.getAccount(omitZeroBalances, recvWindow); } + /** + * Current open orders Get all open orders on a symbol. **Careful** when accessing this with no + * symbol. Weight: 6 for a single symbol; **80** when the symbol parameter is omitted + * + * @param symbol Symbol to query (optional) + * @param recvWindow The value cannot be greater than `60000` (optional) + * @return ApiResponse<GetOpenOrdersResponse> + * @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 open orders -
+ * + * @see Current + * open orders Documentation + */ + public ApiResponse getOpenOrders(String symbol, Long recvWindow) + throws ApiException { + return accountApi.getOpenOrders(symbol, recvWindow); + } + + /** + * Query order Check an order's status. Weight: 4 + * + * @param symbol (required) + * @param orderId (optional) + * @param origClientOrderId (optional) + * @param recvWindow The value cannot be greater than `60000` (optional) + * @return ApiResponse<GetOrderResponse> + * @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 Query order -
+ * + * @see Query + * order Documentation + */ + public ApiResponse getOrder( + String symbol, Long orderId, String origClientOrderId, Long recvWindow) + throws ApiException { + return accountApi.getOrder(symbol, orderId, origClientOrderId, recvWindow); + } + + /** + * Query Order list Retrieves a specific order list based on provided optional parameters. + * Weight: 4 + * + * @param orderListId Either `orderListId` or `listClientOrderId` must be + * provided (optional) + * @param origClientOrderId (optional) + * @param recvWindow The value cannot be greater than `60000` (optional) + * @return ApiResponse<GetOrderListResponse> + * @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 Query Order list -
+ * + * @see Query + * Order list Documentation + */ + public ApiResponse getOrderList( + Long orderListId, String origClientOrderId, Long recvWindow) throws ApiException { + return accountApi.getOrderList(orderListId, origClientOrderId, recvWindow); + } + /** * Query Allocations Retrieves allocations resulting from SOR order placement. Weight: 20 * @@ -248,6 +391,28 @@ public ApiResponse myTrades( return accountApi.myTrades(symbol, orderId, startTime, endTime, fromId, limit, recvWindow); } + /** + * Query Open Order lists Weight: 6 + * + * @param recvWindow The value cannot be greater than `60000` (optional) + * @return ApiResponse<OpenOrderListResponse> + * @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 Query Open Order lists -
+ * + * @see Query + * Open Order lists Documentation + */ + public ApiResponse openOrderList(Long recvWindow) throws ApiException { + return accountApi.openOrderList(recvWindow); + } + /** * Query Order Amendments Queries all amendments of a single order. Weight: 4 * @@ -726,70 +891,6 @@ public ApiResponse uiKlines( return marketApi.uiKlines(symbol, interval, startTime, endTime, timeZone, limit); } - /** - * Query all Order lists Retrieves all order lists based on provided optional parameters. Note - * that the time between `startTime` and `endTime` can't be longer than - * 24 hours. Weight: 20 - * - * @param fromId ID to get aggregate trades from INCLUSIVE. (optional) - * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) - * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) - * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) - * @return ApiResponse<AllOrderListResponse> - * @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 Query all Order lists -
- * - * @see Query - * all Order lists Documentation - */ - public ApiResponse allOrderList( - Long fromId, Long startTime, Long endTime, Integer limit, Long recvWindow) - throws ApiException { - return tradeApi.allOrderList(fromId, startTime, endTime, limit, recvWindow); - } - - /** - * All orders Get all account orders; active, canceled, or filled. Weight: 20 - * - * @param symbol (required) - * @param orderId (optional) - * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) - * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) - * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) - * @return ApiResponse<AllOrdersResponse> - * @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 orders -
- * - * @see All - * orders Documentation - */ - public ApiResponse allOrders( - String symbol, - Long orderId, - Long startTime, - Long endTime, - Integer limit, - Long recvWindow) - throws ApiException { - return tradeApi.allOrders(symbol, orderId, startTime, endTime, limit, recvWindow); - } - /** * Cancel All Open Orders on a Symbol Cancels all active orders on a symbol. This includes * orders that are part of an order list. Weight: 1 @@ -893,85 +994,6 @@ public ApiResponse deleteOrderList( symbol, orderListId, listClientOrderId, newClientOrderId, recvWindow); } - /** - * Current open orders Get all open orders on a symbol. **Careful** when accessing this with no - * symbol. Weight: 6 for a single symbol; **80** when the symbol parameter is omitted - * - * @param symbol Symbol to query (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) - * @return ApiResponse<GetOpenOrdersResponse> - * @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 open orders -
- * - * @see Current - * open orders Documentation - */ - public ApiResponse getOpenOrders(String symbol, Long recvWindow) - throws ApiException { - return tradeApi.getOpenOrders(symbol, recvWindow); - } - - /** - * Query order Check an order's status. Weight: 4 - * - * @param symbol (required) - * @param orderId (optional) - * @param origClientOrderId (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) - * @return ApiResponse<GetOrderResponse> - * @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 Query order -
- * - * @see Query - * order Documentation - */ - public ApiResponse getOrder( - String symbol, Long orderId, String origClientOrderId, Long recvWindow) - throws ApiException { - return tradeApi.getOrder(symbol, orderId, origClientOrderId, recvWindow); - } - - /** - * Query Order list Retrieves a specific order list based on provided optional parameters. - * Weight: 4 - * - * @param orderListId Either `orderListId` or `listClientOrderId` must be - * provided (optional) - * @param origClientOrderId (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) - * @return ApiResponse<GetOrderListResponse> - * @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 Query Order list -
- * - * @see Query - * Order list Documentation - */ - public ApiResponse getOrderList( - Long orderListId, String origClientOrderId, Long recvWindow) throws ApiException { - return tradeApi.getOrderList(orderListId, origClientOrderId, recvWindow); - } - /** * New order Send in a new order. This adds 1 order to the `EXCHANGE_MAX_ORDERS` * filter and the `MAX_NUM_ORDERS` filter. Weight: 1 @@ -996,28 +1018,6 @@ public ApiResponse newOrder(NewOrderRequest newOrderRequest) return tradeApi.newOrder(newOrderRequest); } - /** - * Query Open Order lists Weight: 6 - * - * @param recvWindow The value cannot be greater than `60000` (optional) - * @return ApiResponse<OpenOrderListResponse> - * @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 Query Open Order lists -
- * - * @see Query - * Open Order lists Documentation - */ - public ApiResponse openOrderList(Long recvWindow) throws ApiException { - return tradeApi.openOrderList(recvWindow); - } - /** * Order Amend Keep Priority Reduce the quantity of an existing open order. This adds 0 orders * to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. Read @@ -1107,7 +1107,7 @@ public ApiResponse orderListOco(OrderListOcoRequest orderL } /** - * New Order list - OTO Places an OTO. * An OTO (One-Triggers-the-Other) is an order list + * New Order list - OTO Place an OTO. * An OTO (One-Triggers-the-Other) is an order list * comprised of 2 orders. * The first order is called the **working order** and must be * `LIMIT` or `LIMIT_MAKER`. Initially, only the working order goes on the * order book. * The second order is called the **pending order**. It can be any order type diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/TradeApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/TradeApi.java index b56280c9..4a0b943e 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/TradeApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/TradeApi.java @@ -20,18 +20,12 @@ 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.spot.rest.model.AllOrderListResponse; -import com.binance.connector.client.spot.rest.model.AllOrdersResponse; import com.binance.connector.client.spot.rest.model.CancelRestrictions; import com.binance.connector.client.spot.rest.model.DeleteOpenOrdersResponse; import com.binance.connector.client.spot.rest.model.DeleteOrderListResponse; import com.binance.connector.client.spot.rest.model.DeleteOrderResponse; -import com.binance.connector.client.spot.rest.model.GetOpenOrdersResponse; -import com.binance.connector.client.spot.rest.model.GetOrderListResponse; -import com.binance.connector.client.spot.rest.model.GetOrderResponse; import com.binance.connector.client.spot.rest.model.NewOrderRequest; import com.binance.connector.client.spot.rest.model.NewOrderResponse; -import com.binance.connector.client.spot.rest.model.OpenOrderListResponse; import com.binance.connector.client.spot.rest.model.OrderAmendKeepPriorityRequest; import com.binance.connector.client.spot.rest.model.OrderAmendKeepPriorityResponse; import com.binance.connector.client.spot.rest.model.OrderCancelReplaceRequest; @@ -73,7 +67,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-spot/2.0.0 (Java/%s; %s; %s)", + "binance-spot/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; @@ -111,940 +105,9 @@ public void setCustomBaseUrl(String customBaseUrl) { } /** - * Build call for allOrderList - * - * @param fromId ID to get aggregate trades from INCLUSIVE. (optional) - * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) - * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) - * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (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 Query all Order lists -
- * - * @see Query - * all Order lists Documentation - */ - private okhttp3.Call allOrderListCall( - Long fromId, Long startTime, Long endTime, Integer 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 = "/api/v3/allOrderList"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (fromId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fromId", fromId)); - } - - if (startTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); - } - - if (endTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); - } - - 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 (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call allOrderListValidateBeforeCall( - Long fromId, Long startTime, Long endTime, Integer limit, Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {fromId, startTime, endTime, limit, recvWindow}; - Method method = - this.getClass() - .getMethod( - "allOrderList", - Long.class, - Long.class, - Long.class, - Integer.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return allOrderListCall(fromId, startTime, endTime, 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 Order lists Retrieves all order lists based on provided optional parameters. Note - * that the time between `startTime` and `endTime` can't be longer than - * 24 hours. Weight: 20 - * - * @param fromId ID to get aggregate trades from INCLUSIVE. (optional) - * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) - * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) - * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) - * @return ApiResponse<AllOrderListResponse> - * @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 Query all Order lists -
- * - * @see Query - * all Order lists Documentation - */ - public ApiResponse allOrderList( - Long fromId, Long startTime, Long endTime, Integer limit, Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - allOrderListValidateBeforeCall(fromId, startTime, endTime, limit, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for allOrders - * - * @param symbol (required) - * @param orderId (optional) - * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) - * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) - * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (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 orders -
- * - * @see All - * orders Documentation - */ - private okhttp3.Call allOrdersCall( - String symbol, - Long orderId, - Long startTime, - Long endTime, - Integer 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 = "/api/v3/allOrders"; - - 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 (orderId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("orderId", orderId)); - } - - if (startTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); - } - - if (endTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); - } - - 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 (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call allOrdersValidateBeforeCall( - String symbol, - Long orderId, - Long startTime, - Long endTime, - Integer limit, - Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {symbol, orderId, startTime, endTime, limit, recvWindow}; - Method method = - this.getClass() - .getMethod( - "allOrders", - String.class, - Long.class, - Long.class, - Long.class, - Integer.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return allOrdersCall(symbol, orderId, startTime, endTime, 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()); - } - } - - /** - * All orders Get all account orders; active, canceled, or filled. Weight: 20 - * - * @param symbol (required) - * @param orderId (optional) - * @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE. (optional) - * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE. (optional) - * @param limit Default: 500; Maximum: 1000. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) - * @return ApiResponse<AllOrdersResponse> - * @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 orders -
- * - * @see All - * orders Documentation - */ - public ApiResponse allOrders( - @NotNull String symbol, - Long orderId, - Long startTime, - Long endTime, - Integer limit, - Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - allOrdersValidateBeforeCall(symbol, orderId, startTime, endTime, limit, recvWindow); - java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for deleteOpenOrders - * - * @param symbol (required) - * @param recvWindow The value cannot be greater than `60000` (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 Open Orders on a Symbol -
- * - * @see Cancel - * All Open Orders on a Symbol Documentation - */ - private okhttp3.Call deleteOpenOrdersCall(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 = "/api/v3/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)); - } - - 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 (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteOpenOrdersValidateBeforeCall(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("deleteOpenOrders", String.class, Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return deleteOpenOrdersCall(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 Open Orders on a Symbol Cancels all active orders on a symbol. This includes - * orders that are part of an order list. Weight: 1 - * - * @param symbol (required) - * @param recvWindow The value cannot be greater than `60000` (optional) - * @return ApiResponse<DeleteOpenOrdersResponse> - * @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 Open Orders on a Symbol -
- * - * @see Cancel - * All Open Orders on a Symbol Documentation - */ - public ApiResponse deleteOpenOrders( - @NotNull String symbol, Long recvWindow) throws ApiException { - okhttp3.Call localVarCall = deleteOpenOrdersValidateBeforeCall(symbol, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for deleteOrder - * - * @param symbol (required) - * @param orderId (optional) - * @param origClientOrderId (optional) - * @param newClientOrderId A unique id among open orders. Automatically generated if not - * sent.<br/> Orders with the same `newClientOrderID` can be accepted only - * when the previous one is filled, otherwise the order will be rejected. (optional) - * @param cancelRestrictions (optional) - * @param recvWindow The value cannot be greater than `60000` (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 order -
- * - * @see Cancel - * order Documentation - */ - private okhttp3.Call deleteOrderCall( - String symbol, - Long orderId, - String origClientOrderId, - String newClientOrderId, - CancelRestrictions cancelRestrictions, - 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 = "/api/v3/order"; - - 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 (orderId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("orderId", orderId)); - } - - if (origClientOrderId != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("origClientOrderId", origClientOrderId)); - } - - if (newClientOrderId != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("newClientOrderId", newClientOrderId)); - } - - if (cancelRestrictions != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("cancelRestrictions", cancelRestrictions)); - } - - 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 (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteOrderValidateBeforeCall( - String symbol, - Long orderId, - String origClientOrderId, - String newClientOrderId, - CancelRestrictions cancelRestrictions, - Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = { - symbol, orderId, origClientOrderId, newClientOrderId, cancelRestrictions, recvWindow - }; - Method method = - this.getClass() - .getMethod( - "deleteOrder", - String.class, - Long.class, - String.class, - String.class, - CancelRestrictions.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return deleteOrderCall( - symbol, - orderId, - origClientOrderId, - newClientOrderId, - cancelRestrictions, - 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 order Cancel an active order. Weight: 1 - * - * @param symbol (required) - * @param orderId (optional) - * @param origClientOrderId (optional) - * @param newClientOrderId A unique id among open orders. Automatically generated if not - * sent.<br/> Orders with the same `newClientOrderID` can be accepted only - * when the previous one is filled, otherwise the order will be rejected. (optional) - * @param cancelRestrictions (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) - * @return ApiResponse<DeleteOrderResponse> - * @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 order -
- * - * @see Cancel - * order Documentation - */ - public ApiResponse deleteOrder( - @NotNull String symbol, - Long orderId, - String origClientOrderId, - String newClientOrderId, - CancelRestrictions cancelRestrictions, - Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - deleteOrderValidateBeforeCall( - symbol, - orderId, - origClientOrderId, - newClientOrderId, - cancelRestrictions, - recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for deleteOrderList - * - * @param symbol (required) - * @param orderListId Either `orderListId` or `listClientOrderId` must be - * provided (optional) - * @param listClientOrderId A unique Id for the entire orderList (optional) - * @param newClientOrderId A unique id among open orders. Automatically generated if not - * sent.<br/> Orders with the same `newClientOrderID` can be accepted only - * when the previous one is filled, otherwise the order will be rejected. (optional) - * @param recvWindow The value cannot be greater than `60000` (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 Order list -
- * - * @see Cancel - * Order list Documentation - */ - private okhttp3.Call deleteOrderListCall( - String symbol, - Long orderListId, - String listClientOrderId, - String newClientOrderId, - 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 = "/api/v3/orderList"; - - 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 (orderListId != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("orderListId", orderListId)); - } - - if (listClientOrderId != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("listClientOrderId", listClientOrderId)); - } - - if (newClientOrderId != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("newClientOrderId", newClientOrderId)); - } - - 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 (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteOrderListValidateBeforeCall( - String symbol, - Long orderListId, - String listClientOrderId, - String newClientOrderId, - Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = { - symbol, orderListId, listClientOrderId, newClientOrderId, recvWindow - }; - Method method = - this.getClass() - .getMethod( - "deleteOrderList", - String.class, - Long.class, - String.class, - String.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return deleteOrderListCall( - symbol, orderListId, listClientOrderId, newClientOrderId, 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 Order list Cancel an entire Order list Weight: 1 + * Build call for deleteOpenOrders * * @param symbol (required) - * @param orderListId Either `orderListId` or `listClientOrderId` must be - * provided (optional) - * @param listClientOrderId A unique Id for the entire orderList (optional) - * @param newClientOrderId A unique id among open orders. Automatically generated if not - * sent.<br/> Orders with the same `newClientOrderID` can be accepted only - * when the previous one is filled, otherwise the order will be rejected. (optional) - * @param recvWindow The value cannot be greater than `60000` (optional) - * @return ApiResponse<DeleteOrderListResponse> - * @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 Order list -
- * - * @see Cancel - * Order list Documentation - */ - public ApiResponse deleteOrderList( - @NotNull String symbol, - Long orderListId, - String listClientOrderId, - String newClientOrderId, - Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - deleteOrderListValidateBeforeCall( - symbol, orderListId, listClientOrderId, newClientOrderId, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for getOpenOrders - * - * @param symbol Symbol to query (optional) * @param recvWindow The value cannot be greater than `60000` (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1052,14 +115,14 @@ public ApiResponse deleteOrderList( * * * - * + * *
Response Details
Status Code Description Response Headers
200 Current open orders -
200 Cancel All Open Orders on a Symbol -
* * @see Current - * open orders Documentation + * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-all-open-orders-on-a-symbol-trade">Cancel + * All Open Orders on a Symbol Documentation */ - private okhttp3.Call getOpenOrdersCall(String symbol, Long recvWindow) throws ApiException { + private okhttp3.Call deleteOpenOrdersCall(String symbol, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -1116,7 +179,7 @@ private okhttp3.Call getOpenOrdersCall(String symbol, Long recvWindow) throws Ap return localVarApiClient.buildCall( basePath, localVarPath, - "GET", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -1127,7 +190,7 @@ private okhttp3.Call getOpenOrdersCall(String symbol, Long recvWindow) throws Ap } @SuppressWarnings("rawtypes") - private okhttp3.Call getOpenOrdersValidateBeforeCall(String symbol, Long recvWindow) + private okhttp3.Call deleteOpenOrdersValidateBeforeCall(String symbol, Long recvWindow) throws ApiException { try { Validator validator = @@ -1139,12 +202,12 @@ private okhttp3.Call getOpenOrdersValidateBeforeCall(String symbol, Long recvWin ExecutableValidator executableValidator = validator.forExecutables(); Object[] parameterValues = {symbol, recvWindow}; - Method method = this.getClass().getMethod("getOpenOrders", String.class, Long.class); + Method method = this.getClass().getMethod("deleteOpenOrders", String.class, Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getOpenOrdersCall(symbol, recvWindow); + return deleteOpenOrdersCall(symbol, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -1158,39 +221,43 @@ private okhttp3.Call getOpenOrdersValidateBeforeCall(String symbol, Long recvWin } /** - * Current open orders Get all open orders on a symbol. **Careful** when accessing this with no - * symbol. Weight: 6 for a single symbol; **80** when the symbol parameter is omitted + * Cancel All Open Orders on a Symbol Cancels all active orders on a symbol. This includes + * orders that are part of an order list. Weight: 1 * - * @param symbol Symbol to query (optional) + * @param symbol (required) * @param recvWindow The value cannot be greater than `60000` (optional) - * @return ApiResponse<GetOpenOrdersResponse> + * @return ApiResponse<DeleteOpenOrdersResponse> * @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 open orders -
200 Cancel All Open Orders on a Symbol -
* * @see Current - * open orders Documentation + * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-all-open-orders-on-a-symbol-trade">Cancel + * All Open Orders on a Symbol Documentation */ - public ApiResponse getOpenOrders(String symbol, Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = getOpenOrdersValidateBeforeCall(symbol, recvWindow); + public ApiResponse deleteOpenOrders( + @NotNull String symbol, Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = deleteOpenOrdersValidateBeforeCall(symbol, recvWindow); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for getOrder + * Build call for deleteOrder * * @param symbol (required) * @param orderId (optional) * @param origClientOrderId (optional) + * @param newClientOrderId A unique id among open orders. Automatically generated if not + * sent.<br/> Orders with the same `newClientOrderID` can be accepted only + * when the previous one is filled, otherwise the order will be rejected. (optional) + * @param cancelRestrictions (optional) * @param recvWindow The value cannot be greater than `60000` (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1198,15 +265,20 @@ public ApiResponse getOpenOrders(String symbol, Long recv * * * - * + * *
Response Details
Status Code Description Response Headers
200 Query order -
200 Cancel order -
* * @see Query + * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-order-trade">Cancel * order Documentation */ - private okhttp3.Call getOrderCall( - String symbol, Long orderId, String origClientOrderId, Long recvWindow) + private okhttp3.Call deleteOrderCall( + String symbol, + Long orderId, + String origClientOrderId, + String newClientOrderId, + CancelRestrictions cancelRestrictions, + Long recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -1245,6 +317,16 @@ private okhttp3.Call getOrderCall( localVarApiClient.parameterToPair("origClientOrderId", origClientOrderId)); } + if (newClientOrderId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("newClientOrderId", newClientOrderId)); + } + + if (cancelRestrictions != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("cancelRestrictions", cancelRestrictions)); + } + if (recvWindow != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); } @@ -1273,7 +355,7 @@ private okhttp3.Call getOrderCall( return localVarApiClient.buildCall( basePath, localVarPath, - "GET", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -1284,8 +366,13 @@ private okhttp3.Call getOrderCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getOrderValidateBeforeCall( - String symbol, Long orderId, String origClientOrderId, Long recvWindow) + private okhttp3.Call deleteOrderValidateBeforeCall( + String symbol, + Long orderId, + String origClientOrderId, + String newClientOrderId, + CancelRestrictions cancelRestrictions, + Long recvWindow) throws ApiException { try { Validator validator = @@ -1296,16 +383,30 @@ private okhttp3.Call getOrderValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {symbol, orderId, origClientOrderId, recvWindow}; + Object[] parameterValues = { + symbol, orderId, origClientOrderId, newClientOrderId, cancelRestrictions, recvWindow + }; Method method = this.getClass() .getMethod( - "getOrder", String.class, Long.class, String.class, Long.class); + "deleteOrder", + String.class, + Long.class, + String.class, + String.class, + CancelRestrictions.class, + Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getOrderCall(symbol, orderId, origClientOrderId, recvWindow); + return deleteOrderCall( + symbol, + orderId, + origClientOrderId, + newClientOrderId, + cancelRestrictions, + recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -1319,41 +420,61 @@ private okhttp3.Call getOrderValidateBeforeCall( } /** - * Query order Check an order's status. Weight: 4 + * Cancel order Cancel an active order. Weight: 1 * * @param symbol (required) * @param orderId (optional) * @param origClientOrderId (optional) + * @param newClientOrderId A unique id among open orders. Automatically generated if not + * sent.<br/> Orders with the same `newClientOrderID` can be accepted only + * when the previous one is filled, otherwise the order will be rejected. (optional) + * @param cancelRestrictions (optional) * @param recvWindow The value cannot be greater than `60000` (optional) - * @return ApiResponse<GetOrderResponse> + * @return ApiResponse<DeleteOrderResponse> * @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 Query order -
200 Cancel order -
* * @see Query + * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-order-trade">Cancel * order Documentation */ - public ApiResponse getOrder( - @NotNull String symbol, Long orderId, String origClientOrderId, Long recvWindow) + public ApiResponse deleteOrder( + @NotNull String symbol, + Long orderId, + String origClientOrderId, + String newClientOrderId, + CancelRestrictions cancelRestrictions, + Long recvWindow) throws ApiException { okhttp3.Call localVarCall = - getOrderValidateBeforeCall(symbol, orderId, origClientOrderId, recvWindow); - java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); + deleteOrderValidateBeforeCall( + symbol, + orderId, + origClientOrderId, + newClientOrderId, + cancelRestrictions, + recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for getOrderList + * Build call for deleteOrderList * + * @param symbol (required) * @param orderListId Either `orderListId` or `listClientOrderId` must be * provided (optional) - * @param origClientOrderId (optional) + * @param listClientOrderId A unique Id for the entire orderList (optional) + * @param newClientOrderId A unique id among open orders. Automatically generated if not + * sent.<br/> Orders with the same `newClientOrderID` can be accepted only + * when the previous one is filled, otherwise the order will be rejected. (optional) * @param recvWindow The value cannot be greater than `60000` (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1361,15 +482,20 @@ public ApiResponse getOrder( * * * - * + * *
Response Details
Status Code Description Response Headers
200 Query Order list -
200 Cancel Order list -
* * @see Query + * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-order-list-trade">Cancel * Order list Documentation */ - private okhttp3.Call getOrderListCall( - Long orderListId, String origClientOrderId, Long recvWindow) throws ApiException { + private okhttp3.Call deleteOrderListCall( + String symbol, + Long orderListId, + String listClientOrderId, + String newClientOrderId, + Long recvWindow) + throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -1394,14 +520,23 @@ private okhttp3.Call getOrderListCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (symbol != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); + } + if (orderListId != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair("orderListId", orderListId)); } - if (origClientOrderId != null) { + if (listClientOrderId != null) { localVarQueryParams.addAll( - localVarApiClient.parameterToPair("origClientOrderId", origClientOrderId)); + localVarApiClient.parameterToPair("listClientOrderId", listClientOrderId)); + } + + if (newClientOrderId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("newClientOrderId", newClientOrderId)); } if (recvWindow != null) { @@ -1432,7 +567,7 @@ private okhttp3.Call getOrderListCall( return localVarApiClient.buildCall( basePath, localVarPath, - "GET", + "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -1443,8 +578,13 @@ private okhttp3.Call getOrderListCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getOrderListValidateBeforeCall( - Long orderListId, String origClientOrderId, Long recvWindow) throws ApiException { + private okhttp3.Call deleteOrderListValidateBeforeCall( + String symbol, + Long orderListId, + String listClientOrderId, + String newClientOrderId, + Long recvWindow) + throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -1454,14 +594,24 @@ private okhttp3.Call getOrderListValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {orderListId, origClientOrderId, recvWindow}; + Object[] parameterValues = { + symbol, orderListId, listClientOrderId, newClientOrderId, recvWindow + }; Method method = - this.getClass().getMethod("getOrderList", Long.class, String.class, Long.class); + this.getClass() + .getMethod( + "deleteOrderList", + String.class, + Long.class, + String.class, + String.class, + Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getOrderListCall(orderListId, origClientOrderId, recvWindow); + return deleteOrderListCall( + symbol, orderListId, listClientOrderId, newClientOrderId, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -1475,33 +625,42 @@ private okhttp3.Call getOrderListValidateBeforeCall( } /** - * Query Order list Retrieves a specific order list based on provided optional parameters. - * Weight: 4 + * Cancel Order list Cancel an entire Order list Weight: 1 * + * @param symbol (required) * @param orderListId Either `orderListId` or `listClientOrderId` must be * provided (optional) - * @param origClientOrderId (optional) + * @param listClientOrderId A unique Id for the entire orderList (optional) + * @param newClientOrderId A unique id among open orders. Automatically generated if not + * sent.<br/> Orders with the same `newClientOrderID` can be accepted only + * when the previous one is filled, otherwise the order will be rejected. (optional) * @param recvWindow The value cannot be greater than `60000` (optional) - * @return ApiResponse<GetOrderListResponse> + * @return ApiResponse<DeleteOrderListResponse> * @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 Query Order list -
200 Cancel Order list -
* * @see Query + * href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-order-list-trade">Cancel * Order list Documentation */ - public ApiResponse getOrderList( - Long orderListId, String origClientOrderId, Long recvWindow) throws ApiException { + public ApiResponse deleteOrderList( + @NotNull String symbol, + Long orderListId, + String listClientOrderId, + String newClientOrderId, + Long recvWindow) + throws ApiException { okhttp3.Call localVarCall = - getOrderListValidateBeforeCall(orderListId, origClientOrderId, recvWindow); + deleteOrderListValidateBeforeCall( + symbol, orderListId, listClientOrderId, newClientOrderId, recvWindow); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1712,141 +871,6 @@ public ApiResponse newOrder(@Valid @NotNull NewOrderRequest ne return localVarApiClient.execute(localVarCall, localVarReturnType); } - /** - * Build call for openOrderList - * - * @param recvWindow The value cannot be greater than `60000` (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 Query Open Order lists -
- * - * @see Query - * Open Order lists Documentation - */ - private okhttp3.Call openOrderListCall(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 = "/api/v3/openOrderList"; - - 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 (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - List localVarAuthNames = new ArrayList<>(); - localVarAuthNames.addAll( - Arrays.asList( - new String[] { - "binanceSignature", - })); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames.toArray(new String[0])); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call openOrderListValidateBeforeCall(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("openOrderList", Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return openOrderListCall(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 Open Order lists Weight: 6 - * - * @param recvWindow The value cannot be greater than `60000` (optional) - * @return ApiResponse<OpenOrderListResponse> - * @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 Query Open Order lists -
- * - * @see Query - * Open Order lists Documentation - */ - public ApiResponse openOrderList(Long recvWindow) throws ApiException { - okhttp3.Call localVarCall = openOrderListValidateBeforeCall(recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - /** * Build call for orderAmendKeepPriority * @@ -2777,7 +1801,7 @@ private okhttp3.Call orderListOtoValidateBeforeCall(OrderListOtoRequest orderLis } /** - * New Order list - OTO Places an OTO. * An OTO (One-Triggers-the-Other) is an order list + * New Order list - OTO Place an OTO. * An OTO (One-Triggers-the-Other) is an order list * comprised of 2 orders. * The first order is called the **working order** and must be * `LIMIT` or `LIMIT_MAKER`. Initially, only the working order goes on the * order book. * The second order is called the **pending order**. It can be any order type diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/UserDataStreamApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/UserDataStreamApi.java index 56647c2a..2f09abfe 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/UserDataStreamApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/UserDataStreamApi.java @@ -44,7 +44,7 @@ public class UserDataStreamApi { private static final String USER_AGENT = String.format( - "binance-spot/2.0.0 (Java/%s; %s; %s)", + "binance-spot/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponse.java index 3bdcbd8e..0a1c14ad 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponse.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AccountCommissionResponse */ @@ -262,18 +260,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AccountCommissionResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountCommissionResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountCommissionResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponseDiscount.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponseDiscount.java index 2d4e6431..b6ed3d8e 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponseDiscount.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponseDiscount.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AccountCommissionResponseDiscount */ @@ -257,18 +255,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountCommissionResponseDiscount.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountCommissionResponseDiscount` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("discountAsset") != null && !jsonObj.get("discountAsset").isJsonNull()) && !jsonObj.get("discountAsset").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponseStandardCommission.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponseStandardCommission.java index b02f44b2..d9289bb2 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponseStandardCommission.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponseStandardCommission.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AccountCommissionResponseStandardCommission */ @@ -253,20 +251,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountCommissionResponseStandardCommission.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountCommissionResponseStandardCommission` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("maker") != null && !jsonObj.get("maker").isJsonNull()) && !jsonObj.get("maker").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponseTaxCommission.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponseTaxCommission.java index 9d1375e3..144fe3bb 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponseTaxCommission.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AccountCommissionResponseTaxCommission.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AccountCommissionResponseTaxCommission */ @@ -249,19 +247,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountCommissionResponseTaxCommission.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountCommissionResponseTaxCommission` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("maker") != null && !jsonObj.get("maker").isJsonNull()) && !jsonObj.get("maker").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AggTradesResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AggTradesResponse.java index 938389e7..bede1b26 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AggTradesResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AggTradesResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** AggTradesResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to AggTradesResponse */ 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) { + AggTradesResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!AggTradesResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AggTradesResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AggTradesResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AggTradesResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AggTradesResponseInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AggTradesResponseInner.java index 3407d2dd..89262ff8 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AggTradesResponseInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AggTradesResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AggTradesResponseInner */ @@ -374,18 +372,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AggTradesResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AggTradesResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AggTradesResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) && !jsonObj.get("p").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrderListResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrderListResponse.java index b77f3916..3ac89a04 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrderListResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrderListResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** AllOrderListResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to AllOrderListResponse */ 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) { + AllOrderListResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!AllOrderListResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AllOrderListResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AllOrderListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AllOrderListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrderListResponseInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrderListResponseInner.java index 7851a4e2..d439328d 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrderListResponseInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrderListResponseInner.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -410,18 +408,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AllOrderListResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AllOrderListResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AllOrderListResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) && !jsonObj.get("contingencyType").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrderListResponseInnerOrdersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrderListResponseInnerOrdersInner.java index 32d25862..227d8f72 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrderListResponseInnerOrdersInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrderListResponseInnerOrdersInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AllOrderListResponseInnerOrdersInner */ @@ -218,19 +216,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AllOrderListResponseInnerOrdersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AllOrderListResponseInnerOrdersInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrdersResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrdersResponse.java index 2d7e5ef9..5ff959d6 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrdersResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** AllOrdersResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to AllOrdersResponse */ 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) { + AllOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!AllOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AllOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AllOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AllOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrdersResponseInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrdersResponseInner.java index d8adf8d5..14c48f0d 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrdersResponseInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AllOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AllOrdersResponseInner */ @@ -795,18 +793,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AllOrdersResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AllOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AllOrdersResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AvgPriceResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AvgPriceResponse.java index 28c655d3..adc6640a 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AvgPriceResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/AvgPriceResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** AvgPriceResponse */ @@ -213,18 +211,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti AvgPriceResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AvgPriceResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AvgPriceResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) && !jsonObj.get("price").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOpenOrdersResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOpenOrdersResponse.java index 3b158e73..15fc50dc 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOpenOrdersResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOpenOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** DeleteOpenOrdersResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to DeleteOpenOrdersResponse */ 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) { + DeleteOpenOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!DeleteOpenOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti DeleteOpenOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DeleteOpenOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DeleteOpenOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOpenOrdersResponseInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOpenOrdersResponseInner.java index a637ca22..7190adfe 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOpenOrdersResponseInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOpenOrdersResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** DeleteOpenOrdersResponseInner */ @@ -92,6 +90,12 @@ public class DeleteOpenOrdersResponseInner { @jakarta.annotation.Nullable private String executedQty; + public static final String SERIALIZED_NAME_ORIG_QUOTE_ORDER_QTY = "origQuoteOrderQty"; + + @SerializedName(SERIALIZED_NAME_ORIG_QUOTE_ORDER_QTY) + @jakarta.annotation.Nullable + private String origQuoteOrderQty; + public static final String SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY = "cummulativeQuoteQty"; @SerializedName(SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY) @@ -307,6 +311,26 @@ public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { this.executedQty = executedQty; } + public DeleteOpenOrdersResponseInner origQuoteOrderQty( + @jakarta.annotation.Nullable String origQuoteOrderQty) { + this.origQuoteOrderQty = origQuoteOrderQty; + return this; + } + + /** + * Get origQuoteOrderQty + * + * @return origQuoteOrderQty + */ + @jakarta.annotation.Nullable + public String getOrigQuoteOrderQty() { + return origQuoteOrderQty; + } + + public void setOrigQuoteOrderQty(@jakarta.annotation.Nullable String origQuoteOrderQty) { + this.origQuoteOrderQty = origQuoteOrderQty; + } + public DeleteOpenOrdersResponseInner cummulativeQuoteQty( @jakarta.annotation.Nullable String cummulativeQuoteQty) { this.cummulativeQuoteQty = cummulativeQuoteQty; @@ -445,6 +469,8 @@ public boolean equals(Object o) { && Objects.equals(this.price, deleteOpenOrdersResponseInner.price) && Objects.equals(this.origQty, deleteOpenOrdersResponseInner.origQty) && Objects.equals(this.executedQty, deleteOpenOrdersResponseInner.executedQty) + && Objects.equals( + this.origQuoteOrderQty, deleteOpenOrdersResponseInner.origQuoteOrderQty) && Objects.equals( this.cummulativeQuoteQty, deleteOpenOrdersResponseInner.cummulativeQuoteQty) && Objects.equals(this.status, deleteOpenOrdersResponseInner.status) @@ -468,6 +494,7 @@ public int hashCode() { price, origQty, executedQty, + origQuoteOrderQty, cummulativeQuoteQty, status, timeInForce, @@ -489,6 +516,7 @@ public String toString() { sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" origQty: ").append(toIndentedString(origQty)).append("\n"); sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); + sb.append(" origQuoteOrderQty: ").append(toIndentedString(origQuoteOrderQty)).append("\n"); sb.append(" cummulativeQuoteQty: ") .append(toIndentedString(cummulativeQuoteQty)) .append("\n"); @@ -544,6 +572,12 @@ public String toUrlQueryString() { String executedQtyValueAsString = ""; executedQtyValueAsString = executedQtyValue.toString(); sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); + Object origQuoteOrderQtyValue = getOrigQuoteOrderQty(); + String origQuoteOrderQtyValueAsString = ""; + origQuoteOrderQtyValueAsString = origQuoteOrderQtyValue.toString(); + sb.append("origQuoteOrderQty=") + .append(urlEncode(origQuoteOrderQtyValueAsString)) + .append(""); Object cummulativeQuoteQtyValue = getCummulativeQuoteQty(); String cummulativeQuoteQtyValueAsString = ""; cummulativeQuoteQtyValueAsString = cummulativeQuoteQtyValue.toString(); @@ -609,6 +643,7 @@ private String toIndentedString(Object o) { openapiFields.add("price"); openapiFields.add("origQty"); openapiFields.add("executedQty"); + openapiFields.add("origQuoteOrderQty"); openapiFields.add("cummulativeQuoteQty"); openapiFields.add("status"); openapiFields.add("timeInForce"); @@ -638,18 +673,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti DeleteOpenOrdersResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DeleteOpenOrdersResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DeleteOpenOrdersResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { @@ -700,6 +723,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("executedQty").toString())); } + if ((jsonObj.get("origQuoteOrderQty") != null + && !jsonObj.get("origQuoteOrderQty").isJsonNull()) + && !jsonObj.get("origQuoteOrderQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origQuoteOrderQty` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("origQuoteOrderQty").toString())); + } if ((jsonObj.get("cummulativeQuoteQty") != null && !jsonObj.get("cummulativeQuoteQty").isJsonNull()) && !jsonObj.get("cummulativeQuoteQty").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOrderListResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOrderListResponse.java index 98f1e573..77cb6563 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOrderListResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOrderListResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -458,18 +456,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti DeleteOrderListResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DeleteOrderListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DeleteOrderListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) && !jsonObj.get("contingencyType").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOrderListResponseOrderReportsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOrderListResponseOrderReportsInner.java index ff8ba683..1bcff7e3 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOrderListResponseOrderReportsInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOrderListResponseOrderReportsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** DeleteOrderListResponseOrderReportsInner */ @@ -725,19 +723,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DeleteOrderListResponseOrderReportsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DeleteOrderListResponseOrderReportsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOrderListResponseOrdersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOrderListResponseOrdersInner.java index 6fcf168e..2efe5296 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOrderListResponseOrdersInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOrderListResponseOrdersInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** DeleteOrderListResponseOrdersInner */ @@ -218,18 +216,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DeleteOrderListResponseOrdersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DeleteOrderListResponseOrdersInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOrderResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOrderResponse.java index 940354e4..02341a98 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOrderResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DeleteOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** DeleteOrderResponse */ @@ -92,6 +90,12 @@ public class DeleteOrderResponse { @jakarta.annotation.Nullable private String executedQty; + public static final String SERIALIZED_NAME_ORIG_QUOTE_ORDER_QTY = "origQuoteOrderQty"; + + @SerializedName(SERIALIZED_NAME_ORIG_QUOTE_ORDER_QTY) + @jakarta.annotation.Nullable + private String origQuoteOrderQty; + public static final String SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY = "cummulativeQuoteQty"; @SerializedName(SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY) @@ -303,6 +307,26 @@ public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { this.executedQty = executedQty; } + public DeleteOrderResponse origQuoteOrderQty( + @jakarta.annotation.Nullable String origQuoteOrderQty) { + this.origQuoteOrderQty = origQuoteOrderQty; + return this; + } + + /** + * Get origQuoteOrderQty + * + * @return origQuoteOrderQty + */ + @jakarta.annotation.Nullable + public String getOrigQuoteOrderQty() { + return origQuoteOrderQty; + } + + public void setOrigQuoteOrderQty(@jakarta.annotation.Nullable String origQuoteOrderQty) { + this.origQuoteOrderQty = origQuoteOrderQty; + } + public DeleteOrderResponse cummulativeQuoteQty( @jakarta.annotation.Nullable String cummulativeQuoteQty) { this.cummulativeQuoteQty = cummulativeQuoteQty; @@ -438,6 +462,7 @@ public boolean equals(Object o) { && Objects.equals(this.price, deleteOrderResponse.price) && Objects.equals(this.origQty, deleteOrderResponse.origQty) && Objects.equals(this.executedQty, deleteOrderResponse.executedQty) + && Objects.equals(this.origQuoteOrderQty, deleteOrderResponse.origQuoteOrderQty) && Objects.equals(this.cummulativeQuoteQty, deleteOrderResponse.cummulativeQuoteQty) && Objects.equals(this.status, deleteOrderResponse.status) && Objects.equals(this.timeInForce, deleteOrderResponse.timeInForce) @@ -459,6 +484,7 @@ public int hashCode() { price, origQty, executedQty, + origQuoteOrderQty, cummulativeQuoteQty, status, timeInForce, @@ -480,6 +506,7 @@ public String toString() { sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" origQty: ").append(toIndentedString(origQty)).append("\n"); sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); + sb.append(" origQuoteOrderQty: ").append(toIndentedString(origQuoteOrderQty)).append("\n"); sb.append(" cummulativeQuoteQty: ") .append(toIndentedString(cummulativeQuoteQty)) .append("\n"); @@ -535,6 +562,12 @@ public String toUrlQueryString() { String executedQtyValueAsString = ""; executedQtyValueAsString = executedQtyValue.toString(); sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); + Object origQuoteOrderQtyValue = getOrigQuoteOrderQty(); + String origQuoteOrderQtyValueAsString = ""; + origQuoteOrderQtyValueAsString = origQuoteOrderQtyValue.toString(); + sb.append("origQuoteOrderQty=") + .append(urlEncode(origQuoteOrderQtyValueAsString)) + .append(""); Object cummulativeQuoteQtyValue = getCummulativeQuoteQty(); String cummulativeQuoteQtyValueAsString = ""; cummulativeQuoteQtyValueAsString = cummulativeQuoteQtyValue.toString(); @@ -600,6 +633,7 @@ private String toIndentedString(Object o) { openapiFields.add("price"); openapiFields.add("origQty"); openapiFields.add("executedQty"); + openapiFields.add("origQuoteOrderQty"); openapiFields.add("cummulativeQuoteQty"); openapiFields.add("status"); openapiFields.add("timeInForce"); @@ -628,18 +662,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti DeleteOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DeleteOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DeleteOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { @@ -690,6 +712,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("executedQty").toString())); } + if ((jsonObj.get("origQuoteOrderQty") != null + && !jsonObj.get("origQuoteOrderQty").isJsonNull()) + && !jsonObj.get("origQuoteOrderQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origQuoteOrderQty` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("origQuoteOrderQty").toString())); + } if ((jsonObj.get("cummulativeQuoteQty") != null && !jsonObj.get("cummulativeQuoteQty").isJsonNull()) && !jsonObj.get("cummulativeQuoteQty").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DepthResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DepthResponse.java index 0c5e7122..4b648409 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DepthResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/DepthResponse.java @@ -32,9 +32,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -242,18 +240,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti DepthResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DepthResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DepthResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the optional json data is an array if present if (jsonObj.get("bids") != null diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeFilters.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeFilters.java new file mode 100644 index 00000000..65ea0db6 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeFilters.java @@ -0,0 +1,183 @@ +/* + * 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.spot.rest.model; + +import com.binance.connector.client.spot.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.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.*; + +/** ExchangeFilters */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExchangeFilters extends ArrayList { + public ExchangeFilters() {} + + @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 ExchangeFilters {\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 ExchangeFilters + */ + 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) { + ExchangeFiltersInner.validateJsonElement(element); + } + if (jsonElement == null) { + if (!ExchangeFilters.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExchangeFilters is not found in the" + + " empty JSON string", + ExchangeFilters.openapiRequiredFields.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExchangeFilters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeFilters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ExchangeFilters.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExchangeFilters value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExchangeFilters read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExchangeFilters given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExchangeFilters + * @throws IOException if the JSON string is invalid with respect to ExchangeFilters + */ + public static ExchangeFilters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeFilters.class); + } + + /** + * Convert an instance of ExchangeFilters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponseExchangeFiltersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeFiltersInner.java similarity index 81% rename from clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponseExchangeFiltersInner.java rename to clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeFiltersInner.java index 941a80ab..fcc8b0e4 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponseExchangeFiltersInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeFiltersInner.java @@ -28,69 +28,79 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; -/** ExchangeInfoResponseExchangeFiltersInner */ +/** ExchangeFiltersInner */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class ExchangeInfoResponseExchangeFiltersInner { +public class ExchangeFiltersInner { public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; @SerializedName(SERIALIZED_NAME_FILTER_TYPE) @jakarta.annotation.Nullable private String filterType; - public static final String SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS = "maxNumIcebergOrders"; + public static final String SERIALIZED_NAME_MIN_PRICE = "minPrice"; - @SerializedName(SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS) + @SerializedName(SERIALIZED_NAME_MIN_PRICE) @jakarta.annotation.Nullable - private Long maxNumIcebergOrders; + private String minPrice; - public static final String SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS = "maxNumAlgoOrders"; + public static final String SERIALIZED_NAME_MAX_PRICE = "maxPrice"; - @SerializedName(SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS) + @SerializedName(SERIALIZED_NAME_MAX_PRICE) @jakarta.annotation.Nullable - private Long maxNumAlgoOrders; + private String maxPrice; - public static final String SERIALIZED_NAME_MAX_NUM_ORDERS = "maxNumOrders"; + public static final String SERIALIZED_NAME_TICK_SIZE = "tickSize"; - @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDERS) + @SerializedName(SERIALIZED_NAME_TICK_SIZE) @jakarta.annotation.Nullable - private Long maxNumOrders; + private String tickSize; - public static final String SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA = "minTrailingAboveDelta"; + public static final String SERIALIZED_NAME_MULTIPLIER_UP = "multiplierUp"; - @SerializedName(SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA) + @SerializedName(SERIALIZED_NAME_MULTIPLIER_UP) @jakarta.annotation.Nullable - private Long minTrailingAboveDelta; + private String multiplierUp; - public static final String SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA = "maxTrailingAboveDelta"; + public static final String SERIALIZED_NAME_MULTIPLIER_DOWN = "multiplierDown"; - @SerializedName(SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA) + @SerializedName(SERIALIZED_NAME_MULTIPLIER_DOWN) @jakarta.annotation.Nullable - private Long maxTrailingAboveDelta; + private String multiplierDown; - public static final String SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA = "minTrailingBelowDelta"; + public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; - @SerializedName(SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA) + @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) @jakarta.annotation.Nullable - private Long minTrailingBelowDelta; + private Long avgPriceMins; - public static final String SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA = "maxTrailingBelowDelta"; + public static final String SERIALIZED_NAME_BID_MULTIPLIER_UP = "bidMultiplierUp"; - @SerializedName(SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA) + @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_UP) @jakarta.annotation.Nullable - private Long maxTrailingBelowDelta; + private String bidMultiplierUp; - public static final String SERIALIZED_NAME_MAX_POSITION = "maxPosition"; + public static final String SERIALIZED_NAME_BID_MULTIPLIER_DOWN = "bidMultiplierDown"; - @SerializedName(SERIALIZED_NAME_MAX_POSITION) + @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_DOWN) @jakarta.annotation.Nullable - private String maxPosition; + private String bidMultiplierDown; + + public static final String SERIALIZED_NAME_ASK_MULTIPLIER_UP = "askMultiplierUp"; + + @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_UP) + @jakarta.annotation.Nullable + private String askMultiplierUp; + + public static final String SERIALIZED_NAME_ASK_MULTIPLIER_DOWN = "askMultiplierDown"; + + @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_DOWN) + @jakarta.annotation.Nullable + private String askMultiplierDown; public static final String SERIALIZED_NAME_MIN_QTY = "minQty"; @@ -110,18 +120,18 @@ public class ExchangeInfoResponseExchangeFiltersInner { @jakarta.annotation.Nullable private String stepSize; - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - @jakarta.annotation.Nullable - private Long limit; - public static final String SERIALIZED_NAME_MIN_NOTIONAL = "minNotional"; @SerializedName(SERIALIZED_NAME_MIN_NOTIONAL) @jakarta.annotation.Nullable private String minNotional; + public static final String SERIALIZED_NAME_APPLY_TO_MARKET = "applyToMarket"; + + @SerializedName(SERIALIZED_NAME_APPLY_TO_MARKET) + @jakarta.annotation.Nullable + private Boolean applyToMarket; + public static final String SERIALIZED_NAME_APPLY_MIN_TO_MARKET = "applyMinToMarket"; @SerializedName(SERIALIZED_NAME_APPLY_MIN_TO_MARKET) @@ -140,76 +150,63 @@ public class ExchangeInfoResponseExchangeFiltersInner { @jakarta.annotation.Nullable private Boolean applyMaxToMarket; - public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; - - @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) - @jakarta.annotation.Nullable - private Long avgPriceMins; - - public static final String SERIALIZED_NAME_APPLY_TO_MARKET = "applyToMarket"; - - @SerializedName(SERIALIZED_NAME_APPLY_TO_MARKET) - @jakarta.annotation.Nullable - private Boolean applyToMarket; - - public static final String SERIALIZED_NAME_BID_MULTIPLIER_UP = "bidMultiplierUp"; + public static final String SERIALIZED_NAME_LIMIT = "limit"; - @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_UP) + @SerializedName(SERIALIZED_NAME_LIMIT) @jakarta.annotation.Nullable - private String bidMultiplierUp; + private Long limit; - public static final String SERIALIZED_NAME_BID_MULTIPLIER_DOWN = "bidMultiplierDown"; + public static final String SERIALIZED_NAME_MAX_NUM_ORDERS = "maxNumOrders"; - @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_DOWN) + @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDERS) @jakarta.annotation.Nullable - private String bidMultiplierDown; + private Long maxNumOrders; - public static final String SERIALIZED_NAME_ASK_MULTIPLIER_UP = "askMultiplierUp"; + public static final String SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS = "maxNumAlgoOrders"; - @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_UP) + @SerializedName(SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS) @jakarta.annotation.Nullable - private String askMultiplierUp; + private Long maxNumAlgoOrders; - public static final String SERIALIZED_NAME_ASK_MULTIPLIER_DOWN = "askMultiplierDown"; + public static final String SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS = "maxNumIcebergOrders"; - @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_DOWN) + @SerializedName(SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS) @jakarta.annotation.Nullable - private String askMultiplierDown; + private Long maxNumIcebergOrders; - public static final String SERIALIZED_NAME_MULTIPLIER_UP = "multiplierUp"; + public static final String SERIALIZED_NAME_MAX_POSITION = "maxPosition"; - @SerializedName(SERIALIZED_NAME_MULTIPLIER_UP) + @SerializedName(SERIALIZED_NAME_MAX_POSITION) @jakarta.annotation.Nullable - private String multiplierUp; + private String maxPosition; - public static final String SERIALIZED_NAME_MULTIPLIER_DOWN = "multiplierDown"; + public static final String SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA = "minTrailingAboveDelta"; - @SerializedName(SERIALIZED_NAME_MULTIPLIER_DOWN) + @SerializedName(SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA) @jakarta.annotation.Nullable - private String multiplierDown; + private Long minTrailingAboveDelta; - public static final String SERIALIZED_NAME_MIN_PRICE = "minPrice"; + public static final String SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA = "maxTrailingAboveDelta"; - @SerializedName(SERIALIZED_NAME_MIN_PRICE) + @SerializedName(SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA) @jakarta.annotation.Nullable - private String minPrice; + private Long maxTrailingAboveDelta; - public static final String SERIALIZED_NAME_MAX_PRICE = "maxPrice"; + public static final String SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA = "minTrailingBelowDelta"; - @SerializedName(SERIALIZED_NAME_MAX_PRICE) + @SerializedName(SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA) @jakarta.annotation.Nullable - private String maxPrice; + private Long minTrailingBelowDelta; - public static final String SERIALIZED_NAME_TICK_SIZE = "tickSize"; + public static final String SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA = "maxTrailingBelowDelta"; - @SerializedName(SERIALIZED_NAME_TICK_SIZE) + @SerializedName(SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA) @jakarta.annotation.Nullable - private String tickSize; + private Long maxTrailingBelowDelta; - public ExchangeInfoResponseExchangeFiltersInner() {} + public ExchangeFiltersInner() {} - public ExchangeInfoResponseExchangeFiltersInner filterType( - @jakarta.annotation.Nullable String filterType) { + public ExchangeFiltersInner filterType(@jakarta.annotation.Nullable String filterType) { this.filterType = filterType; return this; } @@ -228,168 +225,201 @@ public void setFilterType(@jakarta.annotation.Nullable String filterType) { this.filterType = filterType; } - public ExchangeInfoResponseExchangeFiltersInner maxNumIcebergOrders( - @jakarta.annotation.Nullable Long maxNumIcebergOrders) { - this.maxNumIcebergOrders = maxNumIcebergOrders; + public ExchangeFiltersInner minPrice(@jakarta.annotation.Nullable String minPrice) { + this.minPrice = minPrice; return this; } /** - * Get maxNumIcebergOrders + * Get minPrice * - * @return maxNumIcebergOrders + * @return minPrice */ @jakarta.annotation.Nullable - public Long getMaxNumIcebergOrders() { - return maxNumIcebergOrders; + public String getMinPrice() { + return minPrice; } - public void setMaxNumIcebergOrders(@jakarta.annotation.Nullable Long maxNumIcebergOrders) { - this.maxNumIcebergOrders = maxNumIcebergOrders; + public void setMinPrice(@jakarta.annotation.Nullable String minPrice) { + this.minPrice = minPrice; } - public ExchangeInfoResponseExchangeFiltersInner maxNumAlgoOrders( - @jakarta.annotation.Nullable Long maxNumAlgoOrders) { - this.maxNumAlgoOrders = maxNumAlgoOrders; + public ExchangeFiltersInner maxPrice(@jakarta.annotation.Nullable String maxPrice) { + this.maxPrice = maxPrice; return this; } /** - * Get maxNumAlgoOrders + * Get maxPrice * - * @return maxNumAlgoOrders + * @return maxPrice */ @jakarta.annotation.Nullable - public Long getMaxNumAlgoOrders() { - return maxNumAlgoOrders; + public String getMaxPrice() { + return maxPrice; } - public void setMaxNumAlgoOrders(@jakarta.annotation.Nullable Long maxNumAlgoOrders) { - this.maxNumAlgoOrders = maxNumAlgoOrders; + public void setMaxPrice(@jakarta.annotation.Nullable String maxPrice) { + this.maxPrice = maxPrice; } - public ExchangeInfoResponseExchangeFiltersInner maxNumOrders( - @jakarta.annotation.Nullable Long maxNumOrders) { - this.maxNumOrders = maxNumOrders; + public ExchangeFiltersInner tickSize(@jakarta.annotation.Nullable String tickSize) { + this.tickSize = tickSize; return this; } /** - * Get maxNumOrders + * Get tickSize * - * @return maxNumOrders + * @return tickSize */ @jakarta.annotation.Nullable - public Long getMaxNumOrders() { - return maxNumOrders; + public String getTickSize() { + return tickSize; } - public void setMaxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { - this.maxNumOrders = maxNumOrders; + public void setTickSize(@jakarta.annotation.Nullable String tickSize) { + this.tickSize = tickSize; } - public ExchangeInfoResponseExchangeFiltersInner minTrailingAboveDelta( - @jakarta.annotation.Nullable Long minTrailingAboveDelta) { - this.minTrailingAboveDelta = minTrailingAboveDelta; + public ExchangeFiltersInner multiplierUp(@jakarta.annotation.Nullable String multiplierUp) { + this.multiplierUp = multiplierUp; return this; } /** - * Get minTrailingAboveDelta + * Get multiplierUp * - * @return minTrailingAboveDelta + * @return multiplierUp */ @jakarta.annotation.Nullable - public Long getMinTrailingAboveDelta() { - return minTrailingAboveDelta; + public String getMultiplierUp() { + return multiplierUp; } - public void setMinTrailingAboveDelta(@jakarta.annotation.Nullable Long minTrailingAboveDelta) { - this.minTrailingAboveDelta = minTrailingAboveDelta; + public void setMultiplierUp(@jakarta.annotation.Nullable String multiplierUp) { + this.multiplierUp = multiplierUp; } - public ExchangeInfoResponseExchangeFiltersInner maxTrailingAboveDelta( - @jakarta.annotation.Nullable Long maxTrailingAboveDelta) { - this.maxTrailingAboveDelta = maxTrailingAboveDelta; + public ExchangeFiltersInner multiplierDown(@jakarta.annotation.Nullable String multiplierDown) { + this.multiplierDown = multiplierDown; return this; } /** - * Get maxTrailingAboveDelta + * Get multiplierDown * - * @return maxTrailingAboveDelta + * @return multiplierDown */ @jakarta.annotation.Nullable - public Long getMaxTrailingAboveDelta() { - return maxTrailingAboveDelta; + public String getMultiplierDown() { + return multiplierDown; } - public void setMaxTrailingAboveDelta(@jakarta.annotation.Nullable Long maxTrailingAboveDelta) { - this.maxTrailingAboveDelta = maxTrailingAboveDelta; + public void setMultiplierDown(@jakarta.annotation.Nullable String multiplierDown) { + this.multiplierDown = multiplierDown; } - public ExchangeInfoResponseExchangeFiltersInner minTrailingBelowDelta( - @jakarta.annotation.Nullable Long minTrailingBelowDelta) { - this.minTrailingBelowDelta = minTrailingBelowDelta; + public ExchangeFiltersInner avgPriceMins(@jakarta.annotation.Nullable Long avgPriceMins) { + this.avgPriceMins = avgPriceMins; return this; } /** - * Get minTrailingBelowDelta + * Get avgPriceMins * - * @return minTrailingBelowDelta + * @return avgPriceMins */ @jakarta.annotation.Nullable - public Long getMinTrailingBelowDelta() { - return minTrailingBelowDelta; + public Long getAvgPriceMins() { + return avgPriceMins; } - public void setMinTrailingBelowDelta(@jakarta.annotation.Nullable Long minTrailingBelowDelta) { - this.minTrailingBelowDelta = minTrailingBelowDelta; + public void setAvgPriceMins(@jakarta.annotation.Nullable Long avgPriceMins) { + this.avgPriceMins = avgPriceMins; } - public ExchangeInfoResponseExchangeFiltersInner maxTrailingBelowDelta( - @jakarta.annotation.Nullable Long maxTrailingBelowDelta) { - this.maxTrailingBelowDelta = maxTrailingBelowDelta; + public ExchangeFiltersInner bidMultiplierUp( + @jakarta.annotation.Nullable String bidMultiplierUp) { + this.bidMultiplierUp = bidMultiplierUp; return this; } /** - * Get maxTrailingBelowDelta + * Get bidMultiplierUp * - * @return maxTrailingBelowDelta + * @return bidMultiplierUp */ @jakarta.annotation.Nullable - public Long getMaxTrailingBelowDelta() { - return maxTrailingBelowDelta; + public String getBidMultiplierUp() { + return bidMultiplierUp; } - public void setMaxTrailingBelowDelta(@jakarta.annotation.Nullable Long maxTrailingBelowDelta) { - this.maxTrailingBelowDelta = maxTrailingBelowDelta; + public void setBidMultiplierUp(@jakarta.annotation.Nullable String bidMultiplierUp) { + this.bidMultiplierUp = bidMultiplierUp; } - public ExchangeInfoResponseExchangeFiltersInner maxPosition( - @jakarta.annotation.Nullable String maxPosition) { - this.maxPosition = maxPosition; + public ExchangeFiltersInner bidMultiplierDown( + @jakarta.annotation.Nullable String bidMultiplierDown) { + this.bidMultiplierDown = bidMultiplierDown; return this; } /** - * Get maxPosition + * Get bidMultiplierDown * - * @return maxPosition + * @return bidMultiplierDown */ @jakarta.annotation.Nullable - public String getMaxPosition() { - return maxPosition; + public String getBidMultiplierDown() { + return bidMultiplierDown; } - public void setMaxPosition(@jakarta.annotation.Nullable String maxPosition) { - this.maxPosition = maxPosition; + public void setBidMultiplierDown(@jakarta.annotation.Nullable String bidMultiplierDown) { + this.bidMultiplierDown = bidMultiplierDown; + } + + public ExchangeFiltersInner askMultiplierUp( + @jakarta.annotation.Nullable String askMultiplierUp) { + this.askMultiplierUp = askMultiplierUp; + return this; + } + + /** + * Get askMultiplierUp + * + * @return askMultiplierUp + */ + @jakarta.annotation.Nullable + public String getAskMultiplierUp() { + return askMultiplierUp; + } + + public void setAskMultiplierUp(@jakarta.annotation.Nullable String askMultiplierUp) { + this.askMultiplierUp = askMultiplierUp; + } + + public ExchangeFiltersInner askMultiplierDown( + @jakarta.annotation.Nullable String askMultiplierDown) { + this.askMultiplierDown = askMultiplierDown; + return this; + } + + /** + * Get askMultiplierDown + * + * @return askMultiplierDown + */ + @jakarta.annotation.Nullable + public String getAskMultiplierDown() { + return askMultiplierDown; + } + + public void setAskMultiplierDown(@jakarta.annotation.Nullable String askMultiplierDown) { + this.askMultiplierDown = askMultiplierDown; } - public ExchangeInfoResponseExchangeFiltersInner minQty( - @jakarta.annotation.Nullable String minQty) { + public ExchangeFiltersInner minQty(@jakarta.annotation.Nullable String minQty) { this.minQty = minQty; return this; } @@ -408,8 +438,7 @@ public void setMinQty(@jakarta.annotation.Nullable String minQty) { this.minQty = minQty; } - public ExchangeInfoResponseExchangeFiltersInner maxQty( - @jakarta.annotation.Nullable String maxQty) { + public ExchangeFiltersInner maxQty(@jakarta.annotation.Nullable String maxQty) { this.maxQty = maxQty; return this; } @@ -428,8 +457,7 @@ public void setMaxQty(@jakarta.annotation.Nullable String maxQty) { this.maxQty = maxQty; } - public ExchangeInfoResponseExchangeFiltersInner stepSize( - @jakarta.annotation.Nullable String stepSize) { + public ExchangeFiltersInner stepSize(@jakarta.annotation.Nullable String stepSize) { this.stepSize = stepSize; return this; } @@ -448,46 +476,45 @@ public void setStepSize(@jakarta.annotation.Nullable String stepSize) { this.stepSize = stepSize; } - public ExchangeInfoResponseExchangeFiltersInner limit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; + public ExchangeFiltersInner minNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; return this; } /** - * Get limit + * Get minNotional * - * @return limit + * @return minNotional */ @jakarta.annotation.Nullable - public Long getLimit() { - return limit; + public String getMinNotional() { + return minNotional; } - public void setLimit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; + public void setMinNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; } - public ExchangeInfoResponseExchangeFiltersInner minNotional( - @jakarta.annotation.Nullable String minNotional) { - this.minNotional = minNotional; + public ExchangeFiltersInner applyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { + this.applyToMarket = applyToMarket; return this; } /** - * Get minNotional + * Get applyToMarket * - * @return minNotional + * @return applyToMarket */ @jakarta.annotation.Nullable - public String getMinNotional() { - return minNotional; + public Boolean getApplyToMarket() { + return applyToMarket; } - public void setMinNotional(@jakarta.annotation.Nullable String minNotional) { - this.minNotional = minNotional; + public void setApplyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { + this.applyToMarket = applyToMarket; } - public ExchangeInfoResponseExchangeFiltersInner applyMinToMarket( + public ExchangeFiltersInner applyMinToMarket( @jakarta.annotation.Nullable Boolean applyMinToMarket) { this.applyMinToMarket = applyMinToMarket; return this; @@ -507,8 +534,7 @@ public void setApplyMinToMarket(@jakarta.annotation.Nullable Boolean applyMinToM this.applyMinToMarket = applyMinToMarket; } - public ExchangeInfoResponseExchangeFiltersInner maxNotional( - @jakarta.annotation.Nullable String maxNotional) { + public ExchangeFiltersInner maxNotional(@jakarta.annotation.Nullable String maxNotional) { this.maxNotional = maxNotional; return this; } @@ -527,7 +553,7 @@ public void setMaxNotional(@jakarta.annotation.Nullable String maxNotional) { this.maxNotional = maxNotional; } - public ExchangeInfoResponseExchangeFiltersInner applyMaxToMarket( + public ExchangeFiltersInner applyMaxToMarket( @jakarta.annotation.Nullable Boolean applyMaxToMarket) { this.applyMaxToMarket = applyMaxToMarket; return this; @@ -547,224 +573,181 @@ public void setApplyMaxToMarket(@jakarta.annotation.Nullable Boolean applyMaxToM this.applyMaxToMarket = applyMaxToMarket; } - public ExchangeInfoResponseExchangeFiltersInner avgPriceMins( - @jakarta.annotation.Nullable Long avgPriceMins) { - this.avgPriceMins = avgPriceMins; - return this; - } - - /** - * Get avgPriceMins - * - * @return avgPriceMins - */ - @jakarta.annotation.Nullable - public Long getAvgPriceMins() { - return avgPriceMins; - } - - public void setAvgPriceMins(@jakarta.annotation.Nullable Long avgPriceMins) { - this.avgPriceMins = avgPriceMins; - } - - public ExchangeInfoResponseExchangeFiltersInner applyToMarket( - @jakarta.annotation.Nullable Boolean applyToMarket) { - this.applyToMarket = applyToMarket; - return this; - } - - /** - * Get applyToMarket - * - * @return applyToMarket - */ - @jakarta.annotation.Nullable - public Boolean getApplyToMarket() { - return applyToMarket; - } - - public void setApplyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { - this.applyToMarket = applyToMarket; - } - - public ExchangeInfoResponseExchangeFiltersInner bidMultiplierUp( - @jakarta.annotation.Nullable String bidMultiplierUp) { - this.bidMultiplierUp = bidMultiplierUp; + public ExchangeFiltersInner limit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; return this; } /** - * Get bidMultiplierUp + * Get limit * - * @return bidMultiplierUp + * @return limit */ @jakarta.annotation.Nullable - public String getBidMultiplierUp() { - return bidMultiplierUp; + public Long getLimit() { + return limit; } - public void setBidMultiplierUp(@jakarta.annotation.Nullable String bidMultiplierUp) { - this.bidMultiplierUp = bidMultiplierUp; + public void setLimit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; } - public ExchangeInfoResponseExchangeFiltersInner bidMultiplierDown( - @jakarta.annotation.Nullable String bidMultiplierDown) { - this.bidMultiplierDown = bidMultiplierDown; + public ExchangeFiltersInner maxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; return this; } /** - * Get bidMultiplierDown + * Get maxNumOrders * - * @return bidMultiplierDown + * @return maxNumOrders */ @jakarta.annotation.Nullable - public String getBidMultiplierDown() { - return bidMultiplierDown; + public Long getMaxNumOrders() { + return maxNumOrders; } - public void setBidMultiplierDown(@jakarta.annotation.Nullable String bidMultiplierDown) { - this.bidMultiplierDown = bidMultiplierDown; + public void setMaxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; } - public ExchangeInfoResponseExchangeFiltersInner askMultiplierUp( - @jakarta.annotation.Nullable String askMultiplierUp) { - this.askMultiplierUp = askMultiplierUp; + public ExchangeFiltersInner maxNumAlgoOrders( + @jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; return this; } /** - * Get askMultiplierUp + * Get maxNumAlgoOrders * - * @return askMultiplierUp + * @return maxNumAlgoOrders */ @jakarta.annotation.Nullable - public String getAskMultiplierUp() { - return askMultiplierUp; + public Long getMaxNumAlgoOrders() { + return maxNumAlgoOrders; } - public void setAskMultiplierUp(@jakarta.annotation.Nullable String askMultiplierUp) { - this.askMultiplierUp = askMultiplierUp; + public void setMaxNumAlgoOrders(@jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; } - public ExchangeInfoResponseExchangeFiltersInner askMultiplierDown( - @jakarta.annotation.Nullable String askMultiplierDown) { - this.askMultiplierDown = askMultiplierDown; + public ExchangeFiltersInner maxNumIcebergOrders( + @jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; return this; } /** - * Get askMultiplierDown + * Get maxNumIcebergOrders * - * @return askMultiplierDown + * @return maxNumIcebergOrders */ @jakarta.annotation.Nullable - public String getAskMultiplierDown() { - return askMultiplierDown; + public Long getMaxNumIcebergOrders() { + return maxNumIcebergOrders; } - public void setAskMultiplierDown(@jakarta.annotation.Nullable String askMultiplierDown) { - this.askMultiplierDown = askMultiplierDown; + public void setMaxNumIcebergOrders(@jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; } - public ExchangeInfoResponseExchangeFiltersInner multiplierUp( - @jakarta.annotation.Nullable String multiplierUp) { - this.multiplierUp = multiplierUp; + public ExchangeFiltersInner maxPosition(@jakarta.annotation.Nullable String maxPosition) { + this.maxPosition = maxPosition; return this; } /** - * Get multiplierUp + * Get maxPosition * - * @return multiplierUp + * @return maxPosition */ @jakarta.annotation.Nullable - public String getMultiplierUp() { - return multiplierUp; + public String getMaxPosition() { + return maxPosition; } - public void setMultiplierUp(@jakarta.annotation.Nullable String multiplierUp) { - this.multiplierUp = multiplierUp; + public void setMaxPosition(@jakarta.annotation.Nullable String maxPosition) { + this.maxPosition = maxPosition; } - public ExchangeInfoResponseExchangeFiltersInner multiplierDown( - @jakarta.annotation.Nullable String multiplierDown) { - this.multiplierDown = multiplierDown; + public ExchangeFiltersInner minTrailingAboveDelta( + @jakarta.annotation.Nullable Long minTrailingAboveDelta) { + this.minTrailingAboveDelta = minTrailingAboveDelta; return this; } /** - * Get multiplierDown + * Get minTrailingAboveDelta * - * @return multiplierDown + * @return minTrailingAboveDelta */ @jakarta.annotation.Nullable - public String getMultiplierDown() { - return multiplierDown; + public Long getMinTrailingAboveDelta() { + return minTrailingAboveDelta; } - public void setMultiplierDown(@jakarta.annotation.Nullable String multiplierDown) { - this.multiplierDown = multiplierDown; + public void setMinTrailingAboveDelta(@jakarta.annotation.Nullable Long minTrailingAboveDelta) { + this.minTrailingAboveDelta = minTrailingAboveDelta; } - public ExchangeInfoResponseExchangeFiltersInner minPrice( - @jakarta.annotation.Nullable String minPrice) { - this.minPrice = minPrice; + public ExchangeFiltersInner maxTrailingAboveDelta( + @jakarta.annotation.Nullable Long maxTrailingAboveDelta) { + this.maxTrailingAboveDelta = maxTrailingAboveDelta; return this; } /** - * Get minPrice + * Get maxTrailingAboveDelta * - * @return minPrice + * @return maxTrailingAboveDelta */ @jakarta.annotation.Nullable - public String getMinPrice() { - return minPrice; + public Long getMaxTrailingAboveDelta() { + return maxTrailingAboveDelta; } - public void setMinPrice(@jakarta.annotation.Nullable String minPrice) { - this.minPrice = minPrice; + public void setMaxTrailingAboveDelta(@jakarta.annotation.Nullable Long maxTrailingAboveDelta) { + this.maxTrailingAboveDelta = maxTrailingAboveDelta; } - public ExchangeInfoResponseExchangeFiltersInner maxPrice( - @jakarta.annotation.Nullable String maxPrice) { - this.maxPrice = maxPrice; + public ExchangeFiltersInner minTrailingBelowDelta( + @jakarta.annotation.Nullable Long minTrailingBelowDelta) { + this.minTrailingBelowDelta = minTrailingBelowDelta; return this; } /** - * Get maxPrice + * Get minTrailingBelowDelta * - * @return maxPrice + * @return minTrailingBelowDelta */ @jakarta.annotation.Nullable - public String getMaxPrice() { - return maxPrice; + public Long getMinTrailingBelowDelta() { + return minTrailingBelowDelta; } - public void setMaxPrice(@jakarta.annotation.Nullable String maxPrice) { - this.maxPrice = maxPrice; + public void setMinTrailingBelowDelta(@jakarta.annotation.Nullable Long minTrailingBelowDelta) { + this.minTrailingBelowDelta = minTrailingBelowDelta; } - public ExchangeInfoResponseExchangeFiltersInner tickSize( - @jakarta.annotation.Nullable String tickSize) { - this.tickSize = tickSize; + public ExchangeFiltersInner maxTrailingBelowDelta( + @jakarta.annotation.Nullable Long maxTrailingBelowDelta) { + this.maxTrailingBelowDelta = maxTrailingBelowDelta; return this; } /** - * Get tickSize + * Get maxTrailingBelowDelta * - * @return tickSize + * @return maxTrailingBelowDelta */ @jakarta.annotation.Nullable - public String getTickSize() { - return tickSize; + public Long getMaxTrailingBelowDelta() { + return maxTrailingBelowDelta; } - public void setTickSize(@jakarta.annotation.Nullable String tickSize) { - this.tickSize = tickSize; + public void setMaxTrailingBelowDelta(@jakarta.annotation.Nullable Long maxTrailingBelowDelta) { + this.maxTrailingBelowDelta = maxTrailingBelowDelta; } @Override @@ -775,114 +758,105 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ExchangeInfoResponseExchangeFiltersInner exchangeInfoResponseExchangeFiltersInner = - (ExchangeInfoResponseExchangeFiltersInner) o; - return Objects.equals(this.filterType, exchangeInfoResponseExchangeFiltersInner.filterType) + ExchangeFiltersInner exchangeFiltersInner = (ExchangeFiltersInner) o; + return Objects.equals(this.filterType, exchangeFiltersInner.filterType) + && Objects.equals(this.minPrice, exchangeFiltersInner.minPrice) + && Objects.equals(this.maxPrice, exchangeFiltersInner.maxPrice) + && Objects.equals(this.tickSize, exchangeFiltersInner.tickSize) + && Objects.equals(this.multiplierUp, exchangeFiltersInner.multiplierUp) + && Objects.equals(this.multiplierDown, exchangeFiltersInner.multiplierDown) + && Objects.equals(this.avgPriceMins, exchangeFiltersInner.avgPriceMins) + && Objects.equals(this.bidMultiplierUp, exchangeFiltersInner.bidMultiplierUp) + && Objects.equals(this.bidMultiplierDown, exchangeFiltersInner.bidMultiplierDown) + && Objects.equals(this.askMultiplierUp, exchangeFiltersInner.askMultiplierUp) + && Objects.equals(this.askMultiplierDown, exchangeFiltersInner.askMultiplierDown) + && Objects.equals(this.minQty, exchangeFiltersInner.minQty) + && Objects.equals(this.maxQty, exchangeFiltersInner.maxQty) + && Objects.equals(this.stepSize, exchangeFiltersInner.stepSize) + && Objects.equals(this.minNotional, exchangeFiltersInner.minNotional) + && Objects.equals(this.applyToMarket, exchangeFiltersInner.applyToMarket) + && Objects.equals(this.applyMinToMarket, exchangeFiltersInner.applyMinToMarket) + && Objects.equals(this.maxNotional, exchangeFiltersInner.maxNotional) + && Objects.equals(this.applyMaxToMarket, exchangeFiltersInner.applyMaxToMarket) + && Objects.equals(this.limit, exchangeFiltersInner.limit) + && Objects.equals(this.maxNumOrders, exchangeFiltersInner.maxNumOrders) + && Objects.equals(this.maxNumAlgoOrders, exchangeFiltersInner.maxNumAlgoOrders) && Objects.equals( - this.maxNumIcebergOrders, - exchangeInfoResponseExchangeFiltersInner.maxNumIcebergOrders) + this.maxNumIcebergOrders, exchangeFiltersInner.maxNumIcebergOrders) + && Objects.equals(this.maxPosition, exchangeFiltersInner.maxPosition) && Objects.equals( - this.maxNumAlgoOrders, - exchangeInfoResponseExchangeFiltersInner.maxNumAlgoOrders) + this.minTrailingAboveDelta, exchangeFiltersInner.minTrailingAboveDelta) && Objects.equals( - this.maxNumOrders, exchangeInfoResponseExchangeFiltersInner.maxNumOrders) + this.maxTrailingAboveDelta, exchangeFiltersInner.maxTrailingAboveDelta) && Objects.equals( - this.minTrailingAboveDelta, - exchangeInfoResponseExchangeFiltersInner.minTrailingAboveDelta) + this.minTrailingBelowDelta, exchangeFiltersInner.minTrailingBelowDelta) && Objects.equals( - this.maxTrailingAboveDelta, - exchangeInfoResponseExchangeFiltersInner.maxTrailingAboveDelta) - && Objects.equals( - this.minTrailingBelowDelta, - exchangeInfoResponseExchangeFiltersInner.minTrailingBelowDelta) - && Objects.equals( - this.maxTrailingBelowDelta, - exchangeInfoResponseExchangeFiltersInner.maxTrailingBelowDelta) - && Objects.equals( - this.maxPosition, exchangeInfoResponseExchangeFiltersInner.maxPosition) - && Objects.equals(this.minQty, exchangeInfoResponseExchangeFiltersInner.minQty) - && Objects.equals(this.maxQty, exchangeInfoResponseExchangeFiltersInner.maxQty) - && Objects.equals(this.stepSize, exchangeInfoResponseExchangeFiltersInner.stepSize) - && Objects.equals(this.limit, exchangeInfoResponseExchangeFiltersInner.limit) - && Objects.equals( - this.minNotional, exchangeInfoResponseExchangeFiltersInner.minNotional) - && Objects.equals( - this.applyMinToMarket, - exchangeInfoResponseExchangeFiltersInner.applyMinToMarket) - && Objects.equals( - this.maxNotional, exchangeInfoResponseExchangeFiltersInner.maxNotional) - && Objects.equals( - this.applyMaxToMarket, - exchangeInfoResponseExchangeFiltersInner.applyMaxToMarket) - && Objects.equals( - this.avgPriceMins, exchangeInfoResponseExchangeFiltersInner.avgPriceMins) - && Objects.equals( - this.applyToMarket, exchangeInfoResponseExchangeFiltersInner.applyToMarket) - && Objects.equals( - this.bidMultiplierUp, - exchangeInfoResponseExchangeFiltersInner.bidMultiplierUp) - && Objects.equals( - this.bidMultiplierDown, - exchangeInfoResponseExchangeFiltersInner.bidMultiplierDown) - && Objects.equals( - this.askMultiplierUp, - exchangeInfoResponseExchangeFiltersInner.askMultiplierUp) - && Objects.equals( - this.askMultiplierDown, - exchangeInfoResponseExchangeFiltersInner.askMultiplierDown) - && Objects.equals( - this.multiplierUp, exchangeInfoResponseExchangeFiltersInner.multiplierUp) - && Objects.equals( - this.multiplierDown, - exchangeInfoResponseExchangeFiltersInner.multiplierDown) - && Objects.equals(this.minPrice, exchangeInfoResponseExchangeFiltersInner.minPrice) - && Objects.equals(this.maxPrice, exchangeInfoResponseExchangeFiltersInner.maxPrice) - && Objects.equals(this.tickSize, exchangeInfoResponseExchangeFiltersInner.tickSize); + this.maxTrailingBelowDelta, exchangeFiltersInner.maxTrailingBelowDelta); } @Override public int hashCode() { return Objects.hash( filterType, - maxNumIcebergOrders, - maxNumAlgoOrders, - maxNumOrders, - minTrailingAboveDelta, - maxTrailingAboveDelta, - minTrailingBelowDelta, - maxTrailingBelowDelta, - maxPosition, + minPrice, + maxPrice, + tickSize, + multiplierUp, + multiplierDown, + avgPriceMins, + bidMultiplierUp, + bidMultiplierDown, + askMultiplierUp, + askMultiplierDown, minQty, maxQty, stepSize, - limit, minNotional, + applyToMarket, applyMinToMarket, maxNotional, applyMaxToMarket, - avgPriceMins, - applyToMarket, - bidMultiplierUp, - bidMultiplierDown, - askMultiplierUp, - askMultiplierDown, - multiplierUp, - multiplierDown, - minPrice, - maxPrice, - tickSize); + limit, + maxNumOrders, + maxNumAlgoOrders, + maxNumIcebergOrders, + maxPosition, + minTrailingAboveDelta, + maxTrailingAboveDelta, + minTrailingBelowDelta, + maxTrailingBelowDelta); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ExchangeInfoResponseExchangeFiltersInner {\n"); + sb.append("class ExchangeFiltersInner {\n"); sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" minPrice: ").append(toIndentedString(minPrice)).append("\n"); + sb.append(" maxPrice: ").append(toIndentedString(maxPrice)).append("\n"); + sb.append(" tickSize: ").append(toIndentedString(tickSize)).append("\n"); + sb.append(" multiplierUp: ").append(toIndentedString(multiplierUp)).append("\n"); + sb.append(" multiplierDown: ").append(toIndentedString(multiplierDown)).append("\n"); + sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); + sb.append(" bidMultiplierUp: ").append(toIndentedString(bidMultiplierUp)).append("\n"); + sb.append(" bidMultiplierDown: ").append(toIndentedString(bidMultiplierDown)).append("\n"); + sb.append(" askMultiplierUp: ").append(toIndentedString(askMultiplierUp)).append("\n"); + sb.append(" askMultiplierDown: ").append(toIndentedString(askMultiplierDown)).append("\n"); + sb.append(" minQty: ").append(toIndentedString(minQty)).append("\n"); + sb.append(" maxQty: ").append(toIndentedString(maxQty)).append("\n"); + sb.append(" stepSize: ").append(toIndentedString(stepSize)).append("\n"); + sb.append(" minNotional: ").append(toIndentedString(minNotional)).append("\n"); + sb.append(" applyToMarket: ").append(toIndentedString(applyToMarket)).append("\n"); + sb.append(" applyMinToMarket: ").append(toIndentedString(applyMinToMarket)).append("\n"); + sb.append(" maxNotional: ").append(toIndentedString(maxNotional)).append("\n"); + sb.append(" applyMaxToMarket: ").append(toIndentedString(applyMaxToMarket)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" maxNumOrders: ").append(toIndentedString(maxNumOrders)).append("\n"); + sb.append(" maxNumAlgoOrders: ").append(toIndentedString(maxNumAlgoOrders)).append("\n"); sb.append(" maxNumIcebergOrders: ") .append(toIndentedString(maxNumIcebergOrders)) .append("\n"); - sb.append(" maxNumAlgoOrders: ").append(toIndentedString(maxNumAlgoOrders)).append("\n"); - sb.append(" maxNumOrders: ").append(toIndentedString(maxNumOrders)).append("\n"); + sb.append(" maxPosition: ").append(toIndentedString(maxPosition)).append("\n"); sb.append(" minTrailingAboveDelta: ") .append(toIndentedString(minTrailingAboveDelta)) .append("\n"); @@ -895,26 +869,6 @@ public String toString() { sb.append(" maxTrailingBelowDelta: ") .append(toIndentedString(maxTrailingBelowDelta)) .append("\n"); - sb.append(" maxPosition: ").append(toIndentedString(maxPosition)).append("\n"); - sb.append(" minQty: ").append(toIndentedString(minQty)).append("\n"); - sb.append(" maxQty: ").append(toIndentedString(maxQty)).append("\n"); - sb.append(" stepSize: ").append(toIndentedString(stepSize)).append("\n"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" minNotional: ").append(toIndentedString(minNotional)).append("\n"); - sb.append(" applyMinToMarket: ").append(toIndentedString(applyMinToMarket)).append("\n"); - sb.append(" maxNotional: ").append(toIndentedString(maxNotional)).append("\n"); - sb.append(" applyMaxToMarket: ").append(toIndentedString(applyMaxToMarket)).append("\n"); - sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); - sb.append(" applyToMarket: ").append(toIndentedString(applyToMarket)).append("\n"); - sb.append(" bidMultiplierUp: ").append(toIndentedString(bidMultiplierUp)).append("\n"); - sb.append(" bidMultiplierDown: ").append(toIndentedString(bidMultiplierDown)).append("\n"); - sb.append(" askMultiplierUp: ").append(toIndentedString(askMultiplierUp)).append("\n"); - sb.append(" askMultiplierDown: ").append(toIndentedString(askMultiplierDown)).append("\n"); - sb.append(" multiplierUp: ").append(toIndentedString(multiplierUp)).append("\n"); - sb.append(" multiplierDown: ").append(toIndentedString(multiplierDown)).append("\n"); - sb.append(" minPrice: ").append(toIndentedString(minPrice)).append("\n"); - sb.append(" maxPrice: ").append(toIndentedString(maxPrice)).append("\n"); - sb.append(" tickSize: ").append(toIndentedString(tickSize)).append("\n"); sb.append("}"); return sb.toString(); } @@ -926,48 +880,50 @@ public String toUrlQueryString() { String filterTypeValueAsString = ""; filterTypeValueAsString = filterTypeValue.toString(); sb.append("filterType=").append(urlEncode(filterTypeValueAsString)).append(""); - Object maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); - String maxNumIcebergOrdersValueAsString = ""; - maxNumIcebergOrdersValueAsString = maxNumIcebergOrdersValue.toString(); - sb.append("maxNumIcebergOrders=") - .append(urlEncode(maxNumIcebergOrdersValueAsString)) - .append(""); - Object maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); - String maxNumAlgoOrdersValueAsString = ""; - maxNumAlgoOrdersValueAsString = maxNumAlgoOrdersValue.toString(); - sb.append("maxNumAlgoOrders=").append(urlEncode(maxNumAlgoOrdersValueAsString)).append(""); - Object maxNumOrdersValue = getMaxNumOrders(); - String maxNumOrdersValueAsString = ""; - maxNumOrdersValueAsString = maxNumOrdersValue.toString(); - sb.append("maxNumOrders=").append(urlEncode(maxNumOrdersValueAsString)).append(""); - Object minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); - String minTrailingAboveDeltaValueAsString = ""; - minTrailingAboveDeltaValueAsString = minTrailingAboveDeltaValue.toString(); - sb.append("minTrailingAboveDelta=") - .append(urlEncode(minTrailingAboveDeltaValueAsString)) - .append(""); - Object maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); - String maxTrailingAboveDeltaValueAsString = ""; - maxTrailingAboveDeltaValueAsString = maxTrailingAboveDeltaValue.toString(); - sb.append("maxTrailingAboveDelta=") - .append(urlEncode(maxTrailingAboveDeltaValueAsString)) - .append(""); - Object minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); - String minTrailingBelowDeltaValueAsString = ""; - minTrailingBelowDeltaValueAsString = minTrailingBelowDeltaValue.toString(); - sb.append("minTrailingBelowDelta=") - .append(urlEncode(minTrailingBelowDeltaValueAsString)) + Object minPriceValue = getMinPrice(); + String minPriceValueAsString = ""; + minPriceValueAsString = minPriceValue.toString(); + sb.append("minPrice=").append(urlEncode(minPriceValueAsString)).append(""); + Object maxPriceValue = getMaxPrice(); + String maxPriceValueAsString = ""; + maxPriceValueAsString = maxPriceValue.toString(); + sb.append("maxPrice=").append(urlEncode(maxPriceValueAsString)).append(""); + Object tickSizeValue = getTickSize(); + String tickSizeValueAsString = ""; + tickSizeValueAsString = tickSizeValue.toString(); + sb.append("tickSize=").append(urlEncode(tickSizeValueAsString)).append(""); + Object multiplierUpValue = getMultiplierUp(); + String multiplierUpValueAsString = ""; + multiplierUpValueAsString = multiplierUpValue.toString(); + sb.append("multiplierUp=").append(urlEncode(multiplierUpValueAsString)).append(""); + Object multiplierDownValue = getMultiplierDown(); + String multiplierDownValueAsString = ""; + multiplierDownValueAsString = multiplierDownValue.toString(); + sb.append("multiplierDown=").append(urlEncode(multiplierDownValueAsString)).append(""); + Object avgPriceMinsValue = getAvgPriceMins(); + String avgPriceMinsValueAsString = ""; + avgPriceMinsValueAsString = avgPriceMinsValue.toString(); + sb.append("avgPriceMins=").append(urlEncode(avgPriceMinsValueAsString)).append(""); + Object bidMultiplierUpValue = getBidMultiplierUp(); + String bidMultiplierUpValueAsString = ""; + bidMultiplierUpValueAsString = bidMultiplierUpValue.toString(); + sb.append("bidMultiplierUp=").append(urlEncode(bidMultiplierUpValueAsString)).append(""); + Object bidMultiplierDownValue = getBidMultiplierDown(); + String bidMultiplierDownValueAsString = ""; + bidMultiplierDownValueAsString = bidMultiplierDownValue.toString(); + sb.append("bidMultiplierDown=") + .append(urlEncode(bidMultiplierDownValueAsString)) .append(""); - Object maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); - String maxTrailingBelowDeltaValueAsString = ""; - maxTrailingBelowDeltaValueAsString = maxTrailingBelowDeltaValue.toString(); - sb.append("maxTrailingBelowDelta=") - .append(urlEncode(maxTrailingBelowDeltaValueAsString)) + Object askMultiplierUpValue = getAskMultiplierUp(); + String askMultiplierUpValueAsString = ""; + askMultiplierUpValueAsString = askMultiplierUpValue.toString(); + sb.append("askMultiplierUp=").append(urlEncode(askMultiplierUpValueAsString)).append(""); + Object askMultiplierDownValue = getAskMultiplierDown(); + String askMultiplierDownValueAsString = ""; + askMultiplierDownValueAsString = askMultiplierDownValue.toString(); + sb.append("askMultiplierDown=") + .append(urlEncode(askMultiplierDownValueAsString)) .append(""); - Object maxPositionValue = getMaxPosition(); - String maxPositionValueAsString = ""; - maxPositionValueAsString = maxPositionValue.toString(); - sb.append("maxPosition=").append(urlEncode(maxPositionValueAsString)).append(""); Object minQtyValue = getMinQty(); String minQtyValueAsString = ""; minQtyValueAsString = minQtyValue.toString(); @@ -980,14 +936,14 @@ public String toUrlQueryString() { String stepSizeValueAsString = ""; stepSizeValueAsString = stepSizeValue.toString(); sb.append("stepSize=").append(urlEncode(stepSizeValueAsString)).append(""); - Object limitValue = getLimit(); - String limitValueAsString = ""; - limitValueAsString = limitValue.toString(); - sb.append("limit=").append(urlEncode(limitValueAsString)).append(""); Object minNotionalValue = getMinNotional(); String minNotionalValueAsString = ""; minNotionalValueAsString = minNotionalValue.toString(); sb.append("minNotional=").append(urlEncode(minNotionalValueAsString)).append(""); + Object applyToMarketValue = getApplyToMarket(); + String applyToMarketValueAsString = ""; + applyToMarketValueAsString = applyToMarketValue.toString(); + sb.append("applyToMarket=").append(urlEncode(applyToMarketValueAsString)).append(""); Object applyMinToMarketValue = getApplyMinToMarket(); String applyMinToMarketValueAsString = ""; applyMinToMarketValueAsString = applyMinToMarketValue.toString(); @@ -1000,54 +956,52 @@ public String toUrlQueryString() { String applyMaxToMarketValueAsString = ""; applyMaxToMarketValueAsString = applyMaxToMarketValue.toString(); sb.append("applyMaxToMarket=").append(urlEncode(applyMaxToMarketValueAsString)).append(""); - Object avgPriceMinsValue = getAvgPriceMins(); - String avgPriceMinsValueAsString = ""; - avgPriceMinsValueAsString = avgPriceMinsValue.toString(); - sb.append("avgPriceMins=").append(urlEncode(avgPriceMinsValueAsString)).append(""); - Object applyToMarketValue = getApplyToMarket(); - String applyToMarketValueAsString = ""; - applyToMarketValueAsString = applyToMarketValue.toString(); - sb.append("applyToMarket=").append(urlEncode(applyToMarketValueAsString)).append(""); - Object bidMultiplierUpValue = getBidMultiplierUp(); - String bidMultiplierUpValueAsString = ""; - bidMultiplierUpValueAsString = bidMultiplierUpValue.toString(); - sb.append("bidMultiplierUp=").append(urlEncode(bidMultiplierUpValueAsString)).append(""); - Object bidMultiplierDownValue = getBidMultiplierDown(); - String bidMultiplierDownValueAsString = ""; - bidMultiplierDownValueAsString = bidMultiplierDownValue.toString(); - sb.append("bidMultiplierDown=") - .append(urlEncode(bidMultiplierDownValueAsString)) + Object limitValue = getLimit(); + String limitValueAsString = ""; + limitValueAsString = limitValue.toString(); + sb.append("limit=").append(urlEncode(limitValueAsString)).append(""); + Object maxNumOrdersValue = getMaxNumOrders(); + String maxNumOrdersValueAsString = ""; + maxNumOrdersValueAsString = maxNumOrdersValue.toString(); + sb.append("maxNumOrders=").append(urlEncode(maxNumOrdersValueAsString)).append(""); + Object maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); + String maxNumAlgoOrdersValueAsString = ""; + maxNumAlgoOrdersValueAsString = maxNumAlgoOrdersValue.toString(); + sb.append("maxNumAlgoOrders=").append(urlEncode(maxNumAlgoOrdersValueAsString)).append(""); + Object maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); + String maxNumIcebergOrdersValueAsString = ""; + maxNumIcebergOrdersValueAsString = maxNumIcebergOrdersValue.toString(); + sb.append("maxNumIcebergOrders=") + .append(urlEncode(maxNumIcebergOrdersValueAsString)) .append(""); - Object askMultiplierUpValue = getAskMultiplierUp(); - String askMultiplierUpValueAsString = ""; - askMultiplierUpValueAsString = askMultiplierUpValue.toString(); - sb.append("askMultiplierUp=").append(urlEncode(askMultiplierUpValueAsString)).append(""); - Object askMultiplierDownValue = getAskMultiplierDown(); - String askMultiplierDownValueAsString = ""; - askMultiplierDownValueAsString = askMultiplierDownValue.toString(); - sb.append("askMultiplierDown=") - .append(urlEncode(askMultiplierDownValueAsString)) + Object maxPositionValue = getMaxPosition(); + String maxPositionValueAsString = ""; + maxPositionValueAsString = maxPositionValue.toString(); + sb.append("maxPosition=").append(urlEncode(maxPositionValueAsString)).append(""); + Object minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); + String minTrailingAboveDeltaValueAsString = ""; + minTrailingAboveDeltaValueAsString = minTrailingAboveDeltaValue.toString(); + sb.append("minTrailingAboveDelta=") + .append(urlEncode(minTrailingAboveDeltaValueAsString)) + .append(""); + Object maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); + String maxTrailingAboveDeltaValueAsString = ""; + maxTrailingAboveDeltaValueAsString = maxTrailingAboveDeltaValue.toString(); + sb.append("maxTrailingAboveDelta=") + .append(urlEncode(maxTrailingAboveDeltaValueAsString)) + .append(""); + Object minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); + String minTrailingBelowDeltaValueAsString = ""; + minTrailingBelowDeltaValueAsString = minTrailingBelowDeltaValue.toString(); + sb.append("minTrailingBelowDelta=") + .append(urlEncode(minTrailingBelowDeltaValueAsString)) + .append(""); + Object maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); + String maxTrailingBelowDeltaValueAsString = ""; + maxTrailingBelowDeltaValueAsString = maxTrailingBelowDeltaValue.toString(); + sb.append("maxTrailingBelowDelta=") + .append(urlEncode(maxTrailingBelowDeltaValueAsString)) .append(""); - Object multiplierUpValue = getMultiplierUp(); - String multiplierUpValueAsString = ""; - multiplierUpValueAsString = multiplierUpValue.toString(); - sb.append("multiplierUp=").append(urlEncode(multiplierUpValueAsString)).append(""); - Object multiplierDownValue = getMultiplierDown(); - String multiplierDownValueAsString = ""; - multiplierDownValueAsString = multiplierDownValue.toString(); - sb.append("multiplierDown=").append(urlEncode(multiplierDownValueAsString)).append(""); - Object minPriceValue = getMinPrice(); - String minPriceValueAsString = ""; - minPriceValueAsString = minPriceValue.toString(); - sb.append("minPrice=").append(urlEncode(minPriceValueAsString)).append(""); - Object maxPriceValue = getMaxPrice(); - String maxPriceValueAsString = ""; - maxPriceValueAsString = maxPriceValue.toString(); - sb.append("maxPrice=").append(urlEncode(maxPriceValueAsString)).append(""); - Object tickSizeValue = getTickSize(); - String tickSizeValueAsString = ""; - tickSizeValueAsString = tickSizeValue.toString(); - sb.append("tickSize=").append(urlEncode(tickSizeValueAsString)).append(""); return sb.toString(); } @@ -1077,33 +1031,33 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("filterType"); - openapiFields.add("maxNumIcebergOrders"); - openapiFields.add("maxNumAlgoOrders"); - openapiFields.add("maxNumOrders"); - openapiFields.add("minTrailingAboveDelta"); - openapiFields.add("maxTrailingAboveDelta"); - openapiFields.add("minTrailingBelowDelta"); - openapiFields.add("maxTrailingBelowDelta"); - openapiFields.add("maxPosition"); + openapiFields.add("minPrice"); + openapiFields.add("maxPrice"); + openapiFields.add("tickSize"); + openapiFields.add("multiplierUp"); + openapiFields.add("multiplierDown"); + openapiFields.add("avgPriceMins"); + openapiFields.add("bidMultiplierUp"); + openapiFields.add("bidMultiplierDown"); + openapiFields.add("askMultiplierUp"); + openapiFields.add("askMultiplierDown"); openapiFields.add("minQty"); openapiFields.add("maxQty"); openapiFields.add("stepSize"); - openapiFields.add("limit"); openapiFields.add("minNotional"); + openapiFields.add("applyToMarket"); openapiFields.add("applyMinToMarket"); openapiFields.add("maxNotional"); openapiFields.add("applyMaxToMarket"); - openapiFields.add("avgPriceMins"); - openapiFields.add("applyToMarket"); - openapiFields.add("bidMultiplierUp"); - openapiFields.add("bidMultiplierDown"); - openapiFields.add("askMultiplierUp"); - openapiFields.add("askMultiplierDown"); - openapiFields.add("multiplierUp"); - openapiFields.add("multiplierDown"); - openapiFields.add("minPrice"); - openapiFields.add("maxPrice"); - openapiFields.add("tickSize"); + openapiFields.add("limit"); + openapiFields.add("maxNumOrders"); + openapiFields.add("maxNumAlgoOrders"); + openapiFields.add("maxNumIcebergOrders"); + openapiFields.add("maxPosition"); + openapiFields.add("minTrailingAboveDelta"); + openapiFields.add("maxTrailingAboveDelta"); + openapiFields.add("minTrailingBelowDelta"); + openapiFields.add("maxTrailingBelowDelta"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -1113,33 +1067,17 @@ private String toIndentedString(Object o) { * 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 - * ExchangeInfoResponseExchangeFiltersInner + * @throws IOException if the JSON Element is invalid with respect to ExchangeFiltersInner */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ExchangeInfoResponseExchangeFiltersInner.openapiRequiredFields + if (!ExchangeFiltersInner.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in" - + " ExchangeInfoResponseExchangeFiltersInner is not found in" - + " the empty JSON string", - ExchangeInfoResponseExchangeFiltersInner.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeInfoResponseExchangeFiltersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeInfoResponseExchangeFiltersInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); + "The required field(s) %s in ExchangeFiltersInner is not found in" + + " the empty JSON string", + ExchangeFiltersInner.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -1151,53 +1089,45 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("filterType").toString())); } - if ((jsonObj.get("maxPosition") != null && !jsonObj.get("maxPosition").isJsonNull()) - && !jsonObj.get("maxPosition").isJsonPrimitive()) { + if ((jsonObj.get("minPrice") != null && !jsonObj.get("minPrice").isJsonNull()) + && !jsonObj.get("minPrice").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `maxPosition` to be a primitive type in the JSON" + "Expected the field `minPrice` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("maxPosition").toString())); - } - if ((jsonObj.get("minQty") != null && !jsonObj.get("minQty").isJsonNull()) - && !jsonObj.get("minQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `minQty` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("minQty").toString())); + jsonObj.get("minPrice").toString())); } - if ((jsonObj.get("maxQty") != null && !jsonObj.get("maxQty").isJsonNull()) - && !jsonObj.get("maxQty").isJsonPrimitive()) { + if ((jsonObj.get("maxPrice") != null && !jsonObj.get("maxPrice").isJsonNull()) + && !jsonObj.get("maxPrice").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `maxQty` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("maxQty").toString())); + "Expected the field `maxPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("maxPrice").toString())); } - if ((jsonObj.get("stepSize") != null && !jsonObj.get("stepSize").isJsonNull()) - && !jsonObj.get("stepSize").isJsonPrimitive()) { + if ((jsonObj.get("tickSize") != null && !jsonObj.get("tickSize").isJsonNull()) + && !jsonObj.get("tickSize").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `stepSize` to be a primitive type in the JSON" + "Expected the field `tickSize` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("stepSize").toString())); + jsonObj.get("tickSize").toString())); } - if ((jsonObj.get("minNotional") != null && !jsonObj.get("minNotional").isJsonNull()) - && !jsonObj.get("minNotional").isJsonPrimitive()) { + if ((jsonObj.get("multiplierUp") != null && !jsonObj.get("multiplierUp").isJsonNull()) + && !jsonObj.get("multiplierUp").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `minNotional` to be a primitive type in the JSON" + "Expected the field `multiplierUp` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("minNotional").toString())); + jsonObj.get("multiplierUp").toString())); } - if ((jsonObj.get("maxNotional") != null && !jsonObj.get("maxNotional").isJsonNull()) - && !jsonObj.get("maxNotional").isJsonPrimitive()) { + if ((jsonObj.get("multiplierDown") != null && !jsonObj.get("multiplierDown").isJsonNull()) + && !jsonObj.get("multiplierDown").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `maxNotional` to be a primitive type in the JSON" + "Expected the field `multiplierDown` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("maxNotional").toString())); + jsonObj.get("multiplierDown").toString())); } if ((jsonObj.get("bidMultiplierUp") != null && !jsonObj.get("bidMultiplierUp").isJsonNull()) && !jsonObj.get("bidMultiplierUp").isJsonPrimitive()) { @@ -1233,45 +1163,53 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " JSON string but got `%s`", jsonObj.get("askMultiplierDown").toString())); } - if ((jsonObj.get("multiplierUp") != null && !jsonObj.get("multiplierUp").isJsonNull()) - && !jsonObj.get("multiplierUp").isJsonPrimitive()) { + if ((jsonObj.get("minQty") != null && !jsonObj.get("minQty").isJsonNull()) + && !jsonObj.get("minQty").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `multiplierUp` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("multiplierUp").toString())); + "Expected the field `minQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("minQty").toString())); } - if ((jsonObj.get("multiplierDown") != null && !jsonObj.get("multiplierDown").isJsonNull()) - && !jsonObj.get("multiplierDown").isJsonPrimitive()) { + if ((jsonObj.get("maxQty") != null && !jsonObj.get("maxQty").isJsonNull()) + && !jsonObj.get("maxQty").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `multiplierDown` to be a primitive type in the JSON" + "Expected the field `maxQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("maxQty").toString())); + } + if ((jsonObj.get("stepSize") != null && !jsonObj.get("stepSize").isJsonNull()) + && !jsonObj.get("stepSize").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `stepSize` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("multiplierDown").toString())); + jsonObj.get("stepSize").toString())); } - if ((jsonObj.get("minPrice") != null && !jsonObj.get("minPrice").isJsonNull()) - && !jsonObj.get("minPrice").isJsonPrimitive()) { + if ((jsonObj.get("minNotional") != null && !jsonObj.get("minNotional").isJsonNull()) + && !jsonObj.get("minNotional").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `minPrice` to be a primitive type in the JSON" + "Expected the field `minNotional` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("minPrice").toString())); + jsonObj.get("minNotional").toString())); } - if ((jsonObj.get("maxPrice") != null && !jsonObj.get("maxPrice").isJsonNull()) - && !jsonObj.get("maxPrice").isJsonPrimitive()) { + if ((jsonObj.get("maxNotional") != null && !jsonObj.get("maxNotional").isJsonNull()) + && !jsonObj.get("maxNotional").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `maxPrice` to be a primitive type in the JSON" + "Expected the field `maxNotional` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("maxPrice").toString())); + jsonObj.get("maxNotional").toString())); } - if ((jsonObj.get("tickSize") != null && !jsonObj.get("tickSize").isJsonNull()) - && !jsonObj.get("tickSize").isJsonPrimitive()) { + if ((jsonObj.get("maxPosition") != null && !jsonObj.get("maxPosition").isJsonNull()) + && !jsonObj.get("maxPosition").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `tickSize` to be a primitive type in the JSON" + "Expected the field `maxPosition` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("tickSize").toString())); + jsonObj.get("maxPosition").toString())); } } @@ -1279,29 +1217,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExchangeInfoResponseExchangeFiltersInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'ExchangeInfoResponseExchangeFiltersInner' and its subtypes + if (!ExchangeFiltersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeFiltersInner' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ExchangeInfoResponseExchangeFiltersInner.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ExchangeFiltersInner.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write( - JsonWriter out, ExchangeInfoResponseExchangeFiltersInner value) + public void write(JsonWriter out, ExchangeFiltersInner value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public ExchangeInfoResponseExchangeFiltersInner read(JsonReader in) - throws IOException { + public ExchangeFiltersInner read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -1311,20 +1244,18 @@ public ExchangeInfoResponseExchangeFiltersInner read(JsonReader in) } /** - * Create an instance of ExchangeInfoResponseExchangeFiltersInner given an JSON string + * Create an instance of ExchangeFiltersInner given an JSON string * * @param jsonString JSON string - * @return An instance of ExchangeInfoResponseExchangeFiltersInner - * @throws IOException if the JSON string is invalid with respect to - * ExchangeInfoResponseExchangeFiltersInner + * @return An instance of ExchangeFiltersInner + * @throws IOException if the JSON string is invalid with respect to ExchangeFiltersInner */ - public static ExchangeInfoResponseExchangeFiltersInner fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, ExchangeInfoResponseExchangeFiltersInner.class); + public static ExchangeFiltersInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeFiltersInner.class); } /** - * Convert an instance of ExchangeInfoResponseExchangeFiltersInner to an JSON string + * Convert an instance of ExchangeFiltersInner to an JSON string * * @return JSON string */ diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponse.java index b4cb7b76..3926356d 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -60,13 +58,13 @@ public class ExchangeInfoResponse { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid ExchangeInfoResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public static final String SERIALIZED_NAME_EXCHANGE_FILTERS = "exchangeFilters"; @SerializedName(SERIALIZED_NAME_EXCHANGE_FILTERS) @jakarta.annotation.Nullable - private List<@Valid ExchangeInfoResponseExchangeFiltersInner> exchangeFilters; + private ExchangeFilters exchangeFilters; public static final String SERIALIZED_NAME_SYMBOLS = "symbols"; @@ -114,22 +112,11 @@ public void setServerTime(@jakarta.annotation.Nullable Long serverTime) { this.serverTime = serverTime; } - public ExchangeInfoResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid ExchangeInfoResponseRateLimitsInner> rateLimits) { + public ExchangeInfoResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public ExchangeInfoResponse addRateLimitsItem( - ExchangeInfoResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -137,32 +124,20 @@ public ExchangeInfoResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid ExchangeInfoResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid ExchangeInfoResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } public ExchangeInfoResponse exchangeFilters( - @jakarta.annotation.Nullable - List<@Valid ExchangeInfoResponseExchangeFiltersInner> exchangeFilters) { + @jakarta.annotation.Nullable ExchangeFilters exchangeFilters) { this.exchangeFilters = exchangeFilters; return this; } - public ExchangeInfoResponse addExchangeFiltersItem( - ExchangeInfoResponseExchangeFiltersInner exchangeFiltersItem) { - if (this.exchangeFilters == null) { - this.exchangeFilters = new ArrayList<>(); - } - this.exchangeFilters.add(exchangeFiltersItem); - return this; - } - /** * Get exchangeFilters * @@ -170,13 +145,11 @@ public ExchangeInfoResponse addExchangeFiltersItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid ExchangeInfoResponseExchangeFiltersInner> getExchangeFilters() { + public ExchangeFilters getExchangeFilters() { return exchangeFilters; } - public void setExchangeFilters( - @jakarta.annotation.Nullable - List<@Valid ExchangeInfoResponseExchangeFiltersInner> exchangeFilters) { + public void setExchangeFilters(@jakarta.annotation.Nullable ExchangeFilters exchangeFilters) { this.exchangeFilters = exchangeFilters; } @@ -257,17 +230,11 @@ public String toUrlQueryString() { sb.append("serverTime=").append(urlEncode(serverTimeValueAsString)).append(""); Object rateLimitsValue = getRateLimits(); String rateLimitsValueAsString = ""; - rateLimitsValueAsString = - (String) - ((Collection) rateLimitsValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); + rateLimitsValueAsString = rateLimitsValue.toString(); sb.append("rateLimits=").append(urlEncode(rateLimitsValueAsString)).append(""); Object exchangeFiltersValue = getExchangeFilters(); String exchangeFiltersValueAsString = ""; - exchangeFiltersValueAsString = - (String) - ((Collection) exchangeFiltersValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); + exchangeFiltersValueAsString = exchangeFiltersValue.toString(); sb.append("exchangeFilters=").append(urlEncode(exchangeFiltersValueAsString)).append(""); Object symbolsValue = getSymbols(); String symbolsValueAsString = ""; @@ -331,18 +298,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ExchangeInfoResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeInfoResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeInfoResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("timezone") != null && !jsonObj.get("timezone").isJsonNull()) && !jsonObj.get("timezone").isJsonPrimitive()) { @@ -352,47 +307,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("timezone").toString())); } - 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++) { - ExchangeInfoResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } - if (jsonObj.get("exchangeFilters") != null - && !jsonObj.get("exchangeFilters").isJsonNull()) { - JsonArray jsonArrayexchangeFilters = jsonObj.getAsJsonArray("exchangeFilters"); - if (jsonArrayexchangeFilters != null) { - // ensure the json data is an array - if (!jsonObj.get("exchangeFilters").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `exchangeFilters` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("exchangeFilters").toString())); - } - - // validate the optional field `exchangeFilters` (array) - for (int i = 0; i < jsonArrayexchangeFilters.size(); i++) { - ExchangeInfoResponseExchangeFiltersInner.validateJsonElement( - jsonArrayexchangeFilters.get(i)); - } - ; - } - } if (jsonObj.get("symbols") != null && !jsonObj.get("symbols").isJsonNull()) { JsonArray jsonArraysymbols = jsonObj.getAsJsonArray("symbols"); if (jsonArraysymbols != null) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponseSymbolsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponseSymbolsInner.java index 288b1c6c..a3b981b2 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponseSymbolsInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponseSymbolsInner.java @@ -14,7 +14,6 @@ import com.binance.connector.client.spot.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; @@ -33,9 +32,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -143,11 +140,11 @@ public class ExchangeInfoResponseSymbolsInner { @jakarta.annotation.Nullable private Boolean cancelReplaceAllowed; - public static final String SERIALIZED_NAME_ALLOW_AMEND = "allowAmend"; + public static final String SERIALIZED_NAME_AMEND_ALLOWED = "amendAllowed"; - @SerializedName(SERIALIZED_NAME_ALLOW_AMEND) + @SerializedName(SERIALIZED_NAME_AMEND_ALLOWED) @jakarta.annotation.Nullable - private Boolean allowAmend; + private Boolean amendAllowed; public static final String SERIALIZED_NAME_IS_SPOT_TRADING_ALLOWED = "isSpotTradingAllowed"; @@ -165,7 +162,7 @@ public class ExchangeInfoResponseSymbolsInner { @SerializedName(SERIALIZED_NAME_FILTERS) @jakarta.annotation.Nullable - private List<@Valid ExchangeInfoResponseExchangeFiltersInner> filters; + private ExchangeFilters filters; public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; @@ -524,24 +521,24 @@ public void setCancelReplaceAllowed(@jakarta.annotation.Nullable Boolean cancelR this.cancelReplaceAllowed = cancelReplaceAllowed; } - public ExchangeInfoResponseSymbolsInner allowAmend( - @jakarta.annotation.Nullable Boolean allowAmend) { - this.allowAmend = allowAmend; + public ExchangeInfoResponseSymbolsInner amendAllowed( + @jakarta.annotation.Nullable Boolean amendAllowed) { + this.amendAllowed = amendAllowed; return this; } /** - * Get allowAmend + * Get amendAllowed * - * @return allowAmend + * @return amendAllowed */ @jakarta.annotation.Nullable - public Boolean getAllowAmend() { - return allowAmend; + public Boolean getAmendAllowed() { + return amendAllowed; } - public void setAllowAmend(@jakarta.annotation.Nullable Boolean allowAmend) { - this.allowAmend = allowAmend; + public void setAmendAllowed(@jakarta.annotation.Nullable Boolean amendAllowed) { + this.amendAllowed = amendAllowed; } public ExchangeInfoResponseSymbolsInner isSpotTradingAllowed( @@ -586,21 +583,11 @@ public void setIsMarginTradingAllowed( } public ExchangeInfoResponseSymbolsInner filters( - @jakarta.annotation.Nullable - List<@Valid ExchangeInfoResponseExchangeFiltersInner> filters) { + @jakarta.annotation.Nullable ExchangeFilters filters) { this.filters = filters; return this; } - public ExchangeInfoResponseSymbolsInner addFiltersItem( - ExchangeInfoResponseExchangeFiltersInner filtersItem) { - if (this.filters == null) { - this.filters = new ArrayList<>(); - } - this.filters.add(filtersItem); - return this; - } - /** * Get filters * @@ -608,13 +595,11 @@ public ExchangeInfoResponseSymbolsInner addFiltersItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid ExchangeInfoResponseExchangeFiltersInner> getFilters() { + public ExchangeFilters getFilters() { return filters; } - public void setFilters( - @jakarta.annotation.Nullable - List<@Valid ExchangeInfoResponseExchangeFiltersInner> filters) { + public void setFilters(@jakarta.annotation.Nullable ExchangeFilters filters) { this.filters = filters; } @@ -767,7 +752,7 @@ public boolean equals(Object o) { && Objects.equals( this.cancelReplaceAllowed, exchangeInfoResponseSymbolsInner.cancelReplaceAllowed) - && Objects.equals(this.allowAmend, exchangeInfoResponseSymbolsInner.allowAmend) + && Objects.equals(this.amendAllowed, exchangeInfoResponseSymbolsInner.amendAllowed) && Objects.equals( this.isSpotTradingAllowed, exchangeInfoResponseSymbolsInner.isSpotTradingAllowed) @@ -805,7 +790,7 @@ public int hashCode() { quoteOrderQtyMarketAllowed, allowTrailingStop, cancelReplaceAllowed, - allowAmend, + amendAllowed, isSpotTradingAllowed, isMarginTradingAllowed, filters, @@ -847,7 +832,7 @@ public String toString() { sb.append(" cancelReplaceAllowed: ") .append(toIndentedString(cancelReplaceAllowed)) .append("\n"); - sb.append(" allowAmend: ").append(toIndentedString(allowAmend)).append("\n"); + sb.append(" amendAllowed: ").append(toIndentedString(amendAllowed)).append("\n"); sb.append(" isSpotTradingAllowed: ") .append(toIndentedString(isSpotTradingAllowed)) .append("\n"); @@ -951,10 +936,10 @@ public String toUrlQueryString() { sb.append("cancelReplaceAllowed=") .append(urlEncode(cancelReplaceAllowedValueAsString)) .append(""); - Object allowAmendValue = getAllowAmend(); - String allowAmendValueAsString = ""; - allowAmendValueAsString = allowAmendValue.toString(); - sb.append("allowAmend=").append(urlEncode(allowAmendValueAsString)).append(""); + Object amendAllowedValue = getAmendAllowed(); + String amendAllowedValueAsString = ""; + amendAllowedValueAsString = amendAllowedValue.toString(); + sb.append("amendAllowed=").append(urlEncode(amendAllowedValueAsString)).append(""); Object isSpotTradingAllowedValue = getIsSpotTradingAllowed(); String isSpotTradingAllowedValueAsString = ""; isSpotTradingAllowedValueAsString = isSpotTradingAllowedValue.toString(); @@ -969,10 +954,7 @@ public String toUrlQueryString() { .append(""); Object filtersValue = getFilters(); String filtersValueAsString = ""; - filtersValueAsString = - (String) - ((Collection) filtersValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); + filtersValueAsString = filtersValue.toString(); sb.append("filters=").append(urlEncode(filtersValueAsString)).append(""); Object permissionsValue = getPermissions(); String permissionsValueAsString = ""; @@ -1048,7 +1030,7 @@ private String toIndentedString(Object o) { openapiFields.add("quoteOrderQtyMarketAllowed"); openapiFields.add("allowTrailingStop"); openapiFields.add("cancelReplaceAllowed"); - openapiFields.add("allowAmend"); + openapiFields.add("amendAllowed"); openapiFields.add("isSpotTradingAllowed"); openapiFields.add("isMarginTradingAllowed"); openapiFields.add("filters"); @@ -1079,18 +1061,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ExchangeInfoResponseSymbolsInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeInfoResponseSymbolsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeInfoResponseSymbolsInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { @@ -1134,26 +1104,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("orderTypes").toString())); } - if (jsonObj.get("filters") != null && !jsonObj.get("filters").isJsonNull()) { - JsonArray jsonArrayfilters = jsonObj.getAsJsonArray("filters"); - if (jsonArrayfilters != null) { - // ensure the json data is an array - if (!jsonObj.get("filters").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `filters` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("filters").toString())); - } - - // validate the optional field `filters` (array) - for (int i = 0; i < jsonArrayfilters.size(); i++) { - ExchangeInfoResponseExchangeFiltersInner.validateJsonElement( - jsonArrayfilters.get(i)); - } - ; - } - } // ensure the optional json data is an array if present if (jsonObj.get("permissions") != null && !jsonObj.get("permissions").isJsonNull() diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetAccountResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetAccountResponse.java index 7fda73d9..a715110a 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetAccountResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetAccountResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -688,18 +686,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetAccountResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetAccountResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetAccountResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `commissionRates` if (jsonObj.get("commissionRates") != null diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetAccountResponseBalancesInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetAccountResponseBalancesInner.java index 6a9ad089..c4b07c88 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetAccountResponseBalancesInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetAccountResponseBalancesInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetAccountResponseBalancesInner */ @@ -215,18 +213,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetAccountResponseBalancesInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetAccountResponseBalancesInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetAccountResponseBalancesInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) && !jsonObj.get("asset").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetAccountResponseCommissionRates.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetAccountResponseCommissionRates.java index 609eaa0b..f737db40 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetAccountResponseCommissionRates.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetAccountResponseCommissionRates.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetAccountResponseCommissionRates */ @@ -248,18 +246,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetAccountResponseCommissionRates.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetAccountResponseCommissionRates` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("maker") != null && !jsonObj.get("maker").isJsonNull()) && !jsonObj.get("maker").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetOpenOrdersResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetOpenOrdersResponse.java index f8854306..639a73ed 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetOpenOrdersResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetOpenOrdersResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** GetOpenOrdersResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to GetOpenOrdersResponse */ 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) { + AllOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!GetOpenOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetOpenOrdersResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetOpenOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetOpenOrdersResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetOrderListResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetOrderListResponse.java index 3255cb35..3e5791e1 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetOrderListResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetOrderListResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -406,18 +404,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetOrderListResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetOrderListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetOrderListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) && !jsonObj.get("contingencyType").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetOrderListResponseOrdersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetOrderListResponseOrdersInner.java index 4de3af2c..1885555f 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetOrderListResponseOrdersInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetOrderListResponseOrdersInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetOrderListResponseOrdersInner */ @@ -217,18 +215,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetOrderListResponseOrdersInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetOrderListResponseOrdersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetOrderListResponseOrdersInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetOrderResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetOrderResponse.java index deb04bb4..431bf87c 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetOrderResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** GetOrderResponse */ @@ -793,18 +791,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetTradesResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetTradesResponse.java index 020c3f09..f4411a94 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetTradesResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/GetTradesResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** GetTradesResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to GetTradesResponse */ 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) { + HistoricalTradesResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!GetTradesResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti GetTradesResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetTradesResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetTradesResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/HistoricalTradesResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/HistoricalTradesResponse.java index 761707fb..7d9c6315 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/HistoricalTradesResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/HistoricalTradesResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** HistoricalTradesResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to HistoricalTradesResponse */ 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) { + HistoricalTradesResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!HistoricalTradesResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti HistoricalTradesResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!HistoricalTradesResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `HistoricalTradesResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/HistoricalTradesResponseInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/HistoricalTradesResponseInner.java index d69a954a..9fd91062 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/HistoricalTradesResponseInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/HistoricalTradesResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** HistoricalTradesResponseInner */ @@ -345,18 +343,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti HistoricalTradesResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!HistoricalTradesResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `HistoricalTradesResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) && !jsonObj.get("price").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/KlinesItem.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/KlinesItem.java index 98db9519..a7c1d143 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/KlinesItem.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/KlinesItem.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** KlinesItem */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to KlinesItem */ 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) { + KlinesItemInner.validateJsonElement(element); + } if (jsonElement == null) { if (!KlinesItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti KlinesItem.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!KlinesItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `KlinesItem` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/KlinesResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/KlinesResponse.java index 7cc8f31b..7d64367f 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/KlinesResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/KlinesResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** KlinesResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to KlinesResponse */ 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) { + KlinesItem.validateJsonElement(element); + } if (jsonElement == null) { if (!KlinesResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti KlinesResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!KlinesResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `KlinesResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyAllocationsResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyAllocationsResponse.java index dc3ce43d..786d9253 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyAllocationsResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyAllocationsResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** MyAllocationsResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to MyAllocationsResponse */ 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) { + MyAllocationsResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!MyAllocationsResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti MyAllocationsResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MyAllocationsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MyAllocationsResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyAllocationsResponseInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyAllocationsResponseInner.java index 521d7d7a..5a187fb3 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyAllocationsResponseInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyAllocationsResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** MyAllocationsResponseInner */ @@ -582,18 +580,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti MyAllocationsResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MyAllocationsResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MyAllocationsResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyPreventedMatchesResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyPreventedMatchesResponse.java index 28d707fb..44136939 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyPreventedMatchesResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyPreventedMatchesResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** MyPreventedMatchesResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to MyPreventedMatchesResponse */ 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) { + MyPreventedMatchesResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!MyPreventedMatchesResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti MyPreventedMatchesResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MyPreventedMatchesResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MyPreventedMatchesResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyPreventedMatchesResponseInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyPreventedMatchesResponseInner.java index dd0e442b..016e7fde 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyPreventedMatchesResponseInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyPreventedMatchesResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** MyPreventedMatchesResponseInner */ @@ -473,18 +471,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti MyPreventedMatchesResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MyPreventedMatchesResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MyPreventedMatchesResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyTradesResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyTradesResponse.java index 083a91ee..73ce5954 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyTradesResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyTradesResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** MyTradesResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to MyTradesResponse */ 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) { + MyTradesResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!MyTradesResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti MyTradesResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MyTradesResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MyTradesResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyTradesResponseInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyTradesResponseInner.java index 6964f770..7a8cb216 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyTradesResponseInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/MyTradesResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** MyTradesResponseInner */ @@ -547,18 +545,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti MyTradesResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!MyTradesResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `MyTradesResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewOrderRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewOrderRequest.java index 418812b9..4f1655af 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewOrderRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewOrderRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NewOrderRequest */ @@ -673,18 +671,6 @@ 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 (!NewOrderRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewOrderRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : NewOrderRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewOrderResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewOrderResponse.java index 4e8c89be..c8eebf86 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewOrderResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewOrderResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -714,18 +712,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti NewOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NewOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewOrderResponseFillsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewOrderResponseFillsInner.java index 356b9dbb..f42528ba 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewOrderResponseFillsInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewOrderResponseFillsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NewOrderResponseFillsInner */ @@ -278,18 +276,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti NewOrderResponseFillsInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NewOrderResponseFillsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewOrderResponseFillsInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) && !jsonObj.get("price").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewUserDataStreamResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewUserDataStreamResponse.java index 5cf21bc9..9864660c 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewUserDataStreamResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/NewUserDataStreamResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** NewUserDataStreamResponse */ @@ -149,18 +147,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti NewUserDataStreamResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!NewUserDataStreamResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `NewUserDataStreamResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("listenKey") != null && !jsonObj.get("listenKey").isJsonNull()) && !jsonObj.get("listenKey").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OpenOrderListResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OpenOrderListResponse.java index 5f3ca220..0ef297b2 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OpenOrderListResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OpenOrderListResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** OpenOrderListResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to OpenOrderListResponse */ 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) { + OpenOrderListResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!OpenOrderListResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OpenOrderListResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OpenOrderListResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OpenOrderListResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OpenOrderListResponseInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OpenOrderListResponseInner.java index f4fe8b24..52463c74 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OpenOrderListResponseInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OpenOrderListResponseInner.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -412,18 +410,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OpenOrderListResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OpenOrderListResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OpenOrderListResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) && !jsonObj.get("contingencyType").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OpenOrderListResponseInnerOrdersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OpenOrderListResponseInnerOrdersInner.java index c2a13138..588af47c 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OpenOrderListResponseInnerOrdersInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OpenOrderListResponseInnerOrdersInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OpenOrderListResponseInnerOrdersInner */ @@ -220,19 +218,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OpenOrderListResponseInnerOrdersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OpenOrderListResponseInnerOrdersInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityRequest.java index e0ca1f42..c3b02e8c 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderAmendKeepPriorityRequest */ @@ -325,18 +323,6 @@ 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 (!OrderAmendKeepPriorityRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderAmendKeepPriorityRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : OrderAmendKeepPriorityRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityResponse.java index 72a4f48d..128b4647 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityResponse.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderAmendKeepPriorityResponse */ @@ -256,18 +254,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderAmendKeepPriorityResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderAmendKeepPriorityResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderAmendKeepPriorityResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `amendedOrder` if (jsonObj.get("amendedOrder") != null && !jsonObj.get("amendedOrder").isJsonNull()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityResponseAmendedOrder.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityResponseAmendedOrder.java index 9c502590..66d25164 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityResponseAmendedOrder.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityResponseAmendedOrder.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderAmendKeepPriorityResponseAmendedOrder */ @@ -725,20 +723,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderAmendKeepPriorityResponseAmendedOrder.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderAmendKeepPriorityResponseAmendedOrder` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityResponseListStatus.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityResponseListStatus.java index b64c2a61..64b08b92 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityResponseListStatus.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityResponseListStatus.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -351,19 +349,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderAmendKeepPriorityResponseListStatus.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderAmendKeepPriorityResponseListStatus` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) && !jsonObj.get("contingencyType").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityResponseListStatusOrdersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityResponseListStatusOrdersInner.java index 01a82454..be45e453 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityResponseListStatusOrdersInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendKeepPriorityResponseListStatusOrdersInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderAmendKeepPriorityResponseListStatusOrdersInner */ @@ -226,20 +224,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderAmendKeepPriorityResponseListStatusOrdersInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderAmendKeepPriorityResponseListStatusOrdersInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendmentsResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendmentsResponse.java index f6ccb5ff..ab5efbff 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendmentsResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendmentsResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** OrderAmendmentsResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to OrderAmendmentsResponse */ 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) { + OrderAmendmentsResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!OrderAmendmentsResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderAmendmentsResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderAmendmentsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderAmendmentsResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendmentsResponseInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendmentsResponseInner.java index aaf418c3..f53e1100 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendmentsResponseInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderAmendmentsResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderAmendmentsResponseInner */ @@ -389,18 +387,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderAmendmentsResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderAmendmentsResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderAmendmentsResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceRequest.java index cf4f6224..3ee83b5a 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderCancelReplaceRequest */ @@ -922,18 +920,6 @@ 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 (!OrderCancelReplaceRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderCancelReplaceRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : OrderCancelReplaceRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponse.java index 843a8288..5e1d67d3 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponse.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderCancelReplaceResponse */ @@ -216,18 +214,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderCancelReplaceResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderCancelReplaceResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderCancelReplaceResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseData.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseData.java index ba9be41f..1c33439c 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseData.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseData.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderCancelReplaceResponseData */ @@ -263,18 +261,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderCancelReplaceResponseData.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderCancelReplaceResponseData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderCancelReplaceResponseData` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("cancelResult") != null && !jsonObj.get("cancelResult").isJsonNull()) && !jsonObj.get("cancelResult").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseDataCancelResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseDataCancelResponse.java index cea463d7..9442c8c1 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseDataCancelResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseDataCancelResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderCancelReplaceResponseDataCancelResponse */ @@ -696,20 +694,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderCancelReplaceResponseDataCancelResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderCancelReplaceResponseDataCancelResponse` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseDataNewOrderResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseDataNewOrderResponse.java index 8153aba1..d4b8e66b 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseDataNewOrderResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderCancelReplaceResponseDataNewOrderResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderCancelReplaceResponseDataNewOrderResponse */ @@ -188,20 +186,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderCancelReplaceResponseDataNewOrderResponse.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderCancelReplaceResponseDataNewOrderResponse`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) && !jsonObj.get("msg").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoRequest.java index 38ad0c9d..a422e3e2 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderListOcoRequest */ @@ -1008,18 +1006,6 @@ 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 (!OrderListOcoRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderListOcoRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : OrderListOcoRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoResponse.java index a7b0da5e..283fb963 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -456,18 +454,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderListOcoResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderListOcoResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderListOcoResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) && !jsonObj.get("contingencyType").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoResponseOrderReportsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoResponseOrderReportsInner.java index c96cda80..fe8b2cce 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoResponseOrderReportsInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoResponseOrderReportsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderListOcoResponseOrderReportsInner */ @@ -754,19 +752,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderListOcoResponseOrderReportsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderListOcoResponseOrderReportsInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoResponseOrdersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoResponseOrdersInner.java index 3920b084..0000d863 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoResponseOrdersInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOcoResponseOrdersInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderListOcoResponseOrdersInner */ @@ -217,18 +215,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderListOcoResponseOrdersInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderListOcoResponseOrdersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderListOcoResponseOrdersInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoRequest.java index 20212dca..7839a8a8 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderListOtoRequest */ @@ -1042,18 +1040,6 @@ 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 (!OrderListOtoRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderListOtoRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : OrderListOtoRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoResponse.java index c1a6e126..cade3949 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -456,18 +454,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderListOtoResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderListOtoResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderListOtoResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) && !jsonObj.get("contingencyType").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoResponseOrderReportsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoResponseOrderReportsInner.java index 0b03716c..bf73ef3e 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoResponseOrderReportsInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoResponseOrderReportsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderListOtoResponseOrderReportsInner */ @@ -685,19 +683,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderListOtoResponseOrderReportsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderListOtoResponseOrderReportsInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoResponseOrdersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoResponseOrdersInner.java index d6437124..22d90a5f 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoResponseOrdersInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtoResponseOrdersInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderListOtoResponseOrdersInner */ @@ -217,18 +215,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderListOtoResponseOrdersInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderListOtoResponseOrdersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderListOtoResponseOrdersInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoRequest.java index f071e12a..5b13829b 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderListOtocoRequest */ @@ -1439,18 +1437,6 @@ 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 (!OrderListOtocoRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderListOtocoRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : OrderListOtocoRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoResponse.java index f0f91986..72baa6b6 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -458,18 +456,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderListOtocoResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderListOtocoResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderListOtocoResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) && !jsonObj.get("contingencyType").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoResponseOrderReportsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoResponseOrderReportsInner.java index b9e3021b..cbe46f18 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoResponseOrderReportsInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoResponseOrderReportsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderListOtocoResponseOrderReportsInner */ @@ -722,19 +720,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderListOtocoResponseOrderReportsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderListOtocoResponseOrderReportsInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoResponseOrdersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoResponseOrdersInner.java index 1dfc2a1b..bf19a1a0 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoResponseOrdersInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderListOtocoResponseOrdersInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderListOtocoResponseOrdersInner */ @@ -218,18 +216,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderListOtocoResponseOrdersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderListOtocoResponseOrdersInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoRequest.java index 3ac6b04e..0c9feaf1 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderOcoRequest */ @@ -829,18 +827,6 @@ 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 (!OrderOcoRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderOcoRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : OrderOcoRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoResponse.java index 82903444..4d70fe36 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -454,18 +452,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderOcoResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderOcoResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderOcoResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("contingencyType") != null && !jsonObj.get("contingencyType").isJsonNull()) && !jsonObj.get("contingencyType").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoResponseOrderReportsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoResponseOrderReportsInner.java index 4ed24091..0a771336 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoResponseOrderReportsInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoResponseOrderReportsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderOcoResponseOrderReportsInner */ @@ -709,18 +707,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderOcoResponseOrderReportsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderOcoResponseOrderReportsInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoResponseOrdersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoResponseOrdersInner.java index d1b41255..1c2493c5 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoResponseOrdersInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderOcoResponseOrdersInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderOcoResponseOrdersInner */ @@ -215,18 +213,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderOcoResponseOrdersInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderOcoResponseOrdersInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderOcoResponseOrdersInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestRequest.java index 874abb44..43db536f 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderTestRequest */ @@ -155,18 +153,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderTestRequest.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderTestRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderTestRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponse.java index ec8fa7c4..249ffb4f 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponse.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderTestResponse */ @@ -238,18 +236,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderTestResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderTestResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderTestResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `standardCommissionForOrder` if (jsonObj.get("standardCommissionForOrder") != null diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponseDiscount.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponseDiscount.java index ba23b06f..2b02f946 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponseDiscount.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponseDiscount.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderTestResponseDiscount */ @@ -250,18 +248,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti OrderTestResponseDiscount.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderTestResponseDiscount.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderTestResponseDiscount` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("discountAsset") != null && !jsonObj.get("discountAsset").isJsonNull()) && !jsonObj.get("discountAsset").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponseStandardCommissionForOrder.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponseStandardCommissionForOrder.java index 1c93d163..7546c892 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponseStandardCommissionForOrder.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/OrderTestResponseStandardCommissionForOrder.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** OrderTestResponseStandardCommissionForOrder */ @@ -187,20 +185,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti .toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderTestResponseStandardCommissionForOrder.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderTestResponseStandardCommissionForOrder` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("maker") != null && !jsonObj.get("maker").isJsonNull()) && !jsonObj.get("maker").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Permissions.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Permissions.java index c06e2853..bc66f86e 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Permissions.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Permissions.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** Permissions */ @@ -108,6 +107,24 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to Permissions */ 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 (!Permissions.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +135,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti Permissions.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Permissions.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Permissions` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PutUserDataStreamRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PutUserDataStreamRequest.java index bfbfb1c2..1febaaeb 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PutUserDataStreamRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/PutUserDataStreamRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** PutUserDataStreamRequest */ @@ -152,18 +150,6 @@ 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 (!PutUserDataStreamRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PutUserDataStreamRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : PutUserDataStreamRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimitOrderResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimitOrderResponse.java index 48c6699a..fce8f17e 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimitOrderResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimitOrderResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** RateLimitOrderResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to RateLimitOrderResponse */ 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) { + RateLimitOrderResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!RateLimitOrderResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti RateLimitOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RateLimitOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RateLimitOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimitOrderResponseInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimitOrderResponseInner.java index d39c9e34..8bd1cab0 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimitOrderResponseInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimitOrderResponseInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** RateLimitOrderResponseInner */ @@ -279,18 +277,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti RateLimitOrderResponseInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RateLimitOrderResponseInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RateLimitOrderResponseInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) && !jsonObj.get("rateLimitType").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimits.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimits.java new file mode 100644 index 00000000..a536dbc0 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimits.java @@ -0,0 +1,182 @@ +/* + * 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.spot.rest.model; + +import com.binance.connector.client.spot.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.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.*; + +/** RateLimits */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RateLimits extends ArrayList { + public RateLimits() {} + + @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 RateLimits {\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 RateLimits + */ + 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) { + RateLimitsInner.validateJsonElement(element); + } + if (jsonElement == null) { + if (!RateLimits.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RateLimits is not found in the empty" + + " JSON string", + RateLimits.openapiRequiredFields.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RateLimits.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RateLimits' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RateLimits.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RateLimits value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RateLimits read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RateLimits given an JSON string + * + * @param jsonString JSON string + * @return An instance of RateLimits + * @throws IOException if the JSON string is invalid with respect to RateLimits + */ + public static RateLimits fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RateLimits.class); + } + + /** + * Convert an instance of RateLimits to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponseRateLimitsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimitsInner.java similarity index 71% rename from clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponseRateLimitsInner.java rename to clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimitsInner.java index b64af7bf..30bcd5ab 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/ExchangeInfoResponseRateLimitsInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/RateLimitsInner.java @@ -28,16 +28,14 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; -/** ExchangeInfoResponseRateLimitsInner */ +/** RateLimitsInner */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class ExchangeInfoResponseRateLimitsInner { +public class RateLimitsInner { public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) @@ -62,10 +60,15 @@ public class ExchangeInfoResponseRateLimitsInner { @jakarta.annotation.Nullable private Long limit; - public ExchangeInfoResponseRateLimitsInner() {} + public static final String SERIALIZED_NAME_COUNT = "count"; - public ExchangeInfoResponseRateLimitsInner rateLimitType( - @jakarta.annotation.Nullable String rateLimitType) { + @SerializedName(SERIALIZED_NAME_COUNT) + @jakarta.annotation.Nullable + private Long count; + + public RateLimitsInner() {} + + public RateLimitsInner rateLimitType(@jakarta.annotation.Nullable String rateLimitType) { this.rateLimitType = rateLimitType; return this; } @@ -84,8 +87,7 @@ public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) this.rateLimitType = rateLimitType; } - public ExchangeInfoResponseRateLimitsInner interval( - @jakarta.annotation.Nullable String interval) { + public RateLimitsInner interval(@jakarta.annotation.Nullable String interval) { this.interval = interval; return this; } @@ -104,8 +106,7 @@ public void setInterval(@jakarta.annotation.Nullable String interval) { this.interval = interval; } - public ExchangeInfoResponseRateLimitsInner intervalNum( - @jakarta.annotation.Nullable Long intervalNum) { + public RateLimitsInner intervalNum(@jakarta.annotation.Nullable Long intervalNum) { this.intervalNum = intervalNum; return this; } @@ -124,7 +125,7 @@ public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { this.intervalNum = intervalNum; } - public ExchangeInfoResponseRateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { + public RateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { this.limit = limit; return this; } @@ -143,6 +144,25 @@ public void setLimit(@jakarta.annotation.Nullable Long limit) { this.limit = limit; } + public RateLimitsInner count(@jakarta.annotation.Nullable Long count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count + */ + @jakarta.annotation.Nullable + public Long getCount() { + return count; + } + + public void setCount(@jakarta.annotation.Nullable Long count) { + this.count = count; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -151,27 +171,28 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ExchangeInfoResponseRateLimitsInner exchangeInfoResponseRateLimitsInner = - (ExchangeInfoResponseRateLimitsInner) o; - return Objects.equals(this.rateLimitType, exchangeInfoResponseRateLimitsInner.rateLimitType) - && Objects.equals(this.interval, exchangeInfoResponseRateLimitsInner.interval) - && Objects.equals(this.intervalNum, exchangeInfoResponseRateLimitsInner.intervalNum) - && Objects.equals(this.limit, exchangeInfoResponseRateLimitsInner.limit); + RateLimitsInner rateLimitsInner = (RateLimitsInner) o; + return Objects.equals(this.rateLimitType, rateLimitsInner.rateLimitType) + && Objects.equals(this.interval, rateLimitsInner.interval) + && Objects.equals(this.intervalNum, rateLimitsInner.intervalNum) + && Objects.equals(this.limit, rateLimitsInner.limit) + && Objects.equals(this.count, rateLimitsInner.count); } @Override public int hashCode() { - return Objects.hash(rateLimitType, interval, intervalNum, limit); + return Objects.hash(rateLimitType, interval, intervalNum, limit, count); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ExchangeInfoResponseRateLimitsInner {\n"); + sb.append("class RateLimitsInner {\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"); sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); sb.append("}"); return sb.toString(); } @@ -195,6 +216,10 @@ public String toUrlQueryString() { String limitValueAsString = ""; limitValueAsString = limitValue.toString(); sb.append("limit=").append(urlEncode(limitValueAsString)).append(""); + Object countValue = getCount(); + String countValueAsString = ""; + countValueAsString = countValue.toString(); + sb.append("count=").append(urlEncode(countValueAsString)).append(""); return sb.toString(); } @@ -227,6 +252,7 @@ private String toIndentedString(Object o) { openapiFields.add("interval"); openapiFields.add("intervalNum"); openapiFields.add("limit"); + openapiFields.add("count"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -236,31 +262,17 @@ private String toIndentedString(Object o) { * 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 - * ExchangeInfoResponseRateLimitsInner + * @throws IOException if the JSON Element is invalid with respect to RateLimitsInner */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ExchangeInfoResponseRateLimitsInner.openapiRequiredFields + if (!RateLimitsInner.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in ExchangeInfoResponseRateLimitsInner is" - + " not found in the empty JSON string", - ExchangeInfoResponseRateLimitsInner.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeInfoResponseRateLimitsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeInfoResponseRateLimitsInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); + "The required field(s) %s in RateLimitsInner is not found in the" + + " empty JSON string", + RateLimitsInner.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -286,27 +298,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExchangeInfoResponseRateLimitsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ExchangeInfoResponseRateLimitsInner' and - // its subtypes + if (!RateLimitsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RateLimitsInner' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ExchangeInfoResponseRateLimitsInner.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RateLimitsInner.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, ExchangeInfoResponseRateLimitsInner value) + public void write(JsonWriter out, RateLimitsInner value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public ExchangeInfoResponseRateLimitsInner read(JsonReader in) - throws IOException { + public RateLimitsInner read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -316,20 +325,18 @@ public ExchangeInfoResponseRateLimitsInner read(JsonReader in) } /** - * Create an instance of ExchangeInfoResponseRateLimitsInner given an JSON string + * Create an instance of RateLimitsInner given an JSON string * * @param jsonString JSON string - * @return An instance of ExchangeInfoResponseRateLimitsInner - * @throws IOException if the JSON string is invalid with respect to - * ExchangeInfoResponseRateLimitsInner + * @return An instance of RateLimitsInner + * @throws IOException if the JSON string is invalid with respect to RateLimitsInner */ - public static ExchangeInfoResponseRateLimitsInner fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, ExchangeInfoResponseRateLimitsInner.class); + public static RateLimitsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RateLimitsInner.class); } /** - * Convert an instance of ExchangeInfoResponseRateLimitsInner to an JSON string + * Convert an instance of RateLimitsInner to an JSON string * * @return JSON string */ diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderRequest.java index 6086a148..8b37cad2 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderRequest.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** SorOrderRequest */ @@ -574,18 +572,6 @@ 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 (!SorOrderRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SorOrderRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - // check to make sure all required properties/fields are present in the JSON string for (String requiredField : SorOrderRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderResponse.java index 6b3bcbb7..3b12fd0d 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderResponse.java @@ -33,9 +33,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; @@ -780,18 +778,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti SorOrderResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SorOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SorOrderResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderResponseFillsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderResponseFillsInner.java index fff5f434..266e850d 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderResponseFillsInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderResponseFillsInner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** SorOrderResponseFillsInner */ @@ -342,18 +340,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti SorOrderResponseFillsInner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SorOrderResponseFillsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SorOrderResponseFillsInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("matchType") != null && !jsonObj.get("matchType").isJsonNull()) && !jsonObj.get("matchType").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderTestRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderTestRequest.java index 9e6b993c..1f0c09f6 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderTestRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderTestRequest.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** SorOrderTestRequest */ @@ -156,18 +154,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti SorOrderTestRequest.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SorOrderTestRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SorOrderTestRequest` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderTestResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderTestResponse.java index fe070ef1..c471d448 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderTestResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/SorOrderTestResponse.java @@ -29,9 +29,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** SorOrderTestResponse */ @@ -238,18 +236,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti SorOrderTestResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SorOrderTestResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SorOrderTestResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `standardCommissionForOrder` if (jsonObj.get("standardCommissionForOrder") != null diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Symbols.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Symbols.java index 4764c16f..1f977a54 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Symbols.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Symbols.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** Symbols */ @@ -108,6 +107,24 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to Symbols */ 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 (!Symbols.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +135,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti Symbols.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Symbols.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Symbols`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse1.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse1.java index c813b907..67dcc145 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse1.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse1.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** Ticker24hrResponse1 */ @@ -513,18 +511,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti Ticker24hrResponse1.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Ticker24hrResponse1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Ticker24hrResponse1` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse2.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse2.java index d4ae30c1..f3aad678 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse2.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse2.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** Ticker24hrResponse2 */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to Ticker24hrResponse2 */ 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) { + Ticker24hrResponse2Inner.validateJsonElement(element); + } if (jsonElement == null) { if (!Ticker24hrResponse2.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti Ticker24hrResponse2.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Ticker24hrResponse2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Ticker24hrResponse2` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse2Inner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse2Inner.java index 32de81b9..61e5b51d 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse2Inner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/Ticker24hrResponse2Inner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** Ticker24hrResponse2Inner */ @@ -513,18 +511,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti Ticker24hrResponse2Inner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Ticker24hrResponse2Inner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Ticker24hrResponse2Inner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerBookTickerResponse1.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerBookTickerResponse1.java index 5bec5b26..eebd1717 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerBookTickerResponse1.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerBookTickerResponse1.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** TickerBookTickerResponse1 */ @@ -277,18 +275,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TickerBookTickerResponse1.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TickerBookTickerResponse1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TickerBookTickerResponse1` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerBookTickerResponse2.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerBookTickerResponse2.java index 3282c66b..85477452 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerBookTickerResponse2.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerBookTickerResponse2.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** TickerBookTickerResponse2 */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to TickerBookTickerResponse2 */ 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) { + TickerBookTickerResponse2Inner.validateJsonElement(element); + } if (jsonElement == null) { if (!TickerBookTickerResponse2.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TickerBookTickerResponse2.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TickerBookTickerResponse2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TickerBookTickerResponse2` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerBookTickerResponse2Inner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerBookTickerResponse2Inner.java index a2e303cf..6381c52e 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerBookTickerResponse2Inner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerBookTickerResponse2Inner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** TickerBookTickerResponse2Inner */ @@ -279,18 +277,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TickerBookTickerResponse2Inner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TickerBookTickerResponse2Inner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TickerBookTickerResponse2Inner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerPriceResponse1.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerPriceResponse1.java index 743b1d5c..f4b72b01 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerPriceResponse1.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerPriceResponse1.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** TickerPriceResponse1 */ @@ -181,18 +179,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TickerPriceResponse1.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TickerPriceResponse1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TickerPriceResponse1` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerPriceResponse2.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerPriceResponse2.java index ac78d14a..8daba6de 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerPriceResponse2.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerPriceResponse2.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** TickerPriceResponse2 */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to TickerPriceResponse2 */ 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) { + TickerPriceResponse2Inner.validateJsonElement(element); + } if (jsonElement == null) { if (!TickerPriceResponse2.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TickerPriceResponse2.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TickerPriceResponse2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TickerPriceResponse2` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerPriceResponse2Inner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerPriceResponse2Inner.java index 694363da..e110c90c 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerPriceResponse2Inner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerPriceResponse2Inner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** TickerPriceResponse2Inner */ @@ -181,18 +179,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TickerPriceResponse2Inner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TickerPriceResponse2Inner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TickerPriceResponse2Inner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse1.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse1.java index efc2992f..83e13141 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse1.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse1.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** TickerResponse1 */ @@ -513,18 +511,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TickerResponse1.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TickerResponse1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TickerResponse1` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse2.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse2.java index 539cc7c4..07bf2810 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse2.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse2.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** TickerResponse2 */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to TickerResponse2 */ 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) { + TickerResponse2Inner.validateJsonElement(element); + } if (jsonElement == null) { if (!TickerResponse2.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TickerResponse2.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TickerResponse2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TickerResponse2` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse2Inner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse2Inner.java index 8741c295..6337da75 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse2Inner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerResponse2Inner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** TickerResponse2Inner */ @@ -513,18 +511,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TickerResponse2Inner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TickerResponse2Inner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TickerResponse2Inner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse1.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse1.java index 6b1c8952..e04a3576 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse1.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse1.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** TickerTradingDayResponse1 */ @@ -513,18 +511,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TickerTradingDayResponse1.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TickerTradingDayResponse1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TickerTradingDayResponse1` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse2.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse2.java index 3510b699..fd7454e5 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse2.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse2.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** TickerTradingDayResponse2 */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to TickerTradingDayResponse2 */ 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) { + TickerTradingDayResponse2Inner.validateJsonElement(element); + } if (jsonElement == null) { if (!TickerTradingDayResponse2.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TickerTradingDayResponse2.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TickerTradingDayResponse2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TickerTradingDayResponse2` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse2Inner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse2Inner.java index cb2b84e5..1c6049ed 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse2Inner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TickerTradingDayResponse2Inner.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** TickerTradingDayResponse2Inner */ @@ -516,18 +514,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TickerTradingDayResponse2Inner.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TickerTradingDayResponse2Inner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TickerTradingDayResponse2Inner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TimeResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TimeResponse.java index f13ff01a..48dfc578 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TimeResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/TimeResponse.java @@ -28,9 +28,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashSet; -import java.util.Map; import java.util.Objects; -import java.util.Set; import org.hibernate.validator.constraints.*; /** TimeResponse */ @@ -149,18 +147,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti TimeResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TimeResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TimeResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/UiKlinesItem.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/UiKlinesItem.java index 3df0f003..34f8d733 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/UiKlinesItem.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/UiKlinesItem.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** UiKlinesItem */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to UiKlinesItem */ 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) { + KlinesItemInner.validateJsonElement(element); + } if (jsonElement == null) { if (!UiKlinesItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti UiKlinesItem.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UiKlinesItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UiKlinesItem` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/UiKlinesResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/UiKlinesResponse.java index 1b55049e..274d1392 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/UiKlinesResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/model/UiKlinesResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.spot.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; @@ -28,9 +29,7 @@ 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 org.hibernate.validator.constraints.*; /** UiKlinesResponse */ @@ -108,6 +107,18 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to UiKlinesResponse */ 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) { + UiKlinesItem.validateJsonElement(element); + } if (jsonElement == null) { if (!UiKlinesResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -118,18 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti UiKlinesResponse.openapiRequiredFields.toString())); } } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UiKlinesResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UiKlinesResponse` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java index a0e112fb..9c1eb8e2 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java @@ -114,9 +114,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.AccountCommissionResponse .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .AccountCommissionResponseRateLimitsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .AccountCommissionResponseResult.CustomTypeAdapterFactory()); @@ -136,9 +133,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .AccountRateLimitsOrdersResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .AccountRateLimitsOrdersResponseRateLimitsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .AccountRateLimitsOrdersResponseResultInner.CustomTypeAdapterFactory()); @@ -163,6 +157,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.AllOrderListsResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .AllOrderListsResponseResultInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.AllOrdersRequest .CustomTypeAdapterFactory()); @@ -178,9 +175,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.AvgPriceResponse .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .AvgPriceResponseRateLimitsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.AvgPriceResponseResult .CustomTypeAdapterFactory()); @@ -193,6 +187,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.DepthResponseResult .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.ExchangeFilters + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.ExchangeFiltersInner + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.ExchangeInfoRequest .CustomTypeAdapterFactory()); @@ -202,12 +202,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.ExchangeInfoResponseResult .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .ExchangeInfoResponseResultExchangeFiltersInner.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .ExchangeInfoResponseResultRateLimitsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .ExchangeInfoResponseResultSorsInner.CustomTypeAdapterFactory()); @@ -259,9 +253,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .OpenOrderListsStatusResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .OpenOrderListsStatusResponseRateLimitsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .OpenOrderListsStatusResponseResultInner.CustomTypeAdapterFactory()); @@ -330,9 +321,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.OrderCancelReplaceResponse .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .OrderCancelReplaceResponseRateLimitsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .OrderCancelReplaceResponseResult.CustomTypeAdapterFactory()); @@ -352,9 +340,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.OrderCancelResponseResult .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .OrderCancelResponseResultOrderReportsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.OrderListCancelRequest .CustomTypeAdapterFactory()); @@ -392,9 +377,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOtoResponse .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .OrderListPlaceOtoResponseRateLimitsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .OrderListPlaceOtoResponseResult.CustomTypeAdapterFactory()); @@ -411,9 +393,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .OrderListPlaceOtocoResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .OrderListPlaceOtocoResponseRateLimitsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .OrderListPlaceOtocoResponseResult.CustomTypeAdapterFactory()); @@ -430,9 +409,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.OrderListPlaceResponse .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .OrderListPlaceResponseRateLimitsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .OrderListPlaceResponseResult.CustomTypeAdapterFactory()); @@ -445,9 +421,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.OrderListStatusResponse .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .OrderListStatusResponseResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.OrderPlaceRequest .CustomTypeAdapterFactory()); @@ -488,6 +461,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.Permissions .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.PingResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.RateLimits + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model.RateLimitsInner + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.SessionLogonRequest .CustomTypeAdapterFactory()); @@ -590,18 +572,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.TickerResponse1 .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .TickerResponse1RateLimitsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.TickerResponse1Result .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.TickerResponse2 .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .TickerResponse2RateLimitsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.TickerResponse2ResultInner .CustomTypeAdapterFactory()); @@ -617,9 +593,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.TimeResponse .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .TimeResponseRateLimitsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.TimeResponseResult .CustomTypeAdapterFactory()); @@ -638,9 +611,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model.TradesHistoricalResponse .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.spot.websocket.api.model - .TradesHistoricalResponseRateLimitsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .TradesHistoricalResponseResultInner.CustomTypeAdapterFactory()); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/AccountApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/AccountApi.java index f1b4ee3d..50dee314 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/AccountApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/AccountApi.java @@ -32,8 +32,16 @@ import com.binance.connector.client.spot.websocket.api.model.MyPreventedMatchesResponse; import com.binance.connector.client.spot.websocket.api.model.MyTradesRequest; import com.binance.connector.client.spot.websocket.api.model.MyTradesResponse; +import com.binance.connector.client.spot.websocket.api.model.OpenOrderListsStatusRequest; +import com.binance.connector.client.spot.websocket.api.model.OpenOrderListsStatusResponse; +import com.binance.connector.client.spot.websocket.api.model.OpenOrdersStatusRequest; +import com.binance.connector.client.spot.websocket.api.model.OpenOrdersStatusResponse; import com.binance.connector.client.spot.websocket.api.model.OrderAmendmentsRequest; import com.binance.connector.client.spot.websocket.api.model.OrderAmendmentsResponse; +import com.binance.connector.client.spot.websocket.api.model.OrderListStatusRequest; +import com.binance.connector.client.spot.websocket.api.model.OrderListStatusResponse; +import com.binance.connector.client.spot.websocket.api.model.OrderStatusRequest; +import com.binance.connector.client.spot.websocket.api.model.OrderStatusResponse; import jakarta.validation.ConstraintViolation; import jakarta.validation.Validation; import jakarta.validation.Validator; @@ -241,7 +249,7 @@ private void accountStatusValidateBeforeCall(AccountStatusRequest accountStatusR } /** - * WebSocket Account Order list history Query information about all your order lists, filtered + * WebSocket Account order list history Query information about all your order lists, filtered * by time range. Weight: 20 * * @param allOrderListsRequest (required) @@ -252,12 +260,12 @@ private void accountStatusValidateBeforeCall(AccountStatusRequest accountStatusR * * * - * + * *
Response Details
Status Code Description Response Headers
200 Account Order list history -
200 Account order list history -
* * @see WebSocket - * Account Order list history Documentation + * Account order list history Documentation */ public CompletableFuture allOrderLists( AllOrderListsRequest allOrderListsRequest) throws ApiException { @@ -555,6 +563,137 @@ private void myTradesValidateBeforeCall(MyTradesRequest myTradesRequest) throws } } + /** + * WebSocket Current open Order lists Query execution status of all open order lists. If you + * need to continuously monitor order status updates, please consider using WebSocket Streams: * + * `userDataStream.start` request * `executionReport` user data stream event + * Weight: 6 + * + * @param openOrderListsStatusRequest (required) + * @return OpenOrderListsStatusResponse + * @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 open Order lists -
+ * + * @see WebSocket + * Current open Order lists Documentation + */ + public CompletableFuture openOrderListsStatus( + OpenOrderListsStatusRequest openOrderListsStatusRequest) throws ApiException { + openOrderListsStatusValidateBeforeCall(openOrderListsStatusRequest); + String methodName = "/openOrderLists.status".substring(1); + ApiRequestWrapperDTO build = + new ApiRequestWrapperDTO.Builder< + OpenOrderListsStatusRequest, OpenOrderListsStatusResponse>() + .id(getRequestID()) + .method(methodName) + .params(openOrderListsStatusRequest) + .responseType(OpenOrderListsStatusResponse.class) + .build(); + + try { + connection.send(build); + } catch (InterruptedException e) { + throw new ApiException(e); + } + return build.getResponseCallback(); + } + + @SuppressWarnings("rawtypes") + private void openOrderListsStatusValidateBeforeCall( + OpenOrderListsStatusRequest openOrderListsStatusRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(openOrderListsStatusRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * WebSocket Current open orders Query execution status of all open orders. If you need to + * continuously monitor order status updates, please consider using WebSocket Streams: * + * `userDataStream.start` request * `executionReport` user data stream event + * Weight: Adjusted based on the number of requested symbols: | Parameter | Weight | | --------- + * | ------ | | `symbol` | 6 | | none | 80 | + * + * @param openOrdersStatusRequest (required) + * @return OpenOrdersStatusResponse + * @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 open orders -
+ * + * @see WebSocket + * Current open orders Documentation + */ + public CompletableFuture openOrdersStatus( + OpenOrdersStatusRequest openOrdersStatusRequest) throws ApiException { + openOrdersStatusValidateBeforeCall(openOrdersStatusRequest); + String methodName = "/openOrders.status".substring(1); + ApiRequestWrapperDTO build = + new ApiRequestWrapperDTO.Builder< + OpenOrdersStatusRequest, OpenOrdersStatusResponse>() + .id(getRequestID()) + .method(methodName) + .params(openOrdersStatusRequest) + .responseType(OpenOrdersStatusResponse.class) + .build(); + + try { + connection.send(build); + } catch (InterruptedException e) { + throw new ApiException(e); + } + return build.getResponseCallback(); + } + + @SuppressWarnings("rawtypes") + private void openOrdersStatusValidateBeforeCall(OpenOrdersStatusRequest openOrdersStatusRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(openOrdersStatusRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + /** * WebSocket Query Order Amendments Queries all amendments of a single order. Weight: 4 * @@ -616,6 +755,129 @@ private void orderAmendmentsValidateBeforeCall(OrderAmendmentsRequest orderAmend } } + /** + * WebSocket Query Order list Check execution status of an Order list. For execution status of + * individual orders, use `order.status`. Weight: 4 + * + * @param orderListStatusRequest (required) + * @return OrderListStatusResponse + * @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 Query Order list -
+ * + * @see WebSocket + * Query Order list Documentation + */ + public CompletableFuture orderListStatus( + OrderListStatusRequest orderListStatusRequest) throws ApiException { + orderListStatusValidateBeforeCall(orderListStatusRequest); + String methodName = "/orderList.status".substring(1); + ApiRequestWrapperDTO build = + new ApiRequestWrapperDTO.Builder() + .id(getRequestID()) + .method(methodName) + .params(orderListStatusRequest) + .responseType(OrderListStatusResponse.class) + .build(); + + try { + connection.send(build); + } catch (InterruptedException e) { + throw new ApiException(e); + } + return build.getResponseCallback(); + } + + @SuppressWarnings("rawtypes") + private void orderListStatusValidateBeforeCall(OrderListStatusRequest orderListStatusRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(orderListStatusRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * WebSocket Query order Check execution status of an order. Weight: 4 + * + * @param orderStatusRequest (required) + * @return OrderStatusResponse + * @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 Query order -
+ * + * @see WebSocket + * Query order Documentation + */ + public CompletableFuture orderStatus(OrderStatusRequest orderStatusRequest) + throws ApiException { + orderStatusValidateBeforeCall(orderStatusRequest); + String methodName = "/order.status".substring(1); + ApiRequestWrapperDTO build = + new ApiRequestWrapperDTO.Builder() + .id(getRequestID()) + .method(methodName) + .params(orderStatusRequest) + .responseType(OrderStatusResponse.class) + .build(); + + try { + connection.send(build); + } catch (InterruptedException e) { + throw new ApiException(e); + } + return build.getResponseCallback(); + } + + @SuppressWarnings("rawtypes") + private void orderStatusValidateBeforeCall(OrderStatusRequest orderStatusRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(orderStatusRequest); + + 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/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/GeneralApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/GeneralApi.java index 0c9d25cc..578778e7 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/GeneralApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/GeneralApi.java @@ -19,6 +19,7 @@ import com.binance.connector.client.common.websocket.dtos.BaseRequestDTO; import com.binance.connector.client.spot.websocket.api.model.ExchangeInfoRequest; import com.binance.connector.client.spot.websocket.api.model.ExchangeInfoResponse; +import com.binance.connector.client.spot.websocket.api.model.PingResponse; import com.binance.connector.client.spot.websocket.api.model.TimeResponse; import jakarta.validation.ConstraintViolation; import jakarta.validation.Validation; @@ -104,27 +105,29 @@ private void exchangeInfoValidateBeforeCall(ExchangeInfoRequest exchangeInfoRequ /** * WebSocket Test connectivity Test connectivity to the WebSocket API. Weight: 1 * + * @return PingResponse * @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 -
200 Test connectivity -
* * @see WebSocket * Test connectivity Documentation */ - public void ping() throws ApiException { + public CompletableFuture ping() throws ApiException { pingValidateBeforeCall(); String methodName = "/ping".substring(1); - ApiRequestWrapperDTO build = - new ApiRequestWrapperDTO.Builder() + ApiRequestWrapperDTO build = + new ApiRequestWrapperDTO.Builder() .id(getRequestID()) .method(methodName) .params(new BaseRequestDTO()) + .responseType(PingResponse.class) .signed(false) .build(); @@ -133,6 +136,7 @@ public void ping() throws ApiException { } catch (InterruptedException e) { throw new ApiException(e); } + return build.getResponseCallback(); } @SuppressWarnings("rawtypes") diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/SpotWebSocketApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/SpotWebSocketApi.java index e3265428..5be519ab 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/SpotWebSocketApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/SpotWebSocketApi.java @@ -63,6 +63,7 @@ import com.binance.connector.client.spot.websocket.api.model.OrderStatusResponse; import com.binance.connector.client.spot.websocket.api.model.OrderTestRequest; import com.binance.connector.client.spot.websocket.api.model.OrderTestResponse; +import com.binance.connector.client.spot.websocket.api.model.PingResponse; import com.binance.connector.client.spot.websocket.api.model.SessionLogonRequest; import com.binance.connector.client.spot.websocket.api.model.SessionLogonResponse; import com.binance.connector.client.spot.websocket.api.model.SessionLogoutResponse; @@ -102,7 +103,7 @@ public class SpotWebSocketApi { private static final String USER_AGENT = String.format( - "binance-spot/2.0.0 (Java/%s; %s; %s)", + "binance-spot/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private AccountApi accountApi; @@ -173,11 +174,31 @@ public CompletableFuture myTrades(MyTradesRequest myTradesRequ return accountApi.myTrades(myTradesRequest); } + public CompletableFuture openOrderListsStatus( + OpenOrderListsStatusRequest openOrderListsStatusRequest) throws ApiException { + return accountApi.openOrderListsStatus(openOrderListsStatusRequest); + } + + public CompletableFuture openOrdersStatus( + OpenOrdersStatusRequest openOrdersStatusRequest) throws ApiException { + return accountApi.openOrdersStatus(openOrdersStatusRequest); + } + public CompletableFuture orderAmendments( OrderAmendmentsRequest orderAmendmentsRequest) throws ApiException { return accountApi.orderAmendments(orderAmendmentsRequest); } + public CompletableFuture orderListStatus( + OrderListStatusRequest orderListStatusRequest) throws ApiException { + return accountApi.orderListStatus(orderListStatusRequest); + } + + public CompletableFuture orderStatus(OrderStatusRequest orderStatusRequest) + throws ApiException { + return accountApi.orderStatus(orderStatusRequest); + } + public CompletableFuture sessionLogon( SessionLogonRequest sessionLogonRequest) throws ApiException { return authApi.sessionLogon(sessionLogonRequest); @@ -196,8 +217,8 @@ public CompletableFuture exchangeInfo( return generalApi.exchangeInfo(exchangeInfoRequest); } - public void ping() throws ApiException { - generalApi.ping(); + public CompletableFuture ping() throws ApiException { + return generalApi.ping(); } public CompletableFuture time() throws ApiException { @@ -263,21 +284,11 @@ public CompletableFuture uiKlines(UiKlinesRequest uiKlinesRequ return marketApi.uiKlines(uiKlinesRequest); } - public CompletableFuture openOrderListsStatus( - OpenOrderListsStatusRequest openOrderListsStatusRequest) throws ApiException { - return tradeApi.openOrderListsStatus(openOrderListsStatusRequest); - } - public CompletableFuture openOrdersCancelAll( OpenOrdersCancelAllRequest openOrdersCancelAllRequest) throws ApiException { return tradeApi.openOrdersCancelAll(openOrdersCancelAllRequest); } - public CompletableFuture openOrdersStatus( - OpenOrdersStatusRequest openOrdersStatusRequest) throws ApiException { - return tradeApi.openOrdersStatus(openOrdersStatusRequest); - } - public CompletableFuture orderAmendKeepPriority( OrderAmendKeepPriorityRequest orderAmendKeepPriorityRequest) throws ApiException { return tradeApi.orderAmendKeepPriority(orderAmendKeepPriorityRequest); @@ -318,21 +329,11 @@ public CompletableFuture orderListPlaceOtoco( return tradeApi.orderListPlaceOtoco(orderListPlaceOtocoRequest); } - public CompletableFuture orderListStatus( - OrderListStatusRequest orderListStatusRequest) throws ApiException { - return tradeApi.orderListStatus(orderListStatusRequest); - } - public CompletableFuture orderPlace(OrderPlaceRequest orderPlaceRequest) throws ApiException { return tradeApi.orderPlace(orderPlaceRequest); } - public CompletableFuture orderStatus(OrderStatusRequest orderStatusRequest) - throws ApiException { - return tradeApi.orderStatus(orderStatusRequest); - } - public CompletableFuture orderTest(OrderTestRequest orderTestRequest) throws ApiException { return tradeApi.orderTest(orderTestRequest); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/TradeApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/TradeApi.java index 1b10d807..64e5c277 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/TradeApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/TradeApi.java @@ -16,12 +16,8 @@ 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.spot.websocket.api.model.OpenOrderListsStatusRequest; -import com.binance.connector.client.spot.websocket.api.model.OpenOrderListsStatusResponse; import com.binance.connector.client.spot.websocket.api.model.OpenOrdersCancelAllRequest; import com.binance.connector.client.spot.websocket.api.model.OpenOrdersCancelAllResponse; -import com.binance.connector.client.spot.websocket.api.model.OpenOrdersStatusRequest; -import com.binance.connector.client.spot.websocket.api.model.OpenOrdersStatusResponse; import com.binance.connector.client.spot.websocket.api.model.OrderAmendKeepPriorityRequest; import com.binance.connector.client.spot.websocket.api.model.OrderAmendKeepPriorityResponse; import com.binance.connector.client.spot.websocket.api.model.OrderCancelReplaceRequest; @@ -38,12 +34,8 @@ import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceOtocoResponse; import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceRequest; import com.binance.connector.client.spot.websocket.api.model.OrderListPlaceResponse; -import com.binance.connector.client.spot.websocket.api.model.OrderListStatusRequest; -import com.binance.connector.client.spot.websocket.api.model.OrderListStatusResponse; import com.binance.connector.client.spot.websocket.api.model.OrderPlaceRequest; import com.binance.connector.client.spot.websocket.api.model.OrderPlaceResponse; -import com.binance.connector.client.spot.websocket.api.model.OrderStatusRequest; -import com.binance.connector.client.spot.websocket.api.model.OrderStatusResponse; import com.binance.connector.client.spot.websocket.api.model.OrderTestRequest; import com.binance.connector.client.spot.websocket.api.model.OrderTestResponse; import com.binance.connector.client.spot.websocket.api.model.SorOrderPlaceRequest; @@ -68,71 +60,6 @@ public TradeApi(ConnectionInterface connection) { this.connection = connection; } - /** - * WebSocket Current open Order lists Query execution status of all open order lists. If you - * need to continuously monitor order status updates, please consider using WebSocket Streams: * - * `userDataStream.start` request * `executionReport` user data stream event - * Weight: 6 - * - * @param openOrderListsStatusRequest (required) - * @return OpenOrderListsStatusResponse - * @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 open Order lists -
- * - * @see WebSocket - * Current open Order lists Documentation - */ - public CompletableFuture openOrderListsStatus( - OpenOrderListsStatusRequest openOrderListsStatusRequest) throws ApiException { - openOrderListsStatusValidateBeforeCall(openOrderListsStatusRequest); - String methodName = "/openOrderLists.status".substring(1); - ApiRequestWrapperDTO build = - new ApiRequestWrapperDTO.Builder< - OpenOrderListsStatusRequest, OpenOrderListsStatusResponse>() - .id(getRequestID()) - .method(methodName) - .params(openOrderListsStatusRequest) - .responseType(OpenOrderListsStatusResponse.class) - .build(); - - try { - connection.send(build); - } catch (InterruptedException e) { - throw new ApiException(e); - } - return build.getResponseCallback(); - } - - @SuppressWarnings("rawtypes") - private void openOrderListsStatusValidateBeforeCall( - OpenOrderListsStatusRequest openOrderListsStatusRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(openOrderListsStatusRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - /** * WebSocket Cancel open orders Cancel all open orders on a symbol. This includes orders that * are part of an order list. Weight: 1 @@ -196,72 +123,6 @@ private void openOrdersCancelAllValidateBeforeCall( } } - /** - * WebSocket Current open orders Query execution status of all open orders. If you need to - * continuously monitor order status updates, please consider using WebSocket Streams: * - * `userDataStream.start` request * `executionReport` user data stream event - * Weight: Adjusted based on the number of requested symbols: | Parameter | Weight | | --------- - * | ------ | | `symbol` | 6 | | none | 80 | - * - * @param openOrdersStatusRequest (required) - * @return OpenOrdersStatusResponse - * @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 open orders -
- * - * @see WebSocket - * Current open orders Documentation - */ - public CompletableFuture openOrdersStatus( - OpenOrdersStatusRequest openOrdersStatusRequest) throws ApiException { - openOrdersStatusValidateBeforeCall(openOrdersStatusRequest); - String methodName = "/openOrders.status".substring(1); - ApiRequestWrapperDTO build = - new ApiRequestWrapperDTO.Builder< - OpenOrdersStatusRequest, OpenOrdersStatusResponse>() - .id(getRequestID()) - .method(methodName) - .params(openOrdersStatusRequest) - .responseType(OpenOrdersStatusResponse.class) - .build(); - - try { - connection.send(build); - } catch (InterruptedException e) { - throw new ApiException(e); - } - return build.getResponseCallback(); - } - - @SuppressWarnings("rawtypes") - private void openOrdersStatusValidateBeforeCall(OpenOrdersStatusRequest openOrdersStatusRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(openOrdersStatusRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - /** * WebSocket Order Amend Keep Priority Reduce the quantity of an existing open order. This adds * 0 orders to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` @@ -580,7 +441,7 @@ private void orderListPlaceValidateBeforeCall(OrderListPlaceRequest orderListPla } /** - * WebSocket Place new Order list - OCO Send in an one-cancels the other (OCO) pair, where + * WebSocket Place new Order list - OCO Send in an one-cancels-the-other (OCO) pair, where * activation of one order immediately cancels the other. * An OCO has 2 orders called the * **above order** and **below order**. * One of the orders must be a * `LIMIT_MAKER/TAKE_PROFIT/TAKE_PROFIT_LIMIT` order and the other must be @@ -662,9 +523,12 @@ private void orderListPlaceOcoValidateBeforeCall( * except for `MARKET` orders using parameter `quoteOrderQty`. The pending * order is only placed on the order book when the working order gets **fully filled**. * If * either the working order or the pending order is cancelled individually, the other order in - * the order list will also be canceled or expired. * OTOs add **2 orders** to the - * `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. Weight: 1 - * Unfilled Order Count: 2 + * the order list will also be canceled or expired. * When the order list is placed, if the + * working order gets **immediately fully filled**, the placement response will show the working + * order as `FILLED` but the pending order will still appear as + * `PENDING_NEW`. You need to query the status of the pending order again to see its + * updated status. * OTOs add **2 orders** to the `EXCHANGE_MAX_NUM_ORDERS` filter and + * `MAX_NUM_ORDERS` filter. Weight: 1 Unfilled Order Count: 2 * * @param orderListPlaceOtoRequest (required) * @return OrderListPlaceOtoResponse @@ -733,8 +597,10 @@ private void orderListPlaceOtoValidateBeforeCall( * behavior of the working order is the same as the [OTO](#place-new-order-list---oto-trade). * * OTOCO has 2 pending orders (pending above and pending below), forming an OCO pair. The * pending orders are only placed on the order book when the working order gets **fully - * filled**. * OTOCOs add **3 orders** to the `EXCHANGE_MAX_NUM_ORDERS` filter and - * `MAX_NUM_ORDERS` filter. Weight: 1 Unfilled Order Count: 3 + * filled**. * The rules of the pending above and pending below follow the same rules as the + * [Order list OCO](#new-order-list---oco-trade). * OTOCOs add **3 orders** to the + * `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. Weight: 1 + * Unfilled Order Count: 3 * * @param orderListPlaceOtocoRequest (required) * @return OrderListPlaceOtocoResponse @@ -795,68 +661,6 @@ private void orderListPlaceOtocoValidateBeforeCall( } } - /** - * WebSocket Query Order list Check execution status of an Order list. For execution status of - * individual orders, use `order.status`. Weight: 4 - * - * @param orderListStatusRequest (required) - * @return OrderListStatusResponse - * @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 Query Order list -
- * - * @see WebSocket - * Query Order list Documentation - */ - public CompletableFuture orderListStatus( - OrderListStatusRequest orderListStatusRequest) throws ApiException { - orderListStatusValidateBeforeCall(orderListStatusRequest); - String methodName = "/orderList.status".substring(1); - ApiRequestWrapperDTO build = - new ApiRequestWrapperDTO.Builder() - .id(getRequestID()) - .method(methodName) - .params(orderListStatusRequest) - .responseType(OrderListStatusResponse.class) - .build(); - - try { - connection.send(build); - } catch (InterruptedException e) { - throw new ApiException(e); - } - return build.getResponseCallback(); - } - - @SuppressWarnings("rawtypes") - private void orderListStatusValidateBeforeCall(OrderListStatusRequest orderListStatusRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(orderListStatusRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - /** * WebSocket Place new order Send in a new order. This adds 1 order to the * `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. Weight: 1 @@ -919,67 +723,6 @@ private void orderPlaceValidateBeforeCall(OrderPlaceRequest orderPlaceRequest) } } - /** - * WebSocket Query order Check execution status of an order. Weight: 4 - * - * @param orderStatusRequest (required) - * @return OrderStatusResponse - * @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 Query order -
- * - * @see WebSocket - * Query order Documentation - */ - public CompletableFuture orderStatus(OrderStatusRequest orderStatusRequest) - throws ApiException { - orderStatusValidateBeforeCall(orderStatusRequest); - String methodName = "/order.status".substring(1); - ApiRequestWrapperDTO build = - new ApiRequestWrapperDTO.Builder() - .id(getRequestID()) - .method(methodName) - .params(orderStatusRequest) - .responseType(OrderStatusResponse.class) - .build(); - - try { - connection.send(build); - } catch (InterruptedException e) { - throw new ApiException(e); - } - return build.getResponseCallback(); - } - - @SuppressWarnings("rawtypes") - private void orderStatusValidateBeforeCall(OrderStatusRequest orderStatusRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(orderStatusRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - /** * WebSocket Test new order Test order placement. Validates new order parameters and verifies * your signature but does not send the order into the matching engine. Weight: |Condition| @@ -1047,7 +790,7 @@ private void orderTestValidateBeforeCall(OrderTestRequest orderTestRequest) /** * WebSocket Place new order using SOR Places an order using smart order routing (SOR). This * adds 1 order to the `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` - * filter. Weight: 1 Unfilled Order Count: 1 + * filter. Read [SOR FAQ](../faqs/sor_faq.md) to learn more. Weight: 1 Unfilled Order Count: 1 * * @param sorOrderPlaceRequest (required) * @return SorOrderPlaceResponse diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponse.java index 21a2389d..76119eb6 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class AccountCommissionResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public AccountCommissionResponse() {} @@ -129,21 +126,11 @@ public void setResult(@jakarta.annotation.Nullable AccountCommissionResponseResu } public AccountCommissionResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits) { + @jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public AccountCommissionResponse addRateLimitsItem( - AccountCommissionResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -151,13 +138,11 @@ public AccountCommissionResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid AccountCommissionResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -212,7 +197,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -321,26 +306,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { AccountCommissionResponseResult.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++) { - AccountCommissionResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponseRateLimitsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponseRateLimitsInner.java deleted file mode 100644 index 5c2bd1ac..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountCommissionResponseRateLimitsInner.java +++ /dev/null @@ -1,413 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.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.*; - -/** AccountCommissionResponseRateLimitsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class AccountCommissionResponseRateLimitsInner extends BaseDTO { - public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; - - @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) - @jakarta.annotation.Nullable - private String rateLimitType; - - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - - @SerializedName(SERIALIZED_NAME_INTERVAL) - @jakarta.annotation.Nullable - private String interval; - - public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; - - @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) - @jakarta.annotation.Nullable - private Long intervalNum; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - @jakarta.annotation.Nullable - private Long limit; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - @jakarta.annotation.Nullable - private Long count; - - public AccountCommissionResponseRateLimitsInner() {} - - public AccountCommissionResponseRateLimitsInner rateLimitType( - @jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - return this; - } - - /** - * Get rateLimitType - * - * @return rateLimitType - */ - @jakarta.annotation.Nullable - public String getRateLimitType() { - return rateLimitType; - } - - public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - } - - public AccountCommissionResponseRateLimitsInner interval( - @jakarta.annotation.Nullable String interval) { - this.interval = interval; - return this; - } - - /** - * Get interval - * - * @return interval - */ - @jakarta.annotation.Nullable - public String getInterval() { - return interval; - } - - public void setInterval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; - } - - public AccountCommissionResponseRateLimitsInner intervalNum( - @jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - return this; - } - - /** - * Get intervalNum - * - * @return intervalNum - */ - @jakarta.annotation.Nullable - public Long getIntervalNum() { - return intervalNum; - } - - public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - } - - public AccountCommissionResponseRateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - return this; - } - - /** - * Get limit - * - * @return limit - */ - @jakarta.annotation.Nullable - public Long getLimit() { - return limit; - } - - public void setLimit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - } - - public AccountCommissionResponseRateLimitsInner count(@jakarta.annotation.Nullable Long count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count - */ - @jakarta.annotation.Nullable - public Long getCount() { - return count; - } - - public void setCount(@jakarta.annotation.Nullable Long count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AccountCommissionResponseRateLimitsInner accountCommissionResponseRateLimitsInner = - (AccountCommissionResponseRateLimitsInner) o; - return Objects.equals( - this.rateLimitType, accountCommissionResponseRateLimitsInner.rateLimitType) - && Objects.equals(this.interval, accountCommissionResponseRateLimitsInner.interval) - && Objects.equals( - this.intervalNum, accountCommissionResponseRateLimitsInner.intervalNum) - && Objects.equals(this.limit, accountCommissionResponseRateLimitsInner.limit) - && Objects.equals(this.count, accountCommissionResponseRateLimitsInner.count); - } - - @Override - public int hashCode() { - return Objects.hash(rateLimitType, interval, intervalNum, limit, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountCommissionResponseRateLimitsInner {\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"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - String rateLimitTypeValueAsString = rateLimitTypeValue.toString(); - valMap.put("rateLimitType", rateLimitTypeValueAsString); - } - String intervalValue = getInterval(); - if (intervalValue != null) { - String intervalValueAsString = intervalValue.toString(); - valMap.put("interval", intervalValueAsString); - } - Long intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - String intervalNumValueAsString = intervalNumValue.toString(); - valMap.put("intervalNum", intervalNumValueAsString); - } - Long limitValue = getLimit(); - if (limitValue != null) { - String limitValueAsString = limitValue.toString(); - valMap.put("limit", limitValueAsString); - } - Long countValue = getCount(); - if (countValue != null) { - String countValueAsString = countValue.toString(); - valMap.put("count", countValueAsString); - } - - 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 rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - valMap.put("rateLimitType", rateLimitTypeValue); - } - Object intervalValue = getInterval(); - if (intervalValue != null) { - valMap.put("interval", intervalValue); - } - Object intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - valMap.put("intervalNum", intervalNumValue); - } - Object limitValue = getLimit(); - if (limitValue != null) { - valMap.put("limit", limitValue); - } - Object countValue = getCount(); - if (countValue != null) { - valMap.put("count", countValue); - } - - 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("rateLimitType"); - openapiFields.add("interval"); - openapiFields.add("intervalNum"); - openapiFields.add("limit"); - openapiFields.add("count"); - - // 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 - * AccountCommissionResponseRateLimitsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AccountCommissionResponseRateLimitsInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " AccountCommissionResponseRateLimitsInner is not found in" - + " the empty JSON string", - AccountCommissionResponseRateLimitsInner.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountCommissionResponseRateLimitsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountCommissionResponseRateLimitsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) - && !jsonObj.get("rateLimitType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rateLimitType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("rateLimitType").toString())); - } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) - && !jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AccountCommissionResponseRateLimitsInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'AccountCommissionResponseRateLimitsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(AccountCommissionResponseRateLimitsInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, AccountCommissionResponseRateLimitsInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AccountCommissionResponseRateLimitsInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AccountCommissionResponseRateLimitsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of AccountCommissionResponseRateLimitsInner - * @throws IOException if the JSON string is invalid with respect to - * AccountCommissionResponseRateLimitsInner - */ - public static AccountCommissionResponseRateLimitsInner fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, AccountCommissionResponseRateLimitsInner.class); - } - - /** - * Convert an instance of AccountCommissionResponseRateLimitsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountRateLimitsOrdersResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountRateLimitsOrdersResponse.java index 71b5520e..ce60ef1a 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountRateLimitsOrdersResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountRateLimitsOrdersResponse.java @@ -65,7 +65,7 @@ public class AccountRateLimitsOrdersResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AccountRateLimitsOrdersResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public AccountRateLimitsOrdersResponse() {} @@ -141,21 +141,11 @@ public void setResult( } public AccountRateLimitsOrdersResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid AccountRateLimitsOrdersResponseRateLimitsInner> rateLimits) { + @jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public AccountRateLimitsOrdersResponse addRateLimitsItem( - AccountRateLimitsOrdersResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -163,13 +153,11 @@ public AccountRateLimitsOrdersResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid AccountRateLimitsOrdersResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid AccountRateLimitsOrdersResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -225,8 +213,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AccountRateLimitsOrdersResponseRateLimitsInner> rateLimitsValue = - getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -352,26 +339,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - AccountRateLimitsOrdersResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountRateLimitsOrdersResponseRateLimitsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountRateLimitsOrdersResponseRateLimitsInner.java deleted file mode 100644 index e0a1cc02..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountRateLimitsOrdersResponseRateLimitsInner.java +++ /dev/null @@ -1,423 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.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.*; - -/** AccountRateLimitsOrdersResponseRateLimitsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class AccountRateLimitsOrdersResponseRateLimitsInner extends BaseDTO { - public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; - - @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) - @jakarta.annotation.Nullable - private String rateLimitType; - - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - - @SerializedName(SERIALIZED_NAME_INTERVAL) - @jakarta.annotation.Nullable - private String interval; - - public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; - - @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) - @jakarta.annotation.Nullable - private Long intervalNum; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - @jakarta.annotation.Nullable - private Long limit; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - @jakarta.annotation.Nullable - private Long count; - - public AccountRateLimitsOrdersResponseRateLimitsInner() {} - - public AccountRateLimitsOrdersResponseRateLimitsInner rateLimitType( - @jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - return this; - } - - /** - * Get rateLimitType - * - * @return rateLimitType - */ - @jakarta.annotation.Nullable - public String getRateLimitType() { - return rateLimitType; - } - - public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - } - - public AccountRateLimitsOrdersResponseRateLimitsInner interval( - @jakarta.annotation.Nullable String interval) { - this.interval = interval; - return this; - } - - /** - * Get interval - * - * @return interval - */ - @jakarta.annotation.Nullable - public String getInterval() { - return interval; - } - - public void setInterval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; - } - - public AccountRateLimitsOrdersResponseRateLimitsInner intervalNum( - @jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - return this; - } - - /** - * Get intervalNum - * - * @return intervalNum - */ - @jakarta.annotation.Nullable - public Long getIntervalNum() { - return intervalNum; - } - - public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - } - - public AccountRateLimitsOrdersResponseRateLimitsInner limit( - @jakarta.annotation.Nullable Long limit) { - this.limit = limit; - return this; - } - - /** - * Get limit - * - * @return limit - */ - @jakarta.annotation.Nullable - public Long getLimit() { - return limit; - } - - public void setLimit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - } - - public AccountRateLimitsOrdersResponseRateLimitsInner count( - @jakarta.annotation.Nullable Long count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count - */ - @jakarta.annotation.Nullable - public Long getCount() { - return count; - } - - public void setCount(@jakarta.annotation.Nullable Long count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AccountRateLimitsOrdersResponseRateLimitsInner - accountRateLimitsOrdersResponseRateLimitsInner = - (AccountRateLimitsOrdersResponseRateLimitsInner) o; - return Objects.equals( - this.rateLimitType, - accountRateLimitsOrdersResponseRateLimitsInner.rateLimitType) - && Objects.equals( - this.interval, accountRateLimitsOrdersResponseRateLimitsInner.interval) - && Objects.equals( - this.intervalNum, - accountRateLimitsOrdersResponseRateLimitsInner.intervalNum) - && Objects.equals(this.limit, accountRateLimitsOrdersResponseRateLimitsInner.limit) - && Objects.equals(this.count, accountRateLimitsOrdersResponseRateLimitsInner.count); - } - - @Override - public int hashCode() { - return Objects.hash(rateLimitType, interval, intervalNum, limit, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountRateLimitsOrdersResponseRateLimitsInner {\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"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - String rateLimitTypeValueAsString = rateLimitTypeValue.toString(); - valMap.put("rateLimitType", rateLimitTypeValueAsString); - } - String intervalValue = getInterval(); - if (intervalValue != null) { - String intervalValueAsString = intervalValue.toString(); - valMap.put("interval", intervalValueAsString); - } - Long intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - String intervalNumValueAsString = intervalNumValue.toString(); - valMap.put("intervalNum", intervalNumValueAsString); - } - Long limitValue = getLimit(); - if (limitValue != null) { - String limitValueAsString = limitValue.toString(); - valMap.put("limit", limitValueAsString); - } - Long countValue = getCount(); - if (countValue != null) { - String countValueAsString = countValue.toString(); - valMap.put("count", countValueAsString); - } - - 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 rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - valMap.put("rateLimitType", rateLimitTypeValue); - } - Object intervalValue = getInterval(); - if (intervalValue != null) { - valMap.put("interval", intervalValue); - } - Object intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - valMap.put("intervalNum", intervalNumValue); - } - Object limitValue = getLimit(); - if (limitValue != null) { - valMap.put("limit", limitValue); - } - Object countValue = getCount(); - if (countValue != null) { - valMap.put("count", countValue); - } - - 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("rateLimitType"); - openapiFields.add("interval"); - openapiFields.add("intervalNum"); - openapiFields.add("limit"); - openapiFields.add("count"); - - // 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 - * AccountRateLimitsOrdersResponseRateLimitsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AccountRateLimitsOrdersResponseRateLimitsInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " AccountRateLimitsOrdersResponseRateLimitsInner is not found" - + " in the empty JSON string", - AccountRateLimitsOrdersResponseRateLimitsInner.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AccountRateLimitsOrdersResponseRateLimitsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AccountRateLimitsOrdersResponseRateLimitsInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) - && !jsonObj.get("rateLimitType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rateLimitType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("rateLimitType").toString())); - } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) - && !jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AccountRateLimitsOrdersResponseRateLimitsInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'AccountRateLimitsOrdersResponseRateLimitsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get(AccountRateLimitsOrdersResponseRateLimitsInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, - AccountRateLimitsOrdersResponseRateLimitsInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AccountRateLimitsOrdersResponseRateLimitsInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AccountRateLimitsOrdersResponseRateLimitsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of AccountRateLimitsOrdersResponseRateLimitsInner - * @throws IOException if the JSON string is invalid with respect to - * AccountRateLimitsOrdersResponseRateLimitsInner - */ - public static AccountRateLimitsOrdersResponseRateLimitsInner fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, AccountRateLimitsOrdersResponseRateLimitsInner.class); - } - - /** - * Convert an instance of AccountRateLimitsOrdersResponseRateLimitsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountStatusResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountStatusResponse.java index 49e645ef..a29e3115 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountStatusResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AccountStatusResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class AccountStatusResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public AccountStatusResponse() {} @@ -128,22 +125,11 @@ public void setResult(@jakarta.annotation.Nullable AccountStatusResponseResult r this.result = result; } - public AccountStatusResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits) { + public AccountStatusResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public AccountStatusResponse addRateLimitsItem( - AccountCommissionResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -151,13 +137,11 @@ public AccountStatusResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid AccountCommissionResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -212,7 +196,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -321,26 +305,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { AccountStatusResponseResult.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++) { - AccountCommissionResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrderListsResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrderListsResponse.java index 493144f0..f037b6fc 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrderListsResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrderListsResponse.java @@ -59,13 +59,13 @@ public class AllOrderListsResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RESULT) @jakarta.annotation.Nullable - private List<@Valid OrderListStatusResponseResult> result; + private List<@Valid AllOrderListsResponseResultInner> result; public static final String SERIALIZED_NAME_RATE_LIMITS = "rateLimits"; @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public AllOrderListsResponse() {} @@ -108,12 +108,12 @@ public void setStatus(@jakarta.annotation.Nullable Long status) { } public AllOrderListsResponse result( - @jakarta.annotation.Nullable List<@Valid OrderListStatusResponseResult> result) { + @jakarta.annotation.Nullable List<@Valid AllOrderListsResponseResultInner> result) { this.result = result; return this; } - public AllOrderListsResponse addResultItem(OrderListStatusResponseResult resultItem) { + public AllOrderListsResponse addResultItem(AllOrderListsResponseResultInner resultItem) { if (this.result == null) { this.result = new ArrayList<>(); } @@ -128,31 +128,20 @@ public AllOrderListsResponse addResultItem(OrderListStatusResponseResult resultI */ @jakarta.annotation.Nullable @Valid - public List<@Valid OrderListStatusResponseResult> getResult() { + public List<@Valid AllOrderListsResponseResultInner> getResult() { return result; } public void setResult( - @jakarta.annotation.Nullable List<@Valid OrderListStatusResponseResult> result) { + @jakarta.annotation.Nullable List<@Valid AllOrderListsResponseResultInner> result) { this.result = result; } - public AllOrderListsResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits) { + public AllOrderListsResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public AllOrderListsResponse addRateLimitsItem( - AccountCommissionResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -160,13 +149,11 @@ public AllOrderListsResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid AccountCommissionResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -216,12 +203,12 @@ public String toUrlQueryString() { String statusValueAsString = statusValue.toString(); valMap.put("status", statusValueAsString); } - List<@Valid OrderListStatusResponseResult> resultValue = getResult(); + List<@Valid AllOrderListsResponseResultInner> resultValue = getResult(); if (resultValue != null) { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -340,27 +327,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `result` (array) for (int i = 0; i < jsonArrayresult.size(); i++) { - OrderListStatusResponseResult.validateJsonElement(jsonArrayresult.get(i)); - } - ; - } - } - 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++) { - AccountCommissionResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); + AllOrderListsResponseResultInner.validateJsonElement(jsonArrayresult.get(i)); } ; } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListStatusResponseResult.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrderListsResponseResultInner.java similarity index 85% rename from clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListStatusResponseResult.java rename to clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrderListsResponseResultInner.java index a8abe520..eae924a9 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListStatusResponseResult.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrderListsResponseResultInner.java @@ -38,11 +38,11 @@ import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; -/** OrderListStatusResponseResult */ +/** AllOrderListsResponseResultInner */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class OrderListStatusResponseResult extends BaseDTO { +public class AllOrderListsResponseResultInner extends BaseDTO { public static final String SERIALIZED_NAME_ORDER_LIST_ID = "orderListId"; @SerializedName(SERIALIZED_NAME_ORDER_LIST_ID) @@ -91,9 +91,9 @@ public class OrderListStatusResponseResult extends BaseDTO { @jakarta.annotation.Nullable private List<@Valid OrderListCancelResponseResultOrdersInner> orders; - public OrderListStatusResponseResult() {} + public AllOrderListsResponseResultInner() {} - public OrderListStatusResponseResult orderListId( + public AllOrderListsResponseResultInner orderListId( @jakarta.annotation.Nullable Long orderListId) { this.orderListId = orderListId; return this; @@ -113,7 +113,7 @@ public void setOrderListId(@jakarta.annotation.Nullable Long orderListId) { this.orderListId = orderListId; } - public OrderListStatusResponseResult contingencyType( + public AllOrderListsResponseResultInner contingencyType( @jakarta.annotation.Nullable String contingencyType) { this.contingencyType = contingencyType; return this; @@ -133,7 +133,7 @@ public void setContingencyType(@jakarta.annotation.Nullable String contingencyTy this.contingencyType = contingencyType; } - public OrderListStatusResponseResult listStatusType( + public AllOrderListsResponseResultInner listStatusType( @jakarta.annotation.Nullable String listStatusType) { this.listStatusType = listStatusType; return this; @@ -153,7 +153,7 @@ public void setListStatusType(@jakarta.annotation.Nullable String listStatusType this.listStatusType = listStatusType; } - public OrderListStatusResponseResult listOrderStatus( + public AllOrderListsResponseResultInner listOrderStatus( @jakarta.annotation.Nullable String listOrderStatus) { this.listOrderStatus = listOrderStatus; return this; @@ -173,7 +173,7 @@ public void setListOrderStatus(@jakarta.annotation.Nullable String listOrderStat this.listOrderStatus = listOrderStatus; } - public OrderListStatusResponseResult listClientOrderId( + public AllOrderListsResponseResultInner listClientOrderId( @jakarta.annotation.Nullable String listClientOrderId) { this.listClientOrderId = listClientOrderId; return this; @@ -193,7 +193,7 @@ public void setListClientOrderId(@jakarta.annotation.Nullable String listClientO this.listClientOrderId = listClientOrderId; } - public OrderListStatusResponseResult transactionTime( + public AllOrderListsResponseResultInner transactionTime( @jakarta.annotation.Nullable Long transactionTime) { this.transactionTime = transactionTime; return this; @@ -213,7 +213,7 @@ public void setTransactionTime(@jakarta.annotation.Nullable Long transactionTime this.transactionTime = transactionTime; } - public OrderListStatusResponseResult symbol(@jakarta.annotation.Nullable String symbol) { + public AllOrderListsResponseResultInner symbol(@jakarta.annotation.Nullable String symbol) { this.symbol = symbol; return this; } @@ -232,14 +232,14 @@ public void setSymbol(@jakarta.annotation.Nullable String symbol) { this.symbol = symbol; } - public OrderListStatusResponseResult orders( + public AllOrderListsResponseResultInner orders( @jakarta.annotation.Nullable List<@Valid OrderListCancelResponseResultOrdersInner> orders) { this.orders = orders; return this; } - public OrderListStatusResponseResult addOrdersItem( + public AllOrderListsResponseResultInner addOrdersItem( OrderListCancelResponseResultOrdersInner ordersItem) { if (this.orders == null) { this.orders = new ArrayList<>(); @@ -273,20 +273,21 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - OrderListStatusResponseResult orderListStatusResponseResult = - (OrderListStatusResponseResult) o; - return Objects.equals(this.orderListId, orderListStatusResponseResult.orderListId) + AllOrderListsResponseResultInner allOrderListsResponseResultInner = + (AllOrderListsResponseResultInner) o; + return Objects.equals(this.orderListId, allOrderListsResponseResultInner.orderListId) && Objects.equals( - this.contingencyType, orderListStatusResponseResult.contingencyType) - && Objects.equals(this.listStatusType, orderListStatusResponseResult.listStatusType) + this.contingencyType, allOrderListsResponseResultInner.contingencyType) && Objects.equals( - this.listOrderStatus, orderListStatusResponseResult.listOrderStatus) + this.listStatusType, allOrderListsResponseResultInner.listStatusType) && Objects.equals( - this.listClientOrderId, orderListStatusResponseResult.listClientOrderId) + this.listOrderStatus, allOrderListsResponseResultInner.listOrderStatus) && Objects.equals( - this.transactionTime, orderListStatusResponseResult.transactionTime) - && Objects.equals(this.symbol, orderListStatusResponseResult.symbol) - && Objects.equals(this.orders, orderListStatusResponseResult.orders); + this.listClientOrderId, allOrderListsResponseResultInner.listClientOrderId) + && Objects.equals( + this.transactionTime, allOrderListsResponseResultInner.transactionTime) + && Objects.equals(this.symbol, allOrderListsResponseResultInner.symbol) + && Objects.equals(this.orders, allOrderListsResponseResultInner.orders); } @Override @@ -305,7 +306,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class OrderListStatusResponseResult {\n"); + sb.append("class AllOrderListsResponseResultInner {\n"); sb.append(" orderListId: ").append(toIndentedString(orderListId)).append("\n"); sb.append(" contingencyType: ").append(toIndentedString(contingencyType)).append("\n"); sb.append(" listStatusType: ").append(toIndentedString(listStatusType)).append("\n"); @@ -449,28 +450,28 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * OrderListStatusResponseResult + * AllOrderListsResponseResultInner */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!OrderListStatusResponseResult.openapiRequiredFields + if (!AllOrderListsResponseResultInner.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in OrderListStatusResponseResult is not" - + " found in the empty JSON string", - OrderListStatusResponseResult.openapiRequiredFields.toString())); + "The required field(s) %s in AllOrderListsResponseResultInner is" + + " not found in the empty JSON string", + AllOrderListsResponseResultInner.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!OrderListStatusResponseResult.openapiFields.contains(entry.getKey())) { + if (!AllOrderListsResponseResultInner.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `OrderListStatusResponseResult` properties. JSON: %s", + + " `AllOrderListsResponseResultInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } @@ -542,26 +543,26 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!OrderListStatusResponseResult.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OrderListStatusResponseResult' and its - // subtypes + if (!AllOrderListsResponseResultInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AllOrderListsResponseResultInner' and + // its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = + final TypeAdapter thisAdapter = gson.getDelegateAdapter( - this, TypeToken.get(OrderListStatusResponseResult.class)); + this, TypeToken.get(AllOrderListsResponseResultInner.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, OrderListStatusResponseResult value) + public void write(JsonWriter out, AllOrderListsResponseResultInner value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public OrderListStatusResponseResult read(JsonReader in) + public AllOrderListsResponseResultInner read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); @@ -572,19 +573,19 @@ public OrderListStatusResponseResult read(JsonReader in) } /** - * Create an instance of OrderListStatusResponseResult given an JSON string + * Create an instance of AllOrderListsResponseResultInner given an JSON string * * @param jsonString JSON string - * @return An instance of OrderListStatusResponseResult + * @return An instance of AllOrderListsResponseResultInner * @throws IOException if the JSON string is invalid with respect to - * OrderListStatusResponseResult + * AllOrderListsResponseResultInner */ - public static OrderListStatusResponseResult fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OrderListStatusResponseResult.class); + public static AllOrderListsResponseResultInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AllOrderListsResponseResultInner.class); } /** - * Convert an instance of OrderListStatusResponseResult to an JSON string + * Convert an instance of AllOrderListsResponseResultInner to an JSON string * * @return JSON string */ diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrdersResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrdersResponse.java index c22d98d4..28bf16ff 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrdersResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AllOrdersResponse.java @@ -65,7 +65,7 @@ public class AllOrdersResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public AllOrdersResponse() {} @@ -137,22 +137,11 @@ public void setResult( this.result = result; } - public AllOrdersResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits) { + public AllOrdersResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public AllOrdersResponse addRateLimitsItem( - AccountCommissionResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -160,13 +149,11 @@ public AllOrdersResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid AccountCommissionResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -221,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -345,26 +332,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - AccountCommissionResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AvgPriceResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AvgPriceResponse.java index ba7958c7..9a2f5cd8 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AvgPriceResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AvgPriceResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class AvgPriceResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AvgPriceResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public AvgPriceResponse() {} @@ -127,20 +124,11 @@ public void setResult(@jakarta.annotation.Nullable AvgPriceResponseResult result this.result = result; } - public AvgPriceResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public AvgPriceResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public AvgPriceResponse addRateLimitsItem(AvgPriceResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -148,12 +136,11 @@ public AvgPriceResponse addRateLimitsItem(AvgPriceResponseRateLimitsInner rateLi */ @jakarta.annotation.Nullable @Valid - public List<@Valid AvgPriceResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +195,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AvgPriceResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -317,25 +304,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { AvgPriceResponseResult.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++) { - AvgPriceResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AvgPriceResponseRateLimitsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AvgPriceResponseRateLimitsInner.java deleted file mode 100644 index 0cf04503..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/AvgPriceResponseRateLimitsInner.java +++ /dev/null @@ -1,404 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.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.*; - -/** AvgPriceResponseRateLimitsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class AvgPriceResponseRateLimitsInner extends BaseDTO { - public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; - - @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) - @jakarta.annotation.Nullable - private String rateLimitType; - - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - - @SerializedName(SERIALIZED_NAME_INTERVAL) - @jakarta.annotation.Nullable - private String interval; - - public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; - - @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) - @jakarta.annotation.Nullable - private Long intervalNum; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - @jakarta.annotation.Nullable - private Long limit; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - @jakarta.annotation.Nullable - private Long count; - - public AvgPriceResponseRateLimitsInner() {} - - public AvgPriceResponseRateLimitsInner rateLimitType( - @jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - return this; - } - - /** - * Get rateLimitType - * - * @return rateLimitType - */ - @jakarta.annotation.Nullable - public String getRateLimitType() { - return rateLimitType; - } - - public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - } - - public AvgPriceResponseRateLimitsInner interval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; - return this; - } - - /** - * Get interval - * - * @return interval - */ - @jakarta.annotation.Nullable - public String getInterval() { - return interval; - } - - public void setInterval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; - } - - public AvgPriceResponseRateLimitsInner intervalNum( - @jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - return this; - } - - /** - * Get intervalNum - * - * @return intervalNum - */ - @jakarta.annotation.Nullable - public Long getIntervalNum() { - return intervalNum; - } - - public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - } - - public AvgPriceResponseRateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - return this; - } - - /** - * Get limit - * - * @return limit - */ - @jakarta.annotation.Nullable - public Long getLimit() { - return limit; - } - - public void setLimit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - } - - public AvgPriceResponseRateLimitsInner count(@jakarta.annotation.Nullable Long count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count - */ - @jakarta.annotation.Nullable - public Long getCount() { - return count; - } - - public void setCount(@jakarta.annotation.Nullable Long count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AvgPriceResponseRateLimitsInner avgPriceResponseRateLimitsInner = - (AvgPriceResponseRateLimitsInner) o; - return Objects.equals(this.rateLimitType, avgPriceResponseRateLimitsInner.rateLimitType) - && Objects.equals(this.interval, avgPriceResponseRateLimitsInner.interval) - && Objects.equals(this.intervalNum, avgPriceResponseRateLimitsInner.intervalNum) - && Objects.equals(this.limit, avgPriceResponseRateLimitsInner.limit) - && Objects.equals(this.count, avgPriceResponseRateLimitsInner.count); - } - - @Override - public int hashCode() { - return Objects.hash(rateLimitType, interval, intervalNum, limit, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AvgPriceResponseRateLimitsInner {\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"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - String rateLimitTypeValueAsString = rateLimitTypeValue.toString(); - valMap.put("rateLimitType", rateLimitTypeValueAsString); - } - String intervalValue = getInterval(); - if (intervalValue != null) { - String intervalValueAsString = intervalValue.toString(); - valMap.put("interval", intervalValueAsString); - } - Long intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - String intervalNumValueAsString = intervalNumValue.toString(); - valMap.put("intervalNum", intervalNumValueAsString); - } - Long limitValue = getLimit(); - if (limitValue != null) { - String limitValueAsString = limitValue.toString(); - valMap.put("limit", limitValueAsString); - } - Long countValue = getCount(); - if (countValue != null) { - String countValueAsString = countValue.toString(); - valMap.put("count", countValueAsString); - } - - 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 rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - valMap.put("rateLimitType", rateLimitTypeValue); - } - Object intervalValue = getInterval(); - if (intervalValue != null) { - valMap.put("interval", intervalValue); - } - Object intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - valMap.put("intervalNum", intervalNumValue); - } - Object limitValue = getLimit(); - if (limitValue != null) { - valMap.put("limit", limitValue); - } - Object countValue = getCount(); - if (countValue != null) { - valMap.put("count", countValue); - } - - 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("rateLimitType"); - openapiFields.add("interval"); - openapiFields.add("intervalNum"); - openapiFields.add("limit"); - openapiFields.add("count"); - - // 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 - * AvgPriceResponseRateLimitsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AvgPriceResponseRateLimitsInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AvgPriceResponseRateLimitsInner is not" - + " found in the empty JSON string", - AvgPriceResponseRateLimitsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AvgPriceResponseRateLimitsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AvgPriceResponseRateLimitsInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) - && !jsonObj.get("rateLimitType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rateLimitType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("rateLimitType").toString())); - } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) - && !jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AvgPriceResponseRateLimitsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AvgPriceResponseRateLimitsInner' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(AvgPriceResponseRateLimitsInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AvgPriceResponseRateLimitsInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AvgPriceResponseRateLimitsInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AvgPriceResponseRateLimitsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of AvgPriceResponseRateLimitsInner - * @throws IOException if the JSON string is invalid with respect to - * AvgPriceResponseRateLimitsInner - */ - public static AvgPriceResponseRateLimitsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AvgPriceResponseRateLimitsInner.class); - } - - /** - * Convert an instance of AvgPriceResponseRateLimitsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/DepthResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/DepthResponse.java index 35750f81..b9955f33 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/DepthResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/DepthResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class DepthResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AvgPriceResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public DepthResponse() {} @@ -127,20 +124,11 @@ public void setResult(@jakarta.annotation.Nullable DepthResponseResult result) { this.result = result; } - public DepthResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public DepthResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public DepthResponse addRateLimitsItem(AvgPriceResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -148,12 +136,11 @@ public DepthResponse addRateLimitsItem(AvgPriceResponseRateLimitsInner rateLimit */ @jakarta.annotation.Nullable @Valid - public List<@Valid AvgPriceResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +195,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AvgPriceResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -317,25 +304,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { DepthResponseResult.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++) { - AvgPriceResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeFilters.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeFilters.java new file mode 100644 index 00000000..48a4bf65 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeFilters.java @@ -0,0 +1,190 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.api.model; + +import com.binance.connector.client.spot.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.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.*; + +/** ExchangeFilters */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExchangeFilters extends ArrayList { + public ExchangeFilters() {} + + @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 ExchangeFilters {\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 ExchangeFilters + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExchangeFilters.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExchangeFilters is not found in the" + + " empty JSON string", + ExchangeFilters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExchangeFilters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ExchangeFilters` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExchangeFilters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeFilters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ExchangeFilters.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExchangeFilters value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExchangeFilters read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExchangeFilters given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExchangeFilters + * @throws IOException if the JSON string is invalid with respect to ExchangeFilters + */ + public static ExchangeFilters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeFilters.class); + } + + /** + * Convert an instance of ExchangeFilters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResultExchangeFiltersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeFiltersInner.java similarity index 82% rename from clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResultExchangeFiltersInner.java rename to clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeFiltersInner.java index ecd08818..40334780 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResultExchangeFiltersInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeFiltersInner.java @@ -34,64 +34,76 @@ import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; -/** ExchangeInfoResponseResultExchangeFiltersInner */ +/** ExchangeFiltersInner */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class ExchangeInfoResponseResultExchangeFiltersInner extends BaseDTO { +public class ExchangeFiltersInner extends BaseDTO { public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; @SerializedName(SERIALIZED_NAME_FILTER_TYPE) @jakarta.annotation.Nullable private String filterType; - public static final String SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS = "maxNumIcebergOrders"; + public static final String SERIALIZED_NAME_MIN_PRICE = "minPrice"; - @SerializedName(SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS) + @SerializedName(SERIALIZED_NAME_MIN_PRICE) @jakarta.annotation.Nullable - private Long maxNumIcebergOrders; + private String minPrice; - public static final String SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS = "maxNumAlgoOrders"; + public static final String SERIALIZED_NAME_MAX_PRICE = "maxPrice"; - @SerializedName(SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS) + @SerializedName(SERIALIZED_NAME_MAX_PRICE) @jakarta.annotation.Nullable - private Long maxNumAlgoOrders; + private String maxPrice; - public static final String SERIALIZED_NAME_MAX_NUM_ORDERS = "maxNumOrders"; + public static final String SERIALIZED_NAME_TICK_SIZE = "tickSize"; - @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDERS) + @SerializedName(SERIALIZED_NAME_TICK_SIZE) @jakarta.annotation.Nullable - private Long maxNumOrders; + private String tickSize; - public static final String SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA = "minTrailingAboveDelta"; + public static final String SERIALIZED_NAME_MULTIPLIER_UP = "multiplierUp"; - @SerializedName(SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA) + @SerializedName(SERIALIZED_NAME_MULTIPLIER_UP) @jakarta.annotation.Nullable - private Long minTrailingAboveDelta; + private String multiplierUp; - public static final String SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA = "maxTrailingAboveDelta"; + public static final String SERIALIZED_NAME_MULTIPLIER_DOWN = "multiplierDown"; - @SerializedName(SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA) + @SerializedName(SERIALIZED_NAME_MULTIPLIER_DOWN) @jakarta.annotation.Nullable - private Long maxTrailingAboveDelta; + private String multiplierDown; - public static final String SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA = "minTrailingBelowDelta"; + public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; - @SerializedName(SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA) + @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) @jakarta.annotation.Nullable - private Long minTrailingBelowDelta; + private Long avgPriceMins; - public static final String SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA = "maxTrailingBelowDelta"; + public static final String SERIALIZED_NAME_BID_MULTIPLIER_UP = "bidMultiplierUp"; - @SerializedName(SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA) + @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_UP) @jakarta.annotation.Nullable - private Long maxTrailingBelowDelta; + private String bidMultiplierUp; - public static final String SERIALIZED_NAME_MAX_POSITION = "maxPosition"; + public static final String SERIALIZED_NAME_BID_MULTIPLIER_DOWN = "bidMultiplierDown"; - @SerializedName(SERIALIZED_NAME_MAX_POSITION) + @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_DOWN) @jakarta.annotation.Nullable - private String maxPosition; + private String bidMultiplierDown; + + public static final String SERIALIZED_NAME_ASK_MULTIPLIER_UP = "askMultiplierUp"; + + @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_UP) + @jakarta.annotation.Nullable + private String askMultiplierUp; + + public static final String SERIALIZED_NAME_ASK_MULTIPLIER_DOWN = "askMultiplierDown"; + + @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_DOWN) + @jakarta.annotation.Nullable + private String askMultiplierDown; public static final String SERIALIZED_NAME_MIN_QTY = "minQty"; @@ -111,18 +123,18 @@ public class ExchangeInfoResponseResultExchangeFiltersInner extends BaseDTO { @jakarta.annotation.Nullable private String stepSize; - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - @jakarta.annotation.Nullable - private Long limit; - public static final String SERIALIZED_NAME_MIN_NOTIONAL = "minNotional"; @SerializedName(SERIALIZED_NAME_MIN_NOTIONAL) @jakarta.annotation.Nullable private String minNotional; + public static final String SERIALIZED_NAME_APPLY_TO_MARKET = "applyToMarket"; + + @SerializedName(SERIALIZED_NAME_APPLY_TO_MARKET) + @jakarta.annotation.Nullable + private Boolean applyToMarket; + public static final String SERIALIZED_NAME_APPLY_MIN_TO_MARKET = "applyMinToMarket"; @SerializedName(SERIALIZED_NAME_APPLY_MIN_TO_MARKET) @@ -141,76 +153,63 @@ public class ExchangeInfoResponseResultExchangeFiltersInner extends BaseDTO { @jakarta.annotation.Nullable private Boolean applyMaxToMarket; - public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; - - @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) - @jakarta.annotation.Nullable - private Long avgPriceMins; - - public static final String SERIALIZED_NAME_APPLY_TO_MARKET = "applyToMarket"; - - @SerializedName(SERIALIZED_NAME_APPLY_TO_MARKET) - @jakarta.annotation.Nullable - private Boolean applyToMarket; - - public static final String SERIALIZED_NAME_BID_MULTIPLIER_UP = "bidMultiplierUp"; + public static final String SERIALIZED_NAME_LIMIT = "limit"; - @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_UP) + @SerializedName(SERIALIZED_NAME_LIMIT) @jakarta.annotation.Nullable - private String bidMultiplierUp; + private Long limit; - public static final String SERIALIZED_NAME_BID_MULTIPLIER_DOWN = "bidMultiplierDown"; + public static final String SERIALIZED_NAME_MAX_NUM_ORDERS = "maxNumOrders"; - @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_DOWN) + @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDERS) @jakarta.annotation.Nullable - private String bidMultiplierDown; + private Long maxNumOrders; - public static final String SERIALIZED_NAME_ASK_MULTIPLIER_UP = "askMultiplierUp"; + public static final String SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS = "maxNumAlgoOrders"; - @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_UP) + @SerializedName(SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS) @jakarta.annotation.Nullable - private String askMultiplierUp; + private Long maxNumAlgoOrders; - public static final String SERIALIZED_NAME_ASK_MULTIPLIER_DOWN = "askMultiplierDown"; + public static final String SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS = "maxNumIcebergOrders"; - @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_DOWN) + @SerializedName(SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS) @jakarta.annotation.Nullable - private String askMultiplierDown; + private Long maxNumIcebergOrders; - public static final String SERIALIZED_NAME_MULTIPLIER_UP = "multiplierUp"; + public static final String SERIALIZED_NAME_MAX_POSITION = "maxPosition"; - @SerializedName(SERIALIZED_NAME_MULTIPLIER_UP) + @SerializedName(SERIALIZED_NAME_MAX_POSITION) @jakarta.annotation.Nullable - private String multiplierUp; + private String maxPosition; - public static final String SERIALIZED_NAME_MULTIPLIER_DOWN = "multiplierDown"; + public static final String SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA = "minTrailingAboveDelta"; - @SerializedName(SERIALIZED_NAME_MULTIPLIER_DOWN) + @SerializedName(SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA) @jakarta.annotation.Nullable - private String multiplierDown; + private Long minTrailingAboveDelta; - public static final String SERIALIZED_NAME_MIN_PRICE = "minPrice"; + public static final String SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA = "maxTrailingAboveDelta"; - @SerializedName(SERIALIZED_NAME_MIN_PRICE) + @SerializedName(SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA) @jakarta.annotation.Nullable - private String minPrice; + private Long maxTrailingAboveDelta; - public static final String SERIALIZED_NAME_MAX_PRICE = "maxPrice"; + public static final String SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA = "minTrailingBelowDelta"; - @SerializedName(SERIALIZED_NAME_MAX_PRICE) + @SerializedName(SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA) @jakarta.annotation.Nullable - private String maxPrice; + private Long minTrailingBelowDelta; - public static final String SERIALIZED_NAME_TICK_SIZE = "tickSize"; + public static final String SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA = "maxTrailingBelowDelta"; - @SerializedName(SERIALIZED_NAME_TICK_SIZE) + @SerializedName(SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA) @jakarta.annotation.Nullable - private String tickSize; + private Long maxTrailingBelowDelta; - public ExchangeInfoResponseResultExchangeFiltersInner() {} + public ExchangeFiltersInner() {} - public ExchangeInfoResponseResultExchangeFiltersInner filterType( - @jakarta.annotation.Nullable String filterType) { + public ExchangeFiltersInner filterType(@jakarta.annotation.Nullable String filterType) { this.filterType = filterType; return this; } @@ -229,168 +228,201 @@ public void setFilterType(@jakarta.annotation.Nullable String filterType) { this.filterType = filterType; } - public ExchangeInfoResponseResultExchangeFiltersInner maxNumIcebergOrders( - @jakarta.annotation.Nullable Long maxNumIcebergOrders) { - this.maxNumIcebergOrders = maxNumIcebergOrders; + public ExchangeFiltersInner minPrice(@jakarta.annotation.Nullable String minPrice) { + this.minPrice = minPrice; return this; } /** - * Get maxNumIcebergOrders + * Get minPrice * - * @return maxNumIcebergOrders + * @return minPrice */ @jakarta.annotation.Nullable - public Long getMaxNumIcebergOrders() { - return maxNumIcebergOrders; + public String getMinPrice() { + return minPrice; } - public void setMaxNumIcebergOrders(@jakarta.annotation.Nullable Long maxNumIcebergOrders) { - this.maxNumIcebergOrders = maxNumIcebergOrders; + public void setMinPrice(@jakarta.annotation.Nullable String minPrice) { + this.minPrice = minPrice; } - public ExchangeInfoResponseResultExchangeFiltersInner maxNumAlgoOrders( - @jakarta.annotation.Nullable Long maxNumAlgoOrders) { - this.maxNumAlgoOrders = maxNumAlgoOrders; + public ExchangeFiltersInner maxPrice(@jakarta.annotation.Nullable String maxPrice) { + this.maxPrice = maxPrice; return this; } /** - * Get maxNumAlgoOrders + * Get maxPrice * - * @return maxNumAlgoOrders + * @return maxPrice */ @jakarta.annotation.Nullable - public Long getMaxNumAlgoOrders() { - return maxNumAlgoOrders; + public String getMaxPrice() { + return maxPrice; } - public void setMaxNumAlgoOrders(@jakarta.annotation.Nullable Long maxNumAlgoOrders) { - this.maxNumAlgoOrders = maxNumAlgoOrders; + public void setMaxPrice(@jakarta.annotation.Nullable String maxPrice) { + this.maxPrice = maxPrice; } - public ExchangeInfoResponseResultExchangeFiltersInner maxNumOrders( - @jakarta.annotation.Nullable Long maxNumOrders) { - this.maxNumOrders = maxNumOrders; + public ExchangeFiltersInner tickSize(@jakarta.annotation.Nullable String tickSize) { + this.tickSize = tickSize; return this; } /** - * Get maxNumOrders + * Get tickSize * - * @return maxNumOrders + * @return tickSize */ @jakarta.annotation.Nullable - public Long getMaxNumOrders() { - return maxNumOrders; + public String getTickSize() { + return tickSize; } - public void setMaxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { - this.maxNumOrders = maxNumOrders; + public void setTickSize(@jakarta.annotation.Nullable String tickSize) { + this.tickSize = tickSize; } - public ExchangeInfoResponseResultExchangeFiltersInner minTrailingAboveDelta( - @jakarta.annotation.Nullable Long minTrailingAboveDelta) { - this.minTrailingAboveDelta = minTrailingAboveDelta; + public ExchangeFiltersInner multiplierUp(@jakarta.annotation.Nullable String multiplierUp) { + this.multiplierUp = multiplierUp; return this; } /** - * Get minTrailingAboveDelta + * Get multiplierUp * - * @return minTrailingAboveDelta + * @return multiplierUp */ @jakarta.annotation.Nullable - public Long getMinTrailingAboveDelta() { - return minTrailingAboveDelta; + public String getMultiplierUp() { + return multiplierUp; } - public void setMinTrailingAboveDelta(@jakarta.annotation.Nullable Long minTrailingAboveDelta) { - this.minTrailingAboveDelta = minTrailingAboveDelta; + public void setMultiplierUp(@jakarta.annotation.Nullable String multiplierUp) { + this.multiplierUp = multiplierUp; } - public ExchangeInfoResponseResultExchangeFiltersInner maxTrailingAboveDelta( - @jakarta.annotation.Nullable Long maxTrailingAboveDelta) { - this.maxTrailingAboveDelta = maxTrailingAboveDelta; + public ExchangeFiltersInner multiplierDown(@jakarta.annotation.Nullable String multiplierDown) { + this.multiplierDown = multiplierDown; return this; } /** - * Get maxTrailingAboveDelta + * Get multiplierDown * - * @return maxTrailingAboveDelta + * @return multiplierDown */ @jakarta.annotation.Nullable - public Long getMaxTrailingAboveDelta() { - return maxTrailingAboveDelta; + public String getMultiplierDown() { + return multiplierDown; } - public void setMaxTrailingAboveDelta(@jakarta.annotation.Nullable Long maxTrailingAboveDelta) { - this.maxTrailingAboveDelta = maxTrailingAboveDelta; + public void setMultiplierDown(@jakarta.annotation.Nullable String multiplierDown) { + this.multiplierDown = multiplierDown; } - public ExchangeInfoResponseResultExchangeFiltersInner minTrailingBelowDelta( - @jakarta.annotation.Nullable Long minTrailingBelowDelta) { - this.minTrailingBelowDelta = minTrailingBelowDelta; + public ExchangeFiltersInner avgPriceMins(@jakarta.annotation.Nullable Long avgPriceMins) { + this.avgPriceMins = avgPriceMins; return this; } /** - * Get minTrailingBelowDelta + * Get avgPriceMins * - * @return minTrailingBelowDelta + * @return avgPriceMins */ @jakarta.annotation.Nullable - public Long getMinTrailingBelowDelta() { - return minTrailingBelowDelta; + public Long getAvgPriceMins() { + return avgPriceMins; } - public void setMinTrailingBelowDelta(@jakarta.annotation.Nullable Long minTrailingBelowDelta) { - this.minTrailingBelowDelta = minTrailingBelowDelta; + public void setAvgPriceMins(@jakarta.annotation.Nullable Long avgPriceMins) { + this.avgPriceMins = avgPriceMins; } - public ExchangeInfoResponseResultExchangeFiltersInner maxTrailingBelowDelta( - @jakarta.annotation.Nullable Long maxTrailingBelowDelta) { - this.maxTrailingBelowDelta = maxTrailingBelowDelta; + public ExchangeFiltersInner bidMultiplierUp( + @jakarta.annotation.Nullable String bidMultiplierUp) { + this.bidMultiplierUp = bidMultiplierUp; return this; } /** - * Get maxTrailingBelowDelta + * Get bidMultiplierUp * - * @return maxTrailingBelowDelta + * @return bidMultiplierUp */ @jakarta.annotation.Nullable - public Long getMaxTrailingBelowDelta() { - return maxTrailingBelowDelta; + public String getBidMultiplierUp() { + return bidMultiplierUp; } - public void setMaxTrailingBelowDelta(@jakarta.annotation.Nullable Long maxTrailingBelowDelta) { - this.maxTrailingBelowDelta = maxTrailingBelowDelta; + public void setBidMultiplierUp(@jakarta.annotation.Nullable String bidMultiplierUp) { + this.bidMultiplierUp = bidMultiplierUp; } - public ExchangeInfoResponseResultExchangeFiltersInner maxPosition( - @jakarta.annotation.Nullable String maxPosition) { - this.maxPosition = maxPosition; + public ExchangeFiltersInner bidMultiplierDown( + @jakarta.annotation.Nullable String bidMultiplierDown) { + this.bidMultiplierDown = bidMultiplierDown; return this; } /** - * Get maxPosition + * Get bidMultiplierDown * - * @return maxPosition + * @return bidMultiplierDown */ @jakarta.annotation.Nullable - public String getMaxPosition() { - return maxPosition; + public String getBidMultiplierDown() { + return bidMultiplierDown; } - public void setMaxPosition(@jakarta.annotation.Nullable String maxPosition) { - this.maxPosition = maxPosition; + public void setBidMultiplierDown(@jakarta.annotation.Nullable String bidMultiplierDown) { + this.bidMultiplierDown = bidMultiplierDown; + } + + public ExchangeFiltersInner askMultiplierUp( + @jakarta.annotation.Nullable String askMultiplierUp) { + this.askMultiplierUp = askMultiplierUp; + return this; + } + + /** + * Get askMultiplierUp + * + * @return askMultiplierUp + */ + @jakarta.annotation.Nullable + public String getAskMultiplierUp() { + return askMultiplierUp; + } + + public void setAskMultiplierUp(@jakarta.annotation.Nullable String askMultiplierUp) { + this.askMultiplierUp = askMultiplierUp; + } + + public ExchangeFiltersInner askMultiplierDown( + @jakarta.annotation.Nullable String askMultiplierDown) { + this.askMultiplierDown = askMultiplierDown; + return this; + } + + /** + * Get askMultiplierDown + * + * @return askMultiplierDown + */ + @jakarta.annotation.Nullable + public String getAskMultiplierDown() { + return askMultiplierDown; + } + + public void setAskMultiplierDown(@jakarta.annotation.Nullable String askMultiplierDown) { + this.askMultiplierDown = askMultiplierDown; } - public ExchangeInfoResponseResultExchangeFiltersInner minQty( - @jakarta.annotation.Nullable String minQty) { + public ExchangeFiltersInner minQty(@jakarta.annotation.Nullable String minQty) { this.minQty = minQty; return this; } @@ -409,8 +441,7 @@ public void setMinQty(@jakarta.annotation.Nullable String minQty) { this.minQty = minQty; } - public ExchangeInfoResponseResultExchangeFiltersInner maxQty( - @jakarta.annotation.Nullable String maxQty) { + public ExchangeFiltersInner maxQty(@jakarta.annotation.Nullable String maxQty) { this.maxQty = maxQty; return this; } @@ -429,8 +460,7 @@ public void setMaxQty(@jakarta.annotation.Nullable String maxQty) { this.maxQty = maxQty; } - public ExchangeInfoResponseResultExchangeFiltersInner stepSize( - @jakarta.annotation.Nullable String stepSize) { + public ExchangeFiltersInner stepSize(@jakarta.annotation.Nullable String stepSize) { this.stepSize = stepSize; return this; } @@ -449,47 +479,45 @@ public void setStepSize(@jakarta.annotation.Nullable String stepSize) { this.stepSize = stepSize; } - public ExchangeInfoResponseResultExchangeFiltersInner limit( - @jakarta.annotation.Nullable Long limit) { - this.limit = limit; + public ExchangeFiltersInner minNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; return this; } /** - * Get limit + * Get minNotional * - * @return limit + * @return minNotional */ @jakarta.annotation.Nullable - public Long getLimit() { - return limit; + public String getMinNotional() { + return minNotional; } - public void setLimit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; + public void setMinNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; } - public ExchangeInfoResponseResultExchangeFiltersInner minNotional( - @jakarta.annotation.Nullable String minNotional) { - this.minNotional = minNotional; + public ExchangeFiltersInner applyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { + this.applyToMarket = applyToMarket; return this; } /** - * Get minNotional + * Get applyToMarket * - * @return minNotional + * @return applyToMarket */ @jakarta.annotation.Nullable - public String getMinNotional() { - return minNotional; + public Boolean getApplyToMarket() { + return applyToMarket; } - public void setMinNotional(@jakarta.annotation.Nullable String minNotional) { - this.minNotional = minNotional; + public void setApplyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { + this.applyToMarket = applyToMarket; } - public ExchangeInfoResponseResultExchangeFiltersInner applyMinToMarket( + public ExchangeFiltersInner applyMinToMarket( @jakarta.annotation.Nullable Boolean applyMinToMarket) { this.applyMinToMarket = applyMinToMarket; return this; @@ -509,8 +537,7 @@ public void setApplyMinToMarket(@jakarta.annotation.Nullable Boolean applyMinToM this.applyMinToMarket = applyMinToMarket; } - public ExchangeInfoResponseResultExchangeFiltersInner maxNotional( - @jakarta.annotation.Nullable String maxNotional) { + public ExchangeFiltersInner maxNotional(@jakarta.annotation.Nullable String maxNotional) { this.maxNotional = maxNotional; return this; } @@ -529,7 +556,7 @@ public void setMaxNotional(@jakarta.annotation.Nullable String maxNotional) { this.maxNotional = maxNotional; } - public ExchangeInfoResponseResultExchangeFiltersInner applyMaxToMarket( + public ExchangeFiltersInner applyMaxToMarket( @jakarta.annotation.Nullable Boolean applyMaxToMarket) { this.applyMaxToMarket = applyMaxToMarket; return this; @@ -549,224 +576,181 @@ public void setApplyMaxToMarket(@jakarta.annotation.Nullable Boolean applyMaxToM this.applyMaxToMarket = applyMaxToMarket; } - public ExchangeInfoResponseResultExchangeFiltersInner avgPriceMins( - @jakarta.annotation.Nullable Long avgPriceMins) { - this.avgPriceMins = avgPriceMins; - return this; - } - - /** - * Get avgPriceMins - * - * @return avgPriceMins - */ - @jakarta.annotation.Nullable - public Long getAvgPriceMins() { - return avgPriceMins; - } - - public void setAvgPriceMins(@jakarta.annotation.Nullable Long avgPriceMins) { - this.avgPriceMins = avgPriceMins; - } - - public ExchangeInfoResponseResultExchangeFiltersInner applyToMarket( - @jakarta.annotation.Nullable Boolean applyToMarket) { - this.applyToMarket = applyToMarket; - return this; - } - - /** - * Get applyToMarket - * - * @return applyToMarket - */ - @jakarta.annotation.Nullable - public Boolean getApplyToMarket() { - return applyToMarket; - } - - public void setApplyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { - this.applyToMarket = applyToMarket; - } - - public ExchangeInfoResponseResultExchangeFiltersInner bidMultiplierUp( - @jakarta.annotation.Nullable String bidMultiplierUp) { - this.bidMultiplierUp = bidMultiplierUp; + public ExchangeFiltersInner limit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; return this; } /** - * Get bidMultiplierUp + * Get limit * - * @return bidMultiplierUp + * @return limit */ @jakarta.annotation.Nullable - public String getBidMultiplierUp() { - return bidMultiplierUp; + public Long getLimit() { + return limit; } - public void setBidMultiplierUp(@jakarta.annotation.Nullable String bidMultiplierUp) { - this.bidMultiplierUp = bidMultiplierUp; + public void setLimit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; } - public ExchangeInfoResponseResultExchangeFiltersInner bidMultiplierDown( - @jakarta.annotation.Nullable String bidMultiplierDown) { - this.bidMultiplierDown = bidMultiplierDown; + public ExchangeFiltersInner maxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; return this; } /** - * Get bidMultiplierDown + * Get maxNumOrders * - * @return bidMultiplierDown + * @return maxNumOrders */ @jakarta.annotation.Nullable - public String getBidMultiplierDown() { - return bidMultiplierDown; + public Long getMaxNumOrders() { + return maxNumOrders; } - public void setBidMultiplierDown(@jakarta.annotation.Nullable String bidMultiplierDown) { - this.bidMultiplierDown = bidMultiplierDown; + public void setMaxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; } - public ExchangeInfoResponseResultExchangeFiltersInner askMultiplierUp( - @jakarta.annotation.Nullable String askMultiplierUp) { - this.askMultiplierUp = askMultiplierUp; + public ExchangeFiltersInner maxNumAlgoOrders( + @jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; return this; } /** - * Get askMultiplierUp + * Get maxNumAlgoOrders * - * @return askMultiplierUp + * @return maxNumAlgoOrders */ @jakarta.annotation.Nullable - public String getAskMultiplierUp() { - return askMultiplierUp; + public Long getMaxNumAlgoOrders() { + return maxNumAlgoOrders; } - public void setAskMultiplierUp(@jakarta.annotation.Nullable String askMultiplierUp) { - this.askMultiplierUp = askMultiplierUp; + public void setMaxNumAlgoOrders(@jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; } - public ExchangeInfoResponseResultExchangeFiltersInner askMultiplierDown( - @jakarta.annotation.Nullable String askMultiplierDown) { - this.askMultiplierDown = askMultiplierDown; + public ExchangeFiltersInner maxNumIcebergOrders( + @jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; return this; } /** - * Get askMultiplierDown + * Get maxNumIcebergOrders * - * @return askMultiplierDown + * @return maxNumIcebergOrders */ @jakarta.annotation.Nullable - public String getAskMultiplierDown() { - return askMultiplierDown; + public Long getMaxNumIcebergOrders() { + return maxNumIcebergOrders; } - public void setAskMultiplierDown(@jakarta.annotation.Nullable String askMultiplierDown) { - this.askMultiplierDown = askMultiplierDown; + public void setMaxNumIcebergOrders(@jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; } - public ExchangeInfoResponseResultExchangeFiltersInner multiplierUp( - @jakarta.annotation.Nullable String multiplierUp) { - this.multiplierUp = multiplierUp; + public ExchangeFiltersInner maxPosition(@jakarta.annotation.Nullable String maxPosition) { + this.maxPosition = maxPosition; return this; } /** - * Get multiplierUp + * Get maxPosition * - * @return multiplierUp + * @return maxPosition */ @jakarta.annotation.Nullable - public String getMultiplierUp() { - return multiplierUp; + public String getMaxPosition() { + return maxPosition; } - public void setMultiplierUp(@jakarta.annotation.Nullable String multiplierUp) { - this.multiplierUp = multiplierUp; + public void setMaxPosition(@jakarta.annotation.Nullable String maxPosition) { + this.maxPosition = maxPosition; } - public ExchangeInfoResponseResultExchangeFiltersInner multiplierDown( - @jakarta.annotation.Nullable String multiplierDown) { - this.multiplierDown = multiplierDown; + public ExchangeFiltersInner minTrailingAboveDelta( + @jakarta.annotation.Nullable Long minTrailingAboveDelta) { + this.minTrailingAboveDelta = minTrailingAboveDelta; return this; } /** - * Get multiplierDown + * Get minTrailingAboveDelta * - * @return multiplierDown + * @return minTrailingAboveDelta */ @jakarta.annotation.Nullable - public String getMultiplierDown() { - return multiplierDown; + public Long getMinTrailingAboveDelta() { + return minTrailingAboveDelta; } - public void setMultiplierDown(@jakarta.annotation.Nullable String multiplierDown) { - this.multiplierDown = multiplierDown; + public void setMinTrailingAboveDelta(@jakarta.annotation.Nullable Long minTrailingAboveDelta) { + this.minTrailingAboveDelta = minTrailingAboveDelta; } - public ExchangeInfoResponseResultExchangeFiltersInner minPrice( - @jakarta.annotation.Nullable String minPrice) { - this.minPrice = minPrice; + public ExchangeFiltersInner maxTrailingAboveDelta( + @jakarta.annotation.Nullable Long maxTrailingAboveDelta) { + this.maxTrailingAboveDelta = maxTrailingAboveDelta; return this; } /** - * Get minPrice + * Get maxTrailingAboveDelta * - * @return minPrice + * @return maxTrailingAboveDelta */ @jakarta.annotation.Nullable - public String getMinPrice() { - return minPrice; + public Long getMaxTrailingAboveDelta() { + return maxTrailingAboveDelta; } - public void setMinPrice(@jakarta.annotation.Nullable String minPrice) { - this.minPrice = minPrice; + public void setMaxTrailingAboveDelta(@jakarta.annotation.Nullable Long maxTrailingAboveDelta) { + this.maxTrailingAboveDelta = maxTrailingAboveDelta; } - public ExchangeInfoResponseResultExchangeFiltersInner maxPrice( - @jakarta.annotation.Nullable String maxPrice) { - this.maxPrice = maxPrice; + public ExchangeFiltersInner minTrailingBelowDelta( + @jakarta.annotation.Nullable Long minTrailingBelowDelta) { + this.minTrailingBelowDelta = minTrailingBelowDelta; return this; } /** - * Get maxPrice + * Get minTrailingBelowDelta * - * @return maxPrice + * @return minTrailingBelowDelta */ @jakarta.annotation.Nullable - public String getMaxPrice() { - return maxPrice; + public Long getMinTrailingBelowDelta() { + return minTrailingBelowDelta; } - public void setMaxPrice(@jakarta.annotation.Nullable String maxPrice) { - this.maxPrice = maxPrice; + public void setMinTrailingBelowDelta(@jakarta.annotation.Nullable Long minTrailingBelowDelta) { + this.minTrailingBelowDelta = minTrailingBelowDelta; } - public ExchangeInfoResponseResultExchangeFiltersInner tickSize( - @jakarta.annotation.Nullable String tickSize) { - this.tickSize = tickSize; + public ExchangeFiltersInner maxTrailingBelowDelta( + @jakarta.annotation.Nullable Long maxTrailingBelowDelta) { + this.maxTrailingBelowDelta = maxTrailingBelowDelta; return this; } /** - * Get tickSize + * Get maxTrailingBelowDelta * - * @return tickSize + * @return maxTrailingBelowDelta */ @jakarta.annotation.Nullable - public String getTickSize() { - return tickSize; + public Long getMaxTrailingBelowDelta() { + return maxTrailingBelowDelta; } - public void setTickSize(@jakarta.annotation.Nullable String tickSize) { - this.tickSize = tickSize; + public void setMaxTrailingBelowDelta(@jakarta.annotation.Nullable Long maxTrailingBelowDelta) { + this.maxTrailingBelowDelta = maxTrailingBelowDelta; } @Override @@ -777,129 +761,105 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ExchangeInfoResponseResultExchangeFiltersInner - exchangeInfoResponseResultExchangeFiltersInner = - (ExchangeInfoResponseResultExchangeFiltersInner) o; - return Objects.equals( - this.filterType, exchangeInfoResponseResultExchangeFiltersInner.filterType) - && Objects.equals( - this.maxNumIcebergOrders, - exchangeInfoResponseResultExchangeFiltersInner.maxNumIcebergOrders) - && Objects.equals( - this.maxNumAlgoOrders, - exchangeInfoResponseResultExchangeFiltersInner.maxNumAlgoOrders) - && Objects.equals( - this.maxNumOrders, - exchangeInfoResponseResultExchangeFiltersInner.maxNumOrders) - && Objects.equals( - this.minTrailingAboveDelta, - exchangeInfoResponseResultExchangeFiltersInner.minTrailingAboveDelta) - && Objects.equals( - this.maxTrailingAboveDelta, - exchangeInfoResponseResultExchangeFiltersInner.maxTrailingAboveDelta) - && Objects.equals( - this.minTrailingBelowDelta, - exchangeInfoResponseResultExchangeFiltersInner.minTrailingBelowDelta) - && Objects.equals( - this.maxTrailingBelowDelta, - exchangeInfoResponseResultExchangeFiltersInner.maxTrailingBelowDelta) - && Objects.equals( - this.maxPosition, - exchangeInfoResponseResultExchangeFiltersInner.maxPosition) - && Objects.equals( - this.minQty, exchangeInfoResponseResultExchangeFiltersInner.minQty) - && Objects.equals( - this.maxQty, exchangeInfoResponseResultExchangeFiltersInner.maxQty) - && Objects.equals( - this.stepSize, exchangeInfoResponseResultExchangeFiltersInner.stepSize) - && Objects.equals(this.limit, exchangeInfoResponseResultExchangeFiltersInner.limit) - && Objects.equals( - this.minNotional, - exchangeInfoResponseResultExchangeFiltersInner.minNotional) - && Objects.equals( - this.applyMinToMarket, - exchangeInfoResponseResultExchangeFiltersInner.applyMinToMarket) - && Objects.equals( - this.maxNotional, - exchangeInfoResponseResultExchangeFiltersInner.maxNotional) - && Objects.equals( - this.applyMaxToMarket, - exchangeInfoResponseResultExchangeFiltersInner.applyMaxToMarket) - && Objects.equals( - this.avgPriceMins, - exchangeInfoResponseResultExchangeFiltersInner.avgPriceMins) + ExchangeFiltersInner exchangeFiltersInner = (ExchangeFiltersInner) o; + return Objects.equals(this.filterType, exchangeFiltersInner.filterType) + && Objects.equals(this.minPrice, exchangeFiltersInner.minPrice) + && Objects.equals(this.maxPrice, exchangeFiltersInner.maxPrice) + && Objects.equals(this.tickSize, exchangeFiltersInner.tickSize) + && Objects.equals(this.multiplierUp, exchangeFiltersInner.multiplierUp) + && Objects.equals(this.multiplierDown, exchangeFiltersInner.multiplierDown) + && Objects.equals(this.avgPriceMins, exchangeFiltersInner.avgPriceMins) + && Objects.equals(this.bidMultiplierUp, exchangeFiltersInner.bidMultiplierUp) + && Objects.equals(this.bidMultiplierDown, exchangeFiltersInner.bidMultiplierDown) + && Objects.equals(this.askMultiplierUp, exchangeFiltersInner.askMultiplierUp) + && Objects.equals(this.askMultiplierDown, exchangeFiltersInner.askMultiplierDown) + && Objects.equals(this.minQty, exchangeFiltersInner.minQty) + && Objects.equals(this.maxQty, exchangeFiltersInner.maxQty) + && Objects.equals(this.stepSize, exchangeFiltersInner.stepSize) + && Objects.equals(this.minNotional, exchangeFiltersInner.minNotional) + && Objects.equals(this.applyToMarket, exchangeFiltersInner.applyToMarket) + && Objects.equals(this.applyMinToMarket, exchangeFiltersInner.applyMinToMarket) + && Objects.equals(this.maxNotional, exchangeFiltersInner.maxNotional) + && Objects.equals(this.applyMaxToMarket, exchangeFiltersInner.applyMaxToMarket) + && Objects.equals(this.limit, exchangeFiltersInner.limit) + && Objects.equals(this.maxNumOrders, exchangeFiltersInner.maxNumOrders) + && Objects.equals(this.maxNumAlgoOrders, exchangeFiltersInner.maxNumAlgoOrders) && Objects.equals( - this.applyToMarket, - exchangeInfoResponseResultExchangeFiltersInner.applyToMarket) + this.maxNumIcebergOrders, exchangeFiltersInner.maxNumIcebergOrders) + && Objects.equals(this.maxPosition, exchangeFiltersInner.maxPosition) && Objects.equals( - this.bidMultiplierUp, - exchangeInfoResponseResultExchangeFiltersInner.bidMultiplierUp) + this.minTrailingAboveDelta, exchangeFiltersInner.minTrailingAboveDelta) && Objects.equals( - this.bidMultiplierDown, - exchangeInfoResponseResultExchangeFiltersInner.bidMultiplierDown) + this.maxTrailingAboveDelta, exchangeFiltersInner.maxTrailingAboveDelta) && Objects.equals( - this.askMultiplierUp, - exchangeInfoResponseResultExchangeFiltersInner.askMultiplierUp) + this.minTrailingBelowDelta, exchangeFiltersInner.minTrailingBelowDelta) && Objects.equals( - this.askMultiplierDown, - exchangeInfoResponseResultExchangeFiltersInner.askMultiplierDown) - && Objects.equals( - this.multiplierUp, - exchangeInfoResponseResultExchangeFiltersInner.multiplierUp) - && Objects.equals( - this.multiplierDown, - exchangeInfoResponseResultExchangeFiltersInner.multiplierDown) - && Objects.equals( - this.minPrice, exchangeInfoResponseResultExchangeFiltersInner.minPrice) - && Objects.equals( - this.maxPrice, exchangeInfoResponseResultExchangeFiltersInner.maxPrice) - && Objects.equals( - this.tickSize, exchangeInfoResponseResultExchangeFiltersInner.tickSize); + this.maxTrailingBelowDelta, exchangeFiltersInner.maxTrailingBelowDelta); } @Override public int hashCode() { return Objects.hash( filterType, - maxNumIcebergOrders, - maxNumAlgoOrders, - maxNumOrders, - minTrailingAboveDelta, - maxTrailingAboveDelta, - minTrailingBelowDelta, - maxTrailingBelowDelta, - maxPosition, + minPrice, + maxPrice, + tickSize, + multiplierUp, + multiplierDown, + avgPriceMins, + bidMultiplierUp, + bidMultiplierDown, + askMultiplierUp, + askMultiplierDown, minQty, maxQty, stepSize, - limit, minNotional, + applyToMarket, applyMinToMarket, maxNotional, applyMaxToMarket, - avgPriceMins, - applyToMarket, - bidMultiplierUp, - bidMultiplierDown, - askMultiplierUp, - askMultiplierDown, - multiplierUp, - multiplierDown, - minPrice, - maxPrice, - tickSize); + limit, + maxNumOrders, + maxNumAlgoOrders, + maxNumIcebergOrders, + maxPosition, + minTrailingAboveDelta, + maxTrailingAboveDelta, + minTrailingBelowDelta, + maxTrailingBelowDelta); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ExchangeInfoResponseResultExchangeFiltersInner {\n"); + sb.append("class ExchangeFiltersInner {\n"); sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" minPrice: ").append(toIndentedString(minPrice)).append("\n"); + sb.append(" maxPrice: ").append(toIndentedString(maxPrice)).append("\n"); + sb.append(" tickSize: ").append(toIndentedString(tickSize)).append("\n"); + sb.append(" multiplierUp: ").append(toIndentedString(multiplierUp)).append("\n"); + sb.append(" multiplierDown: ").append(toIndentedString(multiplierDown)).append("\n"); + sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); + sb.append(" bidMultiplierUp: ").append(toIndentedString(bidMultiplierUp)).append("\n"); + sb.append(" bidMultiplierDown: ").append(toIndentedString(bidMultiplierDown)).append("\n"); + sb.append(" askMultiplierUp: ").append(toIndentedString(askMultiplierUp)).append("\n"); + sb.append(" askMultiplierDown: ").append(toIndentedString(askMultiplierDown)).append("\n"); + sb.append(" minQty: ").append(toIndentedString(minQty)).append("\n"); + sb.append(" maxQty: ").append(toIndentedString(maxQty)).append("\n"); + sb.append(" stepSize: ").append(toIndentedString(stepSize)).append("\n"); + sb.append(" minNotional: ").append(toIndentedString(minNotional)).append("\n"); + sb.append(" applyToMarket: ").append(toIndentedString(applyToMarket)).append("\n"); + sb.append(" applyMinToMarket: ").append(toIndentedString(applyMinToMarket)).append("\n"); + sb.append(" maxNotional: ").append(toIndentedString(maxNotional)).append("\n"); + sb.append(" applyMaxToMarket: ").append(toIndentedString(applyMaxToMarket)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" maxNumOrders: ").append(toIndentedString(maxNumOrders)).append("\n"); + sb.append(" maxNumAlgoOrders: ").append(toIndentedString(maxNumAlgoOrders)).append("\n"); sb.append(" maxNumIcebergOrders: ") .append(toIndentedString(maxNumIcebergOrders)) .append("\n"); - sb.append(" maxNumAlgoOrders: ").append(toIndentedString(maxNumAlgoOrders)).append("\n"); - sb.append(" maxNumOrders: ").append(toIndentedString(maxNumOrders)).append("\n"); + sb.append(" maxPosition: ").append(toIndentedString(maxPosition)).append("\n"); sb.append(" minTrailingAboveDelta: ") .append(toIndentedString(minTrailingAboveDelta)) .append("\n"); @@ -912,26 +872,6 @@ public String toString() { sb.append(" maxTrailingBelowDelta: ") .append(toIndentedString(maxTrailingBelowDelta)) .append("\n"); - sb.append(" maxPosition: ").append(toIndentedString(maxPosition)).append("\n"); - sb.append(" minQty: ").append(toIndentedString(minQty)).append("\n"); - sb.append(" maxQty: ").append(toIndentedString(maxQty)).append("\n"); - sb.append(" stepSize: ").append(toIndentedString(stepSize)).append("\n"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" minNotional: ").append(toIndentedString(minNotional)).append("\n"); - sb.append(" applyMinToMarket: ").append(toIndentedString(applyMinToMarket)).append("\n"); - sb.append(" maxNotional: ").append(toIndentedString(maxNotional)).append("\n"); - sb.append(" applyMaxToMarket: ").append(toIndentedString(applyMaxToMarket)).append("\n"); - sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); - sb.append(" applyToMarket: ").append(toIndentedString(applyToMarket)).append("\n"); - sb.append(" bidMultiplierUp: ").append(toIndentedString(bidMultiplierUp)).append("\n"); - sb.append(" bidMultiplierDown: ").append(toIndentedString(bidMultiplierDown)).append("\n"); - sb.append(" askMultiplierUp: ").append(toIndentedString(askMultiplierUp)).append("\n"); - sb.append(" askMultiplierDown: ").append(toIndentedString(askMultiplierDown)).append("\n"); - sb.append(" multiplierUp: ").append(toIndentedString(multiplierUp)).append("\n"); - sb.append(" multiplierDown: ").append(toIndentedString(multiplierDown)).append("\n"); - sb.append(" minPrice: ").append(toIndentedString(minPrice)).append("\n"); - sb.append(" maxPrice: ").append(toIndentedString(maxPrice)).append("\n"); - sb.append(" tickSize: ").append(toIndentedString(tickSize)).append("\n"); sb.append("}"); return sb.toString(); } @@ -945,45 +885,55 @@ public String toUrlQueryString() { String filterTypeValueAsString = filterTypeValue.toString(); valMap.put("filterType", filterTypeValueAsString); } - Long maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); - if (maxNumIcebergOrdersValue != null) { - String maxNumIcebergOrdersValueAsString = maxNumIcebergOrdersValue.toString(); - valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValueAsString); + String minPriceValue = getMinPrice(); + if (minPriceValue != null) { + String minPriceValueAsString = minPriceValue.toString(); + valMap.put("minPrice", minPriceValueAsString); } - Long maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); - if (maxNumAlgoOrdersValue != null) { - String maxNumAlgoOrdersValueAsString = maxNumAlgoOrdersValue.toString(); - valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValueAsString); + String maxPriceValue = getMaxPrice(); + if (maxPriceValue != null) { + String maxPriceValueAsString = maxPriceValue.toString(); + valMap.put("maxPrice", maxPriceValueAsString); } - Long maxNumOrdersValue = getMaxNumOrders(); - if (maxNumOrdersValue != null) { - String maxNumOrdersValueAsString = maxNumOrdersValue.toString(); - valMap.put("maxNumOrders", maxNumOrdersValueAsString); + String tickSizeValue = getTickSize(); + if (tickSizeValue != null) { + String tickSizeValueAsString = tickSizeValue.toString(); + valMap.put("tickSize", tickSizeValueAsString); } - Long minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); - if (minTrailingAboveDeltaValue != null) { - String minTrailingAboveDeltaValueAsString = minTrailingAboveDeltaValue.toString(); - valMap.put("minTrailingAboveDelta", minTrailingAboveDeltaValueAsString); + String multiplierUpValue = getMultiplierUp(); + if (multiplierUpValue != null) { + String multiplierUpValueAsString = multiplierUpValue.toString(); + valMap.put("multiplierUp", multiplierUpValueAsString); } - Long maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); - if (maxTrailingAboveDeltaValue != null) { - String maxTrailingAboveDeltaValueAsString = maxTrailingAboveDeltaValue.toString(); - valMap.put("maxTrailingAboveDelta", maxTrailingAboveDeltaValueAsString); + String multiplierDownValue = getMultiplierDown(); + if (multiplierDownValue != null) { + String multiplierDownValueAsString = multiplierDownValue.toString(); + valMap.put("multiplierDown", multiplierDownValueAsString); } - Long minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); - if (minTrailingBelowDeltaValue != null) { - String minTrailingBelowDeltaValueAsString = minTrailingBelowDeltaValue.toString(); - valMap.put("minTrailingBelowDelta", minTrailingBelowDeltaValueAsString); + Long avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + String avgPriceMinsValueAsString = avgPriceMinsValue.toString(); + valMap.put("avgPriceMins", avgPriceMinsValueAsString); } - Long maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); - if (maxTrailingBelowDeltaValue != null) { - String maxTrailingBelowDeltaValueAsString = maxTrailingBelowDeltaValue.toString(); - valMap.put("maxTrailingBelowDelta", maxTrailingBelowDeltaValueAsString); + String bidMultiplierUpValue = getBidMultiplierUp(); + if (bidMultiplierUpValue != null) { + String bidMultiplierUpValueAsString = bidMultiplierUpValue.toString(); + valMap.put("bidMultiplierUp", bidMultiplierUpValueAsString); } - String maxPositionValue = getMaxPosition(); - if (maxPositionValue != null) { - String maxPositionValueAsString = maxPositionValue.toString(); - valMap.put("maxPosition", maxPositionValueAsString); + String bidMultiplierDownValue = getBidMultiplierDown(); + if (bidMultiplierDownValue != null) { + String bidMultiplierDownValueAsString = bidMultiplierDownValue.toString(); + valMap.put("bidMultiplierDown", bidMultiplierDownValueAsString); + } + String askMultiplierUpValue = getAskMultiplierUp(); + if (askMultiplierUpValue != null) { + String askMultiplierUpValueAsString = askMultiplierUpValue.toString(); + valMap.put("askMultiplierUp", askMultiplierUpValueAsString); + } + String askMultiplierDownValue = getAskMultiplierDown(); + if (askMultiplierDownValue != null) { + String askMultiplierDownValueAsString = askMultiplierDownValue.toString(); + valMap.put("askMultiplierDown", askMultiplierDownValueAsString); } String minQtyValue = getMinQty(); if (minQtyValue != null) { @@ -1000,16 +950,16 @@ public String toUrlQueryString() { String stepSizeValueAsString = stepSizeValue.toString(); valMap.put("stepSize", stepSizeValueAsString); } - Long limitValue = getLimit(); - if (limitValue != null) { - String limitValueAsString = limitValue.toString(); - valMap.put("limit", limitValueAsString); - } String minNotionalValue = getMinNotional(); if (minNotionalValue != null) { String minNotionalValueAsString = minNotionalValue.toString(); valMap.put("minNotional", minNotionalValueAsString); } + Boolean applyToMarketValue = getApplyToMarket(); + if (applyToMarketValue != null) { + String applyToMarketValueAsString = applyToMarketValue.toString(); + valMap.put("applyToMarket", applyToMarketValueAsString); + } Boolean applyMinToMarketValue = getApplyMinToMarket(); if (applyMinToMarketValue != null) { String applyMinToMarketValueAsString = applyMinToMarketValue.toString(); @@ -1025,60 +975,50 @@ public String toUrlQueryString() { String applyMaxToMarketValueAsString = applyMaxToMarketValue.toString(); valMap.put("applyMaxToMarket", applyMaxToMarketValueAsString); } - Long avgPriceMinsValue = getAvgPriceMins(); - if (avgPriceMinsValue != null) { - String avgPriceMinsValueAsString = avgPriceMinsValue.toString(); - valMap.put("avgPriceMins", avgPriceMinsValueAsString); - } - Boolean applyToMarketValue = getApplyToMarket(); - if (applyToMarketValue != null) { - String applyToMarketValueAsString = applyToMarketValue.toString(); - valMap.put("applyToMarket", applyToMarketValueAsString); - } - String bidMultiplierUpValue = getBidMultiplierUp(); - if (bidMultiplierUpValue != null) { - String bidMultiplierUpValueAsString = bidMultiplierUpValue.toString(); - valMap.put("bidMultiplierUp", bidMultiplierUpValueAsString); + Long limitValue = getLimit(); + if (limitValue != null) { + String limitValueAsString = limitValue.toString(); + valMap.put("limit", limitValueAsString); } - String bidMultiplierDownValue = getBidMultiplierDown(); - if (bidMultiplierDownValue != null) { - String bidMultiplierDownValueAsString = bidMultiplierDownValue.toString(); - valMap.put("bidMultiplierDown", bidMultiplierDownValueAsString); + Long maxNumOrdersValue = getMaxNumOrders(); + if (maxNumOrdersValue != null) { + String maxNumOrdersValueAsString = maxNumOrdersValue.toString(); + valMap.put("maxNumOrders", maxNumOrdersValueAsString); } - String askMultiplierUpValue = getAskMultiplierUp(); - if (askMultiplierUpValue != null) { - String askMultiplierUpValueAsString = askMultiplierUpValue.toString(); - valMap.put("askMultiplierUp", askMultiplierUpValueAsString); + Long maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); + if (maxNumAlgoOrdersValue != null) { + String maxNumAlgoOrdersValueAsString = maxNumAlgoOrdersValue.toString(); + valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValueAsString); } - String askMultiplierDownValue = getAskMultiplierDown(); - if (askMultiplierDownValue != null) { - String askMultiplierDownValueAsString = askMultiplierDownValue.toString(); - valMap.put("askMultiplierDown", askMultiplierDownValueAsString); + Long maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); + if (maxNumIcebergOrdersValue != null) { + String maxNumIcebergOrdersValueAsString = maxNumIcebergOrdersValue.toString(); + valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValueAsString); } - String multiplierUpValue = getMultiplierUp(); - if (multiplierUpValue != null) { - String multiplierUpValueAsString = multiplierUpValue.toString(); - valMap.put("multiplierUp", multiplierUpValueAsString); + String maxPositionValue = getMaxPosition(); + if (maxPositionValue != null) { + String maxPositionValueAsString = maxPositionValue.toString(); + valMap.put("maxPosition", maxPositionValueAsString); } - String multiplierDownValue = getMultiplierDown(); - if (multiplierDownValue != null) { - String multiplierDownValueAsString = multiplierDownValue.toString(); - valMap.put("multiplierDown", multiplierDownValueAsString); + Long minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); + if (minTrailingAboveDeltaValue != null) { + String minTrailingAboveDeltaValueAsString = minTrailingAboveDeltaValue.toString(); + valMap.put("minTrailingAboveDelta", minTrailingAboveDeltaValueAsString); } - String minPriceValue = getMinPrice(); - if (minPriceValue != null) { - String minPriceValueAsString = minPriceValue.toString(); - valMap.put("minPrice", minPriceValueAsString); + Long maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); + if (maxTrailingAboveDeltaValue != null) { + String maxTrailingAboveDeltaValueAsString = maxTrailingAboveDeltaValue.toString(); + valMap.put("maxTrailingAboveDelta", maxTrailingAboveDeltaValueAsString); } - String maxPriceValue = getMaxPrice(); - if (maxPriceValue != null) { - String maxPriceValueAsString = maxPriceValue.toString(); - valMap.put("maxPrice", maxPriceValueAsString); + Long minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); + if (minTrailingBelowDeltaValue != null) { + String minTrailingBelowDeltaValueAsString = minTrailingBelowDeltaValue.toString(); + valMap.put("minTrailingBelowDelta", minTrailingBelowDeltaValueAsString); } - String tickSizeValue = getTickSize(); - if (tickSizeValue != null) { - String tickSizeValueAsString = tickSizeValue.toString(); - valMap.put("tickSize", tickSizeValueAsString); + Long maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); + if (maxTrailingBelowDeltaValue != null) { + String maxTrailingBelowDeltaValueAsString = maxTrailingBelowDeltaValue.toString(); + valMap.put("maxTrailingBelowDelta", maxTrailingBelowDeltaValueAsString); } valMap.put("timestamp", getTimestamp()); @@ -1095,37 +1035,45 @@ public Map toMap() { if (filterTypeValue != null) { valMap.put("filterType", filterTypeValue); } - Object maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); - if (maxNumIcebergOrdersValue != null) { - valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValue); + Object minPriceValue = getMinPrice(); + if (minPriceValue != null) { + valMap.put("minPrice", minPriceValue); + } + Object maxPriceValue = getMaxPrice(); + if (maxPriceValue != null) { + valMap.put("maxPrice", maxPriceValue); + } + Object tickSizeValue = getTickSize(); + if (tickSizeValue != null) { + valMap.put("tickSize", tickSizeValue); } - Object maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); - if (maxNumAlgoOrdersValue != null) { - valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValue); + Object multiplierUpValue = getMultiplierUp(); + if (multiplierUpValue != null) { + valMap.put("multiplierUp", multiplierUpValue); } - Object maxNumOrdersValue = getMaxNumOrders(); - if (maxNumOrdersValue != null) { - valMap.put("maxNumOrders", maxNumOrdersValue); + Object multiplierDownValue = getMultiplierDown(); + if (multiplierDownValue != null) { + valMap.put("multiplierDown", multiplierDownValue); } - Object minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); - if (minTrailingAboveDeltaValue != null) { - valMap.put("minTrailingAboveDelta", minTrailingAboveDeltaValue); + Object avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + valMap.put("avgPriceMins", avgPriceMinsValue); } - Object maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); - if (maxTrailingAboveDeltaValue != null) { - valMap.put("maxTrailingAboveDelta", maxTrailingAboveDeltaValue); + Object bidMultiplierUpValue = getBidMultiplierUp(); + if (bidMultiplierUpValue != null) { + valMap.put("bidMultiplierUp", bidMultiplierUpValue); } - Object minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); - if (minTrailingBelowDeltaValue != null) { - valMap.put("minTrailingBelowDelta", minTrailingBelowDeltaValue); + Object bidMultiplierDownValue = getBidMultiplierDown(); + if (bidMultiplierDownValue != null) { + valMap.put("bidMultiplierDown", bidMultiplierDownValue); } - Object maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); - if (maxTrailingBelowDeltaValue != null) { - valMap.put("maxTrailingBelowDelta", maxTrailingBelowDeltaValue); + Object askMultiplierUpValue = getAskMultiplierUp(); + if (askMultiplierUpValue != null) { + valMap.put("askMultiplierUp", askMultiplierUpValue); } - Object maxPositionValue = getMaxPosition(); - if (maxPositionValue != null) { - valMap.put("maxPosition", maxPositionValue); + Object askMultiplierDownValue = getAskMultiplierDown(); + if (askMultiplierDownValue != null) { + valMap.put("askMultiplierDown", askMultiplierDownValue); } Object minQtyValue = getMinQty(); if (minQtyValue != null) { @@ -1139,14 +1087,14 @@ public Map toMap() { if (stepSizeValue != null) { valMap.put("stepSize", stepSizeValue); } - Object limitValue = getLimit(); - if (limitValue != null) { - valMap.put("limit", limitValue); - } Object minNotionalValue = getMinNotional(); if (minNotionalValue != null) { valMap.put("minNotional", minNotionalValue); } + Object applyToMarketValue = getApplyToMarket(); + if (applyToMarketValue != null) { + valMap.put("applyToMarket", applyToMarketValue); + } Object applyMinToMarketValue = getApplyMinToMarket(); if (applyMinToMarketValue != null) { valMap.put("applyMinToMarket", applyMinToMarketValue); @@ -1159,49 +1107,41 @@ public Map toMap() { if (applyMaxToMarketValue != null) { valMap.put("applyMaxToMarket", applyMaxToMarketValue); } - Object avgPriceMinsValue = getAvgPriceMins(); - if (avgPriceMinsValue != null) { - valMap.put("avgPriceMins", avgPriceMinsValue); - } - Object applyToMarketValue = getApplyToMarket(); - if (applyToMarketValue != null) { - valMap.put("applyToMarket", applyToMarketValue); - } - Object bidMultiplierUpValue = getBidMultiplierUp(); - if (bidMultiplierUpValue != null) { - valMap.put("bidMultiplierUp", bidMultiplierUpValue); + Object limitValue = getLimit(); + if (limitValue != null) { + valMap.put("limit", limitValue); } - Object bidMultiplierDownValue = getBidMultiplierDown(); - if (bidMultiplierDownValue != null) { - valMap.put("bidMultiplierDown", bidMultiplierDownValue); + Object maxNumOrdersValue = getMaxNumOrders(); + if (maxNumOrdersValue != null) { + valMap.put("maxNumOrders", maxNumOrdersValue); } - Object askMultiplierUpValue = getAskMultiplierUp(); - if (askMultiplierUpValue != null) { - valMap.put("askMultiplierUp", askMultiplierUpValue); + Object maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); + if (maxNumAlgoOrdersValue != null) { + valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValue); } - Object askMultiplierDownValue = getAskMultiplierDown(); - if (askMultiplierDownValue != null) { - valMap.put("askMultiplierDown", askMultiplierDownValue); + Object maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); + if (maxNumIcebergOrdersValue != null) { + valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValue); } - Object multiplierUpValue = getMultiplierUp(); - if (multiplierUpValue != null) { - valMap.put("multiplierUp", multiplierUpValue); + Object maxPositionValue = getMaxPosition(); + if (maxPositionValue != null) { + valMap.put("maxPosition", maxPositionValue); } - Object multiplierDownValue = getMultiplierDown(); - if (multiplierDownValue != null) { - valMap.put("multiplierDown", multiplierDownValue); + Object minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); + if (minTrailingAboveDeltaValue != null) { + valMap.put("minTrailingAboveDelta", minTrailingAboveDeltaValue); } - Object minPriceValue = getMinPrice(); - if (minPriceValue != null) { - valMap.put("minPrice", minPriceValue); + Object maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); + if (maxTrailingAboveDeltaValue != null) { + valMap.put("maxTrailingAboveDelta", maxTrailingAboveDeltaValue); } - Object maxPriceValue = getMaxPrice(); - if (maxPriceValue != null) { - valMap.put("maxPrice", maxPriceValue); + Object minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); + if (minTrailingBelowDeltaValue != null) { + valMap.put("minTrailingBelowDelta", minTrailingBelowDeltaValue); } - Object tickSizeValue = getTickSize(); - if (tickSizeValue != null) { - valMap.put("tickSize", tickSizeValue); + Object maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); + if (maxTrailingBelowDeltaValue != null) { + valMap.put("maxTrailingBelowDelta", maxTrailingBelowDeltaValue); } valMap.put("timestamp", getTimestamp()); @@ -1230,33 +1170,33 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("filterType"); - openapiFields.add("maxNumIcebergOrders"); - openapiFields.add("maxNumAlgoOrders"); - openapiFields.add("maxNumOrders"); - openapiFields.add("minTrailingAboveDelta"); - openapiFields.add("maxTrailingAboveDelta"); - openapiFields.add("minTrailingBelowDelta"); - openapiFields.add("maxTrailingBelowDelta"); - openapiFields.add("maxPosition"); + openapiFields.add("minPrice"); + openapiFields.add("maxPrice"); + openapiFields.add("tickSize"); + openapiFields.add("multiplierUp"); + openapiFields.add("multiplierDown"); + openapiFields.add("avgPriceMins"); + openapiFields.add("bidMultiplierUp"); + openapiFields.add("bidMultiplierDown"); + openapiFields.add("askMultiplierUp"); + openapiFields.add("askMultiplierDown"); openapiFields.add("minQty"); openapiFields.add("maxQty"); openapiFields.add("stepSize"); - openapiFields.add("limit"); openapiFields.add("minNotional"); + openapiFields.add("applyToMarket"); openapiFields.add("applyMinToMarket"); openapiFields.add("maxNotional"); openapiFields.add("applyMaxToMarket"); - openapiFields.add("avgPriceMins"); - openapiFields.add("applyToMarket"); - openapiFields.add("bidMultiplierUp"); - openapiFields.add("bidMultiplierDown"); - openapiFields.add("askMultiplierUp"); - openapiFields.add("askMultiplierDown"); - openapiFields.add("multiplierUp"); - openapiFields.add("multiplierDown"); - openapiFields.add("minPrice"); - openapiFields.add("maxPrice"); - openapiFields.add("tickSize"); + openapiFields.add("limit"); + openapiFields.add("maxNumOrders"); + openapiFields.add("maxNumAlgoOrders"); + openapiFields.add("maxNumIcebergOrders"); + openapiFields.add("maxPosition"); + openapiFields.add("minTrailingAboveDelta"); + openapiFields.add("maxTrailingAboveDelta"); + openapiFields.add("minTrailingBelowDelta"); + openapiFields.add("maxTrailingBelowDelta"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -1266,33 +1206,28 @@ private String toIndentedString(Object o) { * 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 - * ExchangeInfoResponseResultExchangeFiltersInner + * @throws IOException if the JSON Element is invalid with respect to ExchangeFiltersInner */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ExchangeInfoResponseResultExchangeFiltersInner.openapiRequiredFields + if (!ExchangeFiltersInner.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in" - + " ExchangeInfoResponseResultExchangeFiltersInner is not found" - + " in the empty JSON string", - ExchangeInfoResponseResultExchangeFiltersInner.openapiRequiredFields - .toString())); + "The required field(s) %s in ExchangeFiltersInner is not found in" + + " the empty JSON string", + ExchangeFiltersInner.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!ExchangeInfoResponseResultExchangeFiltersInner.openapiFields.contains( - entry.getKey())) { + if (!ExchangeFiltersInner.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `ExchangeInfoResponseResultExchangeFiltersInner`" - + " properties. JSON: %s", + + " `ExchangeFiltersInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } @@ -1305,53 +1240,45 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("filterType").toString())); } - if ((jsonObj.get("maxPosition") != null && !jsonObj.get("maxPosition").isJsonNull()) - && !jsonObj.get("maxPosition").isJsonPrimitive()) { + if ((jsonObj.get("minPrice") != null && !jsonObj.get("minPrice").isJsonNull()) + && !jsonObj.get("minPrice").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `maxPosition` to be a primitive type in the JSON" + "Expected the field `minPrice` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("maxPosition").toString())); - } - if ((jsonObj.get("minQty") != null && !jsonObj.get("minQty").isJsonNull()) - && !jsonObj.get("minQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `minQty` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("minQty").toString())); + jsonObj.get("minPrice").toString())); } - if ((jsonObj.get("maxQty") != null && !jsonObj.get("maxQty").isJsonNull()) - && !jsonObj.get("maxQty").isJsonPrimitive()) { + if ((jsonObj.get("maxPrice") != null && !jsonObj.get("maxPrice").isJsonNull()) + && !jsonObj.get("maxPrice").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `maxQty` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("maxQty").toString())); + "Expected the field `maxPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("maxPrice").toString())); } - if ((jsonObj.get("stepSize") != null && !jsonObj.get("stepSize").isJsonNull()) - && !jsonObj.get("stepSize").isJsonPrimitive()) { + if ((jsonObj.get("tickSize") != null && !jsonObj.get("tickSize").isJsonNull()) + && !jsonObj.get("tickSize").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `stepSize` to be a primitive type in the JSON" + "Expected the field `tickSize` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("stepSize").toString())); + jsonObj.get("tickSize").toString())); } - if ((jsonObj.get("minNotional") != null && !jsonObj.get("minNotional").isJsonNull()) - && !jsonObj.get("minNotional").isJsonPrimitive()) { + if ((jsonObj.get("multiplierUp") != null && !jsonObj.get("multiplierUp").isJsonNull()) + && !jsonObj.get("multiplierUp").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `minNotional` to be a primitive type in the JSON" + "Expected the field `multiplierUp` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("minNotional").toString())); + jsonObj.get("multiplierUp").toString())); } - if ((jsonObj.get("maxNotional") != null && !jsonObj.get("maxNotional").isJsonNull()) - && !jsonObj.get("maxNotional").isJsonPrimitive()) { + if ((jsonObj.get("multiplierDown") != null && !jsonObj.get("multiplierDown").isJsonNull()) + && !jsonObj.get("multiplierDown").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `maxNotional` to be a primitive type in the JSON" + "Expected the field `multiplierDown` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("maxNotional").toString())); + jsonObj.get("multiplierDown").toString())); } if ((jsonObj.get("bidMultiplierUp") != null && !jsonObj.get("bidMultiplierUp").isJsonNull()) && !jsonObj.get("bidMultiplierUp").isJsonPrimitive()) { @@ -1387,45 +1314,53 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " JSON string but got `%s`", jsonObj.get("askMultiplierDown").toString())); } - if ((jsonObj.get("multiplierUp") != null && !jsonObj.get("multiplierUp").isJsonNull()) - && !jsonObj.get("multiplierUp").isJsonPrimitive()) { + if ((jsonObj.get("minQty") != null && !jsonObj.get("minQty").isJsonNull()) + && !jsonObj.get("minQty").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `multiplierUp` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("multiplierUp").toString())); + "Expected the field `minQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("minQty").toString())); } - if ((jsonObj.get("multiplierDown") != null && !jsonObj.get("multiplierDown").isJsonNull()) - && !jsonObj.get("multiplierDown").isJsonPrimitive()) { + if ((jsonObj.get("maxQty") != null && !jsonObj.get("maxQty").isJsonNull()) + && !jsonObj.get("maxQty").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `multiplierDown` to be a primitive type in the JSON" + "Expected the field `maxQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("maxQty").toString())); + } + if ((jsonObj.get("stepSize") != null && !jsonObj.get("stepSize").isJsonNull()) + && !jsonObj.get("stepSize").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `stepSize` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("multiplierDown").toString())); + jsonObj.get("stepSize").toString())); } - if ((jsonObj.get("minPrice") != null && !jsonObj.get("minPrice").isJsonNull()) - && !jsonObj.get("minPrice").isJsonPrimitive()) { + if ((jsonObj.get("minNotional") != null && !jsonObj.get("minNotional").isJsonNull()) + && !jsonObj.get("minNotional").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `minPrice` to be a primitive type in the JSON" + "Expected the field `minNotional` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("minPrice").toString())); + jsonObj.get("minNotional").toString())); } - if ((jsonObj.get("maxPrice") != null && !jsonObj.get("maxPrice").isJsonNull()) - && !jsonObj.get("maxPrice").isJsonPrimitive()) { + if ((jsonObj.get("maxNotional") != null && !jsonObj.get("maxNotional").isJsonNull()) + && !jsonObj.get("maxNotional").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `maxPrice` to be a primitive type in the JSON" + "Expected the field `maxNotional` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("maxPrice").toString())); + jsonObj.get("maxNotional").toString())); } - if ((jsonObj.get("tickSize") != null && !jsonObj.get("tickSize").isJsonNull()) - && !jsonObj.get("tickSize").isJsonPrimitive()) { + if ((jsonObj.get("maxPosition") != null && !jsonObj.get("maxPosition").isJsonNull()) + && !jsonObj.get("maxPosition").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `tickSize` to be a primitive type in the JSON" + "Expected the field `maxPosition` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("tickSize").toString())); + jsonObj.get("maxPosition").toString())); } } @@ -1433,31 +1368,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExchangeInfoResponseResultExchangeFiltersInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'ExchangeInfoResponseResultExchangeFiltersInner' and its subtypes + if (!ExchangeFiltersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeFiltersInner' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get(ExchangeInfoResponseResultExchangeFiltersInner.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ExchangeFiltersInner.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write( - JsonWriter out, - ExchangeInfoResponseResultExchangeFiltersInner value) + public void write(JsonWriter out, ExchangeFiltersInner value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public ExchangeInfoResponseResultExchangeFiltersInner read(JsonReader in) - throws IOException { + public ExchangeFiltersInner read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -1467,21 +1395,18 @@ public ExchangeInfoResponseResultExchangeFiltersInner read(JsonReader in) } /** - * Create an instance of ExchangeInfoResponseResultExchangeFiltersInner given an JSON string + * Create an instance of ExchangeFiltersInner given an JSON string * * @param jsonString JSON string - * @return An instance of ExchangeInfoResponseResultExchangeFiltersInner - * @throws IOException if the JSON string is invalid with respect to - * ExchangeInfoResponseResultExchangeFiltersInner + * @return An instance of ExchangeFiltersInner + * @throws IOException if the JSON string is invalid with respect to ExchangeFiltersInner */ - public static ExchangeInfoResponseResultExchangeFiltersInner fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, ExchangeInfoResponseResultExchangeFiltersInner.class); + public static ExchangeFiltersInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeFiltersInner.class); } /** - * Convert an instance of ExchangeInfoResponseResultExchangeFiltersInner to an JSON string + * Convert an instance of ExchangeFiltersInner to an JSON string * * @return JSON string */ diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponse.java index b7349d63..df51545f 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class ExchangeInfoResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid ExchangeInfoResponseResultRateLimitsInner> rateLimits; + private RateLimits rateLimits; public ExchangeInfoResponse() {} @@ -128,22 +125,11 @@ public void setResult(@jakarta.annotation.Nullable ExchangeInfoResponseResult re this.result = result; } - public ExchangeInfoResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid ExchangeInfoResponseResultRateLimitsInner> rateLimits) { + public ExchangeInfoResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public ExchangeInfoResponse addRateLimitsItem( - ExchangeInfoResponseResultRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -151,13 +137,11 @@ public ExchangeInfoResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid ExchangeInfoResponseResultRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid ExchangeInfoResponseResultRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -212,7 +196,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid ExchangeInfoResponseResultRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -321,26 +305,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { ExchangeInfoResponseResult.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++) { - ExchangeInfoResponseResultRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResult.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResult.java index 06926043..7de5b323 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResult.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResult.java @@ -59,13 +59,13 @@ public class ExchangeInfoResponseResult extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid ExchangeInfoResponseResultRateLimitsInner> rateLimits; + private RateLimits rateLimits; public static final String SERIALIZED_NAME_EXCHANGE_FILTERS = "exchangeFilters"; @SerializedName(SERIALIZED_NAME_EXCHANGE_FILTERS) @jakarta.annotation.Nullable - private List<@Valid ExchangeInfoResponseResultExchangeFiltersInner> exchangeFilters; + private ExchangeFilters exchangeFilters; public static final String SERIALIZED_NAME_SYMBOLS = "symbols"; @@ -120,21 +120,11 @@ public void setServerTime(@jakarta.annotation.Nullable Long serverTime) { } public ExchangeInfoResponseResult rateLimits( - @jakarta.annotation.Nullable - List<@Valid ExchangeInfoResponseResultRateLimitsInner> rateLimits) { + @jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public ExchangeInfoResponseResult addRateLimitsItem( - ExchangeInfoResponseResultRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -142,32 +132,20 @@ public ExchangeInfoResponseResult addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid ExchangeInfoResponseResultRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid ExchangeInfoResponseResultRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } public ExchangeInfoResponseResult exchangeFilters( - @jakarta.annotation.Nullable - List<@Valid ExchangeInfoResponseResultExchangeFiltersInner> exchangeFilters) { + @jakarta.annotation.Nullable ExchangeFilters exchangeFilters) { this.exchangeFilters = exchangeFilters; return this; } - public ExchangeInfoResponseResult addExchangeFiltersItem( - ExchangeInfoResponseResultExchangeFiltersInner exchangeFiltersItem) { - if (this.exchangeFilters == null) { - this.exchangeFilters = new ArrayList<>(); - } - this.exchangeFilters.add(exchangeFiltersItem); - return this; - } - /** * Get exchangeFilters * @@ -175,13 +153,11 @@ public ExchangeInfoResponseResult addExchangeFiltersItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid ExchangeInfoResponseResultExchangeFiltersInner> getExchangeFilters() { + public ExchangeFilters getExchangeFilters() { return exchangeFilters; } - public void setExchangeFilters( - @jakarta.annotation.Nullable - List<@Valid ExchangeInfoResponseResultExchangeFiltersInner> exchangeFilters) { + public void setExchangeFilters(@jakarta.annotation.Nullable ExchangeFilters exchangeFilters) { this.exchangeFilters = exchangeFilters; } @@ -298,13 +274,12 @@ public String toUrlQueryString() { String serverTimeValueAsString = serverTimeValue.toString(); valMap.put("serverTime", serverTimeValueAsString); } - List<@Valid ExchangeInfoResponseResultRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); } - List<@Valid ExchangeInfoResponseResultExchangeFiltersInner> exchangeFiltersValue = - getExchangeFilters(); + ExchangeFilters exchangeFiltersValue = getExchangeFilters(); if (exchangeFiltersValue != null) { String exchangeFiltersValueAsString = JSON.getGson().toJson(exchangeFiltersValue); valMap.put("exchangeFilters", exchangeFiltersValueAsString); @@ -429,47 +404,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("timezone").toString())); } - 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++) { - ExchangeInfoResponseResultRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } - if (jsonObj.get("exchangeFilters") != null - && !jsonObj.get("exchangeFilters").isJsonNull()) { - JsonArray jsonArrayexchangeFilters = jsonObj.getAsJsonArray("exchangeFilters"); - if (jsonArrayexchangeFilters != null) { - // ensure the json data is an array - if (!jsonObj.get("exchangeFilters").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `exchangeFilters` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("exchangeFilters").toString())); - } - - // validate the optional field `exchangeFilters` (array) - for (int i = 0; i < jsonArrayexchangeFilters.size(); i++) { - ExchangeInfoResponseResultExchangeFiltersInner.validateJsonElement( - jsonArrayexchangeFilters.get(i)); - } - ; - } - } if (jsonObj.get("symbols") != null && !jsonObj.get("symbols").isJsonNull()) { JsonArray jsonArraysymbols = jsonObj.getAsJsonArray("symbols"); if (jsonArraysymbols != null) { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResultRateLimitsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResultRateLimitsInner.java deleted file mode 100644 index cd1e8977..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResultRateLimitsInner.java +++ /dev/null @@ -1,377 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.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.*; - -/** ExchangeInfoResponseResultRateLimitsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class ExchangeInfoResponseResultRateLimitsInner extends BaseDTO { - public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; - - @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) - @jakarta.annotation.Nullable - private String rateLimitType; - - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - - @SerializedName(SERIALIZED_NAME_INTERVAL) - @jakarta.annotation.Nullable - private String interval; - - public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; - - @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) - @jakarta.annotation.Nullable - private Long intervalNum; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - @jakarta.annotation.Nullable - private Long limit; - - public ExchangeInfoResponseResultRateLimitsInner() {} - - public ExchangeInfoResponseResultRateLimitsInner rateLimitType( - @jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - return this; - } - - /** - * Get rateLimitType - * - * @return rateLimitType - */ - @jakarta.annotation.Nullable - public String getRateLimitType() { - return rateLimitType; - } - - public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - } - - public ExchangeInfoResponseResultRateLimitsInner interval( - @jakarta.annotation.Nullable String interval) { - this.interval = interval; - return this; - } - - /** - * Get interval - * - * @return interval - */ - @jakarta.annotation.Nullable - public String getInterval() { - return interval; - } - - public void setInterval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; - } - - public ExchangeInfoResponseResultRateLimitsInner intervalNum( - @jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - return this; - } - - /** - * Get intervalNum - * - * @return intervalNum - */ - @jakarta.annotation.Nullable - public Long getIntervalNum() { - return intervalNum; - } - - public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - } - - public ExchangeInfoResponseResultRateLimitsInner limit( - @jakarta.annotation.Nullable Long limit) { - this.limit = limit; - return this; - } - - /** - * Get limit - * - * @return limit - */ - @jakarta.annotation.Nullable - public Long getLimit() { - return limit; - } - - public void setLimit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ExchangeInfoResponseResultRateLimitsInner exchangeInfoResponseResultRateLimitsInner = - (ExchangeInfoResponseResultRateLimitsInner) o; - return Objects.equals( - this.rateLimitType, exchangeInfoResponseResultRateLimitsInner.rateLimitType) - && Objects.equals(this.interval, exchangeInfoResponseResultRateLimitsInner.interval) - && Objects.equals( - this.intervalNum, exchangeInfoResponseResultRateLimitsInner.intervalNum) - && Objects.equals(this.limit, exchangeInfoResponseResultRateLimitsInner.limit); - } - - @Override - public int hashCode() { - return Objects.hash(rateLimitType, interval, intervalNum, limit); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ExchangeInfoResponseResultRateLimitsInner {\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"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - String rateLimitTypeValueAsString = rateLimitTypeValue.toString(); - valMap.put("rateLimitType", rateLimitTypeValueAsString); - } - String intervalValue = getInterval(); - if (intervalValue != null) { - String intervalValueAsString = intervalValue.toString(); - valMap.put("interval", intervalValueAsString); - } - Long intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - String intervalNumValueAsString = intervalNumValue.toString(); - valMap.put("intervalNum", intervalNumValueAsString); - } - Long limitValue = getLimit(); - if (limitValue != null) { - String limitValueAsString = limitValue.toString(); - valMap.put("limit", limitValueAsString); - } - - 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 rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - valMap.put("rateLimitType", rateLimitTypeValue); - } - Object intervalValue = getInterval(); - if (intervalValue != null) { - valMap.put("interval", intervalValue); - } - Object intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - valMap.put("intervalNum", intervalNumValue); - } - Object limitValue = getLimit(); - if (limitValue != null) { - valMap.put("limit", limitValue); - } - - 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("rateLimitType"); - openapiFields.add("interval"); - openapiFields.add("intervalNum"); - openapiFields.add("limit"); - - // 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 - * ExchangeInfoResponseResultRateLimitsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ExchangeInfoResponseResultRateLimitsInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " ExchangeInfoResponseResultRateLimitsInner is not found in" - + " the empty JSON string", - ExchangeInfoResponseResultRateLimitsInner.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExchangeInfoResponseResultRateLimitsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExchangeInfoResponseResultRateLimitsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) - && !jsonObj.get("rateLimitType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rateLimitType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("rateLimitType").toString())); - } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) - && !jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExchangeInfoResponseResultRateLimitsInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'ExchangeInfoResponseResultRateLimitsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ExchangeInfoResponseResultRateLimitsInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, ExchangeInfoResponseResultRateLimitsInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ExchangeInfoResponseResultRateLimitsInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ExchangeInfoResponseResultRateLimitsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of ExchangeInfoResponseResultRateLimitsInner - * @throws IOException if the JSON string is invalid with respect to - * ExchangeInfoResponseResultRateLimitsInner - */ - public static ExchangeInfoResponseResultRateLimitsInner fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, ExchangeInfoResponseResultRateLimitsInner.class); - } - - /** - * Convert an instance of ExchangeInfoResponseResultRateLimitsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResultSymbolsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResultSymbolsInner.java index cda80b17..626a8584 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResultSymbolsInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/ExchangeInfoResponseResultSymbolsInner.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -142,11 +141,11 @@ public class ExchangeInfoResponseResultSymbolsInner extends BaseDTO { @jakarta.annotation.Nullable private Boolean cancelReplaceAllowed; - public static final String SERIALIZED_NAME_ALLOW_AMEND = "allowAmend"; + public static final String SERIALIZED_NAME_AMEND_ALLOWED = "amendAllowed"; - @SerializedName(SERIALIZED_NAME_ALLOW_AMEND) + @SerializedName(SERIALIZED_NAME_AMEND_ALLOWED) @jakarta.annotation.Nullable - private Boolean allowAmend; + private Boolean amendAllowed; public static final String SERIALIZED_NAME_IS_SPOT_TRADING_ALLOWED = "isSpotTradingAllowed"; @@ -164,7 +163,7 @@ public class ExchangeInfoResponseResultSymbolsInner extends BaseDTO { @SerializedName(SERIALIZED_NAME_FILTERS) @jakarta.annotation.Nullable - private List<@Valid ExchangeInfoResponseResultExchangeFiltersInner> filters; + private ExchangeFilters filters; public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; @@ -525,24 +524,24 @@ public void setCancelReplaceAllowed(@jakarta.annotation.Nullable Boolean cancelR this.cancelReplaceAllowed = cancelReplaceAllowed; } - public ExchangeInfoResponseResultSymbolsInner allowAmend( - @jakarta.annotation.Nullable Boolean allowAmend) { - this.allowAmend = allowAmend; + public ExchangeInfoResponseResultSymbolsInner amendAllowed( + @jakarta.annotation.Nullable Boolean amendAllowed) { + this.amendAllowed = amendAllowed; return this; } /** - * Get allowAmend + * Get amendAllowed * - * @return allowAmend + * @return amendAllowed */ @jakarta.annotation.Nullable - public Boolean getAllowAmend() { - return allowAmend; + public Boolean getAmendAllowed() { + return amendAllowed; } - public void setAllowAmend(@jakarta.annotation.Nullable Boolean allowAmend) { - this.allowAmend = allowAmend; + public void setAmendAllowed(@jakarta.annotation.Nullable Boolean amendAllowed) { + this.amendAllowed = amendAllowed; } public ExchangeInfoResponseResultSymbolsInner isSpotTradingAllowed( @@ -587,21 +586,11 @@ public void setIsMarginTradingAllowed( } public ExchangeInfoResponseResultSymbolsInner filters( - @jakarta.annotation.Nullable - List<@Valid ExchangeInfoResponseResultExchangeFiltersInner> filters) { + @jakarta.annotation.Nullable ExchangeFilters filters) { this.filters = filters; return this; } - public ExchangeInfoResponseResultSymbolsInner addFiltersItem( - ExchangeInfoResponseResultExchangeFiltersInner filtersItem) { - if (this.filters == null) { - this.filters = new ArrayList<>(); - } - this.filters.add(filtersItem); - return this; - } - /** * Get filters * @@ -609,13 +598,11 @@ public ExchangeInfoResponseResultSymbolsInner addFiltersItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid ExchangeInfoResponseResultExchangeFiltersInner> getFilters() { + public ExchangeFilters getFilters() { return filters; } - public void setFilters( - @jakarta.annotation.Nullable - List<@Valid ExchangeInfoResponseResultExchangeFiltersInner> filters) { + public void setFilters(@jakarta.annotation.Nullable ExchangeFilters filters) { this.filters = filters; } @@ -775,7 +762,7 @@ public boolean equals(Object o) { this.cancelReplaceAllowed, exchangeInfoResponseResultSymbolsInner.cancelReplaceAllowed) && Objects.equals( - this.allowAmend, exchangeInfoResponseResultSymbolsInner.allowAmend) + this.amendAllowed, exchangeInfoResponseResultSymbolsInner.amendAllowed) && Objects.equals( this.isSpotTradingAllowed, exchangeInfoResponseResultSymbolsInner.isSpotTradingAllowed) @@ -814,7 +801,7 @@ public int hashCode() { quoteOrderQtyMarketAllowed, allowTrailingStop, cancelReplaceAllowed, - allowAmend, + amendAllowed, isSpotTradingAllowed, isMarginTradingAllowed, filters, @@ -856,7 +843,7 @@ public String toString() { sb.append(" cancelReplaceAllowed: ") .append(toIndentedString(cancelReplaceAllowed)) .append("\n"); - sb.append(" allowAmend: ").append(toIndentedString(allowAmend)).append("\n"); + sb.append(" amendAllowed: ").append(toIndentedString(amendAllowed)).append("\n"); sb.append(" isSpotTradingAllowed: ") .append(toIndentedString(isSpotTradingAllowed)) .append("\n"); @@ -961,10 +948,10 @@ public String toUrlQueryString() { String cancelReplaceAllowedValueAsString = cancelReplaceAllowedValue.toString(); valMap.put("cancelReplaceAllowed", cancelReplaceAllowedValueAsString); } - Boolean allowAmendValue = getAllowAmend(); - if (allowAmendValue != null) { - String allowAmendValueAsString = allowAmendValue.toString(); - valMap.put("allowAmend", allowAmendValueAsString); + Boolean amendAllowedValue = getAmendAllowed(); + if (amendAllowedValue != null) { + String amendAllowedValueAsString = amendAllowedValue.toString(); + valMap.put("amendAllowed", amendAllowedValueAsString); } Boolean isSpotTradingAllowedValue = getIsSpotTradingAllowed(); if (isSpotTradingAllowedValue != null) { @@ -976,7 +963,7 @@ public String toUrlQueryString() { String isMarginTradingAllowedValueAsString = isMarginTradingAllowedValue.toString(); valMap.put("isMarginTradingAllowed", isMarginTradingAllowedValueAsString); } - List<@Valid ExchangeInfoResponseResultExchangeFiltersInner> filtersValue = getFilters(); + ExchangeFilters filtersValue = getFilters(); if (filtersValue != null) { String filtersValueAsString = JSON.getGson().toJson(filtersValue); valMap.put("filters", filtersValueAsString); @@ -1081,9 +1068,9 @@ public Map toMap() { if (cancelReplaceAllowedValue != null) { valMap.put("cancelReplaceAllowed", cancelReplaceAllowedValue); } - Object allowAmendValue = getAllowAmend(); - if (allowAmendValue != null) { - valMap.put("allowAmend", allowAmendValue); + Object amendAllowedValue = getAmendAllowed(); + if (amendAllowedValue != null) { + valMap.put("amendAllowed", amendAllowedValue); } Object isSpotTradingAllowedValue = getIsSpotTradingAllowed(); if (isSpotTradingAllowedValue != null) { @@ -1155,7 +1142,7 @@ private String toIndentedString(Object o) { openapiFields.add("quoteOrderQtyMarketAllowed"); openapiFields.add("allowTrailingStop"); openapiFields.add("cancelReplaceAllowed"); - openapiFields.add("allowAmend"); + openapiFields.add("amendAllowed"); openapiFields.add("isSpotTradingAllowed"); openapiFields.add("isMarginTradingAllowed"); openapiFields.add("filters"); @@ -1243,26 +1230,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("orderTypes").toString())); } - if (jsonObj.get("filters") != null && !jsonObj.get("filters").isJsonNull()) { - JsonArray jsonArrayfilters = jsonObj.getAsJsonArray("filters"); - if (jsonArrayfilters != null) { - // ensure the json data is an array - if (!jsonObj.get("filters").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `filters` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("filters").toString())); - } - - // validate the optional field `filters` (array) - for (int i = 0; i < jsonArrayfilters.size(); i++) { - ExchangeInfoResponseResultExchangeFiltersInner.validateJsonElement( - jsonArrayfilters.get(i)); - } - ; - } - } // ensure the optional json data is an array if present if (jsonObj.get("permissions") != null && !jsonObj.get("permissions").isJsonNull() diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/KlinesResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/KlinesResponse.java index 7b683c41..aa469fda 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/KlinesResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/KlinesResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -65,7 +64,7 @@ public class KlinesResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AvgPriceResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public KlinesResponse() {} @@ -135,20 +134,11 @@ public void setResult(@jakarta.annotation.Nullable List result) { this.result = result; } - public KlinesResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public KlinesResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public KlinesResponse addRateLimitsItem(AvgPriceResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -156,12 +146,11 @@ public KlinesResponse addRateLimitsItem(AvgPriceResponseRateLimitsInner rateLimi */ @jakarta.annotation.Nullable @Valid - public List<@Valid AvgPriceResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -216,7 +205,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AvgPriceResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -331,25 +320,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " `%s`", jsonObj.get("result").toString())); } - 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++) { - AvgPriceResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyAllocationsResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyAllocationsResponse.java index 42ef72e8..6f19cd99 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyAllocationsResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyAllocationsResponse.java @@ -65,7 +65,7 @@ public class MyAllocationsResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public MyAllocationsResponse() {} @@ -137,22 +137,11 @@ public void setResult( this.result = result; } - public MyAllocationsResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits) { + public MyAllocationsResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public MyAllocationsResponse addRateLimitsItem( - AccountCommissionResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -160,13 +149,11 @@ public MyAllocationsResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid AccountCommissionResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -221,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -345,26 +332,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - AccountCommissionResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyPreventedMatchesResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyPreventedMatchesResponse.java index 8823f277..a393e61a 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyPreventedMatchesResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyPreventedMatchesResponse.java @@ -65,7 +65,7 @@ public class MyPreventedMatchesResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public MyPreventedMatchesResponse() {} @@ -141,21 +141,11 @@ public void setResult( } public MyPreventedMatchesResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits) { + @jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public MyPreventedMatchesResponse addRateLimitsItem( - AccountCommissionResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -163,13 +153,11 @@ public MyPreventedMatchesResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid AccountCommissionResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -224,7 +212,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -349,26 +337,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - AccountCommissionResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyTradesResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyTradesResponse.java index ffecf73f..28c65664 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyTradesResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/MyTradesResponse.java @@ -65,7 +65,7 @@ public class MyTradesResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public MyTradesResponse() {} @@ -137,22 +137,11 @@ public void setResult( this.result = result; } - public MyTradesResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits) { + public MyTradesResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public MyTradesResponse addRateLimitsItem( - AccountCommissionResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -160,13 +149,11 @@ public MyTradesResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid AccountCommissionResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -221,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AccountCommissionResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -345,26 +332,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - AccountCommissionResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrderListsStatusResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrderListsStatusResponse.java index 1acd68b4..9e11b286 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrderListsStatusResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrderListsStatusResponse.java @@ -65,7 +65,7 @@ public class OpenOrderListsStatusResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid OpenOrderListsStatusResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public OpenOrderListsStatusResponse() {} @@ -141,21 +141,11 @@ public void setResult( } public OpenOrderListsStatusResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid OpenOrderListsStatusResponseRateLimitsInner> rateLimits) { + @jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public OpenOrderListsStatusResponse addRateLimitsItem( - OpenOrderListsStatusResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -163,13 +153,11 @@ public OpenOrderListsStatusResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid OpenOrderListsStatusResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid OpenOrderListsStatusResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -225,7 +213,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid OpenOrderListsStatusResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -351,26 +339,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - OpenOrderListsStatusResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrderListsStatusResponseRateLimitsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrderListsStatusResponseRateLimitsInner.java deleted file mode 100644 index dd6ab20b..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrderListsStatusResponseRateLimitsInner.java +++ /dev/null @@ -1,419 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.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.*; - -/** OpenOrderListsStatusResponseRateLimitsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class OpenOrderListsStatusResponseRateLimitsInner extends BaseDTO { - public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; - - @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) - @jakarta.annotation.Nullable - private String rateLimitType; - - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - - @SerializedName(SERIALIZED_NAME_INTERVAL) - @jakarta.annotation.Nullable - private String interval; - - public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; - - @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) - @jakarta.annotation.Nullable - private Long intervalNum; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - @jakarta.annotation.Nullable - private Long limit; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - @jakarta.annotation.Nullable - private Long count; - - public OpenOrderListsStatusResponseRateLimitsInner() {} - - public OpenOrderListsStatusResponseRateLimitsInner rateLimitType( - @jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - return this; - } - - /** - * Get rateLimitType - * - * @return rateLimitType - */ - @jakarta.annotation.Nullable - public String getRateLimitType() { - return rateLimitType; - } - - public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - } - - public OpenOrderListsStatusResponseRateLimitsInner interval( - @jakarta.annotation.Nullable String interval) { - this.interval = interval; - return this; - } - - /** - * Get interval - * - * @return interval - */ - @jakarta.annotation.Nullable - public String getInterval() { - return interval; - } - - public void setInterval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; - } - - public OpenOrderListsStatusResponseRateLimitsInner intervalNum( - @jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - return this; - } - - /** - * Get intervalNum - * - * @return intervalNum - */ - @jakarta.annotation.Nullable - public Long getIntervalNum() { - return intervalNum; - } - - public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - } - - public OpenOrderListsStatusResponseRateLimitsInner limit( - @jakarta.annotation.Nullable Long limit) { - this.limit = limit; - return this; - } - - /** - * Get limit - * - * @return limit - */ - @jakarta.annotation.Nullable - public Long getLimit() { - return limit; - } - - public void setLimit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - } - - public OpenOrderListsStatusResponseRateLimitsInner count( - @jakarta.annotation.Nullable Long count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count - */ - @jakarta.annotation.Nullable - public Long getCount() { - return count; - } - - public void setCount(@jakarta.annotation.Nullable Long count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OpenOrderListsStatusResponseRateLimitsInner openOrderListsStatusResponseRateLimitsInner = - (OpenOrderListsStatusResponseRateLimitsInner) o; - return Objects.equals( - this.rateLimitType, - openOrderListsStatusResponseRateLimitsInner.rateLimitType) - && Objects.equals( - this.interval, openOrderListsStatusResponseRateLimitsInner.interval) - && Objects.equals( - this.intervalNum, openOrderListsStatusResponseRateLimitsInner.intervalNum) - && Objects.equals(this.limit, openOrderListsStatusResponseRateLimitsInner.limit) - && Objects.equals(this.count, openOrderListsStatusResponseRateLimitsInner.count); - } - - @Override - public int hashCode() { - return Objects.hash(rateLimitType, interval, intervalNum, limit, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OpenOrderListsStatusResponseRateLimitsInner {\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"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - String rateLimitTypeValueAsString = rateLimitTypeValue.toString(); - valMap.put("rateLimitType", rateLimitTypeValueAsString); - } - String intervalValue = getInterval(); - if (intervalValue != null) { - String intervalValueAsString = intervalValue.toString(); - valMap.put("interval", intervalValueAsString); - } - Long intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - String intervalNumValueAsString = intervalNumValue.toString(); - valMap.put("intervalNum", intervalNumValueAsString); - } - Long limitValue = getLimit(); - if (limitValue != null) { - String limitValueAsString = limitValue.toString(); - valMap.put("limit", limitValueAsString); - } - Long countValue = getCount(); - if (countValue != null) { - String countValueAsString = countValue.toString(); - valMap.put("count", countValueAsString); - } - - 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 rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - valMap.put("rateLimitType", rateLimitTypeValue); - } - Object intervalValue = getInterval(); - if (intervalValue != null) { - valMap.put("interval", intervalValue); - } - Object intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - valMap.put("intervalNum", intervalNumValue); - } - Object limitValue = getLimit(); - if (limitValue != null) { - valMap.put("limit", limitValue); - } - Object countValue = getCount(); - if (countValue != null) { - valMap.put("count", countValue); - } - - 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("rateLimitType"); - openapiFields.add("interval"); - openapiFields.add("intervalNum"); - openapiFields.add("limit"); - openapiFields.add("count"); - - // 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 - * OpenOrderListsStatusResponseRateLimitsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OpenOrderListsStatusResponseRateLimitsInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " OpenOrderListsStatusResponseRateLimitsInner is not found in" - + " the empty JSON string", - OpenOrderListsStatusResponseRateLimitsInner.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OpenOrderListsStatusResponseRateLimitsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OpenOrderListsStatusResponseRateLimitsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) - && !jsonObj.get("rateLimitType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rateLimitType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("rateLimitType").toString())); - } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) - && !jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OpenOrderListsStatusResponseRateLimitsInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'OpenOrderListsStatusResponseRateLimitsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(OpenOrderListsStatusResponseRateLimitsInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, OpenOrderListsStatusResponseRateLimitsInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public OpenOrderListsStatusResponseRateLimitsInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of OpenOrderListsStatusResponseRateLimitsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of OpenOrderListsStatusResponseRateLimitsInner - * @throws IOException if the JSON string is invalid with respect to - * OpenOrderListsStatusResponseRateLimitsInner - */ - public static OpenOrderListsStatusResponseRateLimitsInner fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, OpenOrderListsStatusResponseRateLimitsInner.class); - } - - /** - * Convert an instance of OpenOrderListsStatusResponseRateLimitsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersCancelAllResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersCancelAllResponse.java index 9f1c4895..5b41a954 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersCancelAllResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersCancelAllResponse.java @@ -65,7 +65,7 @@ public class OpenOrdersCancelAllResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid TimeResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public OpenOrdersCancelAllResponse() {} @@ -141,20 +141,11 @@ public void setResult( } public OpenOrdersCancelAllResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid TimeResponseRateLimitsInner> rateLimits) { + @jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public OpenOrdersCancelAllResponse addRateLimitsItem( - TimeResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -162,12 +153,11 @@ public OpenOrdersCancelAllResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid TimeResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid TimeResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -222,7 +212,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid TimeResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -348,25 +338,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - TimeResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersStatusResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersStatusResponse.java index ebfbc68c..62874b7d 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersStatusResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OpenOrdersStatusResponse.java @@ -65,7 +65,7 @@ public class OpenOrdersStatusResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid OpenOrderListsStatusResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public OpenOrdersStatusResponse() {} @@ -137,22 +137,11 @@ public void setResult( this.result = result; } - public OpenOrdersStatusResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid OpenOrderListsStatusResponseRateLimitsInner> rateLimits) { + public OpenOrdersStatusResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public OpenOrdersStatusResponse addRateLimitsItem( - OpenOrderListsStatusResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -160,13 +149,11 @@ public OpenOrdersStatusResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid OpenOrderListsStatusResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid OpenOrderListsStatusResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -221,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid OpenOrderListsStatusResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -345,26 +332,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - OpenOrderListsStatusResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendKeepPriorityResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendKeepPriorityResponse.java index 2fef76c6..bce3aaaf 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendKeepPriorityResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendKeepPriorityResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class OrderAmendKeepPriorityResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid TimeResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public OrderAmendKeepPriorityResponse() {} @@ -130,20 +127,11 @@ public void setResult( } public OrderAmendKeepPriorityResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid TimeResponseRateLimitsInner> rateLimits) { + @jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public OrderAmendKeepPriorityResponse addRateLimitsItem( - TimeResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -151,12 +139,11 @@ public OrderAmendKeepPriorityResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid TimeResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid TimeResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -212,7 +199,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid TimeResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -322,25 +309,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderAmendKeepPriorityResponseResult.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++) { - TimeResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendmentsResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendmentsResponse.java index 957ed02a..e594e17a 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendmentsResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendmentsResponse.java @@ -65,7 +65,7 @@ public class OrderAmendmentsResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid TickerResponse1RateLimitsInner> rateLimits; + private RateLimits rateLimits; public OrderAmendmentsResponse() {} @@ -137,21 +137,11 @@ public void setResult( this.result = result; } - public OrderAmendmentsResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid TickerResponse1RateLimitsInner> rateLimits) { + public OrderAmendmentsResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public OrderAmendmentsResponse addRateLimitsItem( - TickerResponse1RateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -159,12 +149,11 @@ public OrderAmendmentsResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid TickerResponse1RateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid TickerResponse1RateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -219,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid TickerResponse1RateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -343,25 +332,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - TickerResponse1RateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelReplaceResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelReplaceResponse.java index 18e70c48..bc2f6ce0 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelReplaceResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelReplaceResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class OrderCancelReplaceResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid OrderCancelReplaceResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public OrderCancelReplaceResponse() {} @@ -129,21 +126,11 @@ public void setResult(@jakarta.annotation.Nullable OrderCancelReplaceResponseRes } public OrderCancelReplaceResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid OrderCancelReplaceResponseRateLimitsInner> rateLimits) { + @jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public OrderCancelReplaceResponse addRateLimitsItem( - OrderCancelReplaceResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -151,13 +138,11 @@ public OrderCancelReplaceResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid OrderCancelReplaceResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid OrderCancelReplaceResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -212,7 +197,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid OrderCancelReplaceResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -321,26 +306,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderCancelReplaceResponseResult.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++) { - OrderCancelReplaceResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelReplaceResponseRateLimitsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelReplaceResponseRateLimitsInner.java deleted file mode 100644 index dab2a0fc..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelReplaceResponseRateLimitsInner.java +++ /dev/null @@ -1,415 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.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.*; - -/** OrderCancelReplaceResponseRateLimitsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class OrderCancelReplaceResponseRateLimitsInner extends BaseDTO { - public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; - - @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) - @jakarta.annotation.Nullable - private String rateLimitType; - - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - - @SerializedName(SERIALIZED_NAME_INTERVAL) - @jakarta.annotation.Nullable - private String interval; - - public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; - - @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) - @jakarta.annotation.Nullable - private Long intervalNum; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - @jakarta.annotation.Nullable - private Long limit; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - @jakarta.annotation.Nullable - private Long count; - - public OrderCancelReplaceResponseRateLimitsInner() {} - - public OrderCancelReplaceResponseRateLimitsInner rateLimitType( - @jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - return this; - } - - /** - * Get rateLimitType - * - * @return rateLimitType - */ - @jakarta.annotation.Nullable - public String getRateLimitType() { - return rateLimitType; - } - - public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - } - - public OrderCancelReplaceResponseRateLimitsInner interval( - @jakarta.annotation.Nullable String interval) { - this.interval = interval; - return this; - } - - /** - * Get interval - * - * @return interval - */ - @jakarta.annotation.Nullable - public String getInterval() { - return interval; - } - - public void setInterval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; - } - - public OrderCancelReplaceResponseRateLimitsInner intervalNum( - @jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - return this; - } - - /** - * Get intervalNum - * - * @return intervalNum - */ - @jakarta.annotation.Nullable - public Long getIntervalNum() { - return intervalNum; - } - - public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - } - - public OrderCancelReplaceResponseRateLimitsInner limit( - @jakarta.annotation.Nullable Long limit) { - this.limit = limit; - return this; - } - - /** - * Get limit - * - * @return limit - */ - @jakarta.annotation.Nullable - public Long getLimit() { - return limit; - } - - public void setLimit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - } - - public OrderCancelReplaceResponseRateLimitsInner count( - @jakarta.annotation.Nullable Long count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count - */ - @jakarta.annotation.Nullable - public Long getCount() { - return count; - } - - public void setCount(@jakarta.annotation.Nullable Long count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OrderCancelReplaceResponseRateLimitsInner orderCancelReplaceResponseRateLimitsInner = - (OrderCancelReplaceResponseRateLimitsInner) o; - return Objects.equals( - this.rateLimitType, orderCancelReplaceResponseRateLimitsInner.rateLimitType) - && Objects.equals(this.interval, orderCancelReplaceResponseRateLimitsInner.interval) - && Objects.equals( - this.intervalNum, orderCancelReplaceResponseRateLimitsInner.intervalNum) - && Objects.equals(this.limit, orderCancelReplaceResponseRateLimitsInner.limit) - && Objects.equals(this.count, orderCancelReplaceResponseRateLimitsInner.count); - } - - @Override - public int hashCode() { - return Objects.hash(rateLimitType, interval, intervalNum, limit, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OrderCancelReplaceResponseRateLimitsInner {\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"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - String rateLimitTypeValueAsString = rateLimitTypeValue.toString(); - valMap.put("rateLimitType", rateLimitTypeValueAsString); - } - String intervalValue = getInterval(); - if (intervalValue != null) { - String intervalValueAsString = intervalValue.toString(); - valMap.put("interval", intervalValueAsString); - } - Long intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - String intervalNumValueAsString = intervalNumValue.toString(); - valMap.put("intervalNum", intervalNumValueAsString); - } - Long limitValue = getLimit(); - if (limitValue != null) { - String limitValueAsString = limitValue.toString(); - valMap.put("limit", limitValueAsString); - } - Long countValue = getCount(); - if (countValue != null) { - String countValueAsString = countValue.toString(); - valMap.put("count", countValueAsString); - } - - 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 rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - valMap.put("rateLimitType", rateLimitTypeValue); - } - Object intervalValue = getInterval(); - if (intervalValue != null) { - valMap.put("interval", intervalValue); - } - Object intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - valMap.put("intervalNum", intervalNumValue); - } - Object limitValue = getLimit(); - if (limitValue != null) { - valMap.put("limit", limitValue); - } - Object countValue = getCount(); - if (countValue != null) { - valMap.put("count", countValue); - } - - 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("rateLimitType"); - openapiFields.add("interval"); - openapiFields.add("intervalNum"); - openapiFields.add("limit"); - openapiFields.add("count"); - - // 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 - * OrderCancelReplaceResponseRateLimitsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OrderCancelReplaceResponseRateLimitsInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " OrderCancelReplaceResponseRateLimitsInner is not found in" - + " the empty JSON string", - OrderCancelReplaceResponseRateLimitsInner.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderCancelReplaceResponseRateLimitsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderCancelReplaceResponseRateLimitsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) - && !jsonObj.get("rateLimitType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rateLimitType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("rateLimitType").toString())); - } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) - && !jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OrderCancelReplaceResponseRateLimitsInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'OrderCancelReplaceResponseRateLimitsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(OrderCancelReplaceResponseRateLimitsInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, OrderCancelReplaceResponseRateLimitsInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public OrderCancelReplaceResponseRateLimitsInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of OrderCancelReplaceResponseRateLimitsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of OrderCancelReplaceResponseRateLimitsInner - * @throws IOException if the JSON string is invalid with respect to - * OrderCancelReplaceResponseRateLimitsInner - */ - public static OrderCancelReplaceResponseRateLimitsInner fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, OrderCancelReplaceResponseRateLimitsInner.class); - } - - /** - * Convert an instance of OrderCancelReplaceResponseRateLimitsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelResponse.java index fd18d372..4c54e959 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class OrderCancelResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid TimeResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public OrderCancelResponse() {} @@ -128,20 +125,11 @@ public void setResult(@jakarta.annotation.Nullable OrderCancelResponseResult res this.result = result; } - public OrderCancelResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid TimeResponseRateLimitsInner> rateLimits) { + public OrderCancelResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public OrderCancelResponse addRateLimitsItem(TimeResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -149,12 +137,11 @@ public OrderCancelResponse addRateLimitsItem(TimeResponseRateLimitsInner rateLim */ @jakarta.annotation.Nullable @Valid - public List<@Valid TimeResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid TimeResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -209,7 +196,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid TimeResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -318,25 +305,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderCancelResponseResult.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++) { - TimeResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelResponseResult.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelResponseResult.java index e95006cb..63fb25cd 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelResponseResult.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelResponseResult.java @@ -210,7 +210,7 @@ public class OrderCancelResponseResult extends BaseDTO { @SerializedName(SERIALIZED_NAME_ORDER_REPORTS) @jakarta.annotation.Nullable - private List<@Valid OrderCancelResponseResultOrderReportsInner> orderReports; + private List<@Valid OpenOrdersCancelAllResponseResultInnerOrderReportsInner> orderReports; public OrderCancelResponseResult() {} @@ -755,13 +755,14 @@ public void setOrders( public OrderCancelResponseResult orderReports( @jakarta.annotation.Nullable - List<@Valid OrderCancelResponseResultOrderReportsInner> orderReports) { + List<@Valid OpenOrdersCancelAllResponseResultInnerOrderReportsInner> + orderReports) { this.orderReports = orderReports; return this; } public OrderCancelResponseResult addOrderReportsItem( - OrderCancelResponseResultOrderReportsInner orderReportsItem) { + OpenOrdersCancelAllResponseResultInnerOrderReportsInner orderReportsItem) { if (this.orderReports == null) { this.orderReports = new ArrayList<>(); } @@ -776,13 +777,14 @@ public OrderCancelResponseResult addOrderReportsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid OrderCancelResponseResultOrderReportsInner> getOrderReports() { + public List<@Valid OpenOrdersCancelAllResponseResultInnerOrderReportsInner> getOrderReports() { return orderReports; } public void setOrderReports( @jakarta.annotation.Nullable - List<@Valid OrderCancelResponseResultOrderReportsInner> orderReports) { + List<@Valid OpenOrdersCancelAllResponseResultInnerOrderReportsInner> + orderReports) { this.orderReports = orderReports; } @@ -1043,7 +1045,7 @@ public String toUrlQueryString() { String ordersValueAsString = JSON.getGson().toJson(ordersValue); valMap.put("orders", ordersValueAsString); } - List<@Valid OrderCancelResponseResultOrderReportsInner> orderReportsValue = + List<@Valid OpenOrdersCancelAllResponseResultInnerOrderReportsInner> orderReportsValue = getOrderReports(); if (orderReportsValue != null) { String orderReportsValueAsString = JSON.getGson().toJson(orderReportsValue); @@ -1452,7 +1454,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `orderReports` (array) for (int i = 0; i < jsonArrayorderReports.size(); i++) { - OrderCancelResponseResultOrderReportsInner.validateJsonElement( + OpenOrdersCancelAllResponseResultInnerOrderReportsInner.validateJsonElement( jsonArrayorderReports.get(i)); } ; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelResponseResultOrderReportsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelResponseResultOrderReportsInner.java deleted file mode 100644 index bb81434f..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderCancelResponseResultOrderReportsInner.java +++ /dev/null @@ -1,1009 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.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.*; - -/** OrderCancelResponseResultOrderReportsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class OrderCancelResponseResultOrderReportsInner extends BaseDTO { - public static final String SERIALIZED_NAME_SYMBOL = "symbol"; - - @SerializedName(SERIALIZED_NAME_SYMBOL) - @jakarta.annotation.Nullable - private String symbol; - - public static final String SERIALIZED_NAME_ORIG_CLIENT_ORDER_ID = "origClientOrderId"; - - @SerializedName(SERIALIZED_NAME_ORIG_CLIENT_ORDER_ID) - @jakarta.annotation.Nullable - private String origClientOrderId; - - public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; - - @SerializedName(SERIALIZED_NAME_ORDER_ID) - @jakarta.annotation.Nullable - private Long orderId; - - public static final String SERIALIZED_NAME_ORDER_LIST_ID = "orderListId"; - - @SerializedName(SERIALIZED_NAME_ORDER_LIST_ID) - @jakarta.annotation.Nullable - private Long orderListId; - - public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; - - @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) - @jakarta.annotation.Nullable - private String clientOrderId; - - public static final String SERIALIZED_NAME_TRANSACT_TIME = "transactTime"; - - @SerializedName(SERIALIZED_NAME_TRANSACT_TIME) - @jakarta.annotation.Nullable - private Long transactTime; - - public static final String SERIALIZED_NAME_PRICE = "price"; - - @SerializedName(SERIALIZED_NAME_PRICE) - @jakarta.annotation.Nullable - private String price; - - public static final String SERIALIZED_NAME_ORIG_QTY = "origQty"; - - @SerializedName(SERIALIZED_NAME_ORIG_QTY) - @jakarta.annotation.Nullable - private String origQty; - - public static final String SERIALIZED_NAME_EXECUTED_QTY = "executedQty"; - - @SerializedName(SERIALIZED_NAME_EXECUTED_QTY) - @jakarta.annotation.Nullable - private String executedQty; - - public static final String SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY = "cummulativeQuoteQty"; - - @SerializedName(SERIALIZED_NAME_CUMMULATIVE_QUOTE_QTY) - @jakarta.annotation.Nullable - private String cummulativeQuoteQty; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @jakarta.annotation.Nullable - private String status; - - 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_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @jakarta.annotation.Nullable - private String type; - - public static final String SERIALIZED_NAME_SIDE = "side"; - - @SerializedName(SERIALIZED_NAME_SIDE) - @jakarta.annotation.Nullable - private String side; - - 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_ORIG_QUOTE_ORDER_QTY = "origQuoteOrderQty"; - - @SerializedName(SERIALIZED_NAME_ORIG_QUOTE_ORDER_QTY) - @jakarta.annotation.Nullable - private String origQuoteOrderQty; - - public static final String SERIALIZED_NAME_STOP_PRICE = "stopPrice"; - - @SerializedName(SERIALIZED_NAME_STOP_PRICE) - @jakarta.annotation.Nullable - private String stopPrice; - - public OrderCancelResponseResultOrderReportsInner() {} - - public OrderCancelResponseResultOrderReportsInner 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 OrderCancelResponseResultOrderReportsInner origClientOrderId( - @jakarta.annotation.Nullable String origClientOrderId) { - this.origClientOrderId = origClientOrderId; - return this; - } - - /** - * Get origClientOrderId - * - * @return origClientOrderId - */ - @jakarta.annotation.Nullable - public String getOrigClientOrderId() { - return origClientOrderId; - } - - public void setOrigClientOrderId(@jakarta.annotation.Nullable String origClientOrderId) { - this.origClientOrderId = origClientOrderId; - } - - public OrderCancelResponseResultOrderReportsInner orderId( - @jakarta.annotation.Nullable Long orderId) { - this.orderId = orderId; - return this; - } - - /** - * Get orderId - * - * @return orderId - */ - @jakarta.annotation.Nullable - public Long getOrderId() { - return orderId; - } - - public void setOrderId(@jakarta.annotation.Nullable Long orderId) { - this.orderId = orderId; - } - - public OrderCancelResponseResultOrderReportsInner orderListId( - @jakarta.annotation.Nullable Long orderListId) { - this.orderListId = orderListId; - return this; - } - - /** - * Get orderListId - * - * @return orderListId - */ - @jakarta.annotation.Nullable - public Long getOrderListId() { - return orderListId; - } - - public void setOrderListId(@jakarta.annotation.Nullable Long orderListId) { - this.orderListId = orderListId; - } - - public OrderCancelResponseResultOrderReportsInner clientOrderId( - @jakarta.annotation.Nullable String clientOrderId) { - this.clientOrderId = clientOrderId; - return this; - } - - /** - * Get clientOrderId - * - * @return clientOrderId - */ - @jakarta.annotation.Nullable - public String getClientOrderId() { - return clientOrderId; - } - - public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) { - this.clientOrderId = clientOrderId; - } - - public OrderCancelResponseResultOrderReportsInner transactTime( - @jakarta.annotation.Nullable Long transactTime) { - this.transactTime = transactTime; - return this; - } - - /** - * Get transactTime - * - * @return transactTime - */ - @jakarta.annotation.Nullable - public Long getTransactTime() { - return transactTime; - } - - public void setTransactTime(@jakarta.annotation.Nullable Long transactTime) { - this.transactTime = transactTime; - } - - public OrderCancelResponseResultOrderReportsInner 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 OrderCancelResponseResultOrderReportsInner origQty( - @jakarta.annotation.Nullable String origQty) { - this.origQty = origQty; - return this; - } - - /** - * Get origQty - * - * @return origQty - */ - @jakarta.annotation.Nullable - public String getOrigQty() { - return origQty; - } - - public void setOrigQty(@jakarta.annotation.Nullable String origQty) { - this.origQty = origQty; - } - - public OrderCancelResponseResultOrderReportsInner executedQty( - @jakarta.annotation.Nullable String executedQty) { - this.executedQty = executedQty; - return this; - } - - /** - * Get executedQty - * - * @return executedQty - */ - @jakarta.annotation.Nullable - public String getExecutedQty() { - return executedQty; - } - - public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { - this.executedQty = executedQty; - } - - public OrderCancelResponseResultOrderReportsInner cummulativeQuoteQty( - @jakarta.annotation.Nullable String cummulativeQuoteQty) { - this.cummulativeQuoteQty = cummulativeQuoteQty; - return this; - } - - /** - * Get cummulativeQuoteQty - * - * @return cummulativeQuoteQty - */ - @jakarta.annotation.Nullable - public String getCummulativeQuoteQty() { - return cummulativeQuoteQty; - } - - public void setCummulativeQuoteQty(@jakarta.annotation.Nullable String cummulativeQuoteQty) { - this.cummulativeQuoteQty = cummulativeQuoteQty; - } - - public OrderCancelResponseResultOrderReportsInner 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; - } - - public OrderCancelResponseResultOrderReportsInner 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 OrderCancelResponseResultOrderReportsInner 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; - } - - public OrderCancelResponseResultOrderReportsInner 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 OrderCancelResponseResultOrderReportsInner 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 OrderCancelResponseResultOrderReportsInner origQuoteOrderQty( - @jakarta.annotation.Nullable String origQuoteOrderQty) { - this.origQuoteOrderQty = origQuoteOrderQty; - return this; - } - - /** - * Get origQuoteOrderQty - * - * @return origQuoteOrderQty - */ - @jakarta.annotation.Nullable - public String getOrigQuoteOrderQty() { - return origQuoteOrderQty; - } - - public void setOrigQuoteOrderQty(@jakarta.annotation.Nullable String origQuoteOrderQty) { - this.origQuoteOrderQty = origQuoteOrderQty; - } - - public OrderCancelResponseResultOrderReportsInner stopPrice( - @jakarta.annotation.Nullable String stopPrice) { - this.stopPrice = stopPrice; - return this; - } - - /** - * Get stopPrice - * - * @return stopPrice - */ - @jakarta.annotation.Nullable - public String getStopPrice() { - return stopPrice; - } - - public void setStopPrice(@jakarta.annotation.Nullable String stopPrice) { - this.stopPrice = stopPrice; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OrderCancelResponseResultOrderReportsInner orderCancelResponseResultOrderReportsInner = - (OrderCancelResponseResultOrderReportsInner) o; - return Objects.equals(this.symbol, orderCancelResponseResultOrderReportsInner.symbol) - && Objects.equals( - this.origClientOrderId, - orderCancelResponseResultOrderReportsInner.origClientOrderId) - && Objects.equals(this.orderId, orderCancelResponseResultOrderReportsInner.orderId) - && Objects.equals( - this.orderListId, orderCancelResponseResultOrderReportsInner.orderListId) - && Objects.equals( - this.clientOrderId, - orderCancelResponseResultOrderReportsInner.clientOrderId) - && Objects.equals( - this.transactTime, orderCancelResponseResultOrderReportsInner.transactTime) - && Objects.equals(this.price, orderCancelResponseResultOrderReportsInner.price) - && Objects.equals(this.origQty, orderCancelResponseResultOrderReportsInner.origQty) - && Objects.equals( - this.executedQty, orderCancelResponseResultOrderReportsInner.executedQty) - && Objects.equals( - this.cummulativeQuoteQty, - orderCancelResponseResultOrderReportsInner.cummulativeQuoteQty) - && Objects.equals(this.status, orderCancelResponseResultOrderReportsInner.status) - && Objects.equals( - this.timeInForce, orderCancelResponseResultOrderReportsInner.timeInForce) - && Objects.equals(this.type, orderCancelResponseResultOrderReportsInner.type) - && Objects.equals(this.side, orderCancelResponseResultOrderReportsInner.side) - && Objects.equals( - this.selfTradePreventionMode, - orderCancelResponseResultOrderReportsInner.selfTradePreventionMode) - && Objects.equals( - this.origQuoteOrderQty, - orderCancelResponseResultOrderReportsInner.origQuoteOrderQty) - && Objects.equals( - this.stopPrice, orderCancelResponseResultOrderReportsInner.stopPrice); - } - - @Override - public int hashCode() { - return Objects.hash( - symbol, - origClientOrderId, - orderId, - orderListId, - clientOrderId, - transactTime, - price, - origQty, - executedQty, - cummulativeQuoteQty, - status, - timeInForce, - type, - side, - selfTradePreventionMode, - origQuoteOrderQty, - stopPrice); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OrderCancelResponseResultOrderReportsInner {\n"); - sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); - sb.append(" origClientOrderId: ").append(toIndentedString(origClientOrderId)).append("\n"); - sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); - sb.append(" orderListId: ").append(toIndentedString(orderListId)).append("\n"); - sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); - sb.append(" transactTime: ").append(toIndentedString(transactTime)).append("\n"); - sb.append(" price: ").append(toIndentedString(price)).append("\n"); - sb.append(" origQty: ").append(toIndentedString(origQty)).append("\n"); - sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); - sb.append(" cummulativeQuoteQty: ") - .append(toIndentedString(cummulativeQuoteQty)) - .append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" side: ").append(toIndentedString(side)).append("\n"); - sb.append(" selfTradePreventionMode: ") - .append(toIndentedString(selfTradePreventionMode)) - .append("\n"); - sb.append(" origQuoteOrderQty: ").append(toIndentedString(origQuoteOrderQty)).append("\n"); - sb.append(" stopPrice: ").append(toIndentedString(stopPrice)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String symbolValue = getSymbol(); - if (symbolValue != null) { - String symbolValueAsString = symbolValue.toString(); - valMap.put("symbol", symbolValueAsString); - } - String origClientOrderIdValue = getOrigClientOrderId(); - if (origClientOrderIdValue != null) { - String origClientOrderIdValueAsString = origClientOrderIdValue.toString(); - valMap.put("origClientOrderId", origClientOrderIdValueAsString); - } - Long orderIdValue = getOrderId(); - if (orderIdValue != null) { - String orderIdValueAsString = orderIdValue.toString(); - valMap.put("orderId", orderIdValueAsString); - } - Long orderListIdValue = getOrderListId(); - if (orderListIdValue != null) { - String orderListIdValueAsString = orderListIdValue.toString(); - valMap.put("orderListId", orderListIdValueAsString); - } - String clientOrderIdValue = getClientOrderId(); - if (clientOrderIdValue != null) { - String clientOrderIdValueAsString = clientOrderIdValue.toString(); - valMap.put("clientOrderId", clientOrderIdValueAsString); - } - Long transactTimeValue = getTransactTime(); - if (transactTimeValue != null) { - String transactTimeValueAsString = transactTimeValue.toString(); - valMap.put("transactTime", transactTimeValueAsString); - } - String priceValue = getPrice(); - if (priceValue != null) { - String priceValueAsString = priceValue.toString(); - valMap.put("price", priceValueAsString); - } - String origQtyValue = getOrigQty(); - if (origQtyValue != null) { - String origQtyValueAsString = origQtyValue.toString(); - valMap.put("origQty", origQtyValueAsString); - } - String executedQtyValue = getExecutedQty(); - if (executedQtyValue != null) { - String executedQtyValueAsString = executedQtyValue.toString(); - valMap.put("executedQty", executedQtyValueAsString); - } - String cummulativeQuoteQtyValue = getCummulativeQuoteQty(); - if (cummulativeQuoteQtyValue != null) { - String cummulativeQuoteQtyValueAsString = cummulativeQuoteQtyValue.toString(); - valMap.put("cummulativeQuoteQty", cummulativeQuoteQtyValueAsString); - } - String statusValue = getStatus(); - if (statusValue != null) { - String statusValueAsString = statusValue.toString(); - valMap.put("status", statusValueAsString); - } - String timeInForceValue = getTimeInForce(); - if (timeInForceValue != null) { - String timeInForceValueAsString = timeInForceValue.toString(); - valMap.put("timeInForce", timeInForceValueAsString); - } - String typeValue = getType(); - if (typeValue != null) { - String typeValueAsString = typeValue.toString(); - valMap.put("type", typeValueAsString); - } - String sideValue = getSide(); - if (sideValue != null) { - String sideValueAsString = sideValue.toString(); - valMap.put("side", sideValueAsString); - } - String selfTradePreventionModeValue = getSelfTradePreventionMode(); - if (selfTradePreventionModeValue != null) { - String selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); - valMap.put("selfTradePreventionMode", selfTradePreventionModeValueAsString); - } - String origQuoteOrderQtyValue = getOrigQuoteOrderQty(); - if (origQuoteOrderQtyValue != null) { - String origQuoteOrderQtyValueAsString = origQuoteOrderQtyValue.toString(); - valMap.put("origQuoteOrderQty", origQuoteOrderQtyValueAsString); - } - String stopPriceValue = getStopPrice(); - if (stopPriceValue != null) { - String stopPriceValueAsString = stopPriceValue.toString(); - valMap.put("stopPrice", stopPriceValueAsString); - } - - 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 symbolValue = getSymbol(); - if (symbolValue != null) { - valMap.put("symbol", symbolValue); - } - Object origClientOrderIdValue = getOrigClientOrderId(); - if (origClientOrderIdValue != null) { - valMap.put("origClientOrderId", origClientOrderIdValue); - } - Object orderIdValue = getOrderId(); - if (orderIdValue != null) { - valMap.put("orderId", orderIdValue); - } - Object orderListIdValue = getOrderListId(); - if (orderListIdValue != null) { - valMap.put("orderListId", orderListIdValue); - } - Object clientOrderIdValue = getClientOrderId(); - if (clientOrderIdValue != null) { - valMap.put("clientOrderId", clientOrderIdValue); - } - Object transactTimeValue = getTransactTime(); - if (transactTimeValue != null) { - valMap.put("transactTime", transactTimeValue); - } - Object priceValue = getPrice(); - if (priceValue != null) { - valMap.put("price", priceValue); - } - Object origQtyValue = getOrigQty(); - if (origQtyValue != null) { - valMap.put("origQty", origQtyValue); - } - Object executedQtyValue = getExecutedQty(); - if (executedQtyValue != null) { - valMap.put("executedQty", executedQtyValue); - } - Object cummulativeQuoteQtyValue = getCummulativeQuoteQty(); - if (cummulativeQuoteQtyValue != null) { - valMap.put("cummulativeQuoteQty", cummulativeQuoteQtyValue); - } - Object statusValue = getStatus(); - if (statusValue != null) { - valMap.put("status", statusValue); - } - Object timeInForceValue = getTimeInForce(); - if (timeInForceValue != null) { - valMap.put("timeInForce", timeInForceValue); - } - Object typeValue = getType(); - if (typeValue != null) { - valMap.put("type", typeValue); - } - Object sideValue = getSide(); - if (sideValue != null) { - valMap.put("side", sideValue); - } - Object selfTradePreventionModeValue = getSelfTradePreventionMode(); - if (selfTradePreventionModeValue != null) { - valMap.put("selfTradePreventionMode", selfTradePreventionModeValue); - } - Object origQuoteOrderQtyValue = getOrigQuoteOrderQty(); - if (origQuoteOrderQtyValue != null) { - valMap.put("origQuoteOrderQty", origQuoteOrderQtyValue); - } - Object stopPriceValue = getStopPrice(); - if (stopPriceValue != null) { - valMap.put("stopPrice", stopPriceValue); - } - - 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("symbol"); - openapiFields.add("origClientOrderId"); - openapiFields.add("orderId"); - openapiFields.add("orderListId"); - openapiFields.add("clientOrderId"); - openapiFields.add("transactTime"); - openapiFields.add("price"); - openapiFields.add("origQty"); - openapiFields.add("executedQty"); - openapiFields.add("cummulativeQuoteQty"); - openapiFields.add("status"); - openapiFields.add("timeInForce"); - openapiFields.add("type"); - openapiFields.add("side"); - openapiFields.add("selfTradePreventionMode"); - openapiFields.add("origQuoteOrderQty"); - openapiFields.add("stopPrice"); - - // 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 - * OrderCancelResponseResultOrderReportsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OrderCancelResponseResultOrderReportsInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " OrderCancelResponseResultOrderReportsInner is not found in" - + " the empty JSON string", - OrderCancelResponseResultOrderReportsInner.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderCancelResponseResultOrderReportsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderCancelResponseResultOrderReportsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.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("origClientOrderId") != null - && !jsonObj.get("origClientOrderId").isJsonNull()) - && !jsonObj.get("origClientOrderId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `origClientOrderId` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("origClientOrderId").toString())); - } - if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) - && !jsonObj.get("clientOrderId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `clientOrderId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("clientOrderId").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("origQty") != null && !jsonObj.get("origQty").isJsonNull()) - && !jsonObj.get("origQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `origQty` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("origQty").toString())); - } - if ((jsonObj.get("executedQty") != null && !jsonObj.get("executedQty").isJsonNull()) - && !jsonObj.get("executedQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `executedQty` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("executedQty").toString())); - } - if ((jsonObj.get("cummulativeQuoteQty") != null - && !jsonObj.get("cummulativeQuoteQty").isJsonNull()) - && !jsonObj.get("cummulativeQuoteQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `cummulativeQuoteQty` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("cummulativeQuoteQty").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())); - } - 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("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())); - } - 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("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("origQuoteOrderQty") != null - && !jsonObj.get("origQuoteOrderQty").isJsonNull()) - && !jsonObj.get("origQuoteOrderQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `origQuoteOrderQty` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("origQuoteOrderQty").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())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OrderCancelResponseResultOrderReportsInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'OrderCancelResponseResultOrderReportsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(OrderCancelResponseResultOrderReportsInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, OrderCancelResponseResultOrderReportsInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public OrderCancelResponseResultOrderReportsInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of OrderCancelResponseResultOrderReportsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of OrderCancelResponseResultOrderReportsInner - * @throws IOException if the JSON string is invalid with respect to - * OrderCancelResponseResultOrderReportsInner - */ - public static OrderCancelResponseResultOrderReportsInner fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, OrderCancelResponseResultOrderReportsInner.class); - } - - /** - * Convert an instance of OrderCancelResponseResultOrderReportsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListCancelResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListCancelResponse.java index fbbc7105..9071d5c7 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListCancelResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListCancelResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class OrderListCancelResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid TimeResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public OrderListCancelResponse() {} @@ -128,20 +125,11 @@ public void setResult(@jakarta.annotation.Nullable OrderListCancelResponseResult this.result = result; } - public OrderListCancelResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid TimeResponseRateLimitsInner> rateLimits) { + public OrderListCancelResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public OrderListCancelResponse addRateLimitsItem(TimeResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -149,12 +137,11 @@ public OrderListCancelResponse addRateLimitsItem(TimeResponseRateLimitsInner rat */ @jakarta.annotation.Nullable @Valid - public List<@Valid TimeResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid TimeResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -209,7 +196,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid TimeResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -318,25 +305,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderListCancelResponseResult.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++) { - TimeResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOcoResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOcoResponse.java index 062a51d8..fc55cf5d 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOcoResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOcoResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class OrderListPlaceOcoResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid OrderListPlaceResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public OrderListPlaceOcoResponse() {} @@ -129,21 +126,11 @@ public void setResult(@jakarta.annotation.Nullable OrderListPlaceOcoResponseResu } public OrderListPlaceOcoResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid OrderListPlaceResponseRateLimitsInner> rateLimits) { + @jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public OrderListPlaceOcoResponse addRateLimitsItem( - OrderListPlaceResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -151,13 +138,11 @@ public OrderListPlaceOcoResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid OrderListPlaceResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid OrderListPlaceResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -212,7 +197,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid OrderListPlaceResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -321,26 +306,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderListPlaceOcoResponseResult.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++) { - OrderListPlaceResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtoResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtoResponse.java index 132ad0bb..96d10534 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtoResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtoResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class OrderListPlaceOtoResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid OrderListPlaceOtoResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public OrderListPlaceOtoResponse() {} @@ -129,21 +126,11 @@ public void setResult(@jakarta.annotation.Nullable OrderListPlaceOtoResponseResu } public OrderListPlaceOtoResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid OrderListPlaceOtoResponseRateLimitsInner> rateLimits) { + @jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public OrderListPlaceOtoResponse addRateLimitsItem( - OrderListPlaceOtoResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -151,13 +138,11 @@ public OrderListPlaceOtoResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid OrderListPlaceOtoResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid OrderListPlaceOtoResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -212,7 +197,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid OrderListPlaceOtoResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -321,26 +306,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderListPlaceOtoResponseResult.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++) { - OrderListPlaceOtoResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtoResponseRateLimitsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtoResponseRateLimitsInner.java deleted file mode 100644 index 9ec9a7c9..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtoResponseRateLimitsInner.java +++ /dev/null @@ -1,413 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.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.*; - -/** OrderListPlaceOtoResponseRateLimitsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class OrderListPlaceOtoResponseRateLimitsInner extends BaseDTO { - public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; - - @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) - @jakarta.annotation.Nullable - private String rateLimitType; - - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - - @SerializedName(SERIALIZED_NAME_INTERVAL) - @jakarta.annotation.Nullable - private String interval; - - public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; - - @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) - @jakarta.annotation.Nullable - private Long intervalNum; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - @jakarta.annotation.Nullable - private Long limit; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - @jakarta.annotation.Nullable - private Long count; - - public OrderListPlaceOtoResponseRateLimitsInner() {} - - public OrderListPlaceOtoResponseRateLimitsInner rateLimitType( - @jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - return this; - } - - /** - * Get rateLimitType - * - * @return rateLimitType - */ - @jakarta.annotation.Nullable - public String getRateLimitType() { - return rateLimitType; - } - - public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - } - - public OrderListPlaceOtoResponseRateLimitsInner interval( - @jakarta.annotation.Nullable String interval) { - this.interval = interval; - return this; - } - - /** - * Get interval - * - * @return interval - */ - @jakarta.annotation.Nullable - public String getInterval() { - return interval; - } - - public void setInterval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; - } - - public OrderListPlaceOtoResponseRateLimitsInner intervalNum( - @jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - return this; - } - - /** - * Get intervalNum - * - * @return intervalNum - */ - @jakarta.annotation.Nullable - public Long getIntervalNum() { - return intervalNum; - } - - public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - } - - public OrderListPlaceOtoResponseRateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - return this; - } - - /** - * Get limit - * - * @return limit - */ - @jakarta.annotation.Nullable - public Long getLimit() { - return limit; - } - - public void setLimit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - } - - public OrderListPlaceOtoResponseRateLimitsInner count(@jakarta.annotation.Nullable Long count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count - */ - @jakarta.annotation.Nullable - public Long getCount() { - return count; - } - - public void setCount(@jakarta.annotation.Nullable Long count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OrderListPlaceOtoResponseRateLimitsInner orderListPlaceOtoResponseRateLimitsInner = - (OrderListPlaceOtoResponseRateLimitsInner) o; - return Objects.equals( - this.rateLimitType, orderListPlaceOtoResponseRateLimitsInner.rateLimitType) - && Objects.equals(this.interval, orderListPlaceOtoResponseRateLimitsInner.interval) - && Objects.equals( - this.intervalNum, orderListPlaceOtoResponseRateLimitsInner.intervalNum) - && Objects.equals(this.limit, orderListPlaceOtoResponseRateLimitsInner.limit) - && Objects.equals(this.count, orderListPlaceOtoResponseRateLimitsInner.count); - } - - @Override - public int hashCode() { - return Objects.hash(rateLimitType, interval, intervalNum, limit, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OrderListPlaceOtoResponseRateLimitsInner {\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"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - String rateLimitTypeValueAsString = rateLimitTypeValue.toString(); - valMap.put("rateLimitType", rateLimitTypeValueAsString); - } - String intervalValue = getInterval(); - if (intervalValue != null) { - String intervalValueAsString = intervalValue.toString(); - valMap.put("interval", intervalValueAsString); - } - Long intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - String intervalNumValueAsString = intervalNumValue.toString(); - valMap.put("intervalNum", intervalNumValueAsString); - } - Long limitValue = getLimit(); - if (limitValue != null) { - String limitValueAsString = limitValue.toString(); - valMap.put("limit", limitValueAsString); - } - Long countValue = getCount(); - if (countValue != null) { - String countValueAsString = countValue.toString(); - valMap.put("count", countValueAsString); - } - - 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 rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - valMap.put("rateLimitType", rateLimitTypeValue); - } - Object intervalValue = getInterval(); - if (intervalValue != null) { - valMap.put("interval", intervalValue); - } - Object intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - valMap.put("intervalNum", intervalNumValue); - } - Object limitValue = getLimit(); - if (limitValue != null) { - valMap.put("limit", limitValue); - } - Object countValue = getCount(); - if (countValue != null) { - valMap.put("count", countValue); - } - - 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("rateLimitType"); - openapiFields.add("interval"); - openapiFields.add("intervalNum"); - openapiFields.add("limit"); - openapiFields.add("count"); - - // 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 - * OrderListPlaceOtoResponseRateLimitsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OrderListPlaceOtoResponseRateLimitsInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " OrderListPlaceOtoResponseRateLimitsInner is not found in" - + " the empty JSON string", - OrderListPlaceOtoResponseRateLimitsInner.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderListPlaceOtoResponseRateLimitsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderListPlaceOtoResponseRateLimitsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) - && !jsonObj.get("rateLimitType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rateLimitType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("rateLimitType").toString())); - } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) - && !jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OrderListPlaceOtoResponseRateLimitsInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'OrderListPlaceOtoResponseRateLimitsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(OrderListPlaceOtoResponseRateLimitsInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, OrderListPlaceOtoResponseRateLimitsInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public OrderListPlaceOtoResponseRateLimitsInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of OrderListPlaceOtoResponseRateLimitsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of OrderListPlaceOtoResponseRateLimitsInner - * @throws IOException if the JSON string is invalid with respect to - * OrderListPlaceOtoResponseRateLimitsInner - */ - public static OrderListPlaceOtoResponseRateLimitsInner fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, OrderListPlaceOtoResponseRateLimitsInner.class); - } - - /** - * Convert an instance of OrderListPlaceOtoResponseRateLimitsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtocoResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtocoResponse.java index 158ad359..5cea3f69 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtocoResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtocoResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class OrderListPlaceOtocoResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid OrderListPlaceOtocoResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public OrderListPlaceOtocoResponse() {} @@ -129,21 +126,11 @@ public void setResult(@jakarta.annotation.Nullable OrderListPlaceOtocoResponseRe } public OrderListPlaceOtocoResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid OrderListPlaceOtocoResponseRateLimitsInner> rateLimits) { + @jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public OrderListPlaceOtocoResponse addRateLimitsItem( - OrderListPlaceOtocoResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -151,13 +138,11 @@ public OrderListPlaceOtocoResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid OrderListPlaceOtocoResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid OrderListPlaceOtocoResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -212,7 +197,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid OrderListPlaceOtocoResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -322,26 +307,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderListPlaceOtocoResponseResult.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++) { - OrderListPlaceOtocoResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtocoResponseRateLimitsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtocoResponseRateLimitsInner.java deleted file mode 100644 index f3411f21..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceOtocoResponseRateLimitsInner.java +++ /dev/null @@ -1,419 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.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.*; - -/** OrderListPlaceOtocoResponseRateLimitsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class OrderListPlaceOtocoResponseRateLimitsInner extends BaseDTO { - public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; - - @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) - @jakarta.annotation.Nullable - private String rateLimitType; - - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - - @SerializedName(SERIALIZED_NAME_INTERVAL) - @jakarta.annotation.Nullable - private String interval; - - public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; - - @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) - @jakarta.annotation.Nullable - private Long intervalNum; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - @jakarta.annotation.Nullable - private Long limit; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - @jakarta.annotation.Nullable - private Long count; - - public OrderListPlaceOtocoResponseRateLimitsInner() {} - - public OrderListPlaceOtocoResponseRateLimitsInner rateLimitType( - @jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - return this; - } - - /** - * Get rateLimitType - * - * @return rateLimitType - */ - @jakarta.annotation.Nullable - public String getRateLimitType() { - return rateLimitType; - } - - public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - } - - public OrderListPlaceOtocoResponseRateLimitsInner interval( - @jakarta.annotation.Nullable String interval) { - this.interval = interval; - return this; - } - - /** - * Get interval - * - * @return interval - */ - @jakarta.annotation.Nullable - public String getInterval() { - return interval; - } - - public void setInterval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; - } - - public OrderListPlaceOtocoResponseRateLimitsInner intervalNum( - @jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - return this; - } - - /** - * Get intervalNum - * - * @return intervalNum - */ - @jakarta.annotation.Nullable - public Long getIntervalNum() { - return intervalNum; - } - - public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - } - - public OrderListPlaceOtocoResponseRateLimitsInner limit( - @jakarta.annotation.Nullable Long limit) { - this.limit = limit; - return this; - } - - /** - * Get limit - * - * @return limit - */ - @jakarta.annotation.Nullable - public Long getLimit() { - return limit; - } - - public void setLimit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - } - - public OrderListPlaceOtocoResponseRateLimitsInner count( - @jakarta.annotation.Nullable Long count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count - */ - @jakarta.annotation.Nullable - public Long getCount() { - return count; - } - - public void setCount(@jakarta.annotation.Nullable Long count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OrderListPlaceOtocoResponseRateLimitsInner orderListPlaceOtocoResponseRateLimitsInner = - (OrderListPlaceOtocoResponseRateLimitsInner) o; - return Objects.equals( - this.rateLimitType, - orderListPlaceOtocoResponseRateLimitsInner.rateLimitType) - && Objects.equals( - this.interval, orderListPlaceOtocoResponseRateLimitsInner.interval) - && Objects.equals( - this.intervalNum, orderListPlaceOtocoResponseRateLimitsInner.intervalNum) - && Objects.equals(this.limit, orderListPlaceOtocoResponseRateLimitsInner.limit) - && Objects.equals(this.count, orderListPlaceOtocoResponseRateLimitsInner.count); - } - - @Override - public int hashCode() { - return Objects.hash(rateLimitType, interval, intervalNum, limit, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OrderListPlaceOtocoResponseRateLimitsInner {\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"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - String rateLimitTypeValueAsString = rateLimitTypeValue.toString(); - valMap.put("rateLimitType", rateLimitTypeValueAsString); - } - String intervalValue = getInterval(); - if (intervalValue != null) { - String intervalValueAsString = intervalValue.toString(); - valMap.put("interval", intervalValueAsString); - } - Long intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - String intervalNumValueAsString = intervalNumValue.toString(); - valMap.put("intervalNum", intervalNumValueAsString); - } - Long limitValue = getLimit(); - if (limitValue != null) { - String limitValueAsString = limitValue.toString(); - valMap.put("limit", limitValueAsString); - } - Long countValue = getCount(); - if (countValue != null) { - String countValueAsString = countValue.toString(); - valMap.put("count", countValueAsString); - } - - 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 rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - valMap.put("rateLimitType", rateLimitTypeValue); - } - Object intervalValue = getInterval(); - if (intervalValue != null) { - valMap.put("interval", intervalValue); - } - Object intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - valMap.put("intervalNum", intervalNumValue); - } - Object limitValue = getLimit(); - if (limitValue != null) { - valMap.put("limit", limitValue); - } - Object countValue = getCount(); - if (countValue != null) { - valMap.put("count", countValue); - } - - 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("rateLimitType"); - openapiFields.add("interval"); - openapiFields.add("intervalNum"); - openapiFields.add("limit"); - openapiFields.add("count"); - - // 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 - * OrderListPlaceOtocoResponseRateLimitsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OrderListPlaceOtocoResponseRateLimitsInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " OrderListPlaceOtocoResponseRateLimitsInner is not found in" - + " the empty JSON string", - OrderListPlaceOtocoResponseRateLimitsInner.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderListPlaceOtocoResponseRateLimitsInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderListPlaceOtocoResponseRateLimitsInner` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) - && !jsonObj.get("rateLimitType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rateLimitType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("rateLimitType").toString())); - } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) - && !jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OrderListPlaceOtocoResponseRateLimitsInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'OrderListPlaceOtocoResponseRateLimitsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(OrderListPlaceOtocoResponseRateLimitsInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, OrderListPlaceOtocoResponseRateLimitsInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public OrderListPlaceOtocoResponseRateLimitsInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of OrderListPlaceOtocoResponseRateLimitsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of OrderListPlaceOtocoResponseRateLimitsInner - * @throws IOException if the JSON string is invalid with respect to - * OrderListPlaceOtocoResponseRateLimitsInner - */ - public static OrderListPlaceOtocoResponseRateLimitsInner fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, OrderListPlaceOtocoResponseRateLimitsInner.class); - } - - /** - * Convert an instance of OrderListPlaceOtocoResponseRateLimitsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceResponse.java index 74817898..dccf609c 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class OrderListPlaceResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid OrderListPlaceResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public OrderListPlaceResponse() {} @@ -128,22 +125,11 @@ public void setResult(@jakarta.annotation.Nullable OrderListPlaceResponseResult this.result = result; } - public OrderListPlaceResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid OrderListPlaceResponseRateLimitsInner> rateLimits) { + public OrderListPlaceResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public OrderListPlaceResponse addRateLimitsItem( - OrderListPlaceResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -151,13 +137,11 @@ public OrderListPlaceResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid OrderListPlaceResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid OrderListPlaceResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -212,7 +196,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid OrderListPlaceResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -321,26 +305,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderListPlaceResponseResult.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++) { - OrderListPlaceResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceResponseRateLimitsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceResponseRateLimitsInner.java deleted file mode 100644 index 29f386ce..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListPlaceResponseRateLimitsInner.java +++ /dev/null @@ -1,411 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.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.*; - -/** OrderListPlaceResponseRateLimitsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class OrderListPlaceResponseRateLimitsInner extends BaseDTO { - public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; - - @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) - @jakarta.annotation.Nullable - private String rateLimitType; - - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - - @SerializedName(SERIALIZED_NAME_INTERVAL) - @jakarta.annotation.Nullable - private String interval; - - public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; - - @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) - @jakarta.annotation.Nullable - private Long intervalNum; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - @jakarta.annotation.Nullable - private Long limit; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - @jakarta.annotation.Nullable - private Long count; - - public OrderListPlaceResponseRateLimitsInner() {} - - public OrderListPlaceResponseRateLimitsInner rateLimitType( - @jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - return this; - } - - /** - * Get rateLimitType - * - * @return rateLimitType - */ - @jakarta.annotation.Nullable - public String getRateLimitType() { - return rateLimitType; - } - - public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - } - - public OrderListPlaceResponseRateLimitsInner interval( - @jakarta.annotation.Nullable String interval) { - this.interval = interval; - return this; - } - - /** - * Get interval - * - * @return interval - */ - @jakarta.annotation.Nullable - public String getInterval() { - return interval; - } - - public void setInterval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; - } - - public OrderListPlaceResponseRateLimitsInner intervalNum( - @jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - return this; - } - - /** - * Get intervalNum - * - * @return intervalNum - */ - @jakarta.annotation.Nullable - public Long getIntervalNum() { - return intervalNum; - } - - public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - } - - public OrderListPlaceResponseRateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - return this; - } - - /** - * Get limit - * - * @return limit - */ - @jakarta.annotation.Nullable - public Long getLimit() { - return limit; - } - - public void setLimit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - } - - public OrderListPlaceResponseRateLimitsInner count(@jakarta.annotation.Nullable Long count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count - */ - @jakarta.annotation.Nullable - public Long getCount() { - return count; - } - - public void setCount(@jakarta.annotation.Nullable Long count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OrderListPlaceResponseRateLimitsInner orderListPlaceResponseRateLimitsInner = - (OrderListPlaceResponseRateLimitsInner) o; - return Objects.equals( - this.rateLimitType, orderListPlaceResponseRateLimitsInner.rateLimitType) - && Objects.equals(this.interval, orderListPlaceResponseRateLimitsInner.interval) - && Objects.equals( - this.intervalNum, orderListPlaceResponseRateLimitsInner.intervalNum) - && Objects.equals(this.limit, orderListPlaceResponseRateLimitsInner.limit) - && Objects.equals(this.count, orderListPlaceResponseRateLimitsInner.count); - } - - @Override - public int hashCode() { - return Objects.hash(rateLimitType, interval, intervalNum, limit, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OrderListPlaceResponseRateLimitsInner {\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"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - String rateLimitTypeValueAsString = rateLimitTypeValue.toString(); - valMap.put("rateLimitType", rateLimitTypeValueAsString); - } - String intervalValue = getInterval(); - if (intervalValue != null) { - String intervalValueAsString = intervalValue.toString(); - valMap.put("interval", intervalValueAsString); - } - Long intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - String intervalNumValueAsString = intervalNumValue.toString(); - valMap.put("intervalNum", intervalNumValueAsString); - } - Long limitValue = getLimit(); - if (limitValue != null) { - String limitValueAsString = limitValue.toString(); - valMap.put("limit", limitValueAsString); - } - Long countValue = getCount(); - if (countValue != null) { - String countValueAsString = countValue.toString(); - valMap.put("count", countValueAsString); - } - - 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 rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - valMap.put("rateLimitType", rateLimitTypeValue); - } - Object intervalValue = getInterval(); - if (intervalValue != null) { - valMap.put("interval", intervalValue); - } - Object intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - valMap.put("intervalNum", intervalNumValue); - } - Object limitValue = getLimit(); - if (limitValue != null) { - valMap.put("limit", limitValue); - } - Object countValue = getCount(); - if (countValue != null) { - valMap.put("count", countValue); - } - - 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("rateLimitType"); - openapiFields.add("interval"); - openapiFields.add("intervalNum"); - openapiFields.add("limit"); - openapiFields.add("count"); - - // 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 - * OrderListPlaceResponseRateLimitsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OrderListPlaceResponseRateLimitsInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in OrderListPlaceResponseRateLimitsInner" - + " is not found in the empty JSON string", - OrderListPlaceResponseRateLimitsInner.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderListPlaceResponseRateLimitsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderListPlaceResponseRateLimitsInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) - && !jsonObj.get("rateLimitType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rateLimitType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("rateLimitType").toString())); - } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) - && !jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OrderListPlaceResponseRateLimitsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OrderListPlaceResponseRateLimitsInner' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(OrderListPlaceResponseRateLimitsInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, OrderListPlaceResponseRateLimitsInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public OrderListPlaceResponseRateLimitsInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of OrderListPlaceResponseRateLimitsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of OrderListPlaceResponseRateLimitsInner - * @throws IOException if the JSON string is invalid with respect to - * OrderListPlaceResponseRateLimitsInner - */ - public static OrderListPlaceResponseRateLimitsInner fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, OrderListPlaceResponseRateLimitsInner.class); - } - - /** - * Convert an instance of OrderListPlaceResponseRateLimitsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListStatusResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListStatusResponse.java index 7a20451e..890844fe 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListStatusResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderListStatusResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -59,13 +56,13 @@ public class OrderListStatusResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RESULT) @jakarta.annotation.Nullable - private OrderListStatusResponseResult result; + private AllOrderListsResponseResultInner result; public static final String SERIALIZED_NAME_RATE_LIMITS = "rateLimits"; @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid TickerResponse1RateLimitsInner> rateLimits; + private RateLimits rateLimits; public OrderListStatusResponse() {} @@ -108,7 +105,7 @@ public void setStatus(@jakarta.annotation.Nullable Long status) { } public OrderListStatusResponse result( - @jakarta.annotation.Nullable OrderListStatusResponseResult result) { + @jakarta.annotation.Nullable AllOrderListsResponseResultInner result) { this.result = result; return this; } @@ -120,29 +117,19 @@ public OrderListStatusResponse result( */ @jakarta.annotation.Nullable @Valid - public OrderListStatusResponseResult getResult() { + public AllOrderListsResponseResultInner getResult() { return result; } - public void setResult(@jakarta.annotation.Nullable OrderListStatusResponseResult result) { + public void setResult(@jakarta.annotation.Nullable AllOrderListsResponseResultInner result) { this.result = result; } - public OrderListStatusResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid TickerResponse1RateLimitsInner> rateLimits) { + public OrderListStatusResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public OrderListStatusResponse addRateLimitsItem( - TickerResponse1RateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -150,12 +137,11 @@ public OrderListStatusResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid TickerResponse1RateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid TickerResponse1RateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -205,12 +191,12 @@ public String toUrlQueryString() { String statusValueAsString = statusValue.toString(); valMap.put("status", statusValueAsString); } - OrderListStatusResponseResult resultValue = getResult(); + AllOrderListsResponseResultInner resultValue = getResult(); if (resultValue != null) { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid TickerResponse1RateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -317,26 +303,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `result` if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { - OrderListStatusResponseResult.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++) { - TickerResponse1RateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } + AllOrderListsResponseResultInner.validateJsonElement(jsonObj.get("result")); } } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderPlaceResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderPlaceResponse.java index 6661b782..998c4e8d 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderPlaceResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderPlaceResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class OrderPlaceResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid OrderCancelReplaceResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public OrderPlaceResponse() {} @@ -127,22 +124,11 @@ public void setResult(@jakarta.annotation.Nullable OrderPlaceResponseResult resu this.result = result; } - public OrderPlaceResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid OrderCancelReplaceResponseRateLimitsInner> rateLimits) { + public OrderPlaceResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public OrderPlaceResponse addRateLimitsItem( - OrderCancelReplaceResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -150,13 +136,11 @@ public OrderPlaceResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid OrderCancelReplaceResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid OrderCancelReplaceResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -211,7 +195,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid OrderCancelReplaceResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -320,26 +304,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderPlaceResponseResult.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++) { - OrderCancelReplaceResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderStatusResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderStatusResponse.java index 47129079..e965ec78 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderStatusResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderStatusResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class OrderStatusResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid TickerResponse1RateLimitsInner> rateLimits; + private RateLimits rateLimits; public OrderStatusResponse() {} @@ -128,20 +125,11 @@ public void setResult(@jakarta.annotation.Nullable OrderStatusResponseResult res this.result = result; } - public OrderStatusResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid TickerResponse1RateLimitsInner> rateLimits) { + public OrderStatusResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public OrderStatusResponse addRateLimitsItem(TickerResponse1RateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -149,12 +137,11 @@ public OrderStatusResponse addRateLimitsItem(TickerResponse1RateLimitsInner rate */ @jakarta.annotation.Nullable @Valid - public List<@Valid TickerResponse1RateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid TickerResponse1RateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -209,7 +196,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid TickerResponse1RateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -318,25 +305,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderStatusResponseResult.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++) { - TickerResponse1RateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestResponse.java index ecca0562..c7361604 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderTestResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class OrderTestResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid TimeResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public OrderTestResponse() {} @@ -127,20 +124,11 @@ public void setResult(@jakarta.annotation.Nullable OrderTestResponseResult resul this.result = result; } - public OrderTestResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid TimeResponseRateLimitsInner> rateLimits) { + public OrderTestResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public OrderTestResponse addRateLimitsItem(TimeResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -148,12 +136,11 @@ public OrderTestResponse addRateLimitsItem(TimeResponseRateLimitsInner rateLimit */ @jakarta.annotation.Nullable @Valid - public List<@Valid TimeResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid TimeResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +195,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid TimeResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -317,25 +304,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderTestResponseResult.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++) { - TimeResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PingResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PingResponse.java new file mode 100644 index 00000000..aa8c80f0 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/PingResponse.java @@ -0,0 +1,352 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.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.*; + +/** PingResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class PingResponse 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 Object result; + + public static final String SERIALIZED_NAME_RATE_LIMITS = "rateLimits"; + + @SerializedName(SERIALIZED_NAME_RATE_LIMITS) + @jakarta.annotation.Nullable + private RateLimits rateLimits; + + public PingResponse() {} + + public PingResponse 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 PingResponse 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 PingResponse result(@jakarta.annotation.Nullable Object result) { + this.result = result; + return this; + } + + /** + * Get result + * + * @return result + */ + @jakarta.annotation.Nullable + public Object getResult() { + return result; + } + + public void setResult(@jakarta.annotation.Nullable Object result) { + this.result = result; + } + + public PingResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + this.rateLimits = rateLimits; + return this; + } + + /** + * Get rateLimits + * + * @return rateLimits + */ + @jakarta.annotation.Nullable + @Valid + public RateLimits getRateLimits() { + return rateLimits; + } + + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { + this.rateLimits = rateLimits; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PingResponse pingResponse = (PingResponse) o; + return Objects.equals(this.id, pingResponse.id) + && Objects.equals(this.status, pingResponse.status) + && Objects.equals(this.result, pingResponse.result) + && Objects.equals(this.rateLimits, pingResponse.rateLimits); + } + + @Override + public int hashCode() { + return Objects.hash(id, status, result, rateLimits); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PingResponse {\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); + } + Object resultValue = getResult(); + if (resultValue != null) { + String resultValueAsString = resultValue.toString(); + valMap.put("result", resultValueAsString); + } + RateLimits 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 PingResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PingResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PingResponse is not found in the empty" + + " JSON string", + PingResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PingResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PingResponse` 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 (!PingResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PingResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PingResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PingResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PingResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PingResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PingResponse + * @throws IOException if the JSON string is invalid with respect to PingResponse + */ + public static PingResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PingResponse.class); + } + + /** + * Convert an instance of PingResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/RateLimits.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/RateLimits.java new file mode 100644 index 00000000..bc8e1a06 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/RateLimits.java @@ -0,0 +1,189 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.api.model; + +import com.binance.connector.client.spot.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.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.*; + +/** RateLimits */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RateLimits extends ArrayList { + public RateLimits() {} + + @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 RateLimits {\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 RateLimits + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RateLimits.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RateLimits is not found in the empty" + + " JSON string", + RateLimits.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RateLimits.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RateLimits` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RateLimits.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RateLimits' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RateLimits.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RateLimits value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RateLimits read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RateLimits given an JSON string + * + * @param jsonString JSON string + * @return An instance of RateLimits + * @throws IOException if the JSON string is invalid with respect to RateLimits + */ + public static RateLimits fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RateLimits.class); + } + + /** + * Convert an instance of RateLimits to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TimeResponseRateLimitsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/RateLimitsInner.java similarity index 81% rename from clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TimeResponseRateLimitsInner.java rename to clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/RateLimitsInner.java index 215c553f..b5351f84 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TimeResponseRateLimitsInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/RateLimitsInner.java @@ -34,11 +34,11 @@ import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; -/** TimeResponseRateLimitsInner */ +/** RateLimitsInner */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class TimeResponseRateLimitsInner extends BaseDTO { +public class RateLimitsInner extends BaseDTO { public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) @@ -69,10 +69,9 @@ public class TimeResponseRateLimitsInner extends BaseDTO { @jakarta.annotation.Nullable private Long count; - public TimeResponseRateLimitsInner() {} + public RateLimitsInner() {} - public TimeResponseRateLimitsInner rateLimitType( - @jakarta.annotation.Nullable String rateLimitType) { + public RateLimitsInner rateLimitType(@jakarta.annotation.Nullable String rateLimitType) { this.rateLimitType = rateLimitType; return this; } @@ -91,7 +90,7 @@ public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) this.rateLimitType = rateLimitType; } - public TimeResponseRateLimitsInner interval(@jakarta.annotation.Nullable String interval) { + public RateLimitsInner interval(@jakarta.annotation.Nullable String interval) { this.interval = interval; return this; } @@ -110,7 +109,7 @@ public void setInterval(@jakarta.annotation.Nullable String interval) { this.interval = interval; } - public TimeResponseRateLimitsInner intervalNum(@jakarta.annotation.Nullable Long intervalNum) { + public RateLimitsInner intervalNum(@jakarta.annotation.Nullable Long intervalNum) { this.intervalNum = intervalNum; return this; } @@ -129,7 +128,7 @@ public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { this.intervalNum = intervalNum; } - public TimeResponseRateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { + public RateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { this.limit = limit; return this; } @@ -148,7 +147,7 @@ public void setLimit(@jakarta.annotation.Nullable Long limit) { this.limit = limit; } - public TimeResponseRateLimitsInner count(@jakarta.annotation.Nullable Long count) { + public RateLimitsInner count(@jakarta.annotation.Nullable Long count) { this.count = count; return this; } @@ -175,12 +174,12 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TimeResponseRateLimitsInner timeResponseRateLimitsInner = (TimeResponseRateLimitsInner) o; - return Objects.equals(this.rateLimitType, timeResponseRateLimitsInner.rateLimitType) - && Objects.equals(this.interval, timeResponseRateLimitsInner.interval) - && Objects.equals(this.intervalNum, timeResponseRateLimitsInner.intervalNum) - && Objects.equals(this.limit, timeResponseRateLimitsInner.limit) - && Objects.equals(this.count, timeResponseRateLimitsInner.count); + RateLimitsInner rateLimitsInner = (RateLimitsInner) o; + return Objects.equals(this.rateLimitType, rateLimitsInner.rateLimitType) + && Objects.equals(this.interval, rateLimitsInner.interval) + && Objects.equals(this.intervalNum, rateLimitsInner.intervalNum) + && Objects.equals(this.limit, rateLimitsInner.limit) + && Objects.equals(this.count, rateLimitsInner.count); } @Override @@ -191,7 +190,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TimeResponseRateLimitsInner {\n"); + sb.append("class RateLimitsInner {\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"); @@ -301,29 +300,28 @@ private String toIndentedString(Object o) { * 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 - * TimeResponseRateLimitsInner + * @throws IOException if the JSON Element is invalid with respect to RateLimitsInner */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!TimeResponseRateLimitsInner.openapiRequiredFields + if (!RateLimitsInner.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in TimeResponseRateLimitsInner is not" - + " found in the empty JSON string", - TimeResponseRateLimitsInner.openapiRequiredFields.toString())); + "The required field(s) %s in RateLimitsInner is not found in the" + + " empty JSON string", + RateLimitsInner.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!TimeResponseRateLimitsInner.openapiFields.contains(entry.getKey())) { + if (!RateLimitsInner.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `TimeResponseRateLimitsInner` properties. JSON: %s", + + " `RateLimitsInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } @@ -350,25 +348,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!TimeResponseRateLimitsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TimeResponseRateLimitsInner' and its - // subtypes + if (!RateLimitsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RateLimitsInner' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(TimeResponseRateLimitsInner.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RateLimitsInner.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, TimeResponseRateLimitsInner value) + public void write(JsonWriter out, RateLimitsInner value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public TimeResponseRateLimitsInner read(JsonReader in) throws IOException { + public RateLimitsInner read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -378,18 +375,18 @@ public TimeResponseRateLimitsInner read(JsonReader in) throws IOException { } /** - * Create an instance of TimeResponseRateLimitsInner given an JSON string + * Create an instance of RateLimitsInner given an JSON string * * @param jsonString JSON string - * @return An instance of TimeResponseRateLimitsInner - * @throws IOException if the JSON string is invalid with respect to TimeResponseRateLimitsInner + * @return An instance of RateLimitsInner + * @throws IOException if the JSON string is invalid with respect to RateLimitsInner */ - public static TimeResponseRateLimitsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TimeResponseRateLimitsInner.class); + public static RateLimitsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RateLimitsInner.class); } /** - * Convert an instance of TimeResponseRateLimitsInner to an JSON string + * Convert an instance of RateLimitsInner to an JSON string * * @return JSON string */ diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderPlaceResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderPlaceResponse.java index be534d11..2bfc3271 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderPlaceResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderPlaceResponse.java @@ -65,7 +65,7 @@ public class SorOrderPlaceResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid TimeResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public SorOrderPlaceResponse() {} @@ -137,20 +137,11 @@ public void setResult( this.result = result; } - public SorOrderPlaceResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid TimeResponseRateLimitsInner> rateLimits) { + public SorOrderPlaceResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public SorOrderPlaceResponse addRateLimitsItem(TimeResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -158,12 +149,11 @@ public SorOrderPlaceResponse addRateLimitsItem(TimeResponseRateLimitsInner rateL */ @jakarta.annotation.Nullable @Valid - public List<@Valid TimeResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid TimeResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -218,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid TimeResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -342,25 +332,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - TimeResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderTestResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderTestResponse.java index 5ada8f65..ab00a028 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderTestResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/SorOrderTestResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class SorOrderTestResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid TimeResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public SorOrderTestResponse() {} @@ -128,20 +125,11 @@ public void setResult(@jakarta.annotation.Nullable OrderTestResponseResult resul this.result = result; } - public SorOrderTestResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid TimeResponseRateLimitsInner> rateLimits) { + public SorOrderTestResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public SorOrderTestResponse addRateLimitsItem(TimeResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -149,12 +137,11 @@ public SorOrderTestResponse addRateLimitsItem(TimeResponseRateLimitsInner rateLi */ @jakarta.annotation.Nullable @Valid - public List<@Valid TimeResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid TimeResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -209,7 +196,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid TimeResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -318,25 +305,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { OrderTestResponseResult.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++) { - TimeResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrResponse1.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrResponse1.java index ed854743..6ed6a19f 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrResponse1.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrResponse1.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class Ticker24hrResponse1 extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AvgPriceResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public Ticker24hrResponse1() {} @@ -128,20 +125,11 @@ public void setResult(@jakarta.annotation.Nullable Ticker24hrResponse1Result res this.result = result; } - public Ticker24hrResponse1 rateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public Ticker24hrResponse1 rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public Ticker24hrResponse1 addRateLimitsItem(AvgPriceResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -149,12 +137,11 @@ public Ticker24hrResponse1 addRateLimitsItem(AvgPriceResponseRateLimitsInner rat */ @jakarta.annotation.Nullable @Valid - public List<@Valid AvgPriceResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -209,7 +196,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AvgPriceResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -318,25 +305,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { Ticker24hrResponse1Result.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++) { - AvgPriceResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrResponse2.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrResponse2.java index b210ae3e..f2a84489 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrResponse2.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/Ticker24hrResponse2.java @@ -65,7 +65,7 @@ public class Ticker24hrResponse2 extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AvgPriceResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public Ticker24hrResponse2() {} @@ -137,20 +137,11 @@ public void setResult( this.result = result; } - public Ticker24hrResponse2 rateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public Ticker24hrResponse2 rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public Ticker24hrResponse2 addRateLimitsItem(AvgPriceResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -158,12 +149,11 @@ public Ticker24hrResponse2 addRateLimitsItem(AvgPriceResponseRateLimitsInner rat */ @jakarta.annotation.Nullable @Valid - public List<@Valid AvgPriceResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -218,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AvgPriceResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -342,25 +332,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - AvgPriceResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookResponse1.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookResponse1.java index 1cd58232..9f051fbc 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookResponse1.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookResponse1.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class TickerBookResponse1 extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AvgPriceResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public TickerBookResponse1() {} @@ -128,20 +125,11 @@ public void setResult(@jakarta.annotation.Nullable TickerBookResponse1Result res this.result = result; } - public TickerBookResponse1 rateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public TickerBookResponse1 rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public TickerBookResponse1 addRateLimitsItem(AvgPriceResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -149,12 +137,11 @@ public TickerBookResponse1 addRateLimitsItem(AvgPriceResponseRateLimitsInner rat */ @jakarta.annotation.Nullable @Valid - public List<@Valid AvgPriceResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -209,7 +196,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AvgPriceResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -318,25 +305,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { TickerBookResponse1Result.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++) { - AvgPriceResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookResponse2.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookResponse2.java index 0ecb3097..f83c8bf9 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookResponse2.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerBookResponse2.java @@ -65,7 +65,7 @@ public class TickerBookResponse2 extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid TickerResponse1RateLimitsInner> rateLimits; + private RateLimits rateLimits; public TickerBookResponse2() {} @@ -137,20 +137,11 @@ public void setResult( this.result = result; } - public TickerBookResponse2 rateLimits( - @jakarta.annotation.Nullable List<@Valid TickerResponse1RateLimitsInner> rateLimits) { + public TickerBookResponse2 rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public TickerBookResponse2 addRateLimitsItem(TickerResponse1RateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -158,12 +149,11 @@ public TickerBookResponse2 addRateLimitsItem(TickerResponse1RateLimitsInner rate */ @jakarta.annotation.Nullable @Valid - public List<@Valid TickerResponse1RateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid TickerResponse1RateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -218,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid TickerResponse1RateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -342,25 +332,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - TickerResponse1RateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceResponse1.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceResponse1.java index 014a45e3..a551b7c6 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceResponse1.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceResponse1.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class TickerPriceResponse1 extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AvgPriceResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public TickerPriceResponse1() {} @@ -128,20 +125,11 @@ public void setResult(@jakarta.annotation.Nullable TickerPriceResponse1Result re this.result = result; } - public TickerPriceResponse1 rateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public TickerPriceResponse1 rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public TickerPriceResponse1 addRateLimitsItem(AvgPriceResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -149,12 +137,11 @@ public TickerPriceResponse1 addRateLimitsItem(AvgPriceResponseRateLimitsInner ra */ @jakarta.annotation.Nullable @Valid - public List<@Valid AvgPriceResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -209,7 +196,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AvgPriceResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -318,25 +305,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { TickerPriceResponse1Result.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++) { - AvgPriceResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceResponse2.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceResponse2.java index 30a9ecdc..bfd76249 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceResponse2.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerPriceResponse2.java @@ -65,7 +65,7 @@ public class TickerPriceResponse2 extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid TickerResponse1RateLimitsInner> rateLimits; + private RateLimits rateLimits; public TickerPriceResponse2() {} @@ -137,20 +137,11 @@ public void setResult( this.result = result; } - public TickerPriceResponse2 rateLimits( - @jakarta.annotation.Nullable List<@Valid TickerResponse1RateLimitsInner> rateLimits) { + public TickerPriceResponse2 rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public TickerPriceResponse2 addRateLimitsItem(TickerResponse1RateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -158,12 +149,11 @@ public TickerPriceResponse2 addRateLimitsItem(TickerResponse1RateLimitsInner rat */ @jakarta.annotation.Nullable @Valid - public List<@Valid TickerResponse1RateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid TickerResponse1RateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -218,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid TickerResponse1RateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -342,25 +332,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - TickerResponse1RateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse1.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse1.java index 92ab095a..1ebfd1e2 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse1.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse1.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class TickerResponse1 extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid TickerResponse1RateLimitsInner> rateLimits; + private RateLimits rateLimits; public TickerResponse1() {} @@ -127,20 +124,11 @@ public void setResult(@jakarta.annotation.Nullable TickerResponse1Result result) this.result = result; } - public TickerResponse1 rateLimits( - @jakarta.annotation.Nullable List<@Valid TickerResponse1RateLimitsInner> rateLimits) { + public TickerResponse1 rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public TickerResponse1 addRateLimitsItem(TickerResponse1RateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -148,12 +136,11 @@ public TickerResponse1 addRateLimitsItem(TickerResponse1RateLimitsInner rateLimi */ @jakarta.annotation.Nullable @Valid - public List<@Valid TickerResponse1RateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid TickerResponse1RateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +195,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid TickerResponse1RateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -317,25 +304,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { TickerResponse1Result.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++) { - TickerResponse1RateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse2.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse2.java index 2d0eb43d..718639c8 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse2.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse2.java @@ -65,7 +65,7 @@ public class TickerResponse2 extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid TickerResponse2RateLimitsInner> rateLimits; + private RateLimits rateLimits; public TickerResponse2() {} @@ -137,20 +137,11 @@ public void setResult( this.result = result; } - public TickerResponse2 rateLimits( - @jakarta.annotation.Nullable List<@Valid TickerResponse2RateLimitsInner> rateLimits) { + public TickerResponse2 rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public TickerResponse2 addRateLimitsItem(TickerResponse2RateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -158,12 +149,11 @@ public TickerResponse2 addRateLimitsItem(TickerResponse2RateLimitsInner rateLimi */ @jakarta.annotation.Nullable @Valid - public List<@Valid TickerResponse2RateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid TickerResponse2RateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -218,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid TickerResponse2RateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -342,25 +332,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - TickerResponse2RateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse2RateLimitsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse2RateLimitsInner.java deleted file mode 100644 index 6553d77f..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse2RateLimitsInner.java +++ /dev/null @@ -1,404 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.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.*; - -/** TickerResponse2RateLimitsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class TickerResponse2RateLimitsInner extends BaseDTO { - public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; - - @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) - @jakarta.annotation.Nullable - private String rateLimitType; - - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - - @SerializedName(SERIALIZED_NAME_INTERVAL) - @jakarta.annotation.Nullable - private String interval; - - public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; - - @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) - @jakarta.annotation.Nullable - private Long intervalNum; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - @jakarta.annotation.Nullable - private Long limit; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - @jakarta.annotation.Nullable - private Long count; - - public TickerResponse2RateLimitsInner() {} - - public TickerResponse2RateLimitsInner rateLimitType( - @jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - return this; - } - - /** - * Get rateLimitType - * - * @return rateLimitType - */ - @jakarta.annotation.Nullable - public String getRateLimitType() { - return rateLimitType; - } - - public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - } - - public TickerResponse2RateLimitsInner interval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; - return this; - } - - /** - * Get interval - * - * @return interval - */ - @jakarta.annotation.Nullable - public String getInterval() { - return interval; - } - - public void setInterval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; - } - - public TickerResponse2RateLimitsInner intervalNum( - @jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - return this; - } - - /** - * Get intervalNum - * - * @return intervalNum - */ - @jakarta.annotation.Nullable - public Long getIntervalNum() { - return intervalNum; - } - - public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - } - - public TickerResponse2RateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - return this; - } - - /** - * Get limit - * - * @return limit - */ - @jakarta.annotation.Nullable - public Long getLimit() { - return limit; - } - - public void setLimit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - } - - public TickerResponse2RateLimitsInner count(@jakarta.annotation.Nullable Long count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count - */ - @jakarta.annotation.Nullable - public Long getCount() { - return count; - } - - public void setCount(@jakarta.annotation.Nullable Long count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TickerResponse2RateLimitsInner tickerResponse2RateLimitsInner = - (TickerResponse2RateLimitsInner) o; - return Objects.equals(this.rateLimitType, tickerResponse2RateLimitsInner.rateLimitType) - && Objects.equals(this.interval, tickerResponse2RateLimitsInner.interval) - && Objects.equals(this.intervalNum, tickerResponse2RateLimitsInner.intervalNum) - && Objects.equals(this.limit, tickerResponse2RateLimitsInner.limit) - && Objects.equals(this.count, tickerResponse2RateLimitsInner.count); - } - - @Override - public int hashCode() { - return Objects.hash(rateLimitType, interval, intervalNum, limit, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TickerResponse2RateLimitsInner {\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"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - String rateLimitTypeValueAsString = rateLimitTypeValue.toString(); - valMap.put("rateLimitType", rateLimitTypeValueAsString); - } - String intervalValue = getInterval(); - if (intervalValue != null) { - String intervalValueAsString = intervalValue.toString(); - valMap.put("interval", intervalValueAsString); - } - Long intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - String intervalNumValueAsString = intervalNumValue.toString(); - valMap.put("intervalNum", intervalNumValueAsString); - } - Long limitValue = getLimit(); - if (limitValue != null) { - String limitValueAsString = limitValue.toString(); - valMap.put("limit", limitValueAsString); - } - Long countValue = getCount(); - if (countValue != null) { - String countValueAsString = countValue.toString(); - valMap.put("count", countValueAsString); - } - - 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 rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - valMap.put("rateLimitType", rateLimitTypeValue); - } - Object intervalValue = getInterval(); - if (intervalValue != null) { - valMap.put("interval", intervalValue); - } - Object intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - valMap.put("intervalNum", intervalNumValue); - } - Object limitValue = getLimit(); - if (limitValue != null) { - valMap.put("limit", limitValue); - } - Object countValue = getCount(); - if (countValue != null) { - valMap.put("count", countValue); - } - - 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("rateLimitType"); - openapiFields.add("interval"); - openapiFields.add("intervalNum"); - openapiFields.add("limit"); - openapiFields.add("count"); - - // 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 - * TickerResponse2RateLimitsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TickerResponse2RateLimitsInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in TickerResponse2RateLimitsInner is not" - + " found in the empty JSON string", - TickerResponse2RateLimitsInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TickerResponse2RateLimitsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TickerResponse2RateLimitsInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) - && !jsonObj.get("rateLimitType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rateLimitType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("rateLimitType").toString())); - } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) - && !jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TickerResponse2RateLimitsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TickerResponse2RateLimitsInner' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(TickerResponse2RateLimitsInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, TickerResponse2RateLimitsInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TickerResponse2RateLimitsInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of TickerResponse2RateLimitsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of TickerResponse2RateLimitsInner - * @throws IOException if the JSON string is invalid with respect to - * TickerResponse2RateLimitsInner - */ - public static TickerResponse2RateLimitsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TickerResponse2RateLimitsInner.class); - } - - /** - * Convert an instance of TickerResponse2RateLimitsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerTradingDayResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerTradingDayResponse.java index f8afb8bf..833c83de 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerTradingDayResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerTradingDayResponse.java @@ -65,7 +65,7 @@ public class TickerTradingDayResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid TickerResponse2RateLimitsInner> rateLimits; + private RateLimits rateLimits; public TickerTradingDayResponse() {} @@ -137,21 +137,11 @@ public void setResult( this.result = result; } - public TickerTradingDayResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid TickerResponse2RateLimitsInner> rateLimits) { + public TickerTradingDayResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public TickerTradingDayResponse addRateLimitsItem( - TickerResponse2RateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -159,12 +149,11 @@ public TickerTradingDayResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid TickerResponse2RateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid TickerResponse2RateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -219,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid TickerResponse2RateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -343,25 +332,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - TickerResponse2RateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TimeResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TimeResponse.java index 69696484..3b9e9253 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TimeResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TimeResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class TimeResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid TimeResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public TimeResponse() {} @@ -127,20 +124,11 @@ public void setResult(@jakarta.annotation.Nullable TimeResponseResult result) { this.result = result; } - public TimeResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid TimeResponseRateLimitsInner> rateLimits) { + public TimeResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public TimeResponse addRateLimitsItem(TimeResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -148,12 +136,11 @@ public TimeResponse addRateLimitsItem(TimeResponseRateLimitsInner rateLimitsItem */ @jakarta.annotation.Nullable @Valid - public List<@Valid TimeResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid TimeResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +195,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid TimeResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -317,25 +304,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { TimeResponseResult.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++) { - TimeResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesAggregateResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesAggregateResponse.java index f96820f7..b5fdabbf 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesAggregateResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesAggregateResponse.java @@ -65,7 +65,7 @@ public class TradesAggregateResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AvgPriceResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public TradesAggregateResponse() {} @@ -137,21 +137,11 @@ public void setResult( this.result = result; } - public TradesAggregateResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public TradesAggregateResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public TradesAggregateResponse addRateLimitsItem( - AvgPriceResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -159,12 +149,11 @@ public TradesAggregateResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid AvgPriceResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -219,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AvgPriceResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -343,25 +332,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - AvgPriceResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesHistoricalResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesHistoricalResponse.java index ca701fea..c6f19cd9 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesHistoricalResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesHistoricalResponse.java @@ -65,7 +65,7 @@ public class TradesHistoricalResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid TradesHistoricalResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public TradesHistoricalResponse() {} @@ -137,22 +137,11 @@ public void setResult( this.result = result; } - public TradesHistoricalResponse rateLimits( - @jakarta.annotation.Nullable - List<@Valid TradesHistoricalResponseRateLimitsInner> rateLimits) { + public TradesHistoricalResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public TradesHistoricalResponse addRateLimitsItem( - TradesHistoricalResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -160,13 +149,11 @@ public TradesHistoricalResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid TradesHistoricalResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable - List<@Valid TradesHistoricalResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -221,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid TradesHistoricalResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -345,26 +332,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - TradesHistoricalResponseRateLimitsInner.validateJsonElement( - jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesHistoricalResponseRateLimitsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesHistoricalResponseRateLimitsInner.java deleted file mode 100644 index e029090b..00000000 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesHistoricalResponseRateLimitsInner.java +++ /dev/null @@ -1,413 +0,0 @@ -/* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.api.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.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.*; - -/** TradesHistoricalResponseRateLimitsInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class TradesHistoricalResponseRateLimitsInner extends BaseDTO { - public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; - - @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) - @jakarta.annotation.Nullable - private String rateLimitType; - - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - - @SerializedName(SERIALIZED_NAME_INTERVAL) - @jakarta.annotation.Nullable - private String interval; - - public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; - - @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) - @jakarta.annotation.Nullable - private Long intervalNum; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - @jakarta.annotation.Nullable - private Long limit; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - @jakarta.annotation.Nullable - private Long count; - - public TradesHistoricalResponseRateLimitsInner() {} - - public TradesHistoricalResponseRateLimitsInner rateLimitType( - @jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - return this; - } - - /** - * Get rateLimitType - * - * @return rateLimitType - */ - @jakarta.annotation.Nullable - public String getRateLimitType() { - return rateLimitType; - } - - public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { - this.rateLimitType = rateLimitType; - } - - public TradesHistoricalResponseRateLimitsInner interval( - @jakarta.annotation.Nullable String interval) { - this.interval = interval; - return this; - } - - /** - * Get interval - * - * @return interval - */ - @jakarta.annotation.Nullable - public String getInterval() { - return interval; - } - - public void setInterval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; - } - - public TradesHistoricalResponseRateLimitsInner intervalNum( - @jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - return this; - } - - /** - * Get intervalNum - * - * @return intervalNum - */ - @jakarta.annotation.Nullable - public Long getIntervalNum() { - return intervalNum; - } - - public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { - this.intervalNum = intervalNum; - } - - public TradesHistoricalResponseRateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - return this; - } - - /** - * Get limit - * - * @return limit - */ - @jakarta.annotation.Nullable - public Long getLimit() { - return limit; - } - - public void setLimit(@jakarta.annotation.Nullable Long limit) { - this.limit = limit; - } - - public TradesHistoricalResponseRateLimitsInner count(@jakarta.annotation.Nullable Long count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count - */ - @jakarta.annotation.Nullable - public Long getCount() { - return count; - } - - public void setCount(@jakarta.annotation.Nullable Long count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TradesHistoricalResponseRateLimitsInner tradesHistoricalResponseRateLimitsInner = - (TradesHistoricalResponseRateLimitsInner) o; - return Objects.equals( - this.rateLimitType, tradesHistoricalResponseRateLimitsInner.rateLimitType) - && Objects.equals(this.interval, tradesHistoricalResponseRateLimitsInner.interval) - && Objects.equals( - this.intervalNum, tradesHistoricalResponseRateLimitsInner.intervalNum) - && Objects.equals(this.limit, tradesHistoricalResponseRateLimitsInner.limit) - && Objects.equals(this.count, tradesHistoricalResponseRateLimitsInner.count); - } - - @Override - public int hashCode() { - return Objects.hash(rateLimitType, interval, intervalNum, limit, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TradesHistoricalResponseRateLimitsInner {\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"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - String rateLimitTypeValueAsString = rateLimitTypeValue.toString(); - valMap.put("rateLimitType", rateLimitTypeValueAsString); - } - String intervalValue = getInterval(); - if (intervalValue != null) { - String intervalValueAsString = intervalValue.toString(); - valMap.put("interval", intervalValueAsString); - } - Long intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - String intervalNumValueAsString = intervalNumValue.toString(); - valMap.put("intervalNum", intervalNumValueAsString); - } - Long limitValue = getLimit(); - if (limitValue != null) { - String limitValueAsString = limitValue.toString(); - valMap.put("limit", limitValueAsString); - } - Long countValue = getCount(); - if (countValue != null) { - String countValueAsString = countValue.toString(); - valMap.put("count", countValueAsString); - } - - 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 rateLimitTypeValue = getRateLimitType(); - if (rateLimitTypeValue != null) { - valMap.put("rateLimitType", rateLimitTypeValue); - } - Object intervalValue = getInterval(); - if (intervalValue != null) { - valMap.put("interval", intervalValue); - } - Object intervalNumValue = getIntervalNum(); - if (intervalNumValue != null) { - valMap.put("intervalNum", intervalNumValue); - } - Object limitValue = getLimit(); - if (limitValue != null) { - valMap.put("limit", limitValue); - } - Object countValue = getCount(); - if (countValue != null) { - valMap.put("count", countValue); - } - - 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("rateLimitType"); - openapiFields.add("interval"); - openapiFields.add("intervalNum"); - openapiFields.add("limit"); - openapiFields.add("count"); - - // 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 - * TradesHistoricalResponseRateLimitsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TradesHistoricalResponseRateLimitsInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " TradesHistoricalResponseRateLimitsInner is not found in the" - + " empty JSON string", - TradesHistoricalResponseRateLimitsInner.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TradesHistoricalResponseRateLimitsInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TradesHistoricalResponseRateLimitsInner` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) - && !jsonObj.get("rateLimitType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rateLimitType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("rateLimitType").toString())); - } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) - && !jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TradesHistoricalResponseRateLimitsInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes 'TradesHistoricalResponseRateLimitsInner' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(TradesHistoricalResponseRateLimitsInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, TradesHistoricalResponseRateLimitsInner value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TradesHistoricalResponseRateLimitsInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of TradesHistoricalResponseRateLimitsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of TradesHistoricalResponseRateLimitsInner - * @throws IOException if the JSON string is invalid with respect to - * TradesHistoricalResponseRateLimitsInner - */ - public static TradesHistoricalResponseRateLimitsInner fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, TradesHistoricalResponseRateLimitsInner.class); - } - - /** - * Convert an instance of TradesHistoricalResponseRateLimitsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesRecentResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesRecentResponse.java index 3458d1ba..67c80c70 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesRecentResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesRecentResponse.java @@ -65,7 +65,7 @@ public class TradesRecentResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AvgPriceResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public TradesRecentResponse() {} @@ -137,20 +137,11 @@ public void setResult( this.result = result; } - public TradesRecentResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public TradesRecentResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public TradesRecentResponse addRateLimitsItem(AvgPriceResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -158,12 +149,11 @@ public TradesRecentResponse addRateLimitsItem(AvgPriceResponseRateLimitsInner ra */ @jakarta.annotation.Nullable @Valid - public List<@Valid AvgPriceResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -218,7 +208,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AvgPriceResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -342,25 +332,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti ; } } - 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++) { - AvgPriceResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UiKlinesResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UiKlinesResponse.java index 9770bf85..cccf1736 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UiKlinesResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UiKlinesResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -65,7 +64,7 @@ public class UiKlinesResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AvgPriceResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public UiKlinesResponse() {} @@ -135,20 +134,11 @@ public void setResult(@jakarta.annotation.Nullable List result) { this.result = result; } - public UiKlinesResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public UiKlinesResponse rateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public UiKlinesResponse addRateLimitsItem(AvgPriceResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -156,12 +146,11 @@ public UiKlinesResponse addRateLimitsItem(AvgPriceResponseRateLimitsInner rateLi */ @jakarta.annotation.Nullable @Valid - public List<@Valid AvgPriceResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -216,7 +205,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AvgPriceResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -331,25 +320,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " `%s`", jsonObj.get("result").toString())); } - 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++) { - AvgPriceResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamPingResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamPingResponse.java index 8e48fb05..6d65df9b 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamPingResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamPingResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class UserDataStreamPingResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AvgPriceResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public UserDataStreamPingResponse() {} @@ -127,20 +124,11 @@ public void setResponse(@jakarta.annotation.Nullable Object response) { } public UserDataStreamPingResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + @jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public UserDataStreamPingResponse addRateLimitsItem( - AvgPriceResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -148,12 +136,11 @@ public UserDataStreamPingResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid AvgPriceResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +195,7 @@ public String toUrlQueryString() { String responseValueAsString = responseValue.toString(); valMap.put("response", responseValueAsString); } - List<@Valid AvgPriceResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -313,25 +300,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("id").toString())); } - 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++) { - AvgPriceResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStartResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStartResponse.java index 516ad6b9..a0826af2 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStartResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStartResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class UserDataStreamStartResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AvgPriceResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public UserDataStreamStartResponse() {} @@ -129,20 +126,11 @@ public void setResult(@jakarta.annotation.Nullable UserDataStreamStartResponseRe } public UserDataStreamStartResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + @jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public UserDataStreamStartResponse addRateLimitsItem( - AvgPriceResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -150,12 +138,11 @@ public UserDataStreamStartResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid AvgPriceResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -210,7 +197,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid AvgPriceResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -320,25 +307,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { UserDataStreamStartResponseResult.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++) { - AvgPriceResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStopResponse.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStopResponse.java index 2ed41f84..6da5ee92 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStopResponse.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamStopResponse.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.spot.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; @@ -28,9 +27,7 @@ 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; @@ -65,7 +62,7 @@ public class UserDataStreamStopResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid AvgPriceResponseRateLimitsInner> rateLimits; + private RateLimits rateLimits; public UserDataStreamStopResponse() {} @@ -127,20 +124,11 @@ public void setResponse(@jakarta.annotation.Nullable Object response) { } public UserDataStreamStopResponse rateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + @jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; return this; } - public UserDataStreamStopResponse addRateLimitsItem( - AvgPriceResponseRateLimitsInner rateLimitsItem) { - if (this.rateLimits == null) { - this.rateLimits = new ArrayList<>(); - } - this.rateLimits.add(rateLimitsItem); - return this; - } - /** * Get rateLimits * @@ -148,12 +136,11 @@ public UserDataStreamStopResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid AvgPriceResponseRateLimitsInner> getRateLimits() { + public RateLimits getRateLimits() { return rateLimits; } - public void setRateLimits( - @jakarta.annotation.Nullable List<@Valid AvgPriceResponseRateLimitsInner> rateLimits) { + public void setRateLimits(@jakarta.annotation.Nullable RateLimits rateLimits) { this.rateLimits = rateLimits; } @@ -208,7 +195,7 @@ public String toUrlQueryString() { String responseValueAsString = responseValue.toString(); valMap.put("response", responseValueAsString); } - List<@Valid AvgPriceResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + RateLimits rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -313,25 +300,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("id").toString())); } - 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++) { - AvgPriceResponseRateLimitsInner.validateJsonElement(jsonArrayrateLimits.get(i)); - } - ; - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/JSON.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/JSON.java index 0ad87d87..97ab6ed1 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/JSON.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/JSON.java @@ -153,6 +153,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.stream.model.DiffBookDepthResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.ExchangeFilters + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.ExchangeFiltersInner + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.stream.model.KlineOffsetRequest .CustomTypeAdapterFactory()); @@ -180,6 +186,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.stream.model .PartialBookDepthResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.RateLimits + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.stream.model.RateLimitsInner + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.stream.model .RollingWindowTickerRequest.CustomTypeAdapterFactory()); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/SpotWebSocketStreams.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/SpotWebSocketStreams.java index 4c7d3bfe..7a94b41f 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/SpotWebSocketStreams.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/SpotWebSocketStreams.java @@ -38,7 +38,7 @@ public class SpotWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-spot/2.0.0 (Java/%s; %s; %s)", + "binance-spot/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private WebSocketStreamsApi webSocketStreamsApi; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeFilters.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeFilters.java new file mode 100644 index 00000000..a2ea6eb7 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeFilters.java @@ -0,0 +1,190 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.stream.model; + +import com.binance.connector.client.spot.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.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.*; + +/** ExchangeFilters */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExchangeFilters extends ArrayList { + public ExchangeFilters() {} + + @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 ExchangeFilters {\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 ExchangeFilters + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExchangeFilters.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExchangeFilters is not found in the" + + " empty JSON string", + ExchangeFilters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExchangeFilters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ExchangeFilters` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExchangeFilters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeFilters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ExchangeFilters.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExchangeFilters value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExchangeFilters read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExchangeFilters given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExchangeFilters + * @throws IOException if the JSON string is invalid with respect to ExchangeFilters + */ + public static ExchangeFilters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeFilters.class); + } + + /** + * Convert an instance of ExchangeFilters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeFiltersInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeFiltersInner.java new file mode 100644 index 00000000..3d6ae6cc --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/ExchangeFiltersInner.java @@ -0,0 +1,1416 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.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.*; + +/** ExchangeFiltersInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class ExchangeFiltersInner extends BaseDTO { + public static final String SERIALIZED_NAME_FILTER_TYPE = "filterType"; + + @SerializedName(SERIALIZED_NAME_FILTER_TYPE) + @jakarta.annotation.Nullable + private String filterType; + + public static final String SERIALIZED_NAME_MIN_PRICE = "minPrice"; + + @SerializedName(SERIALIZED_NAME_MIN_PRICE) + @jakarta.annotation.Nullable + private String minPrice; + + public static final String SERIALIZED_NAME_MAX_PRICE = "maxPrice"; + + @SerializedName(SERIALIZED_NAME_MAX_PRICE) + @jakarta.annotation.Nullable + private String maxPrice; + + public static final String SERIALIZED_NAME_TICK_SIZE = "tickSize"; + + @SerializedName(SERIALIZED_NAME_TICK_SIZE) + @jakarta.annotation.Nullable + private String tickSize; + + public static final String SERIALIZED_NAME_MULTIPLIER_UP = "multiplierUp"; + + @SerializedName(SERIALIZED_NAME_MULTIPLIER_UP) + @jakarta.annotation.Nullable + private String multiplierUp; + + public static final String SERIALIZED_NAME_MULTIPLIER_DOWN = "multiplierDown"; + + @SerializedName(SERIALIZED_NAME_MULTIPLIER_DOWN) + @jakarta.annotation.Nullable + private String multiplierDown; + + public static final String SERIALIZED_NAME_AVG_PRICE_MINS = "avgPriceMins"; + + @SerializedName(SERIALIZED_NAME_AVG_PRICE_MINS) + @jakarta.annotation.Nullable + private Long avgPriceMins; + + public static final String SERIALIZED_NAME_BID_MULTIPLIER_UP = "bidMultiplierUp"; + + @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_UP) + @jakarta.annotation.Nullable + private String bidMultiplierUp; + + public static final String SERIALIZED_NAME_BID_MULTIPLIER_DOWN = "bidMultiplierDown"; + + @SerializedName(SERIALIZED_NAME_BID_MULTIPLIER_DOWN) + @jakarta.annotation.Nullable + private String bidMultiplierDown; + + public static final String SERIALIZED_NAME_ASK_MULTIPLIER_UP = "askMultiplierUp"; + + @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_UP) + @jakarta.annotation.Nullable + private String askMultiplierUp; + + public static final String SERIALIZED_NAME_ASK_MULTIPLIER_DOWN = "askMultiplierDown"; + + @SerializedName(SERIALIZED_NAME_ASK_MULTIPLIER_DOWN) + @jakarta.annotation.Nullable + private String askMultiplierDown; + + public static final String SERIALIZED_NAME_MIN_QTY = "minQty"; + + @SerializedName(SERIALIZED_NAME_MIN_QTY) + @jakarta.annotation.Nullable + private String minQty; + + public static final String SERIALIZED_NAME_MAX_QTY = "maxQty"; + + @SerializedName(SERIALIZED_NAME_MAX_QTY) + @jakarta.annotation.Nullable + private String maxQty; + + public static final String SERIALIZED_NAME_STEP_SIZE = "stepSize"; + + @SerializedName(SERIALIZED_NAME_STEP_SIZE) + @jakarta.annotation.Nullable + private String stepSize; + + public static final String SERIALIZED_NAME_MIN_NOTIONAL = "minNotional"; + + @SerializedName(SERIALIZED_NAME_MIN_NOTIONAL) + @jakarta.annotation.Nullable + private String minNotional; + + public static final String SERIALIZED_NAME_APPLY_TO_MARKET = "applyToMarket"; + + @SerializedName(SERIALIZED_NAME_APPLY_TO_MARKET) + @jakarta.annotation.Nullable + private Boolean applyToMarket; + + public static final String SERIALIZED_NAME_APPLY_MIN_TO_MARKET = "applyMinToMarket"; + + @SerializedName(SERIALIZED_NAME_APPLY_MIN_TO_MARKET) + @jakarta.annotation.Nullable + private Boolean applyMinToMarket; + + public static final String SERIALIZED_NAME_MAX_NOTIONAL = "maxNotional"; + + @SerializedName(SERIALIZED_NAME_MAX_NOTIONAL) + @jakarta.annotation.Nullable + private String maxNotional; + + public static final String SERIALIZED_NAME_APPLY_MAX_TO_MARKET = "applyMaxToMarket"; + + @SerializedName(SERIALIZED_NAME_APPLY_MAX_TO_MARKET) + @jakarta.annotation.Nullable + private Boolean applyMaxToMarket; + + public static final String SERIALIZED_NAME_LIMIT = "limit"; + + @SerializedName(SERIALIZED_NAME_LIMIT) + @jakarta.annotation.Nullable + private Long limit; + + public static final String SERIALIZED_NAME_MAX_NUM_ORDERS = "maxNumOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumOrders; + + public static final String SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS = "maxNumAlgoOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ALGO_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumAlgoOrders; + + public static final String SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS = "maxNumIcebergOrders"; + + @SerializedName(SERIALIZED_NAME_MAX_NUM_ICEBERG_ORDERS) + @jakarta.annotation.Nullable + private Long maxNumIcebergOrders; + + public static final String SERIALIZED_NAME_MAX_POSITION = "maxPosition"; + + @SerializedName(SERIALIZED_NAME_MAX_POSITION) + @jakarta.annotation.Nullable + private String maxPosition; + + public static final String SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA = "minTrailingAboveDelta"; + + @SerializedName(SERIALIZED_NAME_MIN_TRAILING_ABOVE_DELTA) + @jakarta.annotation.Nullable + private Long minTrailingAboveDelta; + + public static final String SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA = "maxTrailingAboveDelta"; + + @SerializedName(SERIALIZED_NAME_MAX_TRAILING_ABOVE_DELTA) + @jakarta.annotation.Nullable + private Long maxTrailingAboveDelta; + + public static final String SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA = "minTrailingBelowDelta"; + + @SerializedName(SERIALIZED_NAME_MIN_TRAILING_BELOW_DELTA) + @jakarta.annotation.Nullable + private Long minTrailingBelowDelta; + + public static final String SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA = "maxTrailingBelowDelta"; + + @SerializedName(SERIALIZED_NAME_MAX_TRAILING_BELOW_DELTA) + @jakarta.annotation.Nullable + private Long maxTrailingBelowDelta; + + public ExchangeFiltersInner() {} + + public ExchangeFiltersInner filterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + return this; + } + + /** + * Get filterType + * + * @return filterType + */ + @jakarta.annotation.Nullable + public String getFilterType() { + return filterType; + } + + public void setFilterType(@jakarta.annotation.Nullable String filterType) { + this.filterType = filterType; + } + + public ExchangeFiltersInner minPrice(@jakarta.annotation.Nullable String minPrice) { + this.minPrice = minPrice; + return this; + } + + /** + * Get minPrice + * + * @return minPrice + */ + @jakarta.annotation.Nullable + public String getMinPrice() { + return minPrice; + } + + public void setMinPrice(@jakarta.annotation.Nullable String minPrice) { + this.minPrice = minPrice; + } + + public ExchangeFiltersInner maxPrice(@jakarta.annotation.Nullable String maxPrice) { + this.maxPrice = maxPrice; + return this; + } + + /** + * Get maxPrice + * + * @return maxPrice + */ + @jakarta.annotation.Nullable + public String getMaxPrice() { + return maxPrice; + } + + public void setMaxPrice(@jakarta.annotation.Nullable String maxPrice) { + this.maxPrice = maxPrice; + } + + public ExchangeFiltersInner tickSize(@jakarta.annotation.Nullable String tickSize) { + this.tickSize = tickSize; + return this; + } + + /** + * Get tickSize + * + * @return tickSize + */ + @jakarta.annotation.Nullable + public String getTickSize() { + return tickSize; + } + + public void setTickSize(@jakarta.annotation.Nullable String tickSize) { + this.tickSize = tickSize; + } + + public ExchangeFiltersInner multiplierUp(@jakarta.annotation.Nullable String multiplierUp) { + this.multiplierUp = multiplierUp; + return this; + } + + /** + * Get multiplierUp + * + * @return multiplierUp + */ + @jakarta.annotation.Nullable + public String getMultiplierUp() { + return multiplierUp; + } + + public void setMultiplierUp(@jakarta.annotation.Nullable String multiplierUp) { + this.multiplierUp = multiplierUp; + } + + public ExchangeFiltersInner multiplierDown(@jakarta.annotation.Nullable String multiplierDown) { + this.multiplierDown = multiplierDown; + return this; + } + + /** + * Get multiplierDown + * + * @return multiplierDown + */ + @jakarta.annotation.Nullable + public String getMultiplierDown() { + return multiplierDown; + } + + public void setMultiplierDown(@jakarta.annotation.Nullable String multiplierDown) { + this.multiplierDown = multiplierDown; + } + + public ExchangeFiltersInner avgPriceMins(@jakarta.annotation.Nullable Long avgPriceMins) { + this.avgPriceMins = avgPriceMins; + return this; + } + + /** + * Get avgPriceMins + * + * @return avgPriceMins + */ + @jakarta.annotation.Nullable + public Long getAvgPriceMins() { + return avgPriceMins; + } + + public void setAvgPriceMins(@jakarta.annotation.Nullable Long avgPriceMins) { + this.avgPriceMins = avgPriceMins; + } + + public ExchangeFiltersInner bidMultiplierUp( + @jakarta.annotation.Nullable String bidMultiplierUp) { + this.bidMultiplierUp = bidMultiplierUp; + return this; + } + + /** + * Get bidMultiplierUp + * + * @return bidMultiplierUp + */ + @jakarta.annotation.Nullable + public String getBidMultiplierUp() { + return bidMultiplierUp; + } + + public void setBidMultiplierUp(@jakarta.annotation.Nullable String bidMultiplierUp) { + this.bidMultiplierUp = bidMultiplierUp; + } + + public ExchangeFiltersInner bidMultiplierDown( + @jakarta.annotation.Nullable String bidMultiplierDown) { + this.bidMultiplierDown = bidMultiplierDown; + return this; + } + + /** + * Get bidMultiplierDown + * + * @return bidMultiplierDown + */ + @jakarta.annotation.Nullable + public String getBidMultiplierDown() { + return bidMultiplierDown; + } + + public void setBidMultiplierDown(@jakarta.annotation.Nullable String bidMultiplierDown) { + this.bidMultiplierDown = bidMultiplierDown; + } + + public ExchangeFiltersInner askMultiplierUp( + @jakarta.annotation.Nullable String askMultiplierUp) { + this.askMultiplierUp = askMultiplierUp; + return this; + } + + /** + * Get askMultiplierUp + * + * @return askMultiplierUp + */ + @jakarta.annotation.Nullable + public String getAskMultiplierUp() { + return askMultiplierUp; + } + + public void setAskMultiplierUp(@jakarta.annotation.Nullable String askMultiplierUp) { + this.askMultiplierUp = askMultiplierUp; + } + + public ExchangeFiltersInner askMultiplierDown( + @jakarta.annotation.Nullable String askMultiplierDown) { + this.askMultiplierDown = askMultiplierDown; + return this; + } + + /** + * Get askMultiplierDown + * + * @return askMultiplierDown + */ + @jakarta.annotation.Nullable + public String getAskMultiplierDown() { + return askMultiplierDown; + } + + public void setAskMultiplierDown(@jakarta.annotation.Nullable String askMultiplierDown) { + this.askMultiplierDown = askMultiplierDown; + } + + public ExchangeFiltersInner minQty(@jakarta.annotation.Nullable String minQty) { + this.minQty = minQty; + return this; + } + + /** + * Get minQty + * + * @return minQty + */ + @jakarta.annotation.Nullable + public String getMinQty() { + return minQty; + } + + public void setMinQty(@jakarta.annotation.Nullable String minQty) { + this.minQty = minQty; + } + + public ExchangeFiltersInner maxQty(@jakarta.annotation.Nullable String maxQty) { + this.maxQty = maxQty; + return this; + } + + /** + * Get maxQty + * + * @return maxQty + */ + @jakarta.annotation.Nullable + public String getMaxQty() { + return maxQty; + } + + public void setMaxQty(@jakarta.annotation.Nullable String maxQty) { + this.maxQty = maxQty; + } + + public ExchangeFiltersInner stepSize(@jakarta.annotation.Nullable String stepSize) { + this.stepSize = stepSize; + return this; + } + + /** + * Get stepSize + * + * @return stepSize + */ + @jakarta.annotation.Nullable + public String getStepSize() { + return stepSize; + } + + public void setStepSize(@jakarta.annotation.Nullable String stepSize) { + this.stepSize = stepSize; + } + + public ExchangeFiltersInner minNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; + return this; + } + + /** + * Get minNotional + * + * @return minNotional + */ + @jakarta.annotation.Nullable + public String getMinNotional() { + return minNotional; + } + + public void setMinNotional(@jakarta.annotation.Nullable String minNotional) { + this.minNotional = minNotional; + } + + public ExchangeFiltersInner applyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { + this.applyToMarket = applyToMarket; + return this; + } + + /** + * Get applyToMarket + * + * @return applyToMarket + */ + @jakarta.annotation.Nullable + public Boolean getApplyToMarket() { + return applyToMarket; + } + + public void setApplyToMarket(@jakarta.annotation.Nullable Boolean applyToMarket) { + this.applyToMarket = applyToMarket; + } + + public ExchangeFiltersInner applyMinToMarket( + @jakarta.annotation.Nullable Boolean applyMinToMarket) { + this.applyMinToMarket = applyMinToMarket; + return this; + } + + /** + * Get applyMinToMarket + * + * @return applyMinToMarket + */ + @jakarta.annotation.Nullable + public Boolean getApplyMinToMarket() { + return applyMinToMarket; + } + + public void setApplyMinToMarket(@jakarta.annotation.Nullable Boolean applyMinToMarket) { + this.applyMinToMarket = applyMinToMarket; + } + + public ExchangeFiltersInner maxNotional(@jakarta.annotation.Nullable String maxNotional) { + this.maxNotional = maxNotional; + return this; + } + + /** + * Get maxNotional + * + * @return maxNotional + */ + @jakarta.annotation.Nullable + public String getMaxNotional() { + return maxNotional; + } + + public void setMaxNotional(@jakarta.annotation.Nullable String maxNotional) { + this.maxNotional = maxNotional; + } + + public ExchangeFiltersInner applyMaxToMarket( + @jakarta.annotation.Nullable Boolean applyMaxToMarket) { + this.applyMaxToMarket = applyMaxToMarket; + return this; + } + + /** + * Get applyMaxToMarket + * + * @return applyMaxToMarket + */ + @jakarta.annotation.Nullable + public Boolean getApplyMaxToMarket() { + return applyMaxToMarket; + } + + public void setApplyMaxToMarket(@jakarta.annotation.Nullable Boolean applyMaxToMarket) { + this.applyMaxToMarket = applyMaxToMarket; + } + + public ExchangeFiltersInner limit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; + return this; + } + + /** + * Get limit + * + * @return limit + */ + @jakarta.annotation.Nullable + public Long getLimit() { + return limit; + } + + public void setLimit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; + } + + public ExchangeFiltersInner maxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; + return this; + } + + /** + * Get maxNumOrders + * + * @return maxNumOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumOrders() { + return maxNumOrders; + } + + public void setMaxNumOrders(@jakarta.annotation.Nullable Long maxNumOrders) { + this.maxNumOrders = maxNumOrders; + } + + public ExchangeFiltersInner maxNumAlgoOrders( + @jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; + return this; + } + + /** + * Get maxNumAlgoOrders + * + * @return maxNumAlgoOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumAlgoOrders() { + return maxNumAlgoOrders; + } + + public void setMaxNumAlgoOrders(@jakarta.annotation.Nullable Long maxNumAlgoOrders) { + this.maxNumAlgoOrders = maxNumAlgoOrders; + } + + public ExchangeFiltersInner maxNumIcebergOrders( + @jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; + return this; + } + + /** + * Get maxNumIcebergOrders + * + * @return maxNumIcebergOrders + */ + @jakarta.annotation.Nullable + public Long getMaxNumIcebergOrders() { + return maxNumIcebergOrders; + } + + public void setMaxNumIcebergOrders(@jakarta.annotation.Nullable Long maxNumIcebergOrders) { + this.maxNumIcebergOrders = maxNumIcebergOrders; + } + + public ExchangeFiltersInner maxPosition(@jakarta.annotation.Nullable String maxPosition) { + this.maxPosition = maxPosition; + return this; + } + + /** + * Get maxPosition + * + * @return maxPosition + */ + @jakarta.annotation.Nullable + public String getMaxPosition() { + return maxPosition; + } + + public void setMaxPosition(@jakarta.annotation.Nullable String maxPosition) { + this.maxPosition = maxPosition; + } + + public ExchangeFiltersInner minTrailingAboveDelta( + @jakarta.annotation.Nullable Long minTrailingAboveDelta) { + this.minTrailingAboveDelta = minTrailingAboveDelta; + return this; + } + + /** + * Get minTrailingAboveDelta + * + * @return minTrailingAboveDelta + */ + @jakarta.annotation.Nullable + public Long getMinTrailingAboveDelta() { + return minTrailingAboveDelta; + } + + public void setMinTrailingAboveDelta(@jakarta.annotation.Nullable Long minTrailingAboveDelta) { + this.minTrailingAboveDelta = minTrailingAboveDelta; + } + + public ExchangeFiltersInner maxTrailingAboveDelta( + @jakarta.annotation.Nullable Long maxTrailingAboveDelta) { + this.maxTrailingAboveDelta = maxTrailingAboveDelta; + return this; + } + + /** + * Get maxTrailingAboveDelta + * + * @return maxTrailingAboveDelta + */ + @jakarta.annotation.Nullable + public Long getMaxTrailingAboveDelta() { + return maxTrailingAboveDelta; + } + + public void setMaxTrailingAboveDelta(@jakarta.annotation.Nullable Long maxTrailingAboveDelta) { + this.maxTrailingAboveDelta = maxTrailingAboveDelta; + } + + public ExchangeFiltersInner minTrailingBelowDelta( + @jakarta.annotation.Nullable Long minTrailingBelowDelta) { + this.minTrailingBelowDelta = minTrailingBelowDelta; + return this; + } + + /** + * Get minTrailingBelowDelta + * + * @return minTrailingBelowDelta + */ + @jakarta.annotation.Nullable + public Long getMinTrailingBelowDelta() { + return minTrailingBelowDelta; + } + + public void setMinTrailingBelowDelta(@jakarta.annotation.Nullable Long minTrailingBelowDelta) { + this.minTrailingBelowDelta = minTrailingBelowDelta; + } + + public ExchangeFiltersInner maxTrailingBelowDelta( + @jakarta.annotation.Nullable Long maxTrailingBelowDelta) { + this.maxTrailingBelowDelta = maxTrailingBelowDelta; + return this; + } + + /** + * Get maxTrailingBelowDelta + * + * @return maxTrailingBelowDelta + */ + @jakarta.annotation.Nullable + public Long getMaxTrailingBelowDelta() { + return maxTrailingBelowDelta; + } + + public void setMaxTrailingBelowDelta(@jakarta.annotation.Nullable Long maxTrailingBelowDelta) { + this.maxTrailingBelowDelta = maxTrailingBelowDelta; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExchangeFiltersInner exchangeFiltersInner = (ExchangeFiltersInner) o; + return Objects.equals(this.filterType, exchangeFiltersInner.filterType) + && Objects.equals(this.minPrice, exchangeFiltersInner.minPrice) + && Objects.equals(this.maxPrice, exchangeFiltersInner.maxPrice) + && Objects.equals(this.tickSize, exchangeFiltersInner.tickSize) + && Objects.equals(this.multiplierUp, exchangeFiltersInner.multiplierUp) + && Objects.equals(this.multiplierDown, exchangeFiltersInner.multiplierDown) + && Objects.equals(this.avgPriceMins, exchangeFiltersInner.avgPriceMins) + && Objects.equals(this.bidMultiplierUp, exchangeFiltersInner.bidMultiplierUp) + && Objects.equals(this.bidMultiplierDown, exchangeFiltersInner.bidMultiplierDown) + && Objects.equals(this.askMultiplierUp, exchangeFiltersInner.askMultiplierUp) + && Objects.equals(this.askMultiplierDown, exchangeFiltersInner.askMultiplierDown) + && Objects.equals(this.minQty, exchangeFiltersInner.minQty) + && Objects.equals(this.maxQty, exchangeFiltersInner.maxQty) + && Objects.equals(this.stepSize, exchangeFiltersInner.stepSize) + && Objects.equals(this.minNotional, exchangeFiltersInner.minNotional) + && Objects.equals(this.applyToMarket, exchangeFiltersInner.applyToMarket) + && Objects.equals(this.applyMinToMarket, exchangeFiltersInner.applyMinToMarket) + && Objects.equals(this.maxNotional, exchangeFiltersInner.maxNotional) + && Objects.equals(this.applyMaxToMarket, exchangeFiltersInner.applyMaxToMarket) + && Objects.equals(this.limit, exchangeFiltersInner.limit) + && Objects.equals(this.maxNumOrders, exchangeFiltersInner.maxNumOrders) + && Objects.equals(this.maxNumAlgoOrders, exchangeFiltersInner.maxNumAlgoOrders) + && Objects.equals( + this.maxNumIcebergOrders, exchangeFiltersInner.maxNumIcebergOrders) + && Objects.equals(this.maxPosition, exchangeFiltersInner.maxPosition) + && Objects.equals( + this.minTrailingAboveDelta, exchangeFiltersInner.minTrailingAboveDelta) + && Objects.equals( + this.maxTrailingAboveDelta, exchangeFiltersInner.maxTrailingAboveDelta) + && Objects.equals( + this.minTrailingBelowDelta, exchangeFiltersInner.minTrailingBelowDelta) + && Objects.equals( + this.maxTrailingBelowDelta, exchangeFiltersInner.maxTrailingBelowDelta); + } + + @Override + public int hashCode() { + return Objects.hash( + filterType, + minPrice, + maxPrice, + tickSize, + multiplierUp, + multiplierDown, + avgPriceMins, + bidMultiplierUp, + bidMultiplierDown, + askMultiplierUp, + askMultiplierDown, + minQty, + maxQty, + stepSize, + minNotional, + applyToMarket, + applyMinToMarket, + maxNotional, + applyMaxToMarket, + limit, + maxNumOrders, + maxNumAlgoOrders, + maxNumIcebergOrders, + maxPosition, + minTrailingAboveDelta, + maxTrailingAboveDelta, + minTrailingBelowDelta, + maxTrailingBelowDelta); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExchangeFiltersInner {\n"); + sb.append(" filterType: ").append(toIndentedString(filterType)).append("\n"); + sb.append(" minPrice: ").append(toIndentedString(minPrice)).append("\n"); + sb.append(" maxPrice: ").append(toIndentedString(maxPrice)).append("\n"); + sb.append(" tickSize: ").append(toIndentedString(tickSize)).append("\n"); + sb.append(" multiplierUp: ").append(toIndentedString(multiplierUp)).append("\n"); + sb.append(" multiplierDown: ").append(toIndentedString(multiplierDown)).append("\n"); + sb.append(" avgPriceMins: ").append(toIndentedString(avgPriceMins)).append("\n"); + sb.append(" bidMultiplierUp: ").append(toIndentedString(bidMultiplierUp)).append("\n"); + sb.append(" bidMultiplierDown: ").append(toIndentedString(bidMultiplierDown)).append("\n"); + sb.append(" askMultiplierUp: ").append(toIndentedString(askMultiplierUp)).append("\n"); + sb.append(" askMultiplierDown: ").append(toIndentedString(askMultiplierDown)).append("\n"); + sb.append(" minQty: ").append(toIndentedString(minQty)).append("\n"); + sb.append(" maxQty: ").append(toIndentedString(maxQty)).append("\n"); + sb.append(" stepSize: ").append(toIndentedString(stepSize)).append("\n"); + sb.append(" minNotional: ").append(toIndentedString(minNotional)).append("\n"); + sb.append(" applyToMarket: ").append(toIndentedString(applyToMarket)).append("\n"); + sb.append(" applyMinToMarket: ").append(toIndentedString(applyMinToMarket)).append("\n"); + sb.append(" maxNotional: ").append(toIndentedString(maxNotional)).append("\n"); + sb.append(" applyMaxToMarket: ").append(toIndentedString(applyMaxToMarket)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" maxNumOrders: ").append(toIndentedString(maxNumOrders)).append("\n"); + sb.append(" maxNumAlgoOrders: ").append(toIndentedString(maxNumAlgoOrders)).append("\n"); + sb.append(" maxNumIcebergOrders: ") + .append(toIndentedString(maxNumIcebergOrders)) + .append("\n"); + sb.append(" maxPosition: ").append(toIndentedString(maxPosition)).append("\n"); + sb.append(" minTrailingAboveDelta: ") + .append(toIndentedString(minTrailingAboveDelta)) + .append("\n"); + sb.append(" maxTrailingAboveDelta: ") + .append(toIndentedString(maxTrailingAboveDelta)) + .append("\n"); + sb.append(" minTrailingBelowDelta: ") + .append(toIndentedString(minTrailingBelowDelta)) + .append("\n"); + sb.append(" maxTrailingBelowDelta: ") + .append(toIndentedString(maxTrailingBelowDelta)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + String filterTypeValueAsString = filterTypeValue.toString(); + valMap.put("filterType", filterTypeValueAsString); + } + String minPriceValue = getMinPrice(); + if (minPriceValue != null) { + String minPriceValueAsString = minPriceValue.toString(); + valMap.put("minPrice", minPriceValueAsString); + } + String maxPriceValue = getMaxPrice(); + if (maxPriceValue != null) { + String maxPriceValueAsString = maxPriceValue.toString(); + valMap.put("maxPrice", maxPriceValueAsString); + } + String tickSizeValue = getTickSize(); + if (tickSizeValue != null) { + String tickSizeValueAsString = tickSizeValue.toString(); + valMap.put("tickSize", tickSizeValueAsString); + } + String multiplierUpValue = getMultiplierUp(); + if (multiplierUpValue != null) { + String multiplierUpValueAsString = multiplierUpValue.toString(); + valMap.put("multiplierUp", multiplierUpValueAsString); + } + String multiplierDownValue = getMultiplierDown(); + if (multiplierDownValue != null) { + String multiplierDownValueAsString = multiplierDownValue.toString(); + valMap.put("multiplierDown", multiplierDownValueAsString); + } + Long avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + String avgPriceMinsValueAsString = avgPriceMinsValue.toString(); + valMap.put("avgPriceMins", avgPriceMinsValueAsString); + } + String bidMultiplierUpValue = getBidMultiplierUp(); + if (bidMultiplierUpValue != null) { + String bidMultiplierUpValueAsString = bidMultiplierUpValue.toString(); + valMap.put("bidMultiplierUp", bidMultiplierUpValueAsString); + } + String bidMultiplierDownValue = getBidMultiplierDown(); + if (bidMultiplierDownValue != null) { + String bidMultiplierDownValueAsString = bidMultiplierDownValue.toString(); + valMap.put("bidMultiplierDown", bidMultiplierDownValueAsString); + } + String askMultiplierUpValue = getAskMultiplierUp(); + if (askMultiplierUpValue != null) { + String askMultiplierUpValueAsString = askMultiplierUpValue.toString(); + valMap.put("askMultiplierUp", askMultiplierUpValueAsString); + } + String askMultiplierDownValue = getAskMultiplierDown(); + if (askMultiplierDownValue != null) { + String askMultiplierDownValueAsString = askMultiplierDownValue.toString(); + valMap.put("askMultiplierDown", askMultiplierDownValueAsString); + } + String minQtyValue = getMinQty(); + if (minQtyValue != null) { + String minQtyValueAsString = minQtyValue.toString(); + valMap.put("minQty", minQtyValueAsString); + } + String maxQtyValue = getMaxQty(); + if (maxQtyValue != null) { + String maxQtyValueAsString = maxQtyValue.toString(); + valMap.put("maxQty", maxQtyValueAsString); + } + String stepSizeValue = getStepSize(); + if (stepSizeValue != null) { + String stepSizeValueAsString = stepSizeValue.toString(); + valMap.put("stepSize", stepSizeValueAsString); + } + String minNotionalValue = getMinNotional(); + if (minNotionalValue != null) { + String minNotionalValueAsString = minNotionalValue.toString(); + valMap.put("minNotional", minNotionalValueAsString); + } + Boolean applyToMarketValue = getApplyToMarket(); + if (applyToMarketValue != null) { + String applyToMarketValueAsString = applyToMarketValue.toString(); + valMap.put("applyToMarket", applyToMarketValueAsString); + } + Boolean applyMinToMarketValue = getApplyMinToMarket(); + if (applyMinToMarketValue != null) { + String applyMinToMarketValueAsString = applyMinToMarketValue.toString(); + valMap.put("applyMinToMarket", applyMinToMarketValueAsString); + } + String maxNotionalValue = getMaxNotional(); + if (maxNotionalValue != null) { + String maxNotionalValueAsString = maxNotionalValue.toString(); + valMap.put("maxNotional", maxNotionalValueAsString); + } + Boolean applyMaxToMarketValue = getApplyMaxToMarket(); + if (applyMaxToMarketValue != null) { + String applyMaxToMarketValueAsString = applyMaxToMarketValue.toString(); + valMap.put("applyMaxToMarket", applyMaxToMarketValueAsString); + } + Long limitValue = getLimit(); + if (limitValue != null) { + String limitValueAsString = limitValue.toString(); + valMap.put("limit", limitValueAsString); + } + Long maxNumOrdersValue = getMaxNumOrders(); + if (maxNumOrdersValue != null) { + String maxNumOrdersValueAsString = maxNumOrdersValue.toString(); + valMap.put("maxNumOrders", maxNumOrdersValueAsString); + } + Long maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); + if (maxNumAlgoOrdersValue != null) { + String maxNumAlgoOrdersValueAsString = maxNumAlgoOrdersValue.toString(); + valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValueAsString); + } + Long maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); + if (maxNumIcebergOrdersValue != null) { + String maxNumIcebergOrdersValueAsString = maxNumIcebergOrdersValue.toString(); + valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValueAsString); + } + String maxPositionValue = getMaxPosition(); + if (maxPositionValue != null) { + String maxPositionValueAsString = maxPositionValue.toString(); + valMap.put("maxPosition", maxPositionValueAsString); + } + Long minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); + if (minTrailingAboveDeltaValue != null) { + String minTrailingAboveDeltaValueAsString = minTrailingAboveDeltaValue.toString(); + valMap.put("minTrailingAboveDelta", minTrailingAboveDeltaValueAsString); + } + Long maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); + if (maxTrailingAboveDeltaValue != null) { + String maxTrailingAboveDeltaValueAsString = maxTrailingAboveDeltaValue.toString(); + valMap.put("maxTrailingAboveDelta", maxTrailingAboveDeltaValueAsString); + } + Long minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); + if (minTrailingBelowDeltaValue != null) { + String minTrailingBelowDeltaValueAsString = minTrailingBelowDeltaValue.toString(); + valMap.put("minTrailingBelowDelta", minTrailingBelowDeltaValueAsString); + } + Long maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); + if (maxTrailingBelowDeltaValue != null) { + String maxTrailingBelowDeltaValueAsString = maxTrailingBelowDeltaValue.toString(); + valMap.put("maxTrailingBelowDelta", maxTrailingBelowDeltaValueAsString); + } + + 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 filterTypeValue = getFilterType(); + if (filterTypeValue != null) { + valMap.put("filterType", filterTypeValue); + } + Object minPriceValue = getMinPrice(); + if (minPriceValue != null) { + valMap.put("minPrice", minPriceValue); + } + Object maxPriceValue = getMaxPrice(); + if (maxPriceValue != null) { + valMap.put("maxPrice", maxPriceValue); + } + Object tickSizeValue = getTickSize(); + if (tickSizeValue != null) { + valMap.put("tickSize", tickSizeValue); + } + Object multiplierUpValue = getMultiplierUp(); + if (multiplierUpValue != null) { + valMap.put("multiplierUp", multiplierUpValue); + } + Object multiplierDownValue = getMultiplierDown(); + if (multiplierDownValue != null) { + valMap.put("multiplierDown", multiplierDownValue); + } + Object avgPriceMinsValue = getAvgPriceMins(); + if (avgPriceMinsValue != null) { + valMap.put("avgPriceMins", avgPriceMinsValue); + } + Object bidMultiplierUpValue = getBidMultiplierUp(); + if (bidMultiplierUpValue != null) { + valMap.put("bidMultiplierUp", bidMultiplierUpValue); + } + Object bidMultiplierDownValue = getBidMultiplierDown(); + if (bidMultiplierDownValue != null) { + valMap.put("bidMultiplierDown", bidMultiplierDownValue); + } + Object askMultiplierUpValue = getAskMultiplierUp(); + if (askMultiplierUpValue != null) { + valMap.put("askMultiplierUp", askMultiplierUpValue); + } + Object askMultiplierDownValue = getAskMultiplierDown(); + if (askMultiplierDownValue != null) { + valMap.put("askMultiplierDown", askMultiplierDownValue); + } + Object minQtyValue = getMinQty(); + if (minQtyValue != null) { + valMap.put("minQty", minQtyValue); + } + Object maxQtyValue = getMaxQty(); + if (maxQtyValue != null) { + valMap.put("maxQty", maxQtyValue); + } + Object stepSizeValue = getStepSize(); + if (stepSizeValue != null) { + valMap.put("stepSize", stepSizeValue); + } + Object minNotionalValue = getMinNotional(); + if (minNotionalValue != null) { + valMap.put("minNotional", minNotionalValue); + } + Object applyToMarketValue = getApplyToMarket(); + if (applyToMarketValue != null) { + valMap.put("applyToMarket", applyToMarketValue); + } + Object applyMinToMarketValue = getApplyMinToMarket(); + if (applyMinToMarketValue != null) { + valMap.put("applyMinToMarket", applyMinToMarketValue); + } + Object maxNotionalValue = getMaxNotional(); + if (maxNotionalValue != null) { + valMap.put("maxNotional", maxNotionalValue); + } + Object applyMaxToMarketValue = getApplyMaxToMarket(); + if (applyMaxToMarketValue != null) { + valMap.put("applyMaxToMarket", applyMaxToMarketValue); + } + Object limitValue = getLimit(); + if (limitValue != null) { + valMap.put("limit", limitValue); + } + Object maxNumOrdersValue = getMaxNumOrders(); + if (maxNumOrdersValue != null) { + valMap.put("maxNumOrders", maxNumOrdersValue); + } + Object maxNumAlgoOrdersValue = getMaxNumAlgoOrders(); + if (maxNumAlgoOrdersValue != null) { + valMap.put("maxNumAlgoOrders", maxNumAlgoOrdersValue); + } + Object maxNumIcebergOrdersValue = getMaxNumIcebergOrders(); + if (maxNumIcebergOrdersValue != null) { + valMap.put("maxNumIcebergOrders", maxNumIcebergOrdersValue); + } + Object maxPositionValue = getMaxPosition(); + if (maxPositionValue != null) { + valMap.put("maxPosition", maxPositionValue); + } + Object minTrailingAboveDeltaValue = getMinTrailingAboveDelta(); + if (minTrailingAboveDeltaValue != null) { + valMap.put("minTrailingAboveDelta", minTrailingAboveDeltaValue); + } + Object maxTrailingAboveDeltaValue = getMaxTrailingAboveDelta(); + if (maxTrailingAboveDeltaValue != null) { + valMap.put("maxTrailingAboveDelta", maxTrailingAboveDeltaValue); + } + Object minTrailingBelowDeltaValue = getMinTrailingBelowDelta(); + if (minTrailingBelowDeltaValue != null) { + valMap.put("minTrailingBelowDelta", minTrailingBelowDeltaValue); + } + Object maxTrailingBelowDeltaValue = getMaxTrailingBelowDelta(); + if (maxTrailingBelowDeltaValue != null) { + valMap.put("maxTrailingBelowDelta", maxTrailingBelowDeltaValue); + } + + 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("filterType"); + openapiFields.add("minPrice"); + openapiFields.add("maxPrice"); + openapiFields.add("tickSize"); + openapiFields.add("multiplierUp"); + openapiFields.add("multiplierDown"); + openapiFields.add("avgPriceMins"); + openapiFields.add("bidMultiplierUp"); + openapiFields.add("bidMultiplierDown"); + openapiFields.add("askMultiplierUp"); + openapiFields.add("askMultiplierDown"); + openapiFields.add("minQty"); + openapiFields.add("maxQty"); + openapiFields.add("stepSize"); + openapiFields.add("minNotional"); + openapiFields.add("applyToMarket"); + openapiFields.add("applyMinToMarket"); + openapiFields.add("maxNotional"); + openapiFields.add("applyMaxToMarket"); + openapiFields.add("limit"); + openapiFields.add("maxNumOrders"); + openapiFields.add("maxNumAlgoOrders"); + openapiFields.add("maxNumIcebergOrders"); + openapiFields.add("maxPosition"); + openapiFields.add("minTrailingAboveDelta"); + openapiFields.add("maxTrailingAboveDelta"); + openapiFields.add("minTrailingBelowDelta"); + openapiFields.add("maxTrailingBelowDelta"); + + // 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 ExchangeFiltersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExchangeFiltersInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExchangeFiltersInner is not found in" + + " the empty JSON string", + ExchangeFiltersInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExchangeFiltersInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ExchangeFiltersInner` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("filterType") != null && !jsonObj.get("filterType").isJsonNull()) + && !jsonObj.get("filterType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("filterType").toString())); + } + if ((jsonObj.get("minPrice") != null && !jsonObj.get("minPrice").isJsonNull()) + && !jsonObj.get("minPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("minPrice").toString())); + } + if ((jsonObj.get("maxPrice") != null && !jsonObj.get("maxPrice").isJsonNull()) + && !jsonObj.get("maxPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("maxPrice").toString())); + } + if ((jsonObj.get("tickSize") != null && !jsonObj.get("tickSize").isJsonNull()) + && !jsonObj.get("tickSize").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `tickSize` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("tickSize").toString())); + } + if ((jsonObj.get("multiplierUp") != null && !jsonObj.get("multiplierUp").isJsonNull()) + && !jsonObj.get("multiplierUp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `multiplierUp` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("multiplierUp").toString())); + } + if ((jsonObj.get("multiplierDown") != null && !jsonObj.get("multiplierDown").isJsonNull()) + && !jsonObj.get("multiplierDown").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `multiplierDown` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("multiplierDown").toString())); + } + if ((jsonObj.get("bidMultiplierUp") != null && !jsonObj.get("bidMultiplierUp").isJsonNull()) + && !jsonObj.get("bidMultiplierUp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bidMultiplierUp` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("bidMultiplierUp").toString())); + } + if ((jsonObj.get("bidMultiplierDown") != null + && !jsonObj.get("bidMultiplierDown").isJsonNull()) + && !jsonObj.get("bidMultiplierDown").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bidMultiplierDown` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("bidMultiplierDown").toString())); + } + if ((jsonObj.get("askMultiplierUp") != null && !jsonObj.get("askMultiplierUp").isJsonNull()) + && !jsonObj.get("askMultiplierUp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `askMultiplierUp` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("askMultiplierUp").toString())); + } + if ((jsonObj.get("askMultiplierDown") != null + && !jsonObj.get("askMultiplierDown").isJsonNull()) + && !jsonObj.get("askMultiplierDown").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `askMultiplierDown` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("askMultiplierDown").toString())); + } + if ((jsonObj.get("minQty") != null && !jsonObj.get("minQty").isJsonNull()) + && !jsonObj.get("minQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("minQty").toString())); + } + if ((jsonObj.get("maxQty") != null && !jsonObj.get("maxQty").isJsonNull()) + && !jsonObj.get("maxQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("maxQty").toString())); + } + if ((jsonObj.get("stepSize") != null && !jsonObj.get("stepSize").isJsonNull()) + && !jsonObj.get("stepSize").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `stepSize` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("stepSize").toString())); + } + if ((jsonObj.get("minNotional") != null && !jsonObj.get("minNotional").isJsonNull()) + && !jsonObj.get("minNotional").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `minNotional` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("minNotional").toString())); + } + if ((jsonObj.get("maxNotional") != null && !jsonObj.get("maxNotional").isJsonNull()) + && !jsonObj.get("maxNotional").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxNotional` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("maxNotional").toString())); + } + if ((jsonObj.get("maxPosition") != null && !jsonObj.get("maxPosition").isJsonNull()) + && !jsonObj.get("maxPosition").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxPosition` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("maxPosition").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExchangeFiltersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExchangeFiltersInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ExchangeFiltersInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExchangeFiltersInner value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExchangeFiltersInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExchangeFiltersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExchangeFiltersInner + * @throws IOException if the JSON string is invalid with respect to ExchangeFiltersInner + */ + public static ExchangeFiltersInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExchangeFiltersInner.class); + } + + /** + * Convert an instance of ExchangeFiltersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/RateLimits.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/RateLimits.java new file mode 100644 index 00000000..2c64173e --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/RateLimits.java @@ -0,0 +1,189 @@ +/* + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-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.spot.websocket.stream.model; + +import com.binance.connector.client.spot.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.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.*; + +/** RateLimits */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class RateLimits extends ArrayList { + public RateLimits() {} + + @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 RateLimits {\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 RateLimits + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RateLimits.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RateLimits is not found in the empty" + + " JSON string", + RateLimits.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RateLimits.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RateLimits` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RateLimits.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RateLimits' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RateLimits.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RateLimits value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RateLimits read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RateLimits given an JSON string + * + * @param jsonString JSON string + * @return An instance of RateLimits + * @throws IOException if the JSON string is invalid with respect to RateLimits + */ + public static RateLimits fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RateLimits.class); + } + + /** + * Convert an instance of RateLimits to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse1RateLimitsInner.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/RateLimitsInner.java similarity index 76% rename from clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse1RateLimitsInner.java rename to clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/RateLimitsInner.java index edd3ac18..4832b0ad 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TickerResponse1RateLimitsInner.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/model/RateLimitsInner.java @@ -1,6 +1,6 @@ /* - * Binance Spot WebSocket API - * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * Binance Spot WebSocket Streams + * OpenAPI Specifications for the Binance Spot WebSocket Streams API documents: - [Github web-socket-streams documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) - [General API information for web-socket-streams on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams) * * The version of the OpenAPI document: 1.0.0 * @@ -10,10 +10,10 @@ * Do not edit the class manually. */ -package com.binance.connector.client.spot.websocket.api.model; +package com.binance.connector.client.spot.websocket.stream.model; import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.spot.websocket.api.JSON; +import com.binance.connector.client.spot.websocket.stream.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -34,11 +34,11 @@ import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; -/** TickerResponse1RateLimitsInner */ +/** RateLimitsInner */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class TickerResponse1RateLimitsInner extends BaseDTO { +public class RateLimitsInner extends BaseDTO { public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) @@ -69,10 +69,9 @@ public class TickerResponse1RateLimitsInner extends BaseDTO { @jakarta.annotation.Nullable private Long count; - public TickerResponse1RateLimitsInner() {} + public RateLimitsInner() {} - public TickerResponse1RateLimitsInner rateLimitType( - @jakarta.annotation.Nullable String rateLimitType) { + public RateLimitsInner rateLimitType(@jakarta.annotation.Nullable String rateLimitType) { this.rateLimitType = rateLimitType; return this; } @@ -91,7 +90,7 @@ public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) this.rateLimitType = rateLimitType; } - public TickerResponse1RateLimitsInner interval(@jakarta.annotation.Nullable String interval) { + public RateLimitsInner interval(@jakarta.annotation.Nullable String interval) { this.interval = interval; return this; } @@ -110,8 +109,7 @@ public void setInterval(@jakarta.annotation.Nullable String interval) { this.interval = interval; } - public TickerResponse1RateLimitsInner intervalNum( - @jakarta.annotation.Nullable Long intervalNum) { + public RateLimitsInner intervalNum(@jakarta.annotation.Nullable Long intervalNum) { this.intervalNum = intervalNum; return this; } @@ -130,7 +128,7 @@ public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { this.intervalNum = intervalNum; } - public TickerResponse1RateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { + public RateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { this.limit = limit; return this; } @@ -149,7 +147,7 @@ public void setLimit(@jakarta.annotation.Nullable Long limit) { this.limit = limit; } - public TickerResponse1RateLimitsInner count(@jakarta.annotation.Nullable Long count) { + public RateLimitsInner count(@jakarta.annotation.Nullable Long count) { this.count = count; return this; } @@ -176,13 +174,12 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TickerResponse1RateLimitsInner tickerResponse1RateLimitsInner = - (TickerResponse1RateLimitsInner) o; - return Objects.equals(this.rateLimitType, tickerResponse1RateLimitsInner.rateLimitType) - && Objects.equals(this.interval, tickerResponse1RateLimitsInner.interval) - && Objects.equals(this.intervalNum, tickerResponse1RateLimitsInner.intervalNum) - && Objects.equals(this.limit, tickerResponse1RateLimitsInner.limit) - && Objects.equals(this.count, tickerResponse1RateLimitsInner.count); + RateLimitsInner rateLimitsInner = (RateLimitsInner) o; + return Objects.equals(this.rateLimitType, rateLimitsInner.rateLimitType) + && Objects.equals(this.interval, rateLimitsInner.interval) + && Objects.equals(this.intervalNum, rateLimitsInner.intervalNum) + && Objects.equals(this.limit, rateLimitsInner.limit) + && Objects.equals(this.count, rateLimitsInner.count); } @Override @@ -193,7 +190,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TickerResponse1RateLimitsInner {\n"); + sb.append("class RateLimitsInner {\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"); @@ -303,29 +300,28 @@ private String toIndentedString(Object o) { * 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 - * TickerResponse1RateLimitsInner + * @throws IOException if the JSON Element is invalid with respect to RateLimitsInner */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!TickerResponse1RateLimitsInner.openapiRequiredFields + if (!RateLimitsInner.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in TickerResponse1RateLimitsInner is not" - + " found in the empty JSON string", - TickerResponse1RateLimitsInner.openapiRequiredFields.toString())); + "The required field(s) %s in RateLimitsInner is not found in the" + + " empty JSON string", + RateLimitsInner.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!TickerResponse1RateLimitsInner.openapiFields.contains(entry.getKey())) { + if (!RateLimitsInner.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `TickerResponse1RateLimitsInner` properties. JSON: %s", + + " `RateLimitsInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } @@ -352,27 +348,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!TickerResponse1RateLimitsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TickerResponse1RateLimitsInner' and its - // subtypes + if (!RateLimitsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RateLimitsInner' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(TickerResponse1RateLimitsInner.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RateLimitsInner.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, TickerResponse1RateLimitsInner value) + public void write(JsonWriter out, RateLimitsInner value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public TickerResponse1RateLimitsInner read(JsonReader in) - throws IOException { + public RateLimitsInner read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -382,19 +375,18 @@ public TickerResponse1RateLimitsInner read(JsonReader in) } /** - * Create an instance of TickerResponse1RateLimitsInner given an JSON string + * Create an instance of RateLimitsInner given an JSON string * * @param jsonString JSON string - * @return An instance of TickerResponse1RateLimitsInner - * @throws IOException if the JSON string is invalid with respect to - * TickerResponse1RateLimitsInner + * @return An instance of RateLimitsInner + * @throws IOException if the JSON string is invalid with respect to RateLimitsInner */ - public static TickerResponse1RateLimitsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TickerResponse1RateLimitsInner.class); + public static RateLimitsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RateLimitsInner.class); } /** - * Convert an instance of TickerResponse1RateLimitsInner to an JSON string + * Convert an instance of RateLimitsInner to an JSON string * * @return JSON string */ diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/AccountApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/AccountApiTest.java index 1b9af525..a309ab61 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/AccountApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/AccountApiTest.java @@ -24,10 +24,16 @@ import com.binance.connector.client.common.sign.HmacSignatureGenerator; import com.binance.connector.client.common.sign.SignatureGenerator; import com.binance.connector.client.spot.rest.model.AccountCommissionResponse; +import com.binance.connector.client.spot.rest.model.AllOrderListResponse; +import com.binance.connector.client.spot.rest.model.AllOrdersResponse; import com.binance.connector.client.spot.rest.model.GetAccountResponse; +import com.binance.connector.client.spot.rest.model.GetOpenOrdersResponse; +import com.binance.connector.client.spot.rest.model.GetOrderListResponse; +import com.binance.connector.client.spot.rest.model.GetOrderResponse; import com.binance.connector.client.spot.rest.model.MyAllocationsResponse; import com.binance.connector.client.spot.rest.model.MyPreventedMatchesResponse; import com.binance.connector.client.spot.rest.model.MyTradesResponse; +import com.binance.connector.client.spot.rest.model.OpenOrderListResponse; import com.binance.connector.client.spot.rest.model.RateLimitOrderResponse; import jakarta.validation.constraints.*; import okhttp3.Call; @@ -290,4 +296,210 @@ public void rateLimitOrderTest() throws ApiException, CryptoException { actualRequest.url().queryParameter("signature")); assertEquals("/api/v3/rateLimit/order", actualRequest.url().encodedPath()); } + + /** + * Query all Order lists + * + *

Retrieves all order lists based on provided optional parameters. Note that the time + * between `startTime` and `endTime` can't be longer than 24 hours. + * Weight: 20 + * + * @throws ApiException if the Api call fails + */ + @Test + public void allOrderListTest() throws ApiException, CryptoException { + Long fromId = 1L; + Long startTime = 1735693200000L; + Long endTime = 1735693200000L; + Integer limit = 500; + Long recvWindow = 5000L; + ApiResponse response = + api.allOrderList(fromId, startTime, endTime, limit, recvWindow); + + 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( + "fromId=1&startTime=1735693200000&endTime=1735693200000&limit=500&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "3f96b521ab45f68dea5e3b363c355bdd37bc2834d4ec7457ac7990d2d75178c2", + actualRequest.url().queryParameter("signature")); + assertEquals("/api/v3/allOrderList", actualRequest.url().encodedPath()); + } + + /** + * All orders + * + *

Get all account orders; active, canceled, or filled. Weight: 20 + * + * @throws ApiException if the Api call fails + */ + @Test + public void allOrdersTest() throws ApiException, CryptoException { + String symbol = "BNBUSDT"; + Long orderId = 1L; + Long startTime = 1735693200000L; + Long endTime = 1735693200000L; + Integer limit = 500; + Long recvWindow = 5000L; + ApiResponse response = + api.allOrders(symbol, orderId, startTime, endTime, limit, recvWindow); + + 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( + "symbol=BNBUSDT&orderId=1&startTime=1735693200000&endTime=1735693200000&limit=500&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "7f857866c2bd2678db911c5a1084412d274ea5c0dca24c8cca5c97ba0bc38ea6", + actualRequest.url().queryParameter("signature")); + assertEquals("/api/v3/allOrders", actualRequest.url().encodedPath()); + } + + /** + * Current open orders + * + *

Get all open orders on a symbol. **Careful** when accessing this with no symbol. Weight: 6 + * for a single symbol; **80** when the symbol parameter is omitted + * + * @throws ApiException if the Api call fails + */ + @Test + public void getOpenOrdersTest() throws ApiException, CryptoException { + String symbol = "BNBUSDT"; + Long recvWindow = 5000L; + ApiResponse response = api.getOpenOrders(symbol, recvWindow); + + 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( + "symbol=BNBUSDT&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "1c2ec70499498e5c5d2f4e98a7e24c74f2801642a8c3743d289dbfc1ca00c7a8", + actualRequest.url().queryParameter("signature")); + assertEquals("/api/v3/openOrders", actualRequest.url().encodedPath()); + } + + /** + * Query order + * + *

Check an order's status. Weight: 4 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getOrderTest() throws ApiException, CryptoException { + String symbol = "BNBUSDT"; + Long orderId = 1L; + String origClientOrderId = ""; + Long recvWindow = 5000L; + ApiResponse response = + api.getOrder(symbol, orderId, origClientOrderId, recvWindow); + + 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( + "symbol=BNBUSDT&orderId=1&origClientOrderId=&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "7df47f2422bd464ff42ac1a57d75c3296c3fd7867f50fd803ad466992b26ef0c", + actualRequest.url().queryParameter("signature")); + assertEquals("/api/v3/order", actualRequest.url().encodedPath()); + } + + /** + * Query Order list + * + *

Retrieves a specific order list based on provided optional parameters. Weight: 4 + * + * @throws ApiException if the Api call fails + */ + @Test + public void getOrderListTest() throws ApiException, CryptoException { + Long orderListId = 1L; + String origClientOrderId = ""; + Long recvWindow = 5000L; + ApiResponse response = + api.getOrderList(orderListId, origClientOrderId, recvWindow); + + 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( + "orderListId=1&origClientOrderId=&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); + assertEquals( + "6ec9556d1bd19774835e1c8987ff1d260c57f711747a39d4ea50c5e10b099d72", + actualRequest.url().queryParameter("signature")); + assertEquals("/api/v3/orderList", actualRequest.url().encodedPath()); + } + + /** + * Query Open Order lists + * + *

Weight: 6 + * + * @throws ApiException if the Api call fails + */ + @Test + public void openOrderListTest() throws ApiException, CryptoException { + Long recvWindow = 5000L; + ApiResponse response = api.openOrderList(recvWindow); + + 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("recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); + assertEquals( + "2cdd1e484bce80021437bee6b762e6a276b1954c3a0c011a16f6f2f6a47aba75", + actualRequest.url().queryParameter("signature")); + assertEquals("/api/v3/openOrderList", actualRequest.url().encodedPath()); + } } diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/TradeApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/TradeApiTest.java index 07edfcea..e0d059e4 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/TradeApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/rest/api/TradeApiTest.java @@ -112,81 +112,6 @@ public void initApiClient() throws ApiException { api = new TradeApi(apiClientSpy); } - /** - * Query all Order lists - * - *

Retrieves all order lists based on provided optional parameters. Note that the time - * between `startTime` and `endTime` can't be longer than 24 hours. - * Weight: 20 - * - * @throws ApiException if the Api call fails - */ - @Test - public void allOrderListTest() throws ApiException, CryptoException { - Long fromId = 1L; - Long startTime = 1735693200000L; - Long endTime = 1735693200000L; - Integer limit = 500; - Long recvWindow = 5000L; - ApiResponse response = - api.allOrderList(fromId, startTime, endTime, limit, recvWindow); - - 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( - "fromId=1&startTime=1735693200000&endTime=1735693200000&limit=500&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "3f96b521ab45f68dea5e3b363c355bdd37bc2834d4ec7457ac7990d2d75178c2", - actualRequest.url().queryParameter("signature")); - assertEquals("/api/v3/allOrderList", actualRequest.url().encodedPath()); - } - - /** - * All orders - * - *

Get all account orders; active, canceled, or filled. Weight: 20 - * - * @throws ApiException if the Api call fails - */ - @Test - public void allOrdersTest() throws ApiException, CryptoException { - String symbol = "BNBUSDT"; - Long orderId = 1L; - Long startTime = 1735693200000L; - Long endTime = 1735693200000L; - Integer limit = 500; - Long recvWindow = 5000L; - ApiResponse response = - api.allOrders(symbol, orderId, startTime, endTime, limit, recvWindow); - - 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( - "symbol=BNBUSDT&orderId=1&startTime=1735693200000&endTime=1735693200000&limit=500&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "7f857866c2bd2678db911c5a1084412d274ea5c0dca24c8cca5c97ba0bc38ea6", - actualRequest.url().queryParameter("signature")); - assertEquals("/api/v3/allOrders", actualRequest.url().encodedPath()); - } - /** * Cancel All Open Orders on a Symbol * @@ -300,108 +225,6 @@ public void deleteOrderListTest() throws ApiException, CryptoException { assertEquals("/api/v3/orderList", actualRequest.url().encodedPath()); } - /** - * Current open orders - * - *

Get all open orders on a symbol. **Careful** when accessing this with no symbol. Weight: 6 - * for a single symbol; **80** when the symbol parameter is omitted - * - * @throws ApiException if the Api call fails - */ - @Test - public void getOpenOrdersTest() throws ApiException, CryptoException { - String symbol = "BNBUSDT"; - Long recvWindow = 5000L; - ApiResponse response = api.getOpenOrders(symbol, recvWindow); - - 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( - "symbol=BNBUSDT&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "1c2ec70499498e5c5d2f4e98a7e24c74f2801642a8c3743d289dbfc1ca00c7a8", - actualRequest.url().queryParameter("signature")); - assertEquals("/api/v3/openOrders", actualRequest.url().encodedPath()); - } - - /** - * Query order - * - *

Check an order's status. Weight: 4 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getOrderTest() throws ApiException, CryptoException { - String symbol = "BNBUSDT"; - Long orderId = 1L; - String origClientOrderId = ""; - Long recvWindow = 5000L; - ApiResponse response = - api.getOrder(symbol, orderId, origClientOrderId, recvWindow); - - 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( - "symbol=BNBUSDT&orderId=1&origClientOrderId=&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "7df47f2422bd464ff42ac1a57d75c3296c3fd7867f50fd803ad466992b26ef0c", - actualRequest.url().queryParameter("signature")); - assertEquals("/api/v3/order", actualRequest.url().encodedPath()); - } - - /** - * Query Order list - * - *

Retrieves a specific order list based on provided optional parameters. Weight: 4 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getOrderListTest() throws ApiException, CryptoException { - Long orderListId = 1L; - String origClientOrderId = ""; - Long recvWindow = 5000L; - ApiResponse response = - api.getOrderList(orderListId, origClientOrderId, recvWindow); - - 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( - "orderListId=1&origClientOrderId=&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "6ec9556d1bd19774835e1c8987ff1d260c57f711747a39d4ea50c5e10b099d72", - actualRequest.url().queryParameter("signature")); - assertEquals("/api/v3/orderList", actualRequest.url().encodedPath()); - } - /** * New order * @@ -438,35 +261,6 @@ public void newOrderTest() throws ApiException, CryptoException { assertEquals("/api/v3/order", actualRequest.url().encodedPath()); } - /** - * Query Open Order lists - * - *

Weight: 6 - * - * @throws ApiException if the Api call fails - */ - @Test - public void openOrderListTest() throws ApiException, CryptoException { - Long recvWindow = 5000L; - ApiResponse response = api.openOrderList(recvWindow); - - 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("recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); - assertEquals( - "2cdd1e484bce80021437bee6b762e6a276b1954c3a0c011a16f6f2f6a47aba75", - actualRequest.url().queryParameter("signature")); - assertEquals("/api/v3/openOrderList", actualRequest.url().encodedPath()); - } - /** * Cancel an Existing Order and Send a New Order * diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/AccountApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/AccountApiTest.java index 93fd192a..7b1ed213 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/AccountApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/AccountApiTest.java @@ -42,6 +42,12 @@ import java.nio.file.Paths; import java.util.concurrent.CompletableFuture; +import com.binance.connector.client.spot.websocket.api.model.OpenOrdersStatusRequest; +import com.binance.connector.client.spot.websocket.api.model.OpenOrdersStatusResponse; +import com.binance.connector.client.spot.websocket.api.model.OrderListStatusRequest; +import com.binance.connector.client.spot.websocket.api.model.OrderListStatusResponse; +import com.binance.connector.client.spot.websocket.api.model.OrderStatusRequest; +import com.binance.connector.client.spot.websocket.api.model.OrderStatusResponse; import org.eclipse.jetty.websocket.api.RemoteEndpoint; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.client.WebSocketClient; @@ -339,4 +345,100 @@ public void myTradesTest() throws ApiException, URISyntaxException, IOException String expectedJson = Files.readString(Paths.get(resource.toURI())); JSONAssert.assertEquals(expectedJson, sentPayload, true); } + + /** + * WebSocket Current open orders + * + *

Query execution status of all open orders. If you need to continuously monitor order + * status updates, please consider using WebSocket Streams: * `userDataStream.start` + * request * `executionReport` user data stream event Weight: Adjusted based on the + * number of requested symbols: | Parameter | Weight | | --------- | ------ | | + * `symbol` | 6 | | none | 80 | + * + * @throws ApiException if the Api call fails + */ + @Test + public void openOrdersStatusTest() throws ApiException, URISyntaxException, IOException { + OpenOrdersStatusRequest openOrdersStatusRequest = new OpenOrdersStatusRequest(); + CompletableFuture response = + api.openOrdersStatus(openOrdersStatusRequest); + ArgumentCaptor> + callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); + Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); + ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); + RemoteEndpoint remote = sessionMock.getRemote(); + Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); + RequestWrapperDTO requestWrapperDTO = + callArgumentCaptor.getValue(); + OpenOrdersStatusRequest params = requestWrapperDTO.getParams(); + String sentPayload = sendArgumentCaptor.getValue(); + + URL resource = + TradeApiTest.class.getResource( + "/expected/api/TradeApi/openOrders.status-test.json"); + String expectedJson = Files.readString(Paths.get(resource.toURI())); + + JSONAssert.assertEquals(expectedJson, sentPayload, true); + } + + /** + * WebSocket Query Order list + * + *

Check execution status of an Order list. For execution status of individual orders, use + * `order.status`. Weight: 4 + * + * @throws ApiException if the Api call fails + */ + @Test + public void orderListStatusTest() throws ApiException, URISyntaxException, IOException { + OrderListStatusRequest orderListStatusRequest = new OrderListStatusRequest(); + CompletableFuture response = + api.orderListStatus(orderListStatusRequest); + ArgumentCaptor> + callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); + Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); + ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); + RemoteEndpoint remote = sessionMock.getRemote(); + Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); + RequestWrapperDTO requestWrapperDTO = + callArgumentCaptor.getValue(); + OrderListStatusRequest params = requestWrapperDTO.getParams(); + String sentPayload = sendArgumentCaptor.getValue(); + + URL resource = + TradeApiTest.class.getResource("/expected/api/TradeApi/orderList.status-test.json"); + String expectedJson = Files.readString(Paths.get(resource.toURI())); + + JSONAssert.assertEquals(expectedJson, sentPayload, true); + } + + /** + * WebSocket Query order + * + *

Check execution status of an order. Weight: 4 + * + * @throws ApiException if the Api call fails + */ + @Test + public void orderStatusTest() throws ApiException, URISyntaxException, IOException { + OrderStatusRequest orderStatusRequest = new OrderStatusRequest(); + orderStatusRequest.setSymbol("BTCUSDT"); + CompletableFuture response = api.orderStatus(orderStatusRequest); + ArgumentCaptor> + callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); + Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); + ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); + RemoteEndpoint remote = sessionMock.getRemote(); + Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); + RequestWrapperDTO requestWrapperDTO = + callArgumentCaptor.getValue(); + OrderStatusRequest params = requestWrapperDTO.getParams(); + String sentPayload = sendArgumentCaptor.getValue(); + + URL resource = + TradeApiTest.class.getResource("/expected/api/TradeApi/order.status-test.json"); + String expectedJson = Files.readString(Paths.get(resource.toURI())); + + JSONAssert.assertEquals(expectedJson, sentPayload, true); + } } diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/TradeApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/TradeApiTest.java index 9fe2454e..fd2492ec 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/TradeApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/TradeApiTest.java @@ -118,39 +118,6 @@ public void initApiClient() throws Exception { Mockito.doReturn("eaf3292c-64b6-4c04-ad4f-4ca2608b42b4").when(api).getRequestID(); } - /** - * WebSocket Current open Order lists - * - *

Query execution status of all open order lists. If you need to continuously monitor order - * status updates, please consider using WebSocket Streams: * `userDataStream.start` - * request * `executionReport` user data stream event Weight: 6 - * - * @throws ApiException if the Api call fails - */ - @Test - public void openOrderListsStatusTest() throws ApiException, URISyntaxException, IOException { - OpenOrderListsStatusRequest openOrderListsStatusRequest = new OpenOrderListsStatusRequest(); - CompletableFuture response = - api.openOrderListsStatus(openOrderListsStatusRequest); - ArgumentCaptor> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO - requestWrapperDTO = callArgumentCaptor.getValue(); - OpenOrderListsStatusRequest params = requestWrapperDTO.getParams(); - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - TradeApiTest.class.getResource( - "/expected/api/TradeApi/openOrderLists.status-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - /** * WebSocket Cancel open orders * @@ -184,41 +151,6 @@ public void openOrdersCancelAllTest() throws ApiException, URISyntaxException, I JSONAssert.assertEquals(expectedJson, sentPayload, true); } - /** - * WebSocket Current open orders - * - *

Query execution status of all open orders. If you need to continuously monitor order - * status updates, please consider using WebSocket Streams: * `userDataStream.start` - * request * `executionReport` user data stream event Weight: Adjusted based on the - * number of requested symbols: | Parameter | Weight | | --------- | ------ | | - * `symbol` | 6 | | none | 80 | - * - * @throws ApiException if the Api call fails - */ - @Test - public void openOrdersStatusTest() throws ApiException, URISyntaxException, IOException { - OpenOrdersStatusRequest openOrdersStatusRequest = new OpenOrdersStatusRequest(); - CompletableFuture response = - api.openOrdersStatus(openOrdersStatusRequest); - ArgumentCaptor> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO requestWrapperDTO = - callArgumentCaptor.getValue(); - OpenOrdersStatusRequest params = requestWrapperDTO.getParams(); - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - TradeApiTest.class.getResource( - "/expected/api/TradeApi/openOrders.status-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - /** * WebSocket Cancel order * @@ -495,37 +427,6 @@ public void orderListPlaceOtocoTest() throws ApiException, URISyntaxException, I JSONAssert.assertEquals(expectedJson, sentPayload, true); } - /** - * WebSocket Query Order list - * - *

Check execution status of an Order list. For execution status of individual orders, use - * `order.status`. Weight: 4 - * - * @throws ApiException if the Api call fails - */ - @Test - public void orderListStatusTest() throws ApiException, URISyntaxException, IOException { - OrderListStatusRequest orderListStatusRequest = new OrderListStatusRequest(); - CompletableFuture response = - api.orderListStatus(orderListStatusRequest); - ArgumentCaptor> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO requestWrapperDTO = - callArgumentCaptor.getValue(); - OrderListStatusRequest params = requestWrapperDTO.getParams(); - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - TradeApiTest.class.getResource("/expected/api/TradeApi/orderList.status-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - /** * WebSocket Place new order * @@ -556,36 +457,6 @@ public void orderPlaceTest() throws ApiException, URISyntaxException, IOExceptio JSONAssert.assertEquals(expectedJson, sentPayload, true); } - /** - * WebSocket Query order - * - *

Check execution status of an order. Weight: 4 - * - * @throws ApiException if the Api call fails - */ - @Test - public void orderStatusTest() throws ApiException, URISyntaxException, IOException { - OrderStatusRequest orderStatusRequest = new OrderStatusRequest(); - orderStatusRequest.setSymbol("BTCUSDT"); - CompletableFuture response = api.orderStatus(orderStatusRequest); - ArgumentCaptor> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO requestWrapperDTO = - callArgumentCaptor.getValue(); - OrderStatusRequest params = requestWrapperDTO.getParams(); - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - TradeApiTest.class.getResource("/expected/api/TradeApi/order.status-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - /** * WebSocket Test new order * diff --git a/examples/derivatives-trading-coin-futures/pom.xml b/examples/derivatives-trading-coin-futures/pom.xml index 7d3ce1e2..9dde4602 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 - 1.2.0 + 1.2.1 \ No newline at end of file diff --git a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/ModifyIsolatedPositionMarginExample.java b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/ModifyIsolatedPositionMarginExample.java index 3cae2f12..c6efb48c 100644 --- a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/ModifyIsolatedPositionMarginExample.java +++ b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/ModifyIsolatedPositionMarginExample.java @@ -50,7 +50,7 @@ public void modifyIsolatedPositionMarginExample() throws ApiException { ModifyIsolatedPositionMarginRequest modifyIsolatedPositionMarginRequest = new ModifyIsolatedPositionMarginRequest(); modifyIsolatedPositionMarginRequest.symbol(""); - modifyIsolatedPositionMarginRequest.amount(1d); + modifyIsolatedPositionMarginRequest.amount(1.0d); modifyIsolatedPositionMarginRequest.type(Type.LIMIT); ApiResponse response = getApi().modifyIsolatedPositionMargin(modifyIsolatedPositionMarginRequest); diff --git a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/ModifyOrderExample.java b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/ModifyOrderExample.java index dd669066..60c91d0b 100644 --- a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/ModifyOrderExample.java +++ b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/ModifyOrderExample.java @@ -51,8 +51,7 @@ public DerivativesTradingCoinFuturesRestApi getApi() { * will be cancelled by the amendment in the following situations: * when the order is in * partially filled status and the new `quantity` <= `executedQty` * * When the order is `GTX` and the new price will cause it to be executed immediately - * * One order can only be modfied for less than 10000 times * Modify order will set - * `selfTradePreventionMode` to `NONE` Weight: 1 + * * One order can only be modfied for less than 10000 times Weight: 1 * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/ModifyOrderExample.java b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/ModifyOrderExample.java index bc7f5eef..af760715 100644 --- a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/ModifyOrderExample.java +++ b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/trade/ModifyOrderExample.java @@ -59,8 +59,8 @@ public void modifyOrderExampleAsync() { ModifyOrderRequest modifyOrderRequest = new ModifyOrderRequest(); modifyOrderRequest.symbol(""); modifyOrderRequest.side(Side.BUY); - modifyOrderRequest.quantity(1d); - modifyOrderRequest.price(1d); + modifyOrderRequest.quantity(1.0d); + modifyOrderRequest.price(1.0d); CompletableFuture future = getApi().modifyOrder(modifyOrderRequest); future.handle( (response, error) -> { @@ -92,8 +92,8 @@ public void modifyOrderExampleSync() { ModifyOrderRequest modifyOrderRequest = new ModifyOrderRequest(); modifyOrderRequest.symbol(""); modifyOrderRequest.side(Side.BUY); - modifyOrderRequest.quantity(1d); - modifyOrderRequest.price(1d); + modifyOrderRequest.quantity(1.0d); + modifyOrderRequest.price(1.0d); CompletableFuture future = getApi().modifyOrder(modifyOrderRequest); ModifyOrderResponse response = future.join(); System.out.println(response); diff --git a/examples/derivatives-trading-portfolio-margin/pom.xml b/examples/derivatives-trading-portfolio-margin/pom.xml index 8dba4bfc..056afcac 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 - 1.1.0 + 1.2.0 \ No newline at end of file diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/BnbTransferExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/BnbTransferExample.java index 72dba587..f5693eea 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/BnbTransferExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/account/BnbTransferExample.java @@ -48,7 +48,7 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { */ public void bnbTransferExample() throws ApiException { BnbTransferRequest bnbTransferRequest = new BnbTransferRequest(); - bnbTransferRequest.amount(1d); + bnbTransferRequest.amount(1.0d); bnbTransferRequest.transferSide(""); ApiResponse response = getApi().bnbTransfer(bnbTransferRequest); System.out.println(response.getData()); diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/MarginAccountBorrowExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/MarginAccountBorrowExample.java index 407da9a4..231bb33e 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/MarginAccountBorrowExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/MarginAccountBorrowExample.java @@ -48,7 +48,7 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { public void marginAccountBorrowExample() throws ApiException { MarginAccountBorrowRequest marginAccountBorrowRequest = new MarginAccountBorrowRequest(); marginAccountBorrowRequest.asset(""); - marginAccountBorrowRequest.amount(1d); + marginAccountBorrowRequest.amount(1.0d); ApiResponse response = getApi().marginAccountBorrow(marginAccountBorrowRequest); System.out.println(response.getData()); diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/MarginAccountNewOcoExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/MarginAccountNewOcoExample.java index 528feb39..b77238a8 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/MarginAccountNewOcoExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/MarginAccountNewOcoExample.java @@ -54,9 +54,9 @@ public void marginAccountNewOcoExample() throws ApiException { MarginAccountNewOcoRequest marginAccountNewOcoRequest = new MarginAccountNewOcoRequest(); marginAccountNewOcoRequest.symbol(""); marginAccountNewOcoRequest.side(Side.BUY); - marginAccountNewOcoRequest.quantity(1d); - marginAccountNewOcoRequest.price(1d); - marginAccountNewOcoRequest.stopPrice(1d); + marginAccountNewOcoRequest.quantity(1.0d); + marginAccountNewOcoRequest.price(1.0d); + marginAccountNewOcoRequest.stopPrice(1.0d); ApiResponse response = getApi().marginAccountNewOco(marginAccountNewOcoRequest); System.out.println(response.getData()); diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/MarginAccountRepayExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/MarginAccountRepayExample.java index 5dd3884d..dc58f20a 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/MarginAccountRepayExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/MarginAccountRepayExample.java @@ -48,7 +48,7 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { public void marginAccountRepayExample() throws ApiException { MarginAccountRepayRequest marginAccountRepayRequest = new MarginAccountRepayRequest(); marginAccountRepayRequest.asset(""); - marginAccountRepayRequest.amount(1d); + marginAccountRepayRequest.amount(1.0d); ApiResponse response = getApi().marginAccountRepay(marginAccountRepayRequest); System.out.println(response.getData()); diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/ModifyCmOrderExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/ModifyCmOrderExample.java index dbb771e1..d6a14137 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/ModifyCmOrderExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/ModifyCmOrderExample.java @@ -59,8 +59,8 @@ public void modifyCmOrderExample() throws ApiException { ModifyCmOrderRequest modifyCmOrderRequest = new ModifyCmOrderRequest(); modifyCmOrderRequest.symbol(""); modifyCmOrderRequest.side(Side.BUY); - modifyCmOrderRequest.quantity(1d); - modifyCmOrderRequest.price(1d); + modifyCmOrderRequest.quantity(1.0d); + modifyCmOrderRequest.price(1.0d); ApiResponse response = getApi().modifyCmOrder(modifyCmOrderRequest); System.out.println(response.getData()); } diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/ModifyUmOrderExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/ModifyUmOrderExample.java index 1b097cac..a49e4b7d 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/ModifyUmOrderExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/ModifyUmOrderExample.java @@ -57,8 +57,8 @@ public void modifyUmOrderExample() throws ApiException { ModifyUmOrderRequest modifyUmOrderRequest = new ModifyUmOrderRequest(); modifyUmOrderRequest.symbol(""); modifyUmOrderRequest.side(Side.BUY); - modifyUmOrderRequest.quantity(1d); - modifyUmOrderRequest.price(1d); + modifyUmOrderRequest.quantity(1.0d); + modifyUmOrderRequest.price(1.0d); ApiResponse response = getApi().modifyUmOrder(modifyUmOrderRequest); System.out.println(response.getData()); } diff --git a/examples/derivatives-trading-usds-futures/pom.xml b/examples/derivatives-trading-usds-futures/pom.xml index 037a8950..8699f0ec 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 - 2.0.0 + 2.0.1 \ 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/trade/ModifyIsolatedPositionMarginExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/ModifyIsolatedPositionMarginExample.java index b23e20c6..54af0787 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/ModifyIsolatedPositionMarginExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/ModifyIsolatedPositionMarginExample.java @@ -49,7 +49,7 @@ public void modifyIsolatedPositionMarginExample() throws ApiException { ModifyIsolatedPositionMarginRequest modifyIsolatedPositionMarginRequest = new ModifyIsolatedPositionMarginRequest(); modifyIsolatedPositionMarginRequest.symbol(""); - modifyIsolatedPositionMarginRequest.amount(1d); + modifyIsolatedPositionMarginRequest.amount(1.0d); modifyIsolatedPositionMarginRequest.type(""); ApiResponse response = getApi().modifyIsolatedPositionMargin(modifyIsolatedPositionMarginRequest); diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/ModifyOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/ModifyOrderExample.java index e6ab9c38..594b838e 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/ModifyOrderExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/ModifyOrderExample.java @@ -61,8 +61,8 @@ public void modifyOrderExample() throws ApiException { ModifyOrderRequest modifyOrderRequest = new ModifyOrderRequest(); modifyOrderRequest.symbol(""); modifyOrderRequest.side(Side.BUY); - modifyOrderRequest.quantity(1d); - modifyOrderRequest.price(1d); + modifyOrderRequest.quantity(1.0d); + modifyOrderRequest.price(1.0d); ApiResponse response = getApi().modifyOrder(modifyOrderRequest); 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/trade/ModifyOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/ModifyOrderExample.java index 7d863bd6..ff751c69 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/ModifyOrderExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/ModifyOrderExample.java @@ -59,8 +59,8 @@ public void modifyOrderExampleAsync() { ModifyOrderRequest modifyOrderRequest = new ModifyOrderRequest(); modifyOrderRequest.symbol(""); modifyOrderRequest.side(Side.BUY); - modifyOrderRequest.quantity(1d); - modifyOrderRequest.price(1d); + modifyOrderRequest.quantity(1.0d); + modifyOrderRequest.price(1.0d); CompletableFuture future = getApi().modifyOrder(modifyOrderRequest); future.handle( (response, error) -> { @@ -92,8 +92,8 @@ public void modifyOrderExampleSync() { ModifyOrderRequest modifyOrderRequest = new ModifyOrderRequest(); modifyOrderRequest.symbol(""); modifyOrderRequest.side(Side.BUY); - modifyOrderRequest.quantity(1d); - modifyOrderRequest.price(1d); + modifyOrderRequest.quantity(1.0d); + modifyOrderRequest.price(1.0d); CompletableFuture future = getApi().modifyOrder(modifyOrderRequest); ModifyOrderResponse response = future.join(); System.out.println(response); diff --git a/examples/spot/pom.xml b/examples/spot/pom.xml index 72be838c..767d8b63 100644 --- a/examples/spot/pom.xml +++ b/examples/spot/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-spot - 2.0.0 + 3.0.0 \ No newline at end of file diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/AllOrderListExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/AllOrderListExample.java similarity index 96% rename from examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/AllOrderListExample.java rename to examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/AllOrderListExample.java index df550086..0bd979bc 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/AllOrderListExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/AllOrderListExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.spot.rest.trade; +package com.binance.connector.client.spot.rest.account; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.spot.rest.api.SpotRestApi; import com.binance.connector.client.spot.rest.model.AllOrderListResponse; -/** API examples for TradeApi */ +/** API examples for AccountApi */ public class AllOrderListExample { private SpotRestApi api; diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/AllOrdersExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/AllOrdersExample.java similarity index 96% rename from examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/AllOrdersExample.java rename to examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/AllOrdersExample.java index 92265d2b..bbdb57d7 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/AllOrdersExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/AllOrdersExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.spot.rest.trade; +package com.binance.connector.client.spot.rest.account; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.spot.rest.api.SpotRestApi; import com.binance.connector.client.spot.rest.model.AllOrdersResponse; -/** API examples for TradeApi */ +/** API examples for AccountApi */ public class AllOrdersExample { private SpotRestApi api; diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/GetOpenOrdersExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOpenOrdersExample.java similarity index 96% rename from examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/GetOpenOrdersExample.java rename to examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOpenOrdersExample.java index 18d881a4..96997e11 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/GetOpenOrdersExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOpenOrdersExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.spot.rest.trade; +package com.binance.connector.client.spot.rest.account; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.spot.rest.api.SpotRestApi; import com.binance.connector.client.spot.rest.model.GetOpenOrdersResponse; -/** API examples for TradeApi */ +/** API examples for AccountApi */ public class GetOpenOrdersExample { private SpotRestApi api; diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/GetOrderExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOrderExample.java similarity index 96% rename from examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/GetOrderExample.java rename to examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOrderExample.java index 8943c91b..1357a836 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/GetOrderExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOrderExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.spot.rest.trade; +package com.binance.connector.client.spot.rest.account; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.spot.rest.api.SpotRestApi; import com.binance.connector.client.spot.rest.model.GetOrderResponse; -/** API examples for TradeApi */ +/** API examples for AccountApi */ public class GetOrderExample { private SpotRestApi api; diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/GetOrderListExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOrderListExample.java similarity index 96% rename from examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/GetOrderListExample.java rename to examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOrderListExample.java index b54c51ea..f043dacb 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/GetOrderListExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/GetOrderListExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.spot.rest.trade; +package com.binance.connector.client.spot.rest.account; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.spot.rest.api.SpotRestApi; import com.binance.connector.client.spot.rest.model.GetOrderListResponse; -/** API examples for TradeApi */ +/** API examples for AccountApi */ public class GetOrderListExample { private SpotRestApi api; diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OpenOrderListExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/OpenOrderListExample.java similarity index 95% rename from examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OpenOrderListExample.java rename to examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/OpenOrderListExample.java index 05bb7b34..0f84bdfa 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OpenOrderListExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/account/OpenOrderListExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.spot.rest.trade; +package com.binance.connector.client.spot.rest.account; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -20,7 +20,7 @@ import com.binance.connector.client.spot.rest.api.SpotRestApi; import com.binance.connector.client.spot.rest.model.OpenOrderListResponse; -/** API examples for TradeApi */ +/** API examples for AccountApi */ public class OpenOrderListExample { private SpotRestApi api; diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OrderListOtoExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OrderListOtoExample.java index a088fdb3..f26995e0 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OrderListOtoExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/rest/trade/OrderListOtoExample.java @@ -44,7 +44,7 @@ public SpotRestApi getApi() { /** * New Order list - OTO * - *

Places an OTO. * An OTO (One-Triggers-the-Other) is an order list comprised of 2 orders. * + *

Place an OTO. * An OTO (One-Triggers-the-Other) is an order list comprised of 2 orders. * * The first order is called the **working order** and must be `LIMIT` or * `LIMIT_MAKER`. Initially, only the working order goes on the order book. * The * second order is called the **pending order**. It can be any order type except for diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AllOrderListsExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AllOrderListsExample.java index 4b4bbcad..f4dddc4e 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AllOrderListsExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/AllOrderListsExample.java @@ -39,7 +39,7 @@ public SpotWebSocketApi getApi() { } /** - * WebSocket Account Order list history + * WebSocket Account order list history * *

Query information about all your order lists, filtered by time range. Weight: 20 */ @@ -58,7 +58,7 @@ public void allOrderListsExampleAsync() { } /** - * WebSocket Account Order list history + * WebSocket Account order list history * *

Query information about all your order lists, filtered by time range. Weight: 20 */ diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OpenOrderListsStatusExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrderListsStatusExample.java similarity index 97% rename from examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OpenOrderListsStatusExample.java rename to examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrderListsStatusExample.java index 5849daef..7a9665e5 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OpenOrderListsStatusExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrderListsStatusExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.spot.websocket.api.trade; +package com.binance.connector.client.spot.websocket.api.account; import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; @@ -20,7 +20,7 @@ import com.binance.connector.client.spot.websocket.api.model.OpenOrderListsStatusResponse; import java.util.concurrent.CompletableFuture; -/** API examples for TradeApi */ +/** API examples for AccountApi */ public class OpenOrderListsStatusExample { private SpotWebSocketApi api; diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OpenOrdersStatusExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrdersStatusExample.java similarity index 97% rename from examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OpenOrdersStatusExample.java rename to examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrdersStatusExample.java index 7e3bf4ff..806d5809 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OpenOrdersStatusExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OpenOrdersStatusExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.spot.websocket.api.trade; +package com.binance.connector.client.spot.websocket.api.account; import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; @@ -20,7 +20,7 @@ import com.binance.connector.client.spot.websocket.api.model.OpenOrdersStatusResponse; import java.util.concurrent.CompletableFuture; -/** API examples for TradeApi */ +/** API examples for AccountApi */ public class OpenOrdersStatusExample { private SpotWebSocketApi api; diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListStatusExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderListStatusExample.java similarity index 96% rename from examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListStatusExample.java rename to examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderListStatusExample.java index 07dcc779..d875e4f7 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListStatusExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderListStatusExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.spot.websocket.api.trade; +package com.binance.connector.client.spot.websocket.api.account; import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; @@ -20,7 +20,7 @@ import com.binance.connector.client.spot.websocket.api.model.OrderListStatusResponse; import java.util.concurrent.CompletableFuture; -/** API examples for TradeApi */ +/** API examples for AccountApi */ public class OrderListStatusExample { private SpotWebSocketApi api; diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderStatusExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderStatusExample.java similarity index 96% rename from examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderStatusExample.java rename to examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderStatusExample.java index a66c87fe..3a167760 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderStatusExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/account/OrderStatusExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.spot.websocket.api.trade; +package com.binance.connector.client.spot.websocket.api.account; import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; @@ -20,7 +20,7 @@ import com.binance.connector.client.spot.websocket.api.model.OrderStatusResponse; import java.util.concurrent.CompletableFuture; -/** API examples for TradeApi */ +/** API examples for AccountApi */ public class OrderStatusExample { private SpotWebSocketApi api; diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/PingExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/PingExample.java index d8a5f503..3b7138c6 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/PingExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/general/PingExample.java @@ -16,6 +16,8 @@ import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; import com.binance.connector.client.spot.websocket.api.SpotWebSocketApiUtil; import com.binance.connector.client.spot.websocket.api.api.SpotWebSocketApi; +import com.binance.connector.client.spot.websocket.api.model.PingResponse; +import java.util.concurrent.CompletableFuture; /** API examples for GeneralApi */ public class PingExample { @@ -40,7 +42,26 @@ public SpotWebSocketApi getApi() { * *

Test connectivity to the WebSocket API. Weight: 1 */ - public void pingExample() { - getApi().ping(); + public void pingExampleAsync() { + CompletableFuture future = getApi().ping(); + future.handle( + (response, error) -> { + if (error != null) { + System.err.println(error); + } + System.out.println(response); + return response; + }); + } + + /** + * WebSocket Test connectivity + * + *

Test connectivity to the WebSocket API. Weight: 1 + */ + public void pingExampleSync() { + CompletableFuture future = getApi().ping(); + PingResponse response = future.join(); + System.out.println(response); } } diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOcoExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOcoExample.java index a7d1f612..30305dde 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOcoExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOcoExample.java @@ -44,7 +44,7 @@ public SpotWebSocketApi getApi() { /** * WebSocket Place new Order list - OCO * - *

Send in an one-cancels the other (OCO) pair, where activation of one order immediately + *

Send in an one-cancels-the-other (OCO) pair, where activation of one order immediately * cancels the other. * An OCO has 2 orders called the **above order** and **below order**. * * One of the orders must be a `LIMIT_MAKER/TAKE_PROFIT/TAKE_PROFIT_LIMIT` order and * the other must be `STOP_LOSS` or `STOP_LOSS_LIMIT` order. * Price @@ -80,7 +80,7 @@ public void orderListPlaceOcoExampleAsync() { /** * WebSocket Place new Order list - OCO * - *

Send in an one-cancels the other (OCO) pair, where activation of one order immediately + *

Send in an one-cancels-the-other (OCO) pair, where activation of one order immediately * cancels the other. * An OCO has 2 orders called the **above order** and **below order**. * * One of the orders must be a `LIMIT_MAKER/TAKE_PROFIT/TAKE_PROFIT_LIMIT` order and * the other must be `STOP_LOSS` or `STOP_LOSS_LIMIT` order. * Price diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtoExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtoExample.java index 7e24f39a..6629ea88 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtoExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtoExample.java @@ -52,9 +52,12 @@ public SpotWebSocketApi getApi() { * `MARKET` orders using parameter `quoteOrderQty`. The pending order is * only placed on the order book when the working order gets **fully filled**. * If either the * working order or the pending order is cancelled individually, the other order in the order - * list will also be canceled or expired. * OTOs add **2 orders** to the - * `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. Weight: 1 - * Unfilled Order Count: 2 + * list will also be canceled or expired. * When the order list is placed, if the working order + * gets **immediately fully filled**, the placement response will show the working order as + * `FILLED` but the pending order will still appear as `PENDING_NEW`. You + * need to query the status of the pending order again to see its updated status. * OTOs add **2 + * orders** to the `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` + * filter. Weight: 1 Unfilled Order Count: 2 */ public void orderListPlaceOtoExampleAsync() { OrderListPlaceOtoRequest orderListPlaceOtoRequest = new OrderListPlaceOtoRequest(); @@ -88,9 +91,12 @@ public void orderListPlaceOtoExampleAsync() { * `MARKET` orders using parameter `quoteOrderQty`. The pending order is * only placed on the order book when the working order gets **fully filled**. * If either the * working order or the pending order is cancelled individually, the other order in the order - * list will also be canceled or expired. * OTOs add **2 orders** to the - * `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. Weight: 1 - * Unfilled Order Count: 2 + * list will also be canceled or expired. * When the order list is placed, if the working order + * gets **immediately fully filled**, the placement response will show the working order as + * `FILLED` but the pending order will still appear as `PENDING_NEW`. You + * need to query the status of the pending order again to see its updated status. * OTOs add **2 + * orders** to the `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` + * filter. Weight: 1 Unfilled Order Count: 2 */ public void orderListPlaceOtoExampleSync() { OrderListPlaceOtoRequest orderListPlaceOtoRequest = new OrderListPlaceOtoRequest(); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtocoExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtocoExample.java index afeaaf71..fad4e7c0 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtocoExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/OrderListPlaceOtocoExample.java @@ -51,8 +51,10 @@ public SpotWebSocketApi getApi() { * behavior of the working order is the same as the [OTO](#place-new-order-list---oto-trade). * * OTOCO has 2 pending orders (pending above and pending below), forming an OCO pair. The * pending orders are only placed on the order book when the working order gets **fully - * filled**. * OTOCOs add **3 orders** to the `EXCHANGE_MAX_NUM_ORDERS` filter and - * `MAX_NUM_ORDERS` filter. Weight: 1 Unfilled Order Count: 3 + * filled**. * The rules of the pending above and pending below follow the same rules as the + * [Order list OCO](#new-order-list---oco-trade). * OTOCOs add **3 orders** to the + * `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. Weight: 1 + * Unfilled Order Count: 3 */ public void orderListPlaceOtocoExampleAsync() { OrderListPlaceOtocoRequest orderListPlaceOtocoRequest = new OrderListPlaceOtocoRequest(); @@ -85,8 +87,10 @@ public void orderListPlaceOtocoExampleAsync() { * behavior of the working order is the same as the [OTO](#place-new-order-list---oto-trade). * * OTOCO has 2 pending orders (pending above and pending below), forming an OCO pair. The * pending orders are only placed on the order book when the working order gets **fully - * filled**. * OTOCOs add **3 orders** to the `EXCHANGE_MAX_NUM_ORDERS` filter and - * `MAX_NUM_ORDERS` filter. Weight: 1 Unfilled Order Count: 3 + * filled**. * The rules of the pending above and pending below follow the same rules as the + * [Order list OCO](#new-order-list---oco-trade). * OTOCOs add **3 orders** to the + * `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. Weight: 1 + * Unfilled Order Count: 3 */ public void orderListPlaceOtocoExampleSync() { OrderListPlaceOtocoRequest orderListPlaceOtocoRequest = new OrderListPlaceOtocoRequest(); diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/SorOrderPlaceExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/SorOrderPlaceExample.java index 5c624998..062d3d9a 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/SorOrderPlaceExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/trade/SorOrderPlaceExample.java @@ -44,8 +44,8 @@ public SpotWebSocketApi getApi() { * WebSocket Place new order using SOR * *

Places an order using smart order routing (SOR). This adds 1 order to the - * `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. Weight: 1 - * Unfilled Order Count: 1 + * `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. Read [SOR + * FAQ](../faqs/sor_faq.md) to learn more. Weight: 1 Unfilled Order Count: 1 */ public void sorOrderPlaceExampleAsync() { SorOrderPlaceRequest sorOrderPlaceRequest = new SorOrderPlaceRequest(); @@ -69,8 +69,8 @@ public void sorOrderPlaceExampleAsync() { * WebSocket Place new order using SOR * *

Places an order using smart order routing (SOR). This adds 1 order to the - * `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. Weight: 1 - * Unfilled Order Count: 1 + * `EXCHANGE_MAX_ORDERS` filter and the `MAX_NUM_ORDERS` filter. Read [SOR + * FAQ](../faqs/sor_faq.md) to learn more. Weight: 1 Unfilled Order Count: 1 */ public void sorOrderPlaceExampleSync() { SorOrderPlaceRequest sorOrderPlaceRequest = new SorOrderPlaceRequest();