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