diff --git a/clients/common/pom.xml b/clients/common/pom.xml index f6f245aa2..ffd87392c 100644 --- a/clients/common/pom.xml +++ b/clients/common/pom.xml @@ -10,6 +10,6 @@ binance-common common - 2.2.1 + 2.3.1 jar \ No newline at end of file diff --git a/clients/common/src/main/java/com/binance/connector/client/common/websocket/configuration/WebSocketClientConfiguration.java b/clients/common/src/main/java/com/binance/connector/client/common/websocket/configuration/WebSocketClientConfiguration.java index 6c4569831..fdc722ce3 100644 --- a/clients/common/src/main/java/com/binance/connector/client/common/websocket/configuration/WebSocketClientConfiguration.java +++ b/clients/common/src/main/java/com/binance/connector/client/common/websocket/configuration/WebSocketClientConfiguration.java @@ -4,7 +4,7 @@ import org.eclipse.jetty.client.ProxyConfiguration; import org.eclipse.jetty.client.api.Authentication; -public class WebSocketClientConfiguration extends ClientConfiguration { +public class WebSocketClientConfiguration extends ClientConfiguration implements Cloneable { /** Base URL */ protected String url = "wss://ws-api.binance.com:443/ws-api/v3"; @@ -105,4 +105,13 @@ public Long getMessageMaxSize() { public void setMessageMaxSize(Long messageMaxSize) { this.messageMaxSize = messageMaxSize; } + + @Override + public Object clone() { + try { + return super.clone(); + } catch (CloneNotSupportedException e) { + throw new RuntimeException(e); + } + } } diff --git a/clients/common/src/main/java/com/binance/connector/client/common/websocket/service/RequestIdModifierFactory.java b/clients/common/src/main/java/com/binance/connector/client/common/websocket/service/RequestIdModifierFactory.java new file mode 100644 index 000000000..f1e4aadf9 --- /dev/null +++ b/clients/common/src/main/java/com/binance/connector/client/common/websocket/service/RequestIdModifierFactory.java @@ -0,0 +1,47 @@ +package com.binance.connector.client.common.websocket.service; + +import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import org.apache.commons.lang3.StringUtils; + +import java.io.IOException; + +public class RequestIdModifierFactory implements TypeAdapterFactory { + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RequestWrapperDTO.class.isAssignableFrom(type.getRawType())) return null; + + final TypeAdapter delegate = gson.getDelegateAdapter(this, type); + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + + return new TypeAdapter() { + @Override + public void write(JsonWriter out, T value) throws IOException { + JsonElement tree = delegate.toJsonTree(value); + if (tree.isJsonObject()) { + JsonObject jo = tree.getAsJsonObject(); + if (jo.has("id")) { + String id = jo.get("id").getAsString(); + if (StringUtils.isNumeric(id)) { + jo.add("id", new JsonPrimitive(Long.parseLong(id))); + } + } + } + elementAdapter.write(out, tree); + } + + @Override + public T read(JsonReader in) throws IOException { + return delegate.read(in); + } + }.nullSafe(); + } +} \ No newline at end of file diff --git a/clients/derivatives-trading-options/docs/AccountApi.md b/clients/derivatives-trading-options/docs/AccountApi.md index a348742ac..9924fcab3 100644 --- a/clients/derivatives-trading-options/docs/AccountApi.md +++ b/clients/derivatives-trading-options/docs/AccountApi.md @@ -5,9 +5,6 @@ All URIs are relative to *https://eapi.binance.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**accountFundingFlow**](AccountApi.md#accountFundingFlow) | **GET** /eapi/v1/bill | Account Funding Flow (USER_DATA) | -| [**getDownloadIdForOptionTransactionHistory**](AccountApi.md#getDownloadIdForOptionTransactionHistory) | **GET** /eapi/v1/income/asyn | Get Download Id For Option Transaction History (USER_DATA) | -| [**getOptionTransactionHistoryDownloadLinkById**](AccountApi.md#getOptionTransactionHistoryDownloadLinkById) | **GET** /eapi/v1/income/asyn/id | Get Option Transaction History Download Link by Id (USER_DATA) | -| [**optionAccountInformation**](AccountApi.md#optionAccountInformation) | **GET** /eapi/v1/account | Option Account Information(TRADE) | | [**optionMarginAccountInformation**](AccountApi.md#optionMarginAccountInformation) | **GET** /eapi/v1/marginAccount | Option Margin Account Information (USER_DATA) | @@ -83,198 +80,6 @@ No authorization required |-------------|-------------|------------------| | **200** | Account Funding Flow | - | - -# **getDownloadIdForOptionTransactionHistory** -> GetDownloadIdForOptionTransactionHistoryResponse getDownloadIdForOptionTransactionHistory(startTime, endTime, recvWindow) - -Get Download Id For Option Transaction History (USER_DATA) - -Get download id for option transaction history * Request Limitation is 5 times per month, shared by > front end download page and rest api * The time between `startTime` and `endTime` can not be longer than 1 year Weight: 5 - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_options.ApiClient; -import com.binance.connector.client.derivatives_trading_options.ApiException; -import com.binance.connector.client.derivatives_trading_options.Configuration; -import com.binance.connector.client.derivatives_trading_options.models.*; -import com.binance.connector.client.derivatives_trading_options.rest.api.AccountApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://eapi.binance.com"); - - AccountApi apiInstance = new AccountApi(defaultClient); - Long startTime = 56L; // Long | Timestamp in ms - Long endTime = 56L; // Long | Timestamp in ms - Long recvWindow = 56L; // Long | - try { - GetDownloadIdForOptionTransactionHistoryResponse result = apiInstance.getDownloadIdForOptionTransactionHistory(startTime, endTime, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AccountApi#getDownloadIdForOptionTransactionHistory"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **startTime** | **Long**| Timestamp in ms | | -| **endTime** | **Long**| Timestamp in ms | | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetDownloadIdForOptionTransactionHistoryResponse**](GetDownloadIdForOptionTransactionHistoryResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Download Id For Option Transaction History | - | - - -# **getOptionTransactionHistoryDownloadLinkById** -> GetOptionTransactionHistoryDownloadLinkByIdResponse getOptionTransactionHistoryDownloadLinkById(downloadId, recvWindow) - -Get Option Transaction History Download Link by Id (USER_DATA) - -Get option transaction history download Link by Id * Download link expiration: 24h Weight: 5 - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_options.ApiClient; -import com.binance.connector.client.derivatives_trading_options.ApiException; -import com.binance.connector.client.derivatives_trading_options.Configuration; -import com.binance.connector.client.derivatives_trading_options.models.*; -import com.binance.connector.client.derivatives_trading_options.rest.api.AccountApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://eapi.binance.com"); - - AccountApi apiInstance = new AccountApi(defaultClient); - String downloadId = "downloadId_example"; // String | get by download id api - Long recvWindow = 56L; // Long | - try { - GetOptionTransactionHistoryDownloadLinkByIdResponse result = apiInstance.getOptionTransactionHistoryDownloadLinkById(downloadId, recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AccountApi#getOptionTransactionHistoryDownloadLinkById"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **downloadId** | **String**| get by download id api | | -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**GetOptionTransactionHistoryDownloadLinkByIdResponse**](GetOptionTransactionHistoryDownloadLinkByIdResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Get Option Transaction History Download Link by Id | - | - - -# **optionAccountInformation** -> OptionAccountInformationResponse optionAccountInformation(recvWindow) - -Option Account Information(TRADE) - -Get current account information. Weight: 3 - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_options.ApiClient; -import com.binance.connector.client.derivatives_trading_options.ApiException; -import com.binance.connector.client.derivatives_trading_options.Configuration; -import com.binance.connector.client.derivatives_trading_options.models.*; -import com.binance.connector.client.derivatives_trading_options.rest.api.AccountApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://eapi.binance.com"); - - AccountApi apiInstance = new AccountApi(defaultClient); - Long recvWindow = 56L; // Long | - try { - OptionAccountInformationResponse result = apiInstance.optionAccountInformation(recvWindow); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AccountApi#optionAccountInformation"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **recvWindow** | **Long**| | [optional] | - -### Return type - -[**OptionAccountInformationResponse**](OptionAccountInformationResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Option Account Information | - | - # **optionMarginAccountInformation** > OptionMarginAccountInformationResponse optionMarginAccountInformation(recvWindow) diff --git a/clients/derivatives-trading-options/docs/AccountTradeListResponseInner.md b/clients/derivatives-trading-options/docs/AccountTradeListResponseInner.md index c729f638e..16b7c6b58 100644 --- a/clients/derivatives-trading-options/docs/AccountTradeListResponseInner.md +++ b/clients/derivatives-trading-options/docs/AccountTradeListResponseInner.md @@ -17,13 +17,12 @@ |**realizedProfit** | **String** | | [optional] | |**side** | **String** | | [optional] | |**type** | **String** | | [optional] | -|**volatility** | **String** | | [optional] | |**liquidity** | **String** | | [optional] | -|**quoteAsset** | **String** | | [optional] | |**time** | **Long** | | [optional] | |**priceScale** | **Long** | | [optional] | |**quantityScale** | **Long** | | [optional] | |**optionSide** | **String** | | [optional] | +|**quoteAsset** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/AccountUpdate.md b/clients/derivatives-trading-options/docs/AccountUpdate.md deleted file mode 100644 index 48a637e89..000000000 --- a/clients/derivatives-trading-options/docs/AccountUpdate.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# AccountUpdate - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**E** | **Long** | | [optional] | -|**B** | [**List<AccountUpdateBInner>**](AccountUpdateBInner.md) | | [optional] | -|**G** | [**List<AccountUpdateGInner>**](AccountUpdateGInner.md) | | [optional] | -|**P** | [**List<AccountUpdatePInner>**](AccountUpdatePInner.md) | | [optional] | -|**uid** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-options/docs/AccountUpdateBInner.md b/clients/derivatives-trading-options/docs/AccountUpdateBInner.md deleted file mode 100644 index 6b70d0e76..000000000 --- a/clients/derivatives-trading-options/docs/AccountUpdateBInner.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# AccountUpdateBInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**bLowerCase** | **String** | | [optional] | -|**mLowerCase** | **String** | | [optional] | -|**uLowerCase** | **String** | | [optional] | -|**U** | **Long** | | [optional] | -|**M** | **String** | | [optional] | -|**iLowerCase** | **String** | | [optional] | -|**aLowerCase** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-options/docs/AccountUpdateGInner.md b/clients/derivatives-trading-options/docs/AccountUpdateGInner.md deleted file mode 100644 index 124db1377..000000000 --- a/clients/derivatives-trading-options/docs/AccountUpdateGInner.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# AccountUpdateGInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**ui** | **String** | | [optional] | -|**dLowerCase** | **Double** | | [optional] | -|**tLowerCase** | **Double** | | [optional] | -|**gLowerCase** | **Double** | | [optional] | -|**vLowerCase** | **Double** | | [optional] | - - - diff --git a/clients/derivatives-trading-options/docs/BalancePositionUpdate.md b/clients/derivatives-trading-options/docs/BalancePositionUpdate.md new file mode 100644 index 000000000..c3dad7ced --- /dev/null +++ b/clients/derivatives-trading-options/docs/BalancePositionUpdate.md @@ -0,0 +1,17 @@ + + +# BalancePositionUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**mLowerCase** | **String** | | [optional] | +|**B** | [**List<BalancePositionUpdateBInner>**](BalancePositionUpdateBInner.md) | | [optional] | +|**P** | [**List<BalancePositionUpdatePInner>**](BalancePositionUpdatePInner.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-options/docs/BalancePositionUpdateBInner.md b/clients/derivatives-trading-options/docs/BalancePositionUpdateBInner.md new file mode 100644 index 000000000..9b232819f --- /dev/null +++ b/clients/derivatives-trading-options/docs/BalancePositionUpdateBInner.md @@ -0,0 +1,15 @@ + + +# BalancePositionUpdateBInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**aLowerCase** | **String** | | [optional] | +|**bLowerCase** | **String** | | [optional] | +|**bc** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-options/docs/AccountUpdatePInner.md b/clients/derivatives-trading-options/docs/BalancePositionUpdatePInner.md similarity index 81% rename from clients/derivatives-trading-options/docs/AccountUpdatePInner.md rename to clients/derivatives-trading-options/docs/BalancePositionUpdatePInner.md index 1e48fd425..bb2be4d4d 100644 --- a/clients/derivatives-trading-options/docs/AccountUpdatePInner.md +++ b/clients/derivatives-trading-options/docs/BalancePositionUpdatePInner.md @@ -1,6 +1,6 @@ -# AccountUpdatePInner +# BalancePositionUpdatePInner ## Properties @@ -9,7 +9,6 @@ |------------ | ------------- | ------------- | -------------| |**sLowerCase** | **String** | | [optional] | |**cLowerCase** | **String** | | [optional] | -|**rLowerCase** | **String** | | [optional] | |**pLowerCase** | **String** | | [optional] | |**aLowerCase** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/CancelAllOptionOrdersByUnderlyingResponse.md b/clients/derivatives-trading-options/docs/CancelAllOptionOrdersByUnderlyingResponse.md index a620310b1..ea1fedbae 100644 --- a/clients/derivatives-trading-options/docs/CancelAllOptionOrdersByUnderlyingResponse.md +++ b/clients/derivatives-trading-options/docs/CancelAllOptionOrdersByUnderlyingResponse.md @@ -9,7 +9,6 @@ |------------ | ------------- | ------------- | -------------| |**code** | **Long** | | [optional] | |**msg** | **String** | | [optional] | -|**data** | **Long** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/CancelMultipleOptionOrdersResponseInner.md b/clients/derivatives-trading-options/docs/CancelMultipleOptionOrdersResponseInner.md index 2405af12e..80bd030f2 100644 --- a/clients/derivatives-trading-options/docs/CancelMultipleOptionOrdersResponseInner.md +++ b/clients/derivatives-trading-options/docs/CancelMultipleOptionOrdersResponseInner.md @@ -12,16 +12,21 @@ |**price** | **String** | | [optional] | |**quantity** | **String** | | [optional] | |**executedQty** | **String** | | [optional] | -|**fee** | **Long** | | [optional] | |**side** | **String** | | [optional] | |**type** | **String** | | [optional] | |**timeInForce** | **String** | | [optional] | +|**reduceOnly** | **Boolean** | | [optional] | |**createTime** | **Long** | | [optional] | +|**updateTime** | **Long** | | [optional] | |**status** | **String** | | [optional] | |**avgPrice** | **String** | | [optional] | -|**reduceOnly** | **Boolean** | | [optional] | +|**source** | **String** | | [optional] | |**clientOrderId** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | +|**priceScale** | **Long** | | [optional] | +|**quantityScale** | **Long** | | [optional] | +|**optionSide** | **String** | | [optional] | +|**quoteAsset** | **String** | | [optional] | +|**mmp** | **Boolean** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/CancelOptionOrderResponse.md b/clients/derivatives-trading-options/docs/CancelOptionOrderResponse.md index b7ed2e3d6..0465da729 100644 --- a/clients/derivatives-trading-options/docs/CancelOptionOrderResponse.md +++ b/clients/derivatives-trading-options/docs/CancelOptionOrderResponse.md @@ -12,12 +12,10 @@ |**price** | **String** | | [optional] | |**quantity** | **String** | | [optional] | |**executedQty** | **String** | | [optional] | -|**fee** | **String** | | [optional] | |**side** | **String** | | [optional] | |**type** | **String** | | [optional] | |**timeInForce** | **String** | | [optional] | |**reduceOnly** | **Boolean** | | [optional] | -|**postOnly** | **Boolean** | | [optional] | |**createDate** | **Long** | | [optional] | |**updateTime** | **Long** | | [optional] | |**status** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/DiffBookDepthStreamsRequest.md b/clients/derivatives-trading-options/docs/DiffBookDepthStreamsRequest.md new file mode 100644 index 000000000..e50a13600 --- /dev/null +++ b/clients/derivatives-trading-options/docs/DiffBookDepthStreamsRequest.md @@ -0,0 +1,15 @@ + + +# DiffBookDepthStreamsRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Integer** | | [optional] | +|**symbol** | **String** | | | +|**updateSpeed** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-options/docs/DiffBookDepthStreamsResponse.md b/clients/derivatives-trading-options/docs/DiffBookDepthStreamsResponse.md new file mode 100644 index 000000000..47c64c8c0 --- /dev/null +++ b/clients/derivatives-trading-options/docs/DiffBookDepthStreamsResponse.md @@ -0,0 +1,21 @@ + + +# DiffBookDepthStreamsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**eLowerCase** | **String** | | [optional] | +|**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**U** | **Long** | | [optional] | +|**uLowerCase** | **Long** | | [optional] | +|**pu** | **Long** | | [optional] | +|**bLowerCase** | **List<DiffBookDepthStreamsResponseBItem>** | | [optional] | +|**aLowerCase** | **List<DiffBookDepthStreamsResponseAItem>** | | [optional] | + + + diff --git a/clients/derivatives-trading-options/docs/Ticker24HourByUnderlyingAssetAndExpirationDataResponse.md b/clients/derivatives-trading-options/docs/DiffBookDepthStreamsResponseAItem.md similarity index 68% rename from clients/derivatives-trading-options/docs/Ticker24HourByUnderlyingAssetAndExpirationDataResponse.md rename to clients/derivatives-trading-options/docs/DiffBookDepthStreamsResponseAItem.md index 64585ab6d..e95d11d71 100644 --- a/clients/derivatives-trading-options/docs/Ticker24HourByUnderlyingAssetAndExpirationDataResponse.md +++ b/clients/derivatives-trading-options/docs/DiffBookDepthStreamsResponseAItem.md @@ -1,6 +1,6 @@ -# Ticker24HourByUnderlyingAssetAndExpirationDataResponse +# DiffBookDepthStreamsResponseAItem ## Properties diff --git a/clients/derivatives-trading-options/docs/SymbolPriceTickerResponse.md b/clients/derivatives-trading-options/docs/DiffBookDepthStreamsResponseBItem.md similarity index 51% rename from clients/derivatives-trading-options/docs/SymbolPriceTickerResponse.md rename to clients/derivatives-trading-options/docs/DiffBookDepthStreamsResponseBItem.md index 7b99c663f..dce623f51 100644 --- a/clients/derivatives-trading-options/docs/SymbolPriceTickerResponse.md +++ b/clients/derivatives-trading-options/docs/DiffBookDepthStreamsResponseBItem.md @@ -1,14 +1,12 @@ -# SymbolPriceTickerResponse +# DiffBookDepthStreamsResponseBItem ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**time** | **Long** | | [optional] | -|**indexPrice** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/ExchangeInformationResponseOptionSymbolsInner.md b/clients/derivatives-trading-options/docs/ExchangeInformationResponseOptionSymbolsInner.md index de23ca13c..12ec03159 100644 --- a/clients/derivatives-trading-options/docs/ExchangeInformationResponseOptionSymbolsInner.md +++ b/clients/derivatives-trading-options/docs/ExchangeInformationResponseOptionSymbolsInner.md @@ -14,8 +14,6 @@ |**strikePrice** | **String** | | [optional] | |**underlying** | **String** | | [optional] | |**unit** | **Long** | | [optional] | -|**makerFeeRate** | **String** | | [optional] | -|**takerFeeRate** | **String** | | [optional] | |**liquidationFeeRate** | **String** | | [optional] | |**minQty** | **String** | | [optional] | |**maxQty** | **String** | | [optional] | @@ -26,6 +24,7 @@ |**priceScale** | **Long** | | [optional] | |**quantityScale** | **Long** | | [optional] | |**quoteAsset** | **String** | | [optional] | +|**status** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/GetDownloadIdForOptionTransactionHistoryResponse.md b/clients/derivatives-trading-options/docs/GetDownloadIdForOptionTransactionHistoryResponse.md deleted file mode 100644 index d931bd6ca..000000000 --- a/clients/derivatives-trading-options/docs/GetDownloadIdForOptionTransactionHistoryResponse.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# GetDownloadIdForOptionTransactionHistoryResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**avgCostTimestampOfLast30d** | **Long** | | [optional] | -|**downloadId** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-options/docs/GetOptionTransactionHistoryDownloadLinkByIdResponse.md b/clients/derivatives-trading-options/docs/GetOptionTransactionHistoryDownloadLinkByIdResponse.md deleted file mode 100644 index 22030786e..000000000 --- a/clients/derivatives-trading-options/docs/GetOptionTransactionHistoryDownloadLinkByIdResponse.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# GetOptionTransactionHistoryDownloadLinkByIdResponse - - -## 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-options/docs/GreekUpdate.md b/clients/derivatives-trading-options/docs/GreekUpdate.md new file mode 100644 index 000000000..c001caa39 --- /dev/null +++ b/clients/derivatives-trading-options/docs/GreekUpdate.md @@ -0,0 +1,15 @@ + + +# GreekUpdate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | +|**G** | [**List<GreekUpdateGInner>**](GreekUpdateGInner.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-options/docs/GreekUpdateGInner.md b/clients/derivatives-trading-options/docs/GreekUpdateGInner.md new file mode 100644 index 000000000..91472b675 --- /dev/null +++ b/clients/derivatives-trading-options/docs/GreekUpdateGInner.md @@ -0,0 +1,17 @@ + + +# GreekUpdateGInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uLowerCase** | **String** | | [optional] | +|**dLowerCase** | **String** | | [optional] | +|**gLowerCase** | **String** | | [optional] | +|**tLowerCase** | **String** | | [optional] | +|**vLowerCase** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-options/docs/IndexPriceTickerResponse.md b/clients/derivatives-trading-options/docs/IndexPriceResponse.md similarity index 88% rename from clients/derivatives-trading-options/docs/IndexPriceTickerResponse.md rename to clients/derivatives-trading-options/docs/IndexPriceResponse.md index b67143e33..731b0c58a 100644 --- a/clients/derivatives-trading-options/docs/IndexPriceTickerResponse.md +++ b/clients/derivatives-trading-options/docs/IndexPriceResponse.md @@ -1,6 +1,6 @@ -# IndexPriceTickerResponse +# IndexPriceResponse ## Properties diff --git a/clients/derivatives-trading-options/docs/IndexPriceStreamsRequest.md b/clients/derivatives-trading-options/docs/IndexPriceStreamsRequest.md index 7be695ec1..77956f701 100644 --- a/clients/derivatives-trading-options/docs/IndexPriceStreamsRequest.md +++ b/clients/derivatives-trading-options/docs/IndexPriceStreamsRequest.md @@ -7,8 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**symbol** | **String** | | | +|**id** | **Integer** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/IndexPriceStreamsResponse.md b/clients/derivatives-trading-options/docs/IndexPriceStreamsResponse.md index a2f71351a..972c7a7c5 100644 --- a/clients/derivatives-trading-options/docs/IndexPriceStreamsResponse.md +++ b/clients/derivatives-trading-options/docs/IndexPriceStreamsResponse.md @@ -7,10 +7,6 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**eLowerCase** | **String** | | [optional] | -|**E** | **Long** | | [optional] | -|**sLowerCase** | **String** | | [optional] | -|**pLowerCase** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/IndexPriceStreamsResponseInner.md b/clients/derivatives-trading-options/docs/IndexPriceStreamsResponseInner.md new file mode 100644 index 000000000..a4809cab6 --- /dev/null +++ b/clients/derivatives-trading-options/docs/IndexPriceStreamsResponseInner.md @@ -0,0 +1,16 @@ + + +# IndexPriceStreamsResponseInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**eLowerCase** | **String** | | [optional] | +|**E** | **Long** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**pLowerCase** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-options/docs/IndividualSymbolBookTickerStreamsRequest.md b/clients/derivatives-trading-options/docs/IndividualSymbolBookTickerStreamsRequest.md new file mode 100644 index 000000000..2f1df7360 --- /dev/null +++ b/clients/derivatives-trading-options/docs/IndividualSymbolBookTickerStreamsRequest.md @@ -0,0 +1,14 @@ + + +# IndividualSymbolBookTickerStreamsRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Integer** | | [optional] | +|**symbol** | **String** | | | + + + diff --git a/clients/derivatives-trading-options/docs/IndividualSymbolBookTickerStreamsResponse.md b/clients/derivatives-trading-options/docs/IndividualSymbolBookTickerStreamsResponse.md new file mode 100644 index 000000000..735c9595e --- /dev/null +++ b/clients/derivatives-trading-options/docs/IndividualSymbolBookTickerStreamsResponse.md @@ -0,0 +1,21 @@ + + +# IndividualSymbolBookTickerStreamsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**eLowerCase** | **String** | | [optional] | +|**uLowerCase** | **Long** | | [optional] | +|**sLowerCase** | **String** | | [optional] | +|**bLowerCase** | **String** | | [optional] | +|**B** | **String** | | [optional] | +|**aLowerCase** | **String** | | [optional] | +|**A** | **String** | | [optional] | +|**T** | **Long** | | [optional] | +|**E** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-options/docs/KlineCandlestickDataResponseInner.md b/clients/derivatives-trading-options/docs/KlineCandlestickDataResponseInner.md deleted file mode 100644 index 3adbba71f..000000000 --- a/clients/derivatives-trading-options/docs/KlineCandlestickDataResponseInner.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# KlineCandlestickDataResponseInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**open** | **String** | | [optional] | -|**high** | **String** | | [optional] | -|**low** | **String** | | [optional] | -|**close** | **String** | | [optional] | -|**volume** | **String** | | [optional] | -|**amount** | **String** | | [optional] | -|**interval** | **String** | | [optional] | -|**tradeCount** | **Long** | | [optional] | -|**takerVolume** | **String** | | [optional] | -|**takerAmount** | **String** | | [optional] | -|**openTime** | **Long** | | [optional] | -|**closeTime** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-options/docs/OldTradesLookupResponse.md b/clients/derivatives-trading-options/docs/KlineCandlestickDataResponseItem.md similarity index 77% rename from clients/derivatives-trading-options/docs/OldTradesLookupResponse.md rename to clients/derivatives-trading-options/docs/KlineCandlestickDataResponseItem.md index 6b9e13a86..77012692f 100644 --- a/clients/derivatives-trading-options/docs/OldTradesLookupResponse.md +++ b/clients/derivatives-trading-options/docs/KlineCandlestickDataResponseItem.md @@ -1,6 +1,6 @@ -# OldTradesLookupResponse +# KlineCandlestickDataResponseItem ## Properties diff --git a/clients/derivatives-trading-options/docs/KlineCandlestickDataResponseItemInner.md b/clients/derivatives-trading-options/docs/KlineCandlestickDataResponseItemInner.md new file mode 100644 index 000000000..704c5f122 --- /dev/null +++ b/clients/derivatives-trading-options/docs/KlineCandlestickDataResponseItemInner.md @@ -0,0 +1,12 @@ + + +# KlineCandlestickDataResponseItemInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/clients/derivatives-trading-options/docs/KlineCandlestickStreamsRequest.md b/clients/derivatives-trading-options/docs/KlineCandlestickStreamsRequest.md index b33491322..53ed74309 100644 --- a/clients/derivatives-trading-options/docs/KlineCandlestickStreamsRequest.md +++ b/clients/derivatives-trading-options/docs/KlineCandlestickStreamsRequest.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | +|**id** | **Integer** | | [optional] | |**symbol** | **String** | | | |**interval** | **String** | | | diff --git a/clients/derivatives-trading-options/docs/KlineCandlestickStreamsResponseK.md b/clients/derivatives-trading-options/docs/KlineCandlestickStreamsResponseK.md index be7cf40e3..04c7b81ef 100644 --- a/clients/derivatives-trading-options/docs/KlineCandlestickStreamsResponseK.md +++ b/clients/derivatives-trading-options/docs/KlineCandlestickStreamsResponseK.md @@ -11,7 +11,7 @@ |**T** | **Long** | | [optional] | |**sLowerCase** | **String** | | [optional] | |**iLowerCase** | **String** | | [optional] | -|**F** | **Long** | | [optional] | +|**fLowerCase** | **Long** | | [optional] | |**L** | **Long** | | [optional] | |**oLowerCase** | **String** | | [optional] | |**cLowerCase** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/Listenkeyexpired.md b/clients/derivatives-trading-options/docs/Listenkeyexpired.md new file mode 100644 index 000000000..a4f18a418 --- /dev/null +++ b/clients/derivatives-trading-options/docs/Listenkeyexpired.md @@ -0,0 +1,14 @@ + + +# Listenkeyexpired + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**E** | **String** | | [optional] | +|**listenKey** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-options/docs/MarkPriceRequest.md b/clients/derivatives-trading-options/docs/MarkPriceRequest.md index d676cd48f..07071f1e2 100644 --- a/clients/derivatives-trading-options/docs/MarkPriceRequest.md +++ b/clients/derivatives-trading-options/docs/MarkPriceRequest.md @@ -7,8 +7,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**underlyingAsset** | **String** | | | +|**id** | **Integer** | | [optional] | +|**underlying** | **String** | | | diff --git a/clients/derivatives-trading-options/docs/MarkPriceResponseInner.md b/clients/derivatives-trading-options/docs/MarkPriceResponseInner.md index 5ed5f2d95..449de8d13 100644 --- a/clients/derivatives-trading-options/docs/MarkPriceResponseInner.md +++ b/clients/derivatives-trading-options/docs/MarkPriceResponseInner.md @@ -7,10 +7,26 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**eLowerCase** | **String** | | [optional] | -|**E** | **Long** | | [optional] | |**sLowerCase** | **String** | | [optional] | |**mp** | **String** | | [optional] | +|**E** | **Long** | | [optional] | +|**eLowerCase** | **String** | | [optional] | +|**iLowerCase** | **String** | | [optional] | +|**P** | **String** | | [optional] | +|**bo** | **String** | | [optional] | +|**ao** | **String** | | [optional] | +|**bq** | **String** | | [optional] | +|**aq** | **String** | | [optional] | +|**bLowerCase** | **String** | | [optional] | +|**aLowerCase** | **String** | | [optional] | +|**hl** | **String** | | [optional] | +|**ll** | **String** | | [optional] | +|**vo** | **String** | | [optional] | +|**rf** | **String** | | [optional] | +|**dLowerCase** | **String** | | [optional] | +|**tLowerCase** | **String** | | [optional] | +|**gLowerCase** | **String** | | [optional] | +|**vLowerCase** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/MarketApi.md b/clients/derivatives-trading-options/docs/MarketApi.md new file mode 100644 index 000000000..ea8b25453 --- /dev/null +++ b/clients/derivatives-trading-options/docs/MarketApi.md @@ -0,0 +1,323 @@ +# MarketApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**indexPriceStreams**](MarketApi.md#indexPriceStreams) | **POST** /!index@arr | Index Price Streams | +| [**klineCandlestickStreams**](MarketApi.md#klineCandlestickStreams) | **POST** /<symbol>@kline_<interval> | Kline/Candlestick Streams | +| [**markPrice**](MarketApi.md#markPrice) | **POST** /<underlying>@optionMarkPrice | Mark Price | +| [**newSymbolInfo**](MarketApi.md#newSymbolInfo) | **POST** /!optionSymbol | New Symbol Info | +| [**openInterest**](MarketApi.md#openInterest) | **POST** /underlying@optionOpenInterest@<expirationDate> | Open Interest | + + + +# **indexPriceStreams** +> IndexPriceStreamsResponse indexPriceStreams(indexPriceStreamsRequest) + +Index Price Streams + +Underlying(e.g ETHUSDT) index stream. Update Speed: 1000ms + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_options.ApiClient; +import com.binance.connector.client.derivatives_trading_options.ApiException; +import com.binance.connector.client.derivatives_trading_options.Configuration; +import com.binance.connector.client.derivatives_trading_options.models.*; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.MarketApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + MarketApi apiInstance = new MarketApi(defaultClient); + IndexPriceStreamsRequest indexPriceStreamsRequest = new IndexPriceStreamsRequest(); // IndexPriceStreamsRequest | + try { + IndexPriceStreamsResponse result = apiInstance.indexPriceStreams(indexPriceStreamsRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MarketApi#indexPriceStreams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **indexPriceStreamsRequest** | [**IndexPriceStreamsRequest**](IndexPriceStreamsRequest.md)| | | + +### Return type + +[**IndexPriceStreamsResponse**](IndexPriceStreamsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Index Price Streams | - | + + +# **klineCandlestickStreams** +> KlineCandlestickStreamsResponse klineCandlestickStreams(klineCandlestickStreamsRequest) + +Kline/Candlestick Streams + +The Kline/Candlestick Stream push updates to the current klines/candlestick every 1000 milliseconds (if existing). Update Speed: 1000ms + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_options.ApiClient; +import com.binance.connector.client.derivatives_trading_options.ApiException; +import com.binance.connector.client.derivatives_trading_options.Configuration; +import com.binance.connector.client.derivatives_trading_options.models.*; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.MarketApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + MarketApi apiInstance = new MarketApi(defaultClient); + KlineCandlestickStreamsRequest klineCandlestickStreamsRequest = new KlineCandlestickStreamsRequest(); // KlineCandlestickStreamsRequest | + try { + KlineCandlestickStreamsResponse result = apiInstance.klineCandlestickStreams(klineCandlestickStreamsRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MarketApi#klineCandlestickStreams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **klineCandlestickStreamsRequest** | [**KlineCandlestickStreamsRequest**](KlineCandlestickStreamsRequest.md)| | | + +### Return type + +[**KlineCandlestickStreamsResponse**](KlineCandlestickStreamsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Kline/Candlestick Streams | - | + + +# **markPrice** +> MarkPriceResponse markPrice(markPriceRequest) + +Mark Price + +The mark price for all option symbols on specific underlying asset. E.g.[btcusdt@optionMarkPrice](wss://fstream.binance.com/market/stream?streams=btcusdt@optionMarkPrice) Update Speed: 1000ms + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_options.ApiClient; +import com.binance.connector.client.derivatives_trading_options.ApiException; +import com.binance.connector.client.derivatives_trading_options.Configuration; +import com.binance.connector.client.derivatives_trading_options.models.*; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.MarketApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + MarketApi apiInstance = new MarketApi(defaultClient); + MarkPriceRequest markPriceRequest = new MarkPriceRequest(); // MarkPriceRequest | + try { + MarkPriceResponse result = apiInstance.markPrice(markPriceRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MarketApi#markPrice"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **markPriceRequest** | [**MarkPriceRequest**](MarkPriceRequest.md)| | | + +### Return type + +[**MarkPriceResponse**](MarkPriceResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Mark Price | - | + + +# **newSymbolInfo** +> NewSymbolInfoResponse newSymbolInfo(newSymbolInfoRequest) + +New Symbol Info + +New symbol listing stream. Update Speed: 50ms + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_options.ApiClient; +import com.binance.connector.client.derivatives_trading_options.ApiException; +import com.binance.connector.client.derivatives_trading_options.Configuration; +import com.binance.connector.client.derivatives_trading_options.models.*; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.MarketApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + MarketApi apiInstance = new MarketApi(defaultClient); + NewSymbolInfoRequest newSymbolInfoRequest = new NewSymbolInfoRequest(); // NewSymbolInfoRequest | + try { + NewSymbolInfoResponse result = apiInstance.newSymbolInfo(newSymbolInfoRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MarketApi#newSymbolInfo"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **newSymbolInfoRequest** | [**NewSymbolInfoRequest**](NewSymbolInfoRequest.md)| | | + +### Return type + +[**NewSymbolInfoResponse**](NewSymbolInfoResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | New Symbol Info | - | + + +# **openInterest** +> OpenInterestResponse openInterest(openInterestRequest) + +Open Interest + +Option open interest for specific underlying asset on specific expiration date. E.g.[ethusdt@openInterest@221125](wss://fstream.binance.com/market/stream?streams=ethusdt@openInterest@221125) Update Speed: 60s + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_options.ApiClient; +import com.binance.connector.client.derivatives_trading_options.ApiException; +import com.binance.connector.client.derivatives_trading_options.Configuration; +import com.binance.connector.client.derivatives_trading_options.models.*; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.MarketApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + MarketApi apiInstance = new MarketApi(defaultClient); + OpenInterestRequest openInterestRequest = new OpenInterestRequest(); // OpenInterestRequest | + try { + OpenInterestResponse result = apiInstance.openInterest(openInterestRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MarketApi#openInterest"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **openInterestRequest** | [**OpenInterestRequest**](OpenInterestRequest.md)| | | + +### Return type + +[**OpenInterestResponse**](OpenInterestResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Open Interest | - | + diff --git a/clients/derivatives-trading-options/docs/MarketDataApi.md b/clients/derivatives-trading-options/docs/MarketDataApi.md index a36bd5a32..8890d8971 100644 --- a/clients/derivatives-trading-options/docs/MarketDataApi.md +++ b/clients/derivatives-trading-options/docs/MarketDataApi.md @@ -7,9 +7,8 @@ All URIs are relative to *https://eapi.binance.com* | [**checkServerTime**](MarketDataApi.md#checkServerTime) | **GET** /eapi/v1/time | Check Server Time | | [**exchangeInformation**](MarketDataApi.md#exchangeInformation) | **GET** /eapi/v1/exchangeInfo | Exchange Information | | [**historicalExerciseRecords**](MarketDataApi.md#historicalExerciseRecords) | **GET** /eapi/v1/exerciseHistory | Historical Exercise Records | -| [**indexPriceTicker**](MarketDataApi.md#indexPriceTicker) | **GET** /eapi/v1/index | Index Price Ticker | +| [**indexPrice**](MarketDataApi.md#indexPrice) | **GET** /eapi/v1/index | Index Price | | [**klineCandlestickData**](MarketDataApi.md#klineCandlestickData) | **GET** /eapi/v1/klines | Kline/Candlestick Data | -| [**oldTradesLookup**](MarketDataApi.md#oldTradesLookup) | **GET** /eapi/v1/historicalTrades | Old Trades Lookup (MARKET_DATA) | | [**openInterest**](MarketDataApi.md#openInterest) | **GET** /eapi/v1/openInterest | Open Interest | | [**optionMarkPrice**](MarketDataApi.md#optionMarkPrice) | **GET** /eapi/v1/mark | Option Mark Price | | [**orderBook**](MarketDataApi.md#orderBook) | **GET** /eapi/v1/depth | Order Book | @@ -203,11 +202,11 @@ No authorization required |-------------|-------------|------------------| | **200** | Historical Exercise Records | - | - -# **indexPriceTicker** -> IndexPriceTickerResponse indexPriceTicker(underlying) + +# **indexPrice** +> IndexPriceResponse indexPrice(underlying) -Index Price Ticker +Index Price Get spot index price for option underlying. Weight: 1 @@ -228,10 +227,10 @@ public class Example { MarketDataApi apiInstance = new MarketDataApi(defaultClient); String underlying = "underlying_example"; // String | Option underlying, e.g BTCUSDT try { - IndexPriceTickerResponse result = apiInstance.indexPriceTicker(underlying); + IndexPriceResponse result = apiInstance.indexPrice(underlying); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling MarketDataApi#indexPriceTicker"); + System.err.println("Exception when calling MarketDataApi#indexPrice"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -249,7 +248,7 @@ public class Example { ### Return type -[**IndexPriceTickerResponse**](IndexPriceTickerResponse.md) +[**IndexPriceResponse**](IndexPriceResponse.md) ### Authorization @@ -263,7 +262,7 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Index Price Ticker | - | +| **200** | Index Price | - | # **klineCandlestickData** @@ -335,72 +334,6 @@ No authorization required |-------------|-------------|------------------| | **200** | Kline/Candlestick Data | - | - -# **oldTradesLookup** -> OldTradesLookupResponse oldTradesLookup(symbol, fromId, limit) - -Old Trades Lookup (MARKET_DATA) - -Get older market historical trades. Weight: 20 - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_options.ApiClient; -import com.binance.connector.client.derivatives_trading_options.ApiException; -import com.binance.connector.client.derivatives_trading_options.Configuration; -import com.binance.connector.client.derivatives_trading_options.models.*; -import com.binance.connector.client.derivatives_trading_options.rest.api.MarketDataApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://eapi.binance.com"); - - MarketDataApi apiInstance = new MarketDataApi(defaultClient); - String symbol = "symbol_example"; // String | Option trading pair, e.g BTC-200730-9000-C - Long fromId = 56L; // Long | The UniqueId ID from which to return. The latest deal record is returned by default - Long limit = 56L; // Long | Number of result sets returned Default:100 Max:1000 - try { - OldTradesLookupResponse result = apiInstance.oldTradesLookup(symbol, fromId, limit); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling MarketDataApi#oldTradesLookup"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **symbol** | **String**| Option trading pair, e.g BTC-200730-9000-C | | -| **fromId** | **Long**| The UniqueId ID from which to return. The latest deal record is returned by default | [optional] | -| **limit** | **Long**| Number of result sets returned Default:100 Max:1000 | [optional] | - -### Return type - -[**OldTradesLookupResponse**](OldTradesLookupResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Old Trades Lookup | - | - # **openInterest** > OpenInterestResponse openInterest(underlyingAsset, expiration) @@ -533,7 +466,7 @@ No authorization required Order Book -Check orderbook depth on specific symbol Weight: limit | weight ------------ | ------------ 5, 10, 20, 50 | 2 100 | 5 500 | 10 1000 | 20 +Check orderbook depth on specific symbol Weight: limit | weight ------------ | ------------ 5, 10, 20, 50 | 1 100 | 5 500 | 10 1000 | 20 ### Example ```java diff --git a/clients/derivatives-trading-options/docs/NewOrderResponse.md b/clients/derivatives-trading-options/docs/NewOrderResponse.md index 5741ad216..e28463f1e 100644 --- a/clients/derivatives-trading-options/docs/NewOrderResponse.md +++ b/clients/derivatives-trading-options/docs/NewOrderResponse.md @@ -11,24 +11,22 @@ |**symbol** | **String** | | [optional] | |**price** | **String** | | [optional] | |**quantity** | **String** | | [optional] | +|**executedQty** | **String** | | [optional] | |**side** | **String** | | [optional] | |**type** | **String** | | [optional] | -|**createDate** | **Long** | | [optional] | -|**reduceOnly** | **Boolean** | | [optional] | -|**postOnly** | **Boolean** | | [optional] | -|**mmp** | **Boolean** | | [optional] | -|**executedQty** | **String** | | [optional] | -|**fee** | **String** | | [optional] | |**timeInForce** | **String** | | [optional] | +|**reduceOnly** | **Boolean** | | [optional] | |**createTime** | **Long** | | [optional] | |**updateTime** | **Long** | | [optional] | |**status** | **String** | | [optional] | |**avgPrice** | **String** | | [optional] | +|**source** | **String** | | [optional] | |**clientOrderId** | **String** | | [optional] | |**priceScale** | **Long** | | [optional] | |**quantityScale** | **Long** | | [optional] | |**optionSide** | **String** | | [optional] | |**quoteAsset** | **String** | | [optional] | +|**mmp** | **Boolean** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/NewSymbolInfoRequest.md b/clients/derivatives-trading-options/docs/NewSymbolInfoRequest.md index f2584e039..d264e9fda 100644 --- a/clients/derivatives-trading-options/docs/NewSymbolInfoRequest.md +++ b/clients/derivatives-trading-options/docs/NewSymbolInfoRequest.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | +|**id** | **Integer** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/NewSymbolInfoResponse.md b/clients/derivatives-trading-options/docs/NewSymbolInfoResponse.md index 4b946577d..03a7d134a 100644 --- a/clients/derivatives-trading-options/docs/NewSymbolInfoResponse.md +++ b/clients/derivatives-trading-options/docs/NewSymbolInfoResponse.md @@ -9,14 +9,15 @@ |------------ | ------------- | ------------- | -------------| |**eLowerCase** | **String** | | [optional] | |**E** | **Long** | | [optional] | -|**uLowerCase** | **String** | | [optional] | -|**qa** | **String** | | [optional] | |**sLowerCase** | **String** | | [optional] | -|**unit** | **Long** | | [optional] | -|**mq** | **String** | | [optional] | +|**ps** | **String** | | [optional] | +|**qa** | **String** | | [optional] | |**dLowerCase** | **String** | | [optional] | |**sp** | **String** | | [optional] | -|**ed** | **Long** | | [optional] | +|**dt** | **Long** | | [optional] | +|**uLowerCase** | **Long** | | [optional] | +|**ot** | **Long** | | [optional] | +|**cs** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/OldTradesLookupResponseInner.md b/clients/derivatives-trading-options/docs/OldTradesLookupResponseInner.md deleted file mode 100644 index 277912b17..000000000 --- a/clients/derivatives-trading-options/docs/OldTradesLookupResponseInner.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# OldTradesLookupResponseInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**tradeId** | **String** | | [optional] | -|**price** | **String** | | [optional] | -|**qty** | **String** | | [optional] | -|**quoteQty** | **String** | | [optional] | -|**side** | **Long** | | [optional] | -|**time** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-options/docs/OpenInterestRequest.md b/clients/derivatives-trading-options/docs/OpenInterestRequest.md index 1ce656251..6bdbdb78b 100644 --- a/clients/derivatives-trading-options/docs/OpenInterestRequest.md +++ b/clients/derivatives-trading-options/docs/OpenInterestRequest.md @@ -7,8 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**underlyingAsset** | **String** | | | +|**id** | **Integer** | | [optional] | |**expirationDate** | **String** | | | diff --git a/clients/derivatives-trading-options/docs/OptionAccountInformationResponse.md b/clients/derivatives-trading-options/docs/OptionAccountInformationResponse.md deleted file mode 100644 index f9981f359..000000000 --- a/clients/derivatives-trading-options/docs/OptionAccountInformationResponse.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# OptionAccountInformationResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**asset** | [**List<OptionAccountInformationResponseAssetInner>**](OptionAccountInformationResponseAssetInner.md) | | [optional] | -|**greek** | [**List<OptionAccountInformationResponseGreekInner>**](OptionAccountInformationResponseGreekInner.md) | | [optional] | -|**time** | **Long** | | [optional] | -|**riskLevel** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-options/docs/OptionAccountInformationResponseAssetInner.md b/clients/derivatives-trading-options/docs/OptionAccountInformationResponseAssetInner.md deleted file mode 100644 index 0848756f9..000000000 --- a/clients/derivatives-trading-options/docs/OptionAccountInformationResponseAssetInner.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# OptionAccountInformationResponseAssetInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**asset** | **String** | | [optional] | -|**marginBalance** | **String** | | [optional] | -|**equity** | **String** | | [optional] | -|**available** | **String** | | [optional] | -|**locked** | **String** | | [optional] | -|**unrealizedPNL** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-options/docs/OptionMarginAccountInformationResponse.md b/clients/derivatives-trading-options/docs/OptionMarginAccountInformationResponse.md index a3891a631..f168b3a14 100644 --- a/clients/derivatives-trading-options/docs/OptionMarginAccountInformationResponse.md +++ b/clients/derivatives-trading-options/docs/OptionMarginAccountInformationResponse.md @@ -8,8 +8,12 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**asset** | [**List<OptionMarginAccountInformationResponseAssetInner>**](OptionMarginAccountInformationResponseAssetInner.md) | | [optional] | -|**greek** | [**List<OptionAccountInformationResponseGreekInner>**](OptionAccountInformationResponseGreekInner.md) | | [optional] | +|**greek** | [**List<OptionMarginAccountInformationResponseGreekInner>**](OptionMarginAccountInformationResponseGreekInner.md) | | [optional] | |**time** | **Long** | | [optional] | +|**canTrade** | **Boolean** | | [optional] | +|**canDeposit** | **Boolean** | | [optional] | +|**canWithdraw** | **Boolean** | | [optional] | +|**reduceOnly** | **Boolean** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/OptionAccountInformationResponseGreekInner.md b/clients/derivatives-trading-options/docs/OptionMarginAccountInformationResponseGreekInner.md similarity index 87% rename from clients/derivatives-trading-options/docs/OptionAccountInformationResponseGreekInner.md rename to clients/derivatives-trading-options/docs/OptionMarginAccountInformationResponseGreekInner.md index b7e221357..d1c932084 100644 --- a/clients/derivatives-trading-options/docs/OptionAccountInformationResponseGreekInner.md +++ b/clients/derivatives-trading-options/docs/OptionMarginAccountInformationResponseGreekInner.md @@ -1,6 +1,6 @@ -# OptionAccountInformationResponseGreekInner +# OptionMarginAccountInformationResponseGreekInner ## Properties @@ -9,8 +9,8 @@ |------------ | ------------- | ------------- | -------------| |**underlying** | **String** | | [optional] | |**delta** | **String** | | [optional] | -|**gamma** | **String** | | [optional] | |**theta** | **String** | | [optional] | +|**gamma** | **String** | | [optional] | |**vega** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/OptionPositionInformationResponseInner.md b/clients/derivatives-trading-options/docs/OptionPositionInformationResponseInner.md index ba2121879..5b14c72a7 100644 --- a/clients/derivatives-trading-options/docs/OptionPositionInformationResponseInner.md +++ b/clients/derivatives-trading-options/docs/OptionPositionInformationResponseInner.md @@ -11,18 +11,18 @@ |**symbol** | **String** | | [optional] | |**side** | **String** | | [optional] | |**quantity** | **String** | | [optional] | -|**reducibleQty** | **String** | | [optional] | |**markValue** | **String** | | [optional] | -|**ror** | **String** | | [optional] | |**unrealizedPNL** | **String** | | [optional] | |**markPrice** | **String** | | [optional] | |**strikePrice** | **String** | | [optional] | -|**positionCost** | **String** | | [optional] | |**expiryDate** | **Long** | | [optional] | |**priceScale** | **Long** | | [optional] | |**quantityScale** | **Long** | | [optional] | |**optionSide** | **String** | | [optional] | |**quoteAsset** | **String** | | [optional] | +|**time** | **Long** | | [optional] | +|**bidQuantity** | **String** | | [optional] | +|**askQuantity** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/OrderBookResponse.md b/clients/derivatives-trading-options/docs/OrderBookResponse.md index 02cb0a098..9de81f67b 100644 --- a/clients/derivatives-trading-options/docs/OrderBookResponse.md +++ b/clients/derivatives-trading-options/docs/OrderBookResponse.md @@ -7,10 +7,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**T** | **Long** | | [optional] | -|**uLowerCase** | **Long** | | [optional] | |**bids** | **List<OrderBookResponseBidsItem>** | | [optional] | |**asks** | **List<OrderBookResponseAsksItem>** | | [optional] | +|**T** | **Long** | | [optional] | +|**lastUpdateId** | **Long** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/OrderTradeUpdate.md b/clients/derivatives-trading-options/docs/OrderTradeUpdate.md index ea80191de..064017905 100644 --- a/clients/derivatives-trading-options/docs/OrderTradeUpdate.md +++ b/clients/derivatives-trading-options/docs/OrderTradeUpdate.md @@ -8,7 +8,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**E** | **Long** | | [optional] | -|**oLowerCase** | [**List<OrderTradeUpdateOInner>**](OrderTradeUpdateOInner.md) | | [optional] | +|**T** | **Long** | | [optional] | +|**oLowerCase** | [**OrderTradeUpdateO**](OrderTradeUpdateO.md) | | [optional] | diff --git a/clients/derivatives-trading-options/docs/OrderTradeUpdateO.md b/clients/derivatives-trading-options/docs/OrderTradeUpdateO.md new file mode 100644 index 000000000..794d0c420 --- /dev/null +++ b/clients/derivatives-trading-options/docs/OrderTradeUpdateO.md @@ -0,0 +1,36 @@ + + +# OrderTradeUpdateO + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sLowerCase** | **String** | | [optional] | +|**cLowerCase** | **String** | | [optional] | +|**S** | **String** | | [optional] | +|**oLowerCase** | **String** | | [optional] | +|**fLowerCase** | **String** | | [optional] | +|**qLowerCase** | **String** | | [optional] | +|**pLowerCase** | **String** | | [optional] | +|**ap** | **String** | | [optional] | +|**xLowerCase** | **String** | | [optional] | +|**X** | **String** | | [optional] | +|**iLowerCase** | **Long** | | [optional] | +|**lLowerCase** | **String** | | [optional] | +|**zLowerCase** | **String** | | [optional] | +|**L** | **String** | | [optional] | +|**N** | **String** | | [optional] | +|**nLowerCase** | **String** | | [optional] | +|**T** | **Long** | | [optional] | +|**tLowerCase** | **Long** | | [optional] | +|**bLowerCase** | **String** | | [optional] | +|**aLowerCase** | **String** | | [optional] | +|**mLowerCase** | **Boolean** | | [optional] | +|**R** | **Boolean** | | [optional] | +|**ot** | **String** | | [optional] | +|**rp** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-options/docs/OrderTradeUpdateOInner.md b/clients/derivatives-trading-options/docs/OrderTradeUpdateOInner.md deleted file mode 100644 index 48404e70e..000000000 --- a/clients/derivatives-trading-options/docs/OrderTradeUpdateOInner.md +++ /dev/null @@ -1,29 +0,0 @@ - - -# OrderTradeUpdateOInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**T** | **Long** | | [optional] | -|**tLowerCase** | **Long** | | [optional] | -|**sLowerCase** | **String** | | [optional] | -|**cLowerCase** | **String** | | [optional] | -|**oid** | **String** | | [optional] | -|**pLowerCase** | **String** | | [optional] | -|**qLowerCase** | **String** | | [optional] | -|**stp** | **Long** | | [optional] | -|**rLowerCase** | **Boolean** | | [optional] | -|**po** | **Boolean** | | [optional] | -|**S** | **String** | | [optional] | -|**eLowerCase** | **String** | | [optional] | -|**ec** | **String** | | [optional] | -|**fLowerCase** | **String** | | [optional] | -|**tif** | **String** | | [optional] | -|**oty** | **String** | | [optional] | -|**fi** | [**List<OrderTradeUpdateOInnerFiInner>**](OrderTradeUpdateOInnerFiInner.md) | | [optional] | - - - diff --git a/clients/derivatives-trading-options/docs/OrderTradeUpdateOInnerFiInner.md b/clients/derivatives-trading-options/docs/OrderTradeUpdateOInnerFiInner.md deleted file mode 100644 index ee60c44d0..000000000 --- a/clients/derivatives-trading-options/docs/OrderTradeUpdateOInnerFiInner.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# OrderTradeUpdateOInnerFiInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**tLowerCase** | **String** | | [optional] | -|**pLowerCase** | **String** | | [optional] | -|**qLowerCase** | **String** | | [optional] | -|**T** | **Long** | | [optional] | -|**mLowerCase** | **String** | | [optional] | -|**fLowerCase** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-options/docs/OrdersInner.md b/clients/derivatives-trading-options/docs/OrdersInner.md index 60686485c..be2cf5bb9 100644 --- a/clients/derivatives-trading-options/docs/OrdersInner.md +++ b/clients/derivatives-trading-options/docs/OrdersInner.md @@ -45,6 +45,7 @@ | GTC | "GTC" | | IOC | "IOC" | | FOK | "FOK" | +| GTX | "GTX" | diff --git a/clients/derivatives-trading-options/docs/PartialBookDepthStreamsRequest.md b/clients/derivatives-trading-options/docs/PartialBookDepthStreamsRequest.md index 1ccf85f6e..3108675b9 100644 --- a/clients/derivatives-trading-options/docs/PartialBookDepthStreamsRequest.md +++ b/clients/derivatives-trading-options/docs/PartialBookDepthStreamsRequest.md @@ -7,9 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | +|**id** | **Integer** | | [optional] | |**symbol** | **String** | | | -|**levels** | **Long** | | | +|**level** | **String** | | | |**updateSpeed** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/PartialBookDepthStreamsResponse.md b/clients/derivatives-trading-options/docs/PartialBookDepthStreamsResponse.md index 07e9c007f..75bc4521a 100644 --- a/clients/derivatives-trading-options/docs/PartialBookDepthStreamsResponse.md +++ b/clients/derivatives-trading-options/docs/PartialBookDepthStreamsResponse.md @@ -11,6 +11,7 @@ |**E** | **Long** | | [optional] | |**T** | **Long** | | [optional] | |**sLowerCase** | **String** | | [optional] | +|**U** | **Long** | | [optional] | |**uLowerCase** | **Long** | | [optional] | |**pu** | **Long** | | [optional] | |**bLowerCase** | **List<PartialBookDepthStreamsResponseBItem>** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/PlaceMultipleOrdersResponseInner.md b/clients/derivatives-trading-options/docs/PlaceMultipleOrdersResponseInner.md index 893927d46..bd13fc4d0 100644 --- a/clients/derivatives-trading-options/docs/PlaceMultipleOrdersResponseInner.md +++ b/clients/derivatives-trading-options/docs/PlaceMultipleOrdersResponseInner.md @@ -11,11 +11,21 @@ |**symbol** | **String** | | [optional] | |**price** | **String** | | [optional] | |**quantity** | **String** | | [optional] | +|**executedQty** | **String** | | [optional] | |**side** | **String** | | [optional] | |**type** | **String** | | [optional] | +|**timeInForce** | **String** | | [optional] | |**reduceOnly** | **Boolean** | | [optional] | -|**postOnly** | **Boolean** | | [optional] | +|**createTime** | **Long** | | [optional] | +|**updateTime** | **Long** | | [optional] | +|**status** | **String** | | [optional] | +|**avgPrice** | **String** | | [optional] | +|**source** | **String** | | [optional] | |**clientOrderId** | **String** | | [optional] | +|**priceScale** | **Long** | | [optional] | +|**quantityScale** | **Long** | | [optional] | +|**optionSide** | **String** | | [optional] | +|**quoteAsset** | **String** | | [optional] | |**mmp** | **Boolean** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/PublicApi.md b/clients/derivatives-trading-options/docs/PublicApi.md new file mode 100644 index 000000000..210d67095 --- /dev/null +++ b/clients/derivatives-trading-options/docs/PublicApi.md @@ -0,0 +1,323 @@ +# PublicApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**diffBookDepthStreams**](PublicApi.md#diffBookDepthStreams) | **POST** /<symbol>@depth@<updateSpeed> | Diff Book Depth Streams | +| [**individualSymbolBookTickerStreams**](PublicApi.md#individualSymbolBookTickerStreams) | **POST** /<symbol>@bookTicker | Individual Symbol Book Ticker Streams | +| [**partialBookDepthStreams**](PublicApi.md#partialBookDepthStreams) | **POST** /<symbol>@depth<level>@<updateSpeed> | Partial Book Depth Streams | +| [**ticker24Hour**](PublicApi.md#ticker24Hour) | **POST** /<symbol>@optionTicker | 24-hour TICKER | +| [**tradeStreams**](PublicApi.md#tradeStreams) | **POST** /<symbol>@optionTrade | Trade Streams | + + + +# **diffBookDepthStreams** +> DiffBookDepthStreamsResponse diffBookDepthStreams(diffBookDepthStreamsRequest) + +Diff Book Depth Streams + +Bids and asks, pushed every 500 milliseconds, 100 milliseconds (if existing) Update Speed: 100ms or 500ms + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_options.ApiClient; +import com.binance.connector.client.derivatives_trading_options.ApiException; +import com.binance.connector.client.derivatives_trading_options.Configuration; +import com.binance.connector.client.derivatives_trading_options.models.*; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.PublicApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + PublicApi apiInstance = new PublicApi(defaultClient); + DiffBookDepthStreamsRequest diffBookDepthStreamsRequest = new DiffBookDepthStreamsRequest(); // DiffBookDepthStreamsRequest | + try { + DiffBookDepthStreamsResponse result = apiInstance.diffBookDepthStreams(diffBookDepthStreamsRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PublicApi#diffBookDepthStreams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **diffBookDepthStreamsRequest** | [**DiffBookDepthStreamsRequest**](DiffBookDepthStreamsRequest.md)| | | + +### Return type + +[**DiffBookDepthStreamsResponse**](DiffBookDepthStreamsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Diff Book Depth Streams | - | + + +# **individualSymbolBookTickerStreams** +> IndividualSymbolBookTickerStreamsResponse individualSymbolBookTickerStreams(individualSymbolBookTickerStreamsRequest) + +Individual Symbol Book Ticker Streams + +Pushes any update to the best bid or ask's price or quantity in real-time for a specified symbol. Update Speed: Real-Time + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_options.ApiClient; +import com.binance.connector.client.derivatives_trading_options.ApiException; +import com.binance.connector.client.derivatives_trading_options.Configuration; +import com.binance.connector.client.derivatives_trading_options.models.*; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.PublicApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + PublicApi apiInstance = new PublicApi(defaultClient); + IndividualSymbolBookTickerStreamsRequest individualSymbolBookTickerStreamsRequest = new IndividualSymbolBookTickerStreamsRequest(); // IndividualSymbolBookTickerStreamsRequest | + try { + IndividualSymbolBookTickerStreamsResponse result = apiInstance.individualSymbolBookTickerStreams(individualSymbolBookTickerStreamsRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PublicApi#individualSymbolBookTickerStreams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **individualSymbolBookTickerStreamsRequest** | [**IndividualSymbolBookTickerStreamsRequest**](IndividualSymbolBookTickerStreamsRequest.md)| | | + +### Return type + +[**IndividualSymbolBookTickerStreamsResponse**](IndividualSymbolBookTickerStreamsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Individual Symbol Book Ticker Streams | - | + + +# **partialBookDepthStreams** +> PartialBookDepthStreamsResponse partialBookDepthStreams(partialBookDepthStreamsRequest) + +Partial Book Depth Streams + +Top **<levels\\>** bids and asks, Valid levels are **<levels\\>** are 5, 10, 20. Update Speed: 100ms or 500ms + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_options.ApiClient; +import com.binance.connector.client.derivatives_trading_options.ApiException; +import com.binance.connector.client.derivatives_trading_options.Configuration; +import com.binance.connector.client.derivatives_trading_options.models.*; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.PublicApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + PublicApi apiInstance = new PublicApi(defaultClient); + PartialBookDepthStreamsRequest partialBookDepthStreamsRequest = new PartialBookDepthStreamsRequest(); // PartialBookDepthStreamsRequest | + try { + PartialBookDepthStreamsResponse result = apiInstance.partialBookDepthStreams(partialBookDepthStreamsRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PublicApi#partialBookDepthStreams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **partialBookDepthStreamsRequest** | [**PartialBookDepthStreamsRequest**](PartialBookDepthStreamsRequest.md)| | | + +### Return type + +[**PartialBookDepthStreamsResponse**](PartialBookDepthStreamsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Partial Book Depth Streams | - | + + +# **ticker24Hour** +> Ticker24HourResponse ticker24Hour(ticker24HourRequest) + +24-hour TICKER + +24hr ticker info for all symbols. Only symbols whose ticker info changed will be sent. Update Speed: 1000ms + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_options.ApiClient; +import com.binance.connector.client.derivatives_trading_options.ApiException; +import com.binance.connector.client.derivatives_trading_options.Configuration; +import com.binance.connector.client.derivatives_trading_options.models.*; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.PublicApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + PublicApi apiInstance = new PublicApi(defaultClient); + Ticker24HourRequest ticker24HourRequest = new Ticker24HourRequest(); // Ticker24HourRequest | + try { + Ticker24HourResponse result = apiInstance.ticker24Hour(ticker24HourRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PublicApi#ticker24Hour"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **ticker24HourRequest** | [**Ticker24HourRequest**](Ticker24HourRequest.md)| | | + +### Return type + +[**Ticker24HourResponse**](Ticker24HourResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | 24-hour TICKER | - | + + +# **tradeStreams** +> TradeStreamsResponse tradeStreams(tradeStreamsRequest) + +Trade Streams + +The Trade Streams push raw trade information for specific symbol or underlying asset. E.g.[btcusdt@optionTrade](wss://fstream.binance.com/public/stream?streams=btcusdt@optionTrade) Update Speed: 50ms + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_options.ApiClient; +import com.binance.connector.client.derivatives_trading_options.ApiException; +import com.binance.connector.client.derivatives_trading_options.Configuration; +import com.binance.connector.client.derivatives_trading_options.models.*; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.PublicApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + PublicApi apiInstance = new PublicApi(defaultClient); + TradeStreamsRequest tradeStreamsRequest = new TradeStreamsRequest(); // TradeStreamsRequest | + try { + TradeStreamsResponse result = apiInstance.tradeStreams(tradeStreamsRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PublicApi#tradeStreams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tradeStreamsRequest** | [**TradeStreamsRequest**](TradeStreamsRequest.md)| | | + +### Return type + +[**TradeStreamsResponse**](TradeStreamsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Trade Streams | - | + diff --git a/clients/derivatives-trading-options/docs/QueryCurrentOpenOptionOrdersResponseInner.md b/clients/derivatives-trading-options/docs/QueryCurrentOpenOptionOrdersResponseInner.md index 2e0d9fe17..94c7e4f50 100644 --- a/clients/derivatives-trading-options/docs/QueryCurrentOpenOptionOrdersResponseInner.md +++ b/clients/derivatives-trading-options/docs/QueryCurrentOpenOptionOrdersResponseInner.md @@ -12,12 +12,10 @@ |**price** | **String** | | [optional] | |**quantity** | **String** | | [optional] | |**executedQty** | **String** | | [optional] | -|**fee** | **String** | | [optional] | |**side** | **String** | | [optional] | |**type** | **String** | | [optional] | |**timeInForce** | **String** | | [optional] | |**reduceOnly** | **Boolean** | | [optional] | -|**postOnly** | **Boolean** | | [optional] | |**createTime** | **Long** | | [optional] | |**updateTime** | **Long** | | [optional] | |**status** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/QueryOptionOrderHistoryResponseInner.md b/clients/derivatives-trading-options/docs/QueryOptionOrderHistoryResponseInner.md index de6594eca..e58165417 100644 --- a/clients/derivatives-trading-options/docs/QueryOptionOrderHistoryResponseInner.md +++ b/clients/derivatives-trading-options/docs/QueryOptionOrderHistoryResponseInner.md @@ -12,18 +12,14 @@ |**price** | **String** | | [optional] | |**quantity** | **String** | | [optional] | |**executedQty** | **String** | | [optional] | -|**fee** | **String** | | [optional] | |**side** | **String** | | [optional] | |**type** | **String** | | [optional] | |**timeInForce** | **String** | | [optional] | |**reduceOnly** | **Boolean** | | [optional] | -|**postOnly** | **Boolean** | | [optional] | |**createTime** | **Long** | | [optional] | |**updateTime** | **Long** | | [optional] | |**status** | **String** | | [optional] | -|**reason** | **String** | | [optional] | |**avgPrice** | **String** | | [optional] | -|**source** | **String** | | [optional] | |**clientOrderId** | **String** | | [optional] | |**priceScale** | **Long** | | [optional] | |**quantityScale** | **Long** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/QuerySingleOrderResponse.md b/clients/derivatives-trading-options/docs/QuerySingleOrderResponse.md index a092d39bc..d2e6861a0 100644 --- a/clients/derivatives-trading-options/docs/QuerySingleOrderResponse.md +++ b/clients/derivatives-trading-options/docs/QuerySingleOrderResponse.md @@ -12,17 +12,14 @@ |**price** | **String** | | [optional] | |**quantity** | **String** | | [optional] | |**executedQty** | **String** | | [optional] | -|**fee** | **String** | | [optional] | |**side** | **String** | | [optional] | |**type** | **String** | | [optional] | |**timeInForce** | **String** | | [optional] | |**reduceOnly** | **Boolean** | | [optional] | -|**postOnly** | **Boolean** | | [optional] | |**createTime** | **Long** | | [optional] | |**updateTime** | **Long** | | [optional] | |**status** | **String** | | [optional] | |**avgPrice** | **String** | | [optional] | -|**source** | **String** | | [optional] | |**clientOrderId** | **String** | | [optional] | |**priceScale** | **Long** | | [optional] | |**quantityScale** | **Long** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/RecentTradesListResponseInner.md b/clients/derivatives-trading-options/docs/RecentTradesListResponseInner.md index ea05b8a3f..fb0eabb47 100644 --- a/clients/derivatives-trading-options/docs/RecentTradesListResponseInner.md +++ b/clients/derivatives-trading-options/docs/RecentTradesListResponseInner.md @@ -7,7 +7,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | +|**id** | **Long** | | [optional] | +|**tradeId** | **Long** | | [optional] | |**symbol** | **String** | | [optional] | |**price** | **String** | | [optional] | |**qty** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/StartUserDataStreamResponse.md b/clients/derivatives-trading-options/docs/StartUserDataStreamResponse.md index 5908d1f6e..523469bae 100644 --- a/clients/derivatives-trading-options/docs/StartUserDataStreamResponse.md +++ b/clients/derivatives-trading-options/docs/StartUserDataStreamResponse.md @@ -8,6 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**listenKey** | **String** | | [optional] | +|**expiration** | **Long** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/Ticker24HourByUnderlyingAssetAndExpirationDataRequest.md b/clients/derivatives-trading-options/docs/Ticker24HourByUnderlyingAssetAndExpirationDataRequest.md deleted file mode 100644 index c93c7658f..000000000 --- a/clients/derivatives-trading-options/docs/Ticker24HourByUnderlyingAssetAndExpirationDataRequest.md +++ /dev/null @@ -1,15 +0,0 @@ - - -# Ticker24HourByUnderlyingAssetAndExpirationDataRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**underlyingAsset** | **String** | | | -|**expirationDate** | **String** | | | - - - diff --git a/clients/derivatives-trading-options/docs/Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.md b/clients/derivatives-trading-options/docs/Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.md deleted file mode 100644 index 9a858ffe9..000000000 --- a/clients/derivatives-trading-options/docs/Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.md +++ /dev/null @@ -1,43 +0,0 @@ - - -# Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**eLowerCase** | **String** | | [optional] | -|**E** | **Long** | | [optional] | -|**T** | **Long** | | [optional] | -|**sLowerCase** | **String** | | [optional] | -|**oLowerCase** | **String** | | [optional] | -|**hLowerCase** | **String** | | [optional] | -|**lLowerCase** | **String** | | [optional] | -|**cLowerCase** | **String** | | [optional] | -|**V** | **String** | | [optional] | -|**A** | **String** | | [optional] | -|**P** | **String** | | [optional] | -|**pLowerCase** | **String** | | [optional] | -|**Q** | **String** | | [optional] | -|**F** | **String** | | [optional] | -|**L** | **String** | | [optional] | -|**nLowerCase** | **Long** | | [optional] | -|**bo** | **String** | | [optional] | -|**ao** | **String** | | [optional] | -|**bq** | **String** | | [optional] | -|**aq** | **String** | | [optional] | -|**bLowerCase** | **String** | | [optional] | -|**aLowerCase** | **String** | | [optional] | -|**dLowerCase** | **String** | | [optional] | -|**tLowerCase** | **String** | | [optional] | -|**gLowerCase** | **String** | | [optional] | -|**vLowerCase** | **String** | | [optional] | -|**vo** | **String** | | [optional] | -|**mp** | **String** | | [optional] | -|**hl** | **String** | | [optional] | -|**ll** | **String** | | [optional] | -|**eep** | **String** | | [optional] | - - - diff --git a/clients/derivatives-trading-options/docs/Ticker24HourRequest.md b/clients/derivatives-trading-options/docs/Ticker24HourRequest.md index a1df00b53..7a4333987 100644 --- a/clients/derivatives-trading-options/docs/Ticker24HourRequest.md +++ b/clients/derivatives-trading-options/docs/Ticker24HourRequest.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | +|**id** | **Integer** | | [optional] | |**symbol** | **String** | | | diff --git a/clients/derivatives-trading-options/docs/Ticker24HourResponse.md b/clients/derivatives-trading-options/docs/Ticker24HourResponse.md index e3af79fa2..8f893706d 100644 --- a/clients/derivatives-trading-options/docs/Ticker24HourResponse.md +++ b/clients/derivatives-trading-options/docs/Ticker24HourResponse.md @@ -9,35 +9,22 @@ |------------ | ------------- | ------------- | -------------| |**eLowerCase** | **String** | | [optional] | |**E** | **Long** | | [optional] | -|**T** | **Long** | | [optional] | |**sLowerCase** | **String** | | [optional] | +|**pLowerCase** | **String** | | [optional] | +|**P** | **String** | | [optional] | +|**wLowerCase** | **String** | | [optional] | +|**cLowerCase** | **String** | | [optional] | +|**Q** | **String** | | [optional] | |**oLowerCase** | **String** | | [optional] | |**hLowerCase** | **String** | | [optional] | |**lLowerCase** | **String** | | [optional] | -|**cLowerCase** | **String** | | [optional] | -|**V** | **String** | | [optional] | -|**A** | **String** | | [optional] | -|**P** | **String** | | [optional] | -|**pLowerCase** | **String** | | [optional] | -|**Q** | **String** | | [optional] | -|**F** | **String** | | [optional] | -|**L** | **String** | | [optional] | -|**nLowerCase** | **Long** | | [optional] | -|**bo** | **String** | | [optional] | -|**ao** | **String** | | [optional] | -|**bq** | **String** | | [optional] | -|**aq** | **String** | | [optional] | -|**bLowerCase** | **String** | | [optional] | -|**aLowerCase** | **String** | | [optional] | -|**dLowerCase** | **String** | | [optional] | -|**tLowerCase** | **String** | | [optional] | -|**gLowerCase** | **String** | | [optional] | |**vLowerCase** | **String** | | [optional] | -|**vo** | **String** | | [optional] | -|**mp** | **String** | | [optional] | -|**hl** | **String** | | [optional] | -|**ll** | **String** | | [optional] | -|**eep** | **String** | | [optional] | +|**qLowerCase** | **String** | | [optional] | +|**O** | **Long** | | [optional] | +|**C** | **Long** | | [optional] | +|**F** | **Long** | | [optional] | +|**L** | **Long** | | [optional] | +|**nLowerCase** | **Long** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/TimeInForce.md b/clients/derivatives-trading-options/docs/TimeInForce.md index 551040eb9..96ed69b03 100644 --- a/clients/derivatives-trading-options/docs/TimeInForce.md +++ b/clients/derivatives-trading-options/docs/TimeInForce.md @@ -11,5 +11,7 @@ * `FOK` (value: `"FOK"`) +* `GTX` (value: `"GTX"`) + diff --git a/clients/derivatives-trading-options/docs/TradeApi.md b/clients/derivatives-trading-options/docs/TradeApi.md index f90f6f3e5..ce7a9fbfe 100644 --- a/clients/derivatives-trading-options/docs/TradeApi.md +++ b/clients/derivatives-trading-options/docs/TradeApi.md @@ -15,6 +15,7 @@ All URIs are relative to *https://eapi.binance.com* | [**queryCurrentOpenOptionOrders**](TradeApi.md#queryCurrentOpenOptionOrders) | **GET** /eapi/v1/openOrders | Query Current Open Option Orders (USER_DATA) | | [**queryOptionOrderHistory**](TradeApi.md#queryOptionOrderHistory) | **GET** /eapi/v1/historyOrders | Query Option Order History (TRADE) | | [**querySingleOrder**](TradeApi.md#querySingleOrder) | **GET** /eapi/v1/order | Query Single Order (TRADE) | +| [**userCommission**](TradeApi.md#userCommission) | **GET** /eapi/v1/commission | User Commission (USER_DATA) | | [**userExerciseRecord**](TradeApi.md#userExerciseRecord) | **GET** /eapi/v1/exerciseRecord | User Exercise Record (USER_DATA) | @@ -42,7 +43,7 @@ public class Example { TradeApi apiInstance = new TradeApi(defaultClient); String symbol = "symbol_example"; // String | Option trading pair, e.g BTC-200730-9000-C - Long fromId = 56L; // Long | The UniqueId ID from which to return. The latest deal record is returned by default + Long fromId = 56L; // Long | Trade id to fetch from. Default gets most recent trades, e.g 4611875134427365376 Long startTime = 56L; // Long | Start Time, e.g 1593511200000 Long endTime = 56L; // Long | End Time, e.g 1593512200000 Long limit = 56L; // Long | Number of result sets returned Default:100 Max:1000 @@ -66,7 +67,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **symbol** | **String**| Option trading pair, e.g BTC-200730-9000-C | [optional] | -| **fromId** | **Long**| The UniqueId ID from which to return. The latest deal record is returned by default | [optional] | +| **fromId** | **Long**| Trade id to fetch from. Default gets most recent trades, e.g 4611875134427365376 | [optional] | | **startTime** | **Long**| Start Time, e.g 1593511200000 | [optional] | | **endTime** | **Long**| End Time, e.g 1593512200000 | [optional] | | **limit** | **Long**| Number of result sets returned Default:100 Max:1000 | [optional] | @@ -224,7 +225,7 @@ No authorization required Cancel Multiple Option Orders (TRADE) -Cancel multiple orders. * At least one instance of `orderId` and `clientOrderId` must be sent. * Max 10 orders can be deleted in one request Weight: 1 +Cancel multiple orders. * At least one instance of `orderId` and `clientOrderId` must be sent. Weight: 1 ### Example ```java @@ -752,6 +753,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Single Order | - | + +# **userCommission** +> UserCommissionResponse userCommission(recvWindow) + +User Commission (USER_DATA) + +Get account commission. Weight: 5 + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_options.ApiClient; +import com.binance.connector.client.derivatives_trading_options.ApiException; +import com.binance.connector.client.derivatives_trading_options.Configuration; +import com.binance.connector.client.derivatives_trading_options.models.*; +import com.binance.connector.client.derivatives_trading_options.rest.api.TradeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://eapi.binance.com"); + + TradeApi apiInstance = new TradeApi(defaultClient); + Long recvWindow = 56L; // Long | + try { + UserCommissionResponse result = apiInstance.userCommission(recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradeApi#userCommission"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**UserCommissionResponse**](UserCommissionResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | User Commission | - | + # **userExerciseRecord** > UserExerciseRecordResponse userExerciseRecord(symbol, startTime, endTime, limit, recvWindow) diff --git a/clients/derivatives-trading-options/docs/TradeStreamsRequest.md b/clients/derivatives-trading-options/docs/TradeStreamsRequest.md index 26ac27e77..65d27f30f 100644 --- a/clients/derivatives-trading-options/docs/TradeStreamsRequest.md +++ b/clients/derivatives-trading-options/docs/TradeStreamsRequest.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | +|**id** | **Integer** | | [optional] | |**symbol** | **String** | | | diff --git a/clients/derivatives-trading-options/docs/TradeStreamsResponse.md b/clients/derivatives-trading-options/docs/TradeStreamsResponse.md index 09595ed78..e1944f050 100644 --- a/clients/derivatives-trading-options/docs/TradeStreamsResponse.md +++ b/clients/derivatives-trading-options/docs/TradeStreamsResponse.md @@ -9,15 +9,14 @@ |------------ | ------------- | ------------- | -------------| |**eLowerCase** | **String** | | [optional] | |**E** | **Long** | | [optional] | +|**T** | **Long** | | [optional] | |**sLowerCase** | **String** | | [optional] | -|**tLowerCase** | **String** | | [optional] | +|**tLowerCase** | **Long** | | [optional] | |**pLowerCase** | **String** | | [optional] | |**qLowerCase** | **String** | | [optional] | -|**bLowerCase** | **Long** | | [optional] | -|**aLowerCase** | **Long** | | [optional] | -|**T** | **Long** | | [optional] | -|**S** | **String** | | [optional] | |**X** | **String** | | [optional] | +|**S** | **String** | | [optional] | +|**mLowerCase** | **Boolean** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/UserCommissionResponse.md b/clients/derivatives-trading-options/docs/UserCommissionResponse.md new file mode 100644 index 000000000..fb307d028 --- /dev/null +++ b/clients/derivatives-trading-options/docs/UserCommissionResponse.md @@ -0,0 +1,13 @@ + + +# UserCommissionResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**commissions** | [**List<UserCommissionResponseCommissionsInner>**](UserCommissionResponseCommissionsInner.md) | | [optional] | + + + diff --git a/clients/derivatives-trading-options/docs/UserCommissionResponseCommissionsInner.md b/clients/derivatives-trading-options/docs/UserCommissionResponseCommissionsInner.md new file mode 100644 index 000000000..8f5fecf4c --- /dev/null +++ b/clients/derivatives-trading-options/docs/UserCommissionResponseCommissionsInner.md @@ -0,0 +1,15 @@ + + +# UserCommissionResponseCommissionsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**underlying** | **String** | | [optional] | +|**makerFee** | **String** | | [optional] | +|**takerFee** | **String** | | [optional] | + + + diff --git a/clients/derivatives-trading-options/docs/UserDataStreamEventsResponse.md b/clients/derivatives-trading-options/docs/UserDataStreamEventsResponse.md index 721a7e737..c6cb8b974 100644 --- a/clients/derivatives-trading-options/docs/UserDataStreamEventsResponse.md +++ b/clients/derivatives-trading-options/docs/UserDataStreamEventsResponse.md @@ -7,15 +7,17 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**E** | **Long** | | [optional] | -|**B** | [**List<AccountUpdateBInner>**](AccountUpdateBInner.md) | | [optional] | -|**G** | [**List<AccountUpdateGInner>**](AccountUpdateGInner.md) | | [optional] | -|**P** | [**List<AccountUpdatePInner>**](AccountUpdatePInner.md) | | [optional] | -|**uid** | **Long** | | [optional] | -|**oLowerCase** | [**List<OrderTradeUpdateOInner>**](OrderTradeUpdateOInner.md) | | [optional] | +|**E** | **String** | | [optional] | +|**T** | **Long** | | [optional] | +|**mLowerCase** | **String** | | [optional] | +|**B** | [**List<BalancePositionUpdateBInner>**](BalancePositionUpdateBInner.md) | | [optional] | +|**P** | [**List<BalancePositionUpdatePInner>**](BalancePositionUpdatePInner.md) | | [optional] | +|**G** | [**List<GreekUpdateGInner>**](GreekUpdateGInner.md) | | [optional] | +|**oLowerCase** | [**OrderTradeUpdateO**](OrderTradeUpdateO.md) | | [optional] | |**sLowerCase** | **String** | | [optional] | |**mb** | **String** | | [optional] | |**mm** | **String** | | [optional] | +|**listenKey** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/UserExerciseRecordResponseInner.md b/clients/derivatives-trading-options/docs/UserExerciseRecordResponseInner.md index 8ac529bfc..4b28fe8a0 100644 --- a/clients/derivatives-trading-options/docs/UserExerciseRecordResponseInner.md +++ b/clients/derivatives-trading-options/docs/UserExerciseRecordResponseInner.md @@ -11,7 +11,6 @@ |**currency** | **String** | | [optional] | |**symbol** | **String** | | [optional] | |**exercisePrice** | **String** | | [optional] | -|**markPrice** | **String** | | [optional] | |**quantity** | **String** | | [optional] | |**amount** | **String** | | [optional] | |**fee** | **String** | | [optional] | diff --git a/clients/derivatives-trading-options/docs/WebsocketMarketStreamsApi.md b/clients/derivatives-trading-options/docs/WebsocketMarketStreamsApi.md deleted file mode 100644 index 967b8d6be..000000000 --- a/clients/derivatives-trading-options/docs/WebsocketMarketStreamsApi.md +++ /dev/null @@ -1,575 +0,0 @@ -# WebsocketMarketStreamsApi - -All URIs are relative to *http://localhost* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**indexPriceStreams**](WebsocketMarketStreamsApi.md#indexPriceStreams) | **POST** /<symbol>@index | Index Price Streams | -| [**klineCandlestickStreams**](WebsocketMarketStreamsApi.md#klineCandlestickStreams) | **POST** /<symbol>@kline_<interval> | Kline/Candlestick Streams | -| [**markPrice**](WebsocketMarketStreamsApi.md#markPrice) | **POST** /<underlyingAsset>@markPrice | Mark Price | -| [**newSymbolInfo**](WebsocketMarketStreamsApi.md#newSymbolInfo) | **POST** /option_pair | New Symbol Info | -| [**openInterest**](WebsocketMarketStreamsApi.md#openInterest) | **POST** /<underlyingAsset>@openInterest@<expirationDate> | Open Interest | -| [**partialBookDepthStreams**](WebsocketMarketStreamsApi.md#partialBookDepthStreams) | **POST** /<symbol>@depth<levels>@<updateSpeed> | Partial Book Depth Streams | -| [**ticker24Hour**](WebsocketMarketStreamsApi.md#ticker24Hour) | **POST** /<symbol>@ticker | 24-hour TICKER | -| [**ticker24HourByUnderlyingAssetAndExpirationData**](WebsocketMarketStreamsApi.md#ticker24HourByUnderlyingAssetAndExpirationData) | **POST** /<underlyingAsset>@ticker@<expirationDate> | 24-hour TICKER by underlying asset and expiration data | -| [**tradeStreams**](WebsocketMarketStreamsApi.md#tradeStreams) | **POST** /<symbol>@trade | Trade Streams | - - - -# **indexPriceStreams** -> IndexPriceStreamsResponse indexPriceStreams(indexPriceStreamsRequest) - -Index Price Streams - -Underlying(e.g ETHUSDT) index stream. Update Speed: 1000ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_options.ApiClient; -import com.binance.connector.client.derivatives_trading_options.ApiException; -import com.binance.connector.client.derivatives_trading_options.Configuration; -import com.binance.connector.client.derivatives_trading_options.models.*; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - IndexPriceStreamsRequest indexPriceStreamsRequest = new IndexPriceStreamsRequest(); // IndexPriceStreamsRequest | - try { - IndexPriceStreamsResponse result = apiInstance.indexPriceStreams(indexPriceStreamsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#indexPriceStreams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **indexPriceStreamsRequest** | [**IndexPriceStreamsRequest**](IndexPriceStreamsRequest.md)| | | - -### Return type - -[**IndexPriceStreamsResponse**](IndexPriceStreamsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Index Price Streams | - | - - -# **klineCandlestickStreams** -> KlineCandlestickStreamsResponse klineCandlestickStreams(klineCandlestickStreamsRequest) - -Kline/Candlestick Streams - -The Kline/Candlestick Stream push updates to the current klines/candlestick every 1000 milliseconds (if existing). Update Speed: 1000ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_options.ApiClient; -import com.binance.connector.client.derivatives_trading_options.ApiException; -import com.binance.connector.client.derivatives_trading_options.Configuration; -import com.binance.connector.client.derivatives_trading_options.models.*; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - KlineCandlestickStreamsRequest klineCandlestickStreamsRequest = new KlineCandlestickStreamsRequest(); // KlineCandlestickStreamsRequest | - try { - KlineCandlestickStreamsResponse result = apiInstance.klineCandlestickStreams(klineCandlestickStreamsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#klineCandlestickStreams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **klineCandlestickStreamsRequest** | [**KlineCandlestickStreamsRequest**](KlineCandlestickStreamsRequest.md)| | | - -### Return type - -[**KlineCandlestickStreamsResponse**](KlineCandlestickStreamsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Kline/Candlestick Streams | - | - - -# **markPrice** -> MarkPriceResponse markPrice(markPriceRequest) - -Mark Price - -The mark price for all option symbols on specific underlying asset. E.g.[ETH@markPrice](wss://nbstream.binance.com/eoptions/stream?streams=ETH@markPrice) Update Speed: 1000ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_options.ApiClient; -import com.binance.connector.client.derivatives_trading_options.ApiException; -import com.binance.connector.client.derivatives_trading_options.Configuration; -import com.binance.connector.client.derivatives_trading_options.models.*; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - MarkPriceRequest markPriceRequest = new MarkPriceRequest(); // MarkPriceRequest | - try { - MarkPriceResponse result = apiInstance.markPrice(markPriceRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#markPrice"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **markPriceRequest** | [**MarkPriceRequest**](MarkPriceRequest.md)| | | - -### Return type - -[**MarkPriceResponse**](MarkPriceResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Mark Price | - | - - -# **newSymbolInfo** -> NewSymbolInfoResponse newSymbolInfo(newSymbolInfoRequest) - -New Symbol Info - -New symbol listing stream. Update Speed: 50ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_options.ApiClient; -import com.binance.connector.client.derivatives_trading_options.ApiException; -import com.binance.connector.client.derivatives_trading_options.Configuration; -import com.binance.connector.client.derivatives_trading_options.models.*; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - NewSymbolInfoRequest newSymbolInfoRequest = new NewSymbolInfoRequest(); // NewSymbolInfoRequest | - try { - NewSymbolInfoResponse result = apiInstance.newSymbolInfo(newSymbolInfoRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#newSymbolInfo"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **newSymbolInfoRequest** | [**NewSymbolInfoRequest**](NewSymbolInfoRequest.md)| | | - -### Return type - -[**NewSymbolInfoResponse**](NewSymbolInfoResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | New Symbol Info | - | - - -# **openInterest** -> OpenInterestResponse openInterest(openInterestRequest) - -Open Interest - -Option open interest for specific underlying asset on specific expiration date. E.g.[ETH@openInterest@221125](wss://nbstream.binance.com/eoptions/stream?streams=ETH@openInterest@221125) Update Speed: 60s - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_options.ApiClient; -import com.binance.connector.client.derivatives_trading_options.ApiException; -import com.binance.connector.client.derivatives_trading_options.Configuration; -import com.binance.connector.client.derivatives_trading_options.models.*; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - OpenInterestRequest openInterestRequest = new OpenInterestRequest(); // OpenInterestRequest | - try { - OpenInterestResponse result = apiInstance.openInterest(openInterestRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#openInterest"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **openInterestRequest** | [**OpenInterestRequest**](OpenInterestRequest.md)| | | - -### Return type - -[**OpenInterestResponse**](OpenInterestResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Open Interest | - | - - -# **partialBookDepthStreams** -> PartialBookDepthStreamsResponse partialBookDepthStreams(partialBookDepthStreamsRequest) - -Partial Book Depth Streams - -Top **<levels\\>** bids and asks, Valid levels are **<levels\\>** are 10, 20, 50, 100. Update Speed: 100ms or 1000ms, 500ms(default when update speed isn't used) - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_options.ApiClient; -import com.binance.connector.client.derivatives_trading_options.ApiException; -import com.binance.connector.client.derivatives_trading_options.Configuration; -import com.binance.connector.client.derivatives_trading_options.models.*; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - PartialBookDepthStreamsRequest partialBookDepthStreamsRequest = new PartialBookDepthStreamsRequest(); // PartialBookDepthStreamsRequest | - try { - PartialBookDepthStreamsResponse result = apiInstance.partialBookDepthStreams(partialBookDepthStreamsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#partialBookDepthStreams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **partialBookDepthStreamsRequest** | [**PartialBookDepthStreamsRequest**](PartialBookDepthStreamsRequest.md)| | | - -### Return type - -[**PartialBookDepthStreamsResponse**](PartialBookDepthStreamsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Partial Book Depth Streams | - | - - -# **ticker24Hour** -> Ticker24HourResponse ticker24Hour(ticker24HourRequest) - -24-hour TICKER - -24hr ticker info for all symbols. Only symbols whose ticker info changed will be sent. Update Speed: 1000ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_options.ApiClient; -import com.binance.connector.client.derivatives_trading_options.ApiException; -import com.binance.connector.client.derivatives_trading_options.Configuration; -import com.binance.connector.client.derivatives_trading_options.models.*; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - Ticker24HourRequest ticker24HourRequest = new Ticker24HourRequest(); // Ticker24HourRequest | - try { - Ticker24HourResponse result = apiInstance.ticker24Hour(ticker24HourRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#ticker24Hour"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **ticker24HourRequest** | [**Ticker24HourRequest**](Ticker24HourRequest.md)| | | - -### Return type - -[**Ticker24HourResponse**](Ticker24HourResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | 24-hour TICKER | - | - - -# **ticker24HourByUnderlyingAssetAndExpirationData** -> Ticker24HourByUnderlyingAssetAndExpirationDataResponse ticker24HourByUnderlyingAssetAndExpirationData(ticker24HourByUnderlyingAssetAndExpirationDataRequest) - -24-hour TICKER by underlying asset and expiration data - -24hr ticker info by underlying asset and expiration date. E.g.[ETH@ticker@220930](wss://nbstream.binance.com/eoptions/stream?streams=ETH@ticker@220930) Update Speed: 1000ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_options.ApiClient; -import com.binance.connector.client.derivatives_trading_options.ApiException; -import com.binance.connector.client.derivatives_trading_options.Configuration; -import com.binance.connector.client.derivatives_trading_options.models.*; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - Ticker24HourByUnderlyingAssetAndExpirationDataRequest ticker24HourByUnderlyingAssetAndExpirationDataRequest = new Ticker24HourByUnderlyingAssetAndExpirationDataRequest(); // Ticker24HourByUnderlyingAssetAndExpirationDataRequest | - try { - Ticker24HourByUnderlyingAssetAndExpirationDataResponse result = apiInstance.ticker24HourByUnderlyingAssetAndExpirationData(ticker24HourByUnderlyingAssetAndExpirationDataRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#ticker24HourByUnderlyingAssetAndExpirationData"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **ticker24HourByUnderlyingAssetAndExpirationDataRequest** | [**Ticker24HourByUnderlyingAssetAndExpirationDataRequest**](Ticker24HourByUnderlyingAssetAndExpirationDataRequest.md)| | | - -### Return type - -[**Ticker24HourByUnderlyingAssetAndExpirationDataResponse**](Ticker24HourByUnderlyingAssetAndExpirationDataResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | 24-hour TICKER by underlying asset and expiration data | - | - - -# **tradeStreams** -> TradeStreamsResponse tradeStreams(tradeStreamsRequest) - -Trade Streams - -The Trade Streams push raw trade information for specific symbol or underlying asset. E.g.[ETH@trade](wss://nbstream.binance.com/eoptions/stream?streams=ETH@trade) Update Speed: 50ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_options.ApiClient; -import com.binance.connector.client.derivatives_trading_options.ApiException; -import com.binance.connector.client.derivatives_trading_options.Configuration; -import com.binance.connector.client.derivatives_trading_options.models.*; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - TradeStreamsRequest tradeStreamsRequest = new TradeStreamsRequest(); // TradeStreamsRequest | - try { - TradeStreamsResponse result = apiInstance.tradeStreams(tradeStreamsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#tradeStreams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **tradeStreamsRequest** | [**TradeStreamsRequest**](TradeStreamsRequest.md)| | | - -### Return type - -[**TradeStreamsResponse**](TradeStreamsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Trade Streams | - | - diff --git a/clients/derivatives-trading-options/example_rest.md b/clients/derivatives-trading-options/example_rest.md index e9d5e66e9..6fcff9841 100644 --- a/clients/derivatives-trading-options/example_rest.md +++ b/clients/derivatives-trading-options/example_rest.md @@ -1,104 +1,98 @@ ## Account -[GET /eapi/v1/bill](https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow) - accountFundingFlow - [AccountFundingFlowExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/AccountFundingFlowExample.java#L47) +[GET /eapi/v1/bill](https://developers.binance.com/docs/derivatives/options-trading/account/Account-Funding-Flow) - accountFundingFlow - [AccountFundingFlowExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/AccountFundingFlowExample.java#L47) -[GET /eapi/v1/income/asyn](https://developers.binance.com/docs/derivatives/option/account/Get-Download-Id-For-Option-Transaction-History) - getDownloadIdForOptionTransactionHistory - [GetDownloadIdForOptionTransactionHistoryExample.java:49](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/GetDownloadIdForOptionTransactionHistoryExample.java#L49) - -[GET /eapi/v1/income/asyn/id](https://developers.binance.com/docs/derivatives/option/account/Get-Option-Transaction-History-Download-Link-by-Id) - getOptionTransactionHistoryDownloadLinkById - [GetOptionTransactionHistoryDownloadLinkByIdExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/GetOptionTransactionHistoryDownloadLinkByIdExample.java#L48) - -[GET /eapi/v1/account](https://developers.binance.com/docs/derivatives/option/account/Option-Account-Information) - optionAccountInformation - [OptionAccountInformationExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/OptionAccountInformationExample.java#L47) - -[GET /eapi/v1/marginAccount](https://developers.binance.com/docs/derivatives/option/account/Option-Margin-Account-Information) - optionMarginAccountInformation - [OptionMarginAccountInformationExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/OptionMarginAccountInformationExample.java#L47) +[GET /eapi/v1/marginAccount](https://developers.binance.com/docs/derivatives/options-trading/account/Option-Margin-Account-Information) - optionMarginAccountInformation - [OptionMarginAccountInformationExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/OptionMarginAccountInformationExample.java#L47) ## MarketData -[GET /eapi/v1/time](https://developers.binance.com/docs/derivatives/option/market-data/Check-Server-Time) - checkServerTime - [CheckServerTimeExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/CheckServerTimeExample.java#L47) +[GET /eapi/v1/time](https://developers.binance.com/docs/derivatives/options-trading/market-data/Check-Server-Time) - checkServerTime - [CheckServerTimeExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/CheckServerTimeExample.java#L47) -[GET /eapi/v1/exchangeInfo](https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information) - exchangeInformation - [ExchangeInformationExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/ExchangeInformationExample.java#L47) +[GET /eapi/v1/exchangeInfo](https://developers.binance.com/docs/derivatives/options-trading/market-data/Exchange-Information) - exchangeInformation - [ExchangeInformationExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/ExchangeInformationExample.java#L47) -[GET /eapi/v1/exerciseHistory](https://developers.binance.com/docs/derivatives/option/market-data/Historical-Exercise-Records) - historicalExerciseRecords - [HistoricalExerciseRecordsExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/HistoricalExerciseRecordsExample.java#L48) +[GET /eapi/v1/exerciseHistory](https://developers.binance.com/docs/derivatives/options-trading/market-data/Historical-Exercise-Records) - historicalExerciseRecords - [HistoricalExerciseRecordsExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/HistoricalExerciseRecordsExample.java#L48) -[GET /eapi/v1/index](https://developers.binance.com/docs/derivatives/option/market-data/Index-Price-Ticker) - indexPriceTicker - [IndexPriceTickerExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/IndexPriceTickerExample.java#L47) +[GET /eapi/v1/index](https://developers.binance.com/docs/derivatives/options-trading/market-data/Symbol-Price-Ticker) - indexPrice - [IndexPriceExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/IndexPriceExample.java#L47) -[GET /eapi/v1/klines](https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data) - klineCandlestickData - [KlineCandlestickDataExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/KlineCandlestickDataExample.java#L48) +[GET /eapi/v1/klines](https://developers.binance.com/docs/derivatives/options-trading/market-data/Kline-Candlestick-Data) - klineCandlestickData - [KlineCandlestickDataExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/KlineCandlestickDataExample.java#L48) -[GET /eapi/v1/historicalTrades](https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup) - oldTradesLookup - [OldTradesLookupExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/OldTradesLookupExample.java#L47) +[GET /eapi/v1/openInterest](https://developers.binance.com/docs/derivatives/options-trading/market-data/Open-Interest) - openInterest - [OpenInterestExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/OpenInterestExample.java#L47) -[GET /eapi/v1/openInterest](https://developers.binance.com/docs/derivatives/option/market-data/Open-Interest) - openInterest - [OpenInterestExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/OpenInterestExample.java#L47) +[GET /eapi/v1/mark](https://developers.binance.com/docs/derivatives/options-trading/market-data/Option-Mark-Price) - optionMarkPrice - [OptionMarkPriceExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/OptionMarkPriceExample.java#L47) -[GET /eapi/v1/mark](https://developers.binance.com/docs/derivatives/option/market-data/Option-Mark-Price) - optionMarkPrice - [OptionMarkPriceExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/OptionMarkPriceExample.java#L47) +[GET /eapi/v1/depth](https://developers.binance.com/docs/derivatives/options-trading/market-data/Order-Book) - orderBook - [OrderBookExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/OrderBookExample.java#L48) -[GET /eapi/v1/depth](https://developers.binance.com/docs/derivatives/option/market-data/Order-Book) - orderBook - [OrderBookExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/OrderBookExample.java#L48) +[GET /eapi/v1/blockTrades](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Block-Trade-List) - recentBlockTradesList - [RecentBlockTradesListExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/RecentBlockTradesListExample.java#L47) -[GET /eapi/v1/blockTrades](https://developers.binance.com/docs/derivatives/option/market-data/Recent-Block-Trade-List) - recentBlockTradesList - [RecentBlockTradesListExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/RecentBlockTradesListExample.java#L47) +[GET /eapi/v1/trades](https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Trades-List) - recentTradesList - [RecentTradesListExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/RecentTradesListExample.java#L47) -[GET /eapi/v1/trades](https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List) - recentTradesList - [RecentTradesListExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/RecentTradesListExample.java#L47) +[GET /eapi/v1/ping](https://developers.binance.com/docs/derivatives/options-trading/market-data/Test-Connectivity) - testConnectivity - [TestConnectivityExample.java:45](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/TestConnectivityExample.java#L45) -[GET /eapi/v1/ping](https://developers.binance.com/docs/derivatives/option/market-data/Test-Connectivity) - testConnectivity - [TestConnectivityExample.java:45](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/TestConnectivityExample.java#L45) - -[GET /eapi/v1/ticker](https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics) - ticker24hrPriceChangeStatistics - [Ticker24hrPriceChangeStatisticsExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/Ticker24hrPriceChangeStatisticsExample.java#L47) +[GET /eapi/v1/ticker](https://developers.binance.com/docs/derivatives/options-trading/market-data/24hr-Ticker-Price-Change-Statistics) - ticker24hrPriceChangeStatistics - [Ticker24hrPriceChangeStatisticsExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/Ticker24hrPriceChangeStatisticsExample.java#L47) ## MarketMakerBlockTrade -[POST /eapi/v1/block/order/execute](https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Accept-Block-Trade-Order) - acceptBlockTradeOrder - [AcceptBlockTradeOrderExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/AcceptBlockTradeOrderExample.java#L48) +[POST /eapi/v1/block/order/execute](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Accept-Block-Trade-Order) - acceptBlockTradeOrder - [AcceptBlockTradeOrderExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/AcceptBlockTradeOrderExample.java#L48) -[GET /eapi/v1/block/user-trades](https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Account-Block-Trade-List) - accountBlockTradeList - [AccountBlockTradeListExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/AccountBlockTradeListExample.java#L47) +[GET /eapi/v1/block/user-trades](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Account-Block-Trade-List) - accountBlockTradeList - [AccountBlockTradeListExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/AccountBlockTradeListExample.java#L47) -[DELETE /eapi/v1/block/order/create](https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Cancel-Block-Trade-Order) - cancelBlockTradeOrder - [CancelBlockTradeOrderExample.java:45](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/CancelBlockTradeOrderExample.java#L45) +[DELETE /eapi/v1/block/order/create](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Cancel-Block-Trade-Order) - cancelBlockTradeOrder - [CancelBlockTradeOrderExample.java:45](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/CancelBlockTradeOrderExample.java#L45) -[PUT /eapi/v1/block/order/create](https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Extend-Block-Trade-Order) - extendBlockTradeOrder - [ExtendBlockTradeOrderExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/ExtendBlockTradeOrderExample.java#L48) +[PUT /eapi/v1/block/order/create](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Extend-Block-Trade-Order) - extendBlockTradeOrder - [ExtendBlockTradeOrderExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/ExtendBlockTradeOrderExample.java#L48) -[POST /eapi/v1/block/order/create](https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/New-Block-Trade-Order) - newBlockTradeOrder - [NewBlockTradeOrderExample.java:49](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/NewBlockTradeOrderExample.java#L49) +[POST /eapi/v1/block/order/create](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/New-Block-Trade-Order) - newBlockTradeOrder - [NewBlockTradeOrderExample.java:49](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/NewBlockTradeOrderExample.java#L49) -[GET /eapi/v1/block/order/execute](https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Query-Block-Trade-Detail) - queryBlockTradeDetails - [QueryBlockTradeDetailsExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/QueryBlockTradeDetailsExample.java#L48) +[GET /eapi/v1/block/order/execute](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Detail) - queryBlockTradeDetails - [QueryBlockTradeDetailsExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/QueryBlockTradeDetailsExample.java#L48) -[GET /eapi/v1/block/order/orders](https://developers.binance.com/docs/derivatives/option/market-maker-block-trade/Query-Block-Trade-Order) - queryBlockTradeOrder - [QueryBlockTradeOrderExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/QueryBlockTradeOrderExample.java#L47) +[GET /eapi/v1/block/order/orders](https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Order) - queryBlockTradeOrder - [QueryBlockTradeOrderExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerblocktrade/QueryBlockTradeOrderExample.java#L47) ## MarketMakerEndpoints -[POST /eapi/v1/countdownCancelAllHeartBeat](https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat) - autoCancelAllOpenOrders - [AutoCancelAllOpenOrdersExample.java:52](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/AutoCancelAllOpenOrdersExample.java#L52) +[POST /eapi/v1/countdownCancelAllHeartBeat](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat) - autoCancelAllOpenOrders - [AutoCancelAllOpenOrdersExample.java:52](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/AutoCancelAllOpenOrdersExample.java#L52) -[GET /eapi/v1/countdownCancelAll](https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config) - getAutoCancelAllOpenOrders - [GetAutoCancelAllOpenOrdersExample.java:51](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/GetAutoCancelAllOpenOrdersExample.java#L51) +[GET /eapi/v1/countdownCancelAll](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config) - getAutoCancelAllOpenOrders - [GetAutoCancelAllOpenOrdersExample.java:51](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/GetAutoCancelAllOpenOrdersExample.java#L51) -[GET /eapi/v1/mmp](https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Get-Market-Maker-Protection-Config) - getMarketMakerProtectionConfig - [GetMarketMakerProtectionConfigExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/GetMarketMakerProtectionConfigExample.java#L47) +[GET /eapi/v1/mmp](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Market-Maker-Protection-Config) - getMarketMakerProtectionConfig - [GetMarketMakerProtectionConfigExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/GetMarketMakerProtectionConfigExample.java#L47) -[POST /eapi/v1/mmpReset](https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Reset-Market-Maker-Protection-Config) - resetMarketMakerProtectionConfig - [ResetMarketMakerProtectionConfigExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/ResetMarketMakerProtectionConfigExample.java#L48) +[POST /eapi/v1/mmpReset](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Reset-Market-Maker-Protection-Config) - resetMarketMakerProtectionConfig - [ResetMarketMakerProtectionConfigExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/ResetMarketMakerProtectionConfigExample.java#L48) -[POST /eapi/v1/countdownCancelAll](https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config) - setAutoCancelAllOpenOrders - [SetAutoCancelAllOpenOrdersExample.java:62](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/SetAutoCancelAllOpenOrdersExample.java#L62) +[POST /eapi/v1/countdownCancelAll](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config) - setAutoCancelAllOpenOrders - [SetAutoCancelAllOpenOrdersExample.java:62](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/SetAutoCancelAllOpenOrdersExample.java#L62) -[POST /eapi/v1/mmpSet](https://developers.binance.com/docs/derivatives/option/market-maker-endpoints/Set-Market-Maker-Protection-Config) - setMarketMakerProtectionConfig - [ResetMarketMakerProtectionConfigExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/ResetMarketMakerProtectionConfigExample.java#L48) +[POST /eapi/v1/mmpSet](https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Market-Maker-Protection-Config) - setMarketMakerProtectionConfig - [ResetMarketMakerProtectionConfigExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketmakerendpoints/ResetMarketMakerProtectionConfigExample.java#L48) ## Trade -[GET /eapi/v1/userTrades](https://developers.binance.com/docs/derivatives/option/trade/Account-Trade-List) - accountTradeList - [AccountTradeListExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/AccountTradeListExample.java#L47) +[GET /eapi/v1/userTrades](https://developers.binance.com/docs/derivatives/options-trading/trade/Account-Trade-List) - accountTradeList - [AccountTradeListExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/AccountTradeListExample.java#L47) + +[DELETE /eapi/v1/allOpenOrdersByUnderlying](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-All-Option-Orders-By-Underlying) - cancelAllOptionOrdersByUnderlying - [CancelAllOptionOrdersByUnderlyingExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelAllOptionOrdersByUnderlyingExample.java#L47) -[DELETE /eapi/v1/allOpenOrdersByUnderlying](https://developers.binance.com/docs/derivatives/option/trade/Cancel-All-Option-Orders-By-Underlying) - cancelAllOptionOrdersByUnderlying - [CancelAllOptionOrdersByUnderlyingExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelAllOptionOrdersByUnderlyingExample.java#L47) +[DELETE /eapi/v1/allOpenOrders](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-all-Option-orders-on-specific-symbol) - cancelAllOptionOrdersOnSpecificSymbol - [CancelAllOptionOrdersOnSpecificSymbolExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelAllOptionOrdersOnSpecificSymbolExample.java#L47) -[DELETE /eapi/v1/allOpenOrders](https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol) - cancelAllOptionOrdersOnSpecificSymbol - [CancelAllOptionOrdersOnSpecificSymbolExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelAllOptionOrdersOnSpecificSymbolExample.java#L47) +[DELETE /eapi/v1/batchOrders](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Multiple-Option-Orders) - cancelMultipleOptionOrders - [CancelMultipleOptionOrdersExample.java:50](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelMultipleOptionOrdersExample.java#L50) -[DELETE /eapi/v1/batchOrders](https://developers.binance.com/docs/derivatives/option/trade/Cancel-Multiple-Option-Orders) - cancelMultipleOptionOrders - [CancelMultipleOptionOrdersExample.java:51](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelMultipleOptionOrdersExample.java#L51) +[DELETE /eapi/v1/order](https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Option-Order) - cancelOptionOrder - [CancelOptionOrderExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelOptionOrderExample.java#L48) -[DELETE /eapi/v1/order](https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order) - cancelOptionOrder - [CancelOptionOrderExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelOptionOrderExample.java#L48) +[POST /eapi/v1/order](https://developers.binance.com/docs/derivatives/options-trading/trade/New-Order) - newOrder - [NewOrderExample.java:50](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/NewOrderExample.java#L50) -[POST /eapi/v1/order](https://developers.binance.com/docs/derivatives/option/trade/New-Order) - newOrder - [NewOrderExample.java:50](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/NewOrderExample.java#L50) +[GET /eapi/v1/position](https://developers.binance.com/docs/derivatives/options-trading/trade/Option-Position-Information) - optionPositionInformation - [OptionPositionInformationExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/OptionPositionInformationExample.java#L47) -[GET /eapi/v1/position](https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information) - optionPositionInformation - [OptionPositionInformationExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/OptionPositionInformationExample.java#L47) +[POST /eapi/v1/batchOrders](https://developers.binance.com/docs/derivatives/options-trading/trade/Place-Multiple-Orders) - placeMultipleOrders - [PlaceMultipleOrdersExample.java:50](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/PlaceMultipleOrdersExample.java#L50) -[POST /eapi/v1/batchOrders](https://developers.binance.com/docs/derivatives/option/trade/Place-Multiple-Orders) - placeMultipleOrders - [PlaceMultipleOrdersExample.java:50](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/PlaceMultipleOrdersExample.java#L50) +[GET /eapi/v1/openOrders](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Current-Open-Option-Orders) - queryCurrentOpenOptionOrders - [QueryCurrentOpenOptionOrdersExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/QueryCurrentOpenOptionOrdersExample.java#L48) -[GET /eapi/v1/openOrders](https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders) - queryCurrentOpenOptionOrders - [QueryCurrentOpenOptionOrdersExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/QueryCurrentOpenOptionOrdersExample.java#L48) +[GET /eapi/v1/historyOrders](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Option-Order-History) - queryOptionOrderHistory - [QueryOptionOrderHistoryExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/QueryOptionOrderHistoryExample.java#L48) -[GET /eapi/v1/historyOrders](https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History) - queryOptionOrderHistory - [QueryOptionOrderHistoryExample.java:48](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/QueryOptionOrderHistoryExample.java#L48) +[GET /eapi/v1/order](https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Single-Order) - querySingleOrder - [QuerySingleOrderExample.java:50](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/QuerySingleOrderExample.java#L50) -[GET /eapi/v1/order](https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order) - querySingleOrder - [QuerySingleOrderExample.java:50](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/QuerySingleOrderExample.java#L50) +[GET /eapi/v1/commission](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Commission) - userCommission - [UserCommissionExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/UserCommissionExample.java#L47) -[GET /eapi/v1/exerciseRecord](https://developers.binance.com/docs/derivatives/option/trade/User-Exercise-Record) - userExerciseRecord - [UserExerciseRecordExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/UserExerciseRecordExample.java#L47) +[GET /eapi/v1/exerciseRecord](https://developers.binance.com/docs/derivatives/options-trading/trade/User-Exercise-Record) - userExerciseRecord - [UserExerciseRecordExample.java:47](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/UserExerciseRecordExample.java#L47) ## UserDataStreams -[DELETE /eapi/v1/listenKey](https://developers.binance.com/docs/derivatives/option/user-data-streams/Close-User-Data-Stream) - closeUserDataStream - [CloseUserDataStreamExample.java:45](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/userdatastreams/CloseUserDataStreamExample.java#L45) +[DELETE /eapi/v1/listenKey](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Close-User-Data-Stream) - closeUserDataStream - [CloseUserDataStreamExample.java:45](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/userdatastreams/CloseUserDataStreamExample.java#L45) -[PUT /eapi/v1/listenKey](https://developers.binance.com/docs/derivatives/option/user-data-streams/Keepalive-User-Data-Stream) - keepaliveUserDataStream - [KeepaliveUserDataStreamExample.java:46](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/userdatastreams/KeepaliveUserDataStreamExample.java#L46) +[PUT /eapi/v1/listenKey](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Keepalive-User-Data-Stream) - keepaliveUserDataStream - [KeepaliveUserDataStreamExample.java:46](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/userdatastreams/KeepaliveUserDataStreamExample.java#L46) -[POST /eapi/v1/listenKey](https://developers.binance.com/docs/derivatives/option/user-data-streams/Start-User-Data-Stream) - startUserDataStream - [StartUserDataStreamExample.java:49](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/userdatastreams/StartUserDataStreamExample.java#L49) +[POST /eapi/v1/listenKey](https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Start-User-Data-Stream) - startUserDataStream - [StartUserDataStreamExample.java:49](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/userdatastreams/StartUserDataStreamExample.java#L49) diff --git a/clients/derivatives-trading-options/example_websocket_stream.md b/clients/derivatives-trading-options/example_websocket_stream.md index 4563286fc..2e1f8a461 100644 --- a/clients/derivatives-trading-options/example_websocket_stream.md +++ b/clients/derivatives-trading-options/example_websocket_stream.md @@ -1,20 +1,24 @@ -## WebsocketMarketStreams +## Market -[@index](https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Index-Price-Streams) - indexPriceStreams - [IndexPriceStreamsExample.java:43](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/IndexPriceStreamsExample.java#L43) +[!index@arr](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Index-Price-Streams) - indexPriceStreams - [IndexPriceStreamsExample.java:43](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/IndexPriceStreamsExample.java#L43) -[@kline_](https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Kline-Candlestick-Streams) - klineCandlestickStreams - [KlineCandlestickStreamsExample.java:44](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/KlineCandlestickStreamsExample.java#L44) +[@kline_](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Kline-Candlestick-Streams) - klineCandlestickStreams - [KlineCandlestickStreamsExample.java:44](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/KlineCandlestickStreamsExample.java#L44) -[@markPrice](https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Mark-Price) - markPrice - [MarkPriceExample.java:45](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/MarkPriceExample.java#L45) +[@optionMarkPrice](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Mark-Price) - markPrice - [MarkPriceExample.java:45](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/MarkPriceExample.java#L45) -[option_pair](https://developers.binance.com/docs/derivatives/option/websocket-market-streams/New-Symbol-Info) - newSymbolInfo - [NewSymbolInfoExample.java:43](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/NewSymbolInfoExample.java#L43) +[!optionSymbol](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/New-Symbol-Info) - newSymbolInfo - [NewSymbolInfoExample.java:43](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/NewSymbolInfoExample.java#L43) -[@openInterest@](https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Open-Interest) - openInterest - [OpenInterestExample.java:45](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/OpenInterestExample.java#L45) +[underlying@optionOpenInterest@](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Open-Interest) - openInterest - [OpenInterestExample.java:45](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/OpenInterestExample.java#L45) -[@depth@](https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Partial-Book-Depth-Streams) - partialBookDepthStreams - [PartialBookDepthStreamsExample.java:44](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/PartialBookDepthStreamsExample.java#L44) +## Public -[@ticker](https://developers.binance.com/docs/derivatives/option/websocket-market-streams/24-hour-TICKER) - ticker24Hour - [Ticker24HourExample.java:44](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/Ticker24HourExample.java#L44) +[@depth@](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Diff-Book-Depth-Streams) - diffBookDepthStreams - [DiffBookDepthStreamsExample.java:44](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/DiffBookDepthStreamsExample.java#L44) -[@ticker@](https://developers.binance.com/docs/derivatives/option/websocket-market-streams/24-hour-TICKER-by-underlying-asset-and-expiration-data) - ticker24HourByUnderlyingAssetAndExpirationData - [Ticker24HourByUnderlyingAssetAndExpirationDataExample.java:45](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/Ticker24HourByUnderlyingAssetAndExpirationDataExample.java#L45) +[@bookTicker](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams) - individualSymbolBookTickerStreams - [IndividualSymbolBookTickerStreamsExample.java:44](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/IndividualSymbolBookTickerStreamsExample.java#L44) -[@trade](https://developers.binance.com/docs/derivatives/option/websocket-market-streams/Trade-Streams) - tradeStreams - [TradeStreamsExample.java:45](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/TradeStreamsExample.java#L45) +[@depth@](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Partial-Book-Depth-Streams) - partialBookDepthStreams - [PartialBookDepthStreamsExample.java:44](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/PartialBookDepthStreamsExample.java#L44) + +[@optionTicker](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/24-hour-TICKER) - ticker24Hour - [Ticker24HourExample.java:44](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/Ticker24HourExample.java#L44) + +[@optionTrade](https://developers.binance.com/docs/derivatives/options-trading/websocket-market-streams/Trade-Streams) - tradeStreams - [TradeStreamsExample.java:45](/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/TradeStreamsExample.java#L45) diff --git a/clients/derivatives-trading-options/pom.xml b/clients/derivatives-trading-options/pom.xml index d393c7bb8..2e4e917de 100644 --- a/clients/derivatives-trading-options/pom.xml +++ b/clients/derivatives-trading-options/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-options derivatives-trading-options - 5.0.0 + 6.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.2.1 + 2.3.1 \ No newline at end of file diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/JSON.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/JSON.java index 2d4798420..5a1adff5b 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/JSON.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/JSON.java @@ -197,17 +197,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model .GetAutoCancelAllOpenOrdersResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_options.rest.model - .GetDownloadIdForOptionTransactionHistoryResponse - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model .GetMarketMakerProtectionConfigResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_options.rest.model - .GetOptionTransactionHistoryDownloadLinkByIdResponse - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model .HistoricalExerciseRecordsResponse.CustomTypeAdapterFactory()); @@ -216,13 +208,16 @@ private static Class getClassByDiscriminator( .HistoricalExerciseRecordsResponseInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model - .IndexPriceTickerResponse.CustomTypeAdapterFactory()); + .IndexPriceResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model .KlineCandlestickDataResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model - .KlineCandlestickDataResponseInner.CustomTypeAdapterFactory()); + .KlineCandlestickDataResponseItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.rest.model + .KlineCandlestickDataResponseItemInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model.Legs .CustomTypeAdapterFactory()); @@ -238,27 +233,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model .NewOrderResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_options.rest.model - .OldTradesLookupResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_options.rest.model - .OldTradesLookupResponseInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model .OpenInterestResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model .OpenInterestResponseInner.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_options.rest.model - .OptionAccountInformationResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_options.rest.model - .OptionAccountInformationResponseAssetInner.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_options.rest.model - .OptionAccountInformationResponseGreekInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model .OptionMarginAccountInformationResponse.CustomTypeAdapterFactory()); @@ -266,6 +246,10 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.derivatives_trading_options.rest.model .OptionMarginAccountInformationResponseAssetInner .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.rest.model + .OptionMarginAccountInformationResponseGreekInner + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model .OptionMarkPriceResponse.CustomTypeAdapterFactory()); @@ -371,6 +355,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model .Ticker24hrPriceChangeStatisticsResponseInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.rest.model + .UserCommissionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.rest.model + .UserCommissionResponseCommissionsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.rest.model .UserExerciseRecordResponse.CustomTypeAdapterFactory()); diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApi.java index 66b9bbcae..bbf28641b 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApi.java @@ -20,9 +20,6 @@ import com.binance.connector.client.common.configuration.ClientConfiguration; import com.binance.connector.client.common.exception.ConstraintViolationException; import com.binance.connector.client.derivatives_trading_options.rest.model.AccountFundingFlowResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.GetDownloadIdForOptionTransactionHistoryResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.GetOptionTransactionHistoryDownloadLinkByIdResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.OptionAccountInformationResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OptionMarginAccountInformationResponse; import com.google.gson.reflect.TypeToken; import jakarta.validation.ConstraintViolation; @@ -46,7 +43,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -103,7 +100,7 @@ public void setCustomBaseUrl(String customBaseUrl) { * * * @see Account + * href="https://developers.binance.com/docs/derivatives/options-trading/account/Account-Funding-Flow">Account * Funding Flow (USER_DATA) Documentation */ private okhttp3.Call accountFundingFlowCall( @@ -260,7 +257,7 @@ private okhttp3.Call accountFundingFlowValidateBeforeCall( * * * @see Account + * href="https://developers.binance.com/docs/derivatives/options-trading/account/Account-Funding-Flow">Account * Funding Flow (USER_DATA) Documentation */ public ApiResponse accountFundingFlow( @@ -279,447 +276,6 @@ public ApiResponse accountFundingFlow( return localVarApiClient.execute(localVarCall, localVarReturnType); } - /** - * Build call for getDownloadIdForOptionTransactionHistory - * - * @param startTime Timestamp in ms (required) - * @param endTime Timestamp in ms (required) - * @param recvWindow (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Download Id For Option Transaction History -
- * - * @see Get - * Download Id For Option Transaction History (USER_DATA) Documentation - */ - private okhttp3.Call getDownloadIdForOptionTransactionHistoryCall( - Long startTime, Long endTime, Long recvWindow) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/eapi/v1/income/asyn"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (startTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); - } - - if (endTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getDownloadIdForOptionTransactionHistoryValidateBeforeCall( - Long startTime, Long endTime, Long recvWindow) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {startTime, endTime, recvWindow}; - Method method = - this.getClass() - .getMethod( - "getDownloadIdForOptionTransactionHistory", - Long.class, - Long.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return getDownloadIdForOptionTransactionHistoryCall(startTime, endTime, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Get Download Id For Option Transaction History (USER_DATA) Get download id for option - * transaction history * Request Limitation is 5 times per month, shared by > front end - * download page and rest api * The time between `startTime` and `endTime` - * can not be longer than 1 year Weight: 5 - * - * @param startTime Timestamp in ms (required) - * @param endTime Timestamp in ms (required) - * @param recvWindow (optional) - * @return ApiResponse<GetDownloadIdForOptionTransactionHistoryResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Download Id For Option Transaction History -
- * - * @see Get - * Download Id For Option Transaction History (USER_DATA) Documentation - */ - public ApiResponse - getDownloadIdForOptionTransactionHistory( - @NotNull Long startTime, @NotNull Long endTime, Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - getDownloadIdForOptionTransactionHistoryValidateBeforeCall( - startTime, endTime, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for getOptionTransactionHistoryDownloadLinkById - * - * @param downloadId get by download id api (required) - * @param recvWindow (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Option Transaction History Download Link by Id -
- * - * @see Get - * Option Transaction History Download Link by Id (USER_DATA) Documentation - */ - private okhttp3.Call getOptionTransactionHistoryDownloadLinkByIdCall( - String downloadId, Long recvWindow) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/eapi/v1/income/asyn/id"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (downloadId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("downloadId", downloadId)); - } - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getOptionTransactionHistoryDownloadLinkByIdValidateBeforeCall( - String downloadId, Long recvWindow) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {downloadId, recvWindow}; - Method method = - this.getClass() - .getMethod( - "getOptionTransactionHistoryDownloadLinkById", - String.class, - Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return getOptionTransactionHistoryDownloadLinkByIdCall(downloadId, recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Get Option Transaction History Download Link by Id (USER_DATA) Get option transaction history - * download Link by Id * Download link expiration: 24h Weight: 5 - * - * @param downloadId get by download id api (required) - * @param recvWindow (optional) - * @return ApiResponse<GetOptionTransactionHistoryDownloadLinkByIdResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Option Transaction History Download Link by Id -
- * - * @see Get - * Option Transaction History Download Link by Id (USER_DATA) Documentation - */ - public ApiResponse - getOptionTransactionHistoryDownloadLinkById(@NotNull String downloadId, Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = - getOptionTransactionHistoryDownloadLinkByIdValidateBeforeCall( - downloadId, recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for optionAccountInformation - * - * @param recvWindow (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Option Account Information -
- * - * @see Option - * Account Information(TRADE) Documentation - */ - private okhttp3.Call optionAccountInformationCall(Long recvWindow) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/eapi/v1/account"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (recvWindow != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - localVarAuthNames.add("binanceSignature"); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call optionAccountInformationValidateBeforeCall(Long recvWindow) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {recvWindow}; - Method method = this.getClass().getMethod("optionAccountInformation", Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return optionAccountInformationCall(recvWindow); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Option Account Information(TRADE) Get current account information. Weight: 3 - * - * @param recvWindow (optional) - * @return ApiResponse<OptionAccountInformationResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Option Account Information -
- * - * @see Option - * Account Information(TRADE) Documentation - */ - public ApiResponse optionAccountInformation(Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = optionAccountInformationValidateBeforeCall(recvWindow); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - /** * Build call for optionMarginAccountInformation * @@ -734,7 +290,7 @@ public ApiResponse optionAccountInformation(Lo * * * @see Option + * href="https://developers.binance.com/docs/derivatives/options-trading/account/Option-Margin-Account-Information">Option * Margin Account Information (USER_DATA) Documentation */ private okhttp3.Call optionMarginAccountInformationCall(Long recvWindow) throws ApiException { @@ -842,7 +398,7 @@ private okhttp3.Call optionMarginAccountInformationValidateBeforeCall(Long recvW * * * @see Option + * href="https://developers.binance.com/docs/derivatives/options-trading/account/Option-Margin-Account-Information">Option * Margin Account Information (USER_DATA) Documentation */ public ApiResponse optionMarginAccountInformation( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java index 50ddfed2f..8ad4f28d0 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/DerivativesTradingOptionsRestApi.java @@ -22,19 +22,15 @@ import com.binance.connector.client.derivatives_trading_options.rest.model.ExtendBlockTradeOrderRequest; import com.binance.connector.client.derivatives_trading_options.rest.model.ExtendBlockTradeOrderResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.GetAutoCancelAllOpenOrdersResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.GetDownloadIdForOptionTransactionHistoryResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.GetMarketMakerProtectionConfigResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.GetOptionTransactionHistoryDownloadLinkByIdResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.HistoricalExerciseRecordsResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.IndexPriceTickerResponse; +import com.binance.connector.client.derivatives_trading_options.rest.model.IndexPriceResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.KlineCandlestickDataResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.NewBlockTradeOrderRequest; import com.binance.connector.client.derivatives_trading_options.rest.model.NewBlockTradeOrderResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.NewOrderRequest; import com.binance.connector.client.derivatives_trading_options.rest.model.NewOrderResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.OldTradesLookupResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OpenInterestResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.OptionAccountInformationResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OptionMarginAccountInformationResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OptionMarkPriceResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OptionPositionInformationResponse; @@ -57,6 +53,7 @@ import com.binance.connector.client.derivatives_trading_options.rest.model.SetMarketMakerProtectionConfigResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.StartUserDataStreamResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.Ticker24hrPriceChangeStatisticsResponse; +import com.binance.connector.client.derivatives_trading_options.rest.model.UserCommissionResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.UserExerciseRecordResponse; public class DerivativesTradingOptionsRestApi { @@ -102,7 +99,7 @@ public DerivativesTradingOptionsRestApi(ApiClient apiClient) { * * * @see Account + * href="https://developers.binance.com/docs/derivatives/options-trading/account/Account-Funding-Flow">Account * Funding Flow (USER_DATA) Documentation */ public ApiResponse accountFundingFlow( @@ -117,84 +114,6 @@ public ApiResponse accountFundingFlow( currency, recordId, startTime, endTime, limit, recvWindow); } - /** - * Get Download Id For Option Transaction History (USER_DATA) Get download id for option - * transaction history * Request Limitation is 5 times per month, shared by > front end - * download page and rest api * The time between `startTime` and `endTime` - * can not be longer than 1 year Weight: 5 - * - * @param startTime Timestamp in ms (required) - * @param endTime Timestamp in ms (required) - * @param recvWindow (optional) - * @return ApiResponse<GetDownloadIdForOptionTransactionHistoryResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Download Id For Option Transaction History -
- * - * @see Get - * Download Id For Option Transaction History (USER_DATA) Documentation - */ - public ApiResponse - getDownloadIdForOptionTransactionHistory(Long startTime, Long endTime, Long recvWindow) - throws ApiException { - return accountApi.getDownloadIdForOptionTransactionHistory(startTime, endTime, recvWindow); - } - - /** - * Get Option Transaction History Download Link by Id (USER_DATA) Get option transaction history - * download Link by Id * Download link expiration: 24h Weight: 5 - * - * @param downloadId get by download id api (required) - * @param recvWindow (optional) - * @return ApiResponse<GetOptionTransactionHistoryDownloadLinkByIdResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Get Option Transaction History Download Link by Id -
- * - * @see Get - * Option Transaction History Download Link by Id (USER_DATA) Documentation - */ - public ApiResponse - getOptionTransactionHistoryDownloadLinkById(String downloadId, Long recvWindow) - throws ApiException { - return accountApi.getOptionTransactionHistoryDownloadLinkById(downloadId, recvWindow); - } - - /** - * Option Account Information(TRADE) Get current account information. Weight: 3 - * - * @param recvWindow (optional) - * @return ApiResponse<OptionAccountInformationResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Option Account Information -
- * - * @see Option - * Account Information(TRADE) Documentation - */ - public ApiResponse optionAccountInformation(Long recvWindow) - throws ApiException { - return accountApi.optionAccountInformation(recvWindow); - } - /** * Option Margin Account Information (USER_DATA) Get current account information. Weight: 3 * @@ -210,7 +129,7 @@ public ApiResponse optionAccountInformation(Lo * * * @see Option + * href="https://developers.binance.com/docs/derivatives/options-trading/account/Option-Margin-Account-Information">Option * Margin Account Information (USER_DATA) Documentation */ public ApiResponse optionMarginAccountInformation( @@ -233,7 +152,7 @@ public ApiResponse optionMarginAccountIn * * * @see Check + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Check-Server-Time">Check * Server Time Documentation */ public ApiResponse checkServerTime() throws ApiException { @@ -254,7 +173,7 @@ public ApiResponse checkServerTime() throws ApiExceptio * * * @see Exchange + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Exchange-Information">Exchange * Information Documentation */ public ApiResponse exchangeInformation() throws ApiException { @@ -280,7 +199,7 @@ public ApiResponse exchangeInformation() throws Api * * * @see Historical + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Historical-Exercise-Records">Historical * Exercise Records Documentation */ public ApiResponse historicalExerciseRecords( @@ -289,26 +208,25 @@ public ApiResponse historicalExerciseRecords( } /** - * Index Price Ticker Get spot index price for option underlying. Weight: 1 + * Index Price Get spot index price for option underlying. Weight: 1 * * @param underlying Option underlying, e.g BTCUSDT (required) - * @return ApiResponse<IndexPriceTickerResponse> + * @return ApiResponse<IndexPriceResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Index Price Ticker -
200 Index Price -
* * @see Index - * Price Ticker Documentation + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Symbol-Price-Ticker">Index + * Price Documentation */ - public ApiResponse indexPriceTicker(String underlying) - throws ApiException { - return marketDataApi.indexPriceTicker(underlying); + public ApiResponse indexPrice(String underlying) throws ApiException { + return marketDataApi.indexPrice(underlying); } /** @@ -332,7 +250,7 @@ public ApiResponse indexPriceTicker(String underlying) * * * @see Kline/Candlestick + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Kline-Candlestick-Data">Kline/Candlestick * Data Documentation */ public ApiResponse klineCandlestickData( @@ -341,32 +259,6 @@ public ApiResponse klineCandlestickData( return marketDataApi.klineCandlestickData(symbol, interval, startTime, endTime, limit); } - /** - * Old Trades Lookup (MARKET_DATA) Get older market historical trades. Weight: 20 - * - * @param symbol Option trading pair, e.g BTC-200730-9000-C (required) - * @param fromId The UniqueId ID from which to return. The latest deal record is returned by - * default (optional) - * @param limit Number of result sets returned Default:100 Max:1000 (optional) - * @return ApiResponse<OldTradesLookupResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Old Trades Lookup -
- * - * @see Old - * Trades Lookup (MARKET_DATA) Documentation - */ - public ApiResponse oldTradesLookup( - String symbol, Long fromId, Long limit) throws ApiException { - return marketDataApi.oldTradesLookup(symbol, fromId, limit); - } - /** * Open Interest Get open interest for specific underlying asset on specific expiration date. * Weight: 0 @@ -384,7 +276,7 @@ public ApiResponse oldTradesLookup( * * * @see Open + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Open-Interest">Open * Interest Documentation */ public ApiResponse openInterest(String underlyingAsset, String expiration) @@ -407,7 +299,7 @@ public ApiResponse openInterest(String underlyingAsset, St * * * @see Option + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Option-Mark-Price">Option * Mark Price Documentation */ public ApiResponse optionMarkPrice(String symbol) throws ApiException { @@ -416,7 +308,7 @@ public ApiResponse optionMarkPrice(String symbol) throw /** * Order Book Check orderbook depth on specific symbol Weight: limit | weight ------------ | - * ------------ 5, 10, 20, 50 | 2 100 | 5 500 | 10 1000 | 20 + * ------------ 5, 10, 20, 50 | 1 100 | 5 500 | 10 1000 | 20 * * @param symbol Option trading pair, e.g BTC-200730-9000-C (required) * @param limit Number of result sets returned Default:100 Max:1000 (optional) @@ -431,7 +323,7 @@ public ApiResponse optionMarkPrice(String symbol) throw * * * @see Order + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Order-Book">Order * Book Documentation */ public ApiResponse orderBook(String symbol, Long limit) throws ApiException { @@ -454,7 +346,7 @@ public ApiResponse orderBook(String symbol, Long limit) throw * * * @see Recent + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Block-Trade-List">Recent * Block Trades List Documentation */ public ApiResponse recentBlockTradesList( @@ -478,7 +370,7 @@ public ApiResponse recentBlockTradesList( * * * @see Recent + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Trades-List">Recent * Trades List Documentation */ public ApiResponse recentTradesList(String symbol, Long limit) @@ -500,7 +392,7 @@ public ApiResponse recentTradesList(String symbol, Lon * * * @see Test + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Test-Connectivity">Test * Connectivity Documentation */ public void testConnectivity() throws ApiException { @@ -522,7 +414,7 @@ public void testConnectivity() throws ApiException { * * * @see 24hr + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/24hr-Ticker-Price-Change-Statistics">24hr * Ticker Price Change Statistics Documentation */ public ApiResponse ticker24hrPriceChangeStatistics( @@ -545,7 +437,7 @@ public ApiResponse ticker24hrPriceChang * * * @see Accept + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Accept-Block-Trade-Order">Accept * Block Trade Order (TRADE) Documentation */ public ApiResponse acceptBlockTradeOrder( @@ -571,7 +463,7 @@ public ApiResponse acceptBlockTradeOrder( * * * @see Account + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Account-Block-Trade-List">Account * Block Trade List (USER_DATA) Documentation */ public ApiResponse accountBlockTradeList( @@ -596,7 +488,7 @@ public ApiResponse accountBlockTradeList( * * * @see Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Cancel-Block-Trade-Order">Cancel * Block Trade Order (TRADE) Documentation */ public void cancelBlockTradeOrder(String blockOrderMatchingKey, Long recvWindow) @@ -620,7 +512,7 @@ public void cancelBlockTradeOrder(String blockOrderMatchingKey, Long recvWindow) * * * @see Extend + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Extend-Block-Trade-Order">Extend * Block Trade Order (TRADE) Documentation */ public ApiResponse extendBlockTradeOrder( @@ -643,7 +535,7 @@ public ApiResponse extendBlockTradeOrder( * * * @see New + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/New-Block-Trade-Order">New * Block Trade Order (TRADE) Documentation */ public ApiResponse newBlockTradeOrder( @@ -668,7 +560,7 @@ public ApiResponse newBlockTradeOrder( * * * @see Query + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Detail">Query * Block Trade Details (USER_DATA) Documentation */ public ApiResponse queryBlockTradeDetails( @@ -696,7 +588,7 @@ public ApiResponse queryBlockTradeDetails( * * * @see Query + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Order">Query * Block Trade Order (TRADE) Documentation */ public ApiResponse queryBlockTradeOrder( @@ -730,7 +622,7 @@ public ApiResponse queryBlockTradeOrder( * * * @see Auto-Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat">Auto-Cancel * All Open Orders (Kill-Switch) Heartbeat (TRADE) Documentation */ public ApiResponse autoCancelAllOpenOrders( @@ -758,7 +650,7 @@ public ApiResponse autoCancelAllOpenOrders( * * * @see Get + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config">Get * Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE) Documentation */ public ApiResponse getAutoCancelAllOpenOrders( @@ -782,7 +674,7 @@ public ApiResponse getAutoCancelAllOpenOrder * * * @see Get + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Market-Maker-Protection-Config">Get * Market Maker Protection Config (TRADE) Documentation */ public ApiResponse getMarketMakerProtectionConfig( @@ -805,7 +697,7 @@ public ApiResponse getMarketMakerProtect * * * @see Reset + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Reset-Market-Maker-Protection-Config">Reset * Market Maker Protection Config (TRADE) Documentation */ public ApiResponse resetMarketMakerProtectionConfig( @@ -844,7 +736,7 @@ public ApiResponse resetMarketMakerPro * * * @see Set + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config">Set * Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE) Documentation */ public ApiResponse setAutoCancelAllOpenOrders( @@ -874,7 +766,7 @@ public ApiResponse setAutoCancelAllOpenOrder * * * @see Set + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Market-Maker-Protection-Config">Set * Market Maker Protection Config (TRADE) Documentation */ public ApiResponse setMarketMakerProtectionConfig( @@ -888,8 +780,8 @@ public ApiResponse setMarketMakerProtect * Account Trade List (USER_DATA) Get trades for a specific account and symbol. Weight: 5 * * @param symbol Option trading pair, e.g BTC-200730-9000-C (optional) - * @param fromId The UniqueId ID from which to return. The latest deal record is returned by - * default (optional) + * @param fromId Trade id to fetch from. Default gets most recent trades, e.g + * 4611875134427365376 (optional) * @param startTime Start Time, e.g 1593511200000 (optional) * @param endTime End Time, e.g 1593512200000 (optional) * @param limit Number of result sets returned Default:100 Max:1000 (optional) @@ -905,7 +797,7 @@ public ApiResponse setMarketMakerProtect * * * @see Account + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Account-Trade-List">Account * Trade List (USER_DATA) Documentation */ public ApiResponse accountTradeList( @@ -931,7 +823,7 @@ public ApiResponse accountTradeList( * * * @see Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-All-Option-Orders-By-Underlying">Cancel * All Option Orders By Underlying (TRADE) Documentation */ public ApiResponse cancelAllOptionOrdersByUnderlying( @@ -956,7 +848,7 @@ public ApiResponse cancelAllOptionOrd * * * @see Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-all-Option-orders-on-specific-symbol">Cancel * all Option orders on specific symbol (TRADE) Documentation */ public ApiResponse @@ -967,8 +859,7 @@ public ApiResponse cancelAllOptionOrd /** * Cancel Multiple Option Orders (TRADE) Cancel multiple orders. * At least one instance of - * `orderId` and `clientOrderId` must be sent. * Max 10 orders can be - * deleted in one request Weight: 1 + * `orderId` and `clientOrderId` must be sent. Weight: 1 * * @param symbol Option trading pair, e.g BTC-200730-9000-C (required) * @param orderIds Order ID, e.g [4611875134427365377,4611875134427365378] (optional) @@ -986,7 +877,7 @@ public ApiResponse cancelAllOptionOrd * * * @see Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Multiple-Option-Orders">Cancel * Multiple Option Orders (TRADE) Documentation */ public ApiResponse cancelMultipleOptionOrders( @@ -1014,7 +905,7 @@ public ApiResponse cancelMultipleOptionOrder * * * @see Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Option-Order">Cancel * Option Order (TRADE) Documentation */ public ApiResponse cancelOptionOrder( @@ -1037,7 +928,8 @@ public ApiResponse cancelOptionOrder( * 200 New Order - * * - * @see New + * @see New * Order (TRADE) Documentation */ public ApiResponse newOrder(NewOrderRequest newOrderRequest) @@ -1061,7 +953,7 @@ public ApiResponse newOrder(NewOrderRequest newOrderRequest) * * * @see Option + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Option-Position-Information">Option * Position Information (USER_DATA) Documentation */ public ApiResponse optionPositionInformation( @@ -1086,7 +978,7 @@ public ApiResponse optionPositionInformation( * * * @see Place + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Place-Multiple-Orders">Place * Multiple Orders(TRADE) Documentation */ public ApiResponse placeMultipleOrders( @@ -1114,7 +1006,7 @@ public ApiResponse placeMultipleOrders( * * * @see Query + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Current-Open-Option-Orders">Query * Current Open Option Orders (USER_DATA) Documentation */ public ApiResponse queryCurrentOpenOptionOrders( @@ -1145,7 +1037,7 @@ public ApiResponse queryCurrentOpenOptionO * * * @see Query + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Option-Order-History">Query * Option Order History (TRADE) Documentation */ public ApiResponse queryOptionOrderHistory( @@ -1176,7 +1068,7 @@ public ApiResponse queryOptionOrderHistory( * * * @see Query + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Single-Order">Query * Single Order (TRADE) Documentation */ public ApiResponse querySingleOrder( @@ -1185,6 +1077,28 @@ public ApiResponse querySingleOrder( return tradeApi.querySingleOrder(symbol, orderId, clientOrderId, recvWindow); } + /** + * User Commission (USER_DATA) Get account commission. Weight: 5 + * + * @param recvWindow (optional) + * @return ApiResponse<UserCommissionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 User Commission -
+ * + * @see User + * Commission (USER_DATA) Documentation + */ + public ApiResponse userCommission(Long recvWindow) throws ApiException { + return tradeApi.userCommission(recvWindow); + } + /** * User Exercise Record (USER_DATA) Get account exercise records. Weight: 5 * @@ -1204,7 +1118,7 @@ public ApiResponse querySingleOrder( * * * @see User + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/User-Exercise-Record">User * Exercise Record (USER_DATA) Documentation */ public ApiResponse userExerciseRecord( @@ -1227,7 +1141,7 @@ public ApiResponse userExerciseRecord( * * * @see Close + * href="https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Close-User-Data-Stream">Close * User Data Stream (USER_STREAM) Documentation */ public void closeUserDataStream() throws ApiException { @@ -1250,7 +1164,7 @@ public void closeUserDataStream() throws ApiException { * * * @see Keepalive + * href="https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Keepalive-User-Data-Stream">Keepalive * User Data Stream (USER_STREAM) Documentation */ public void keepaliveUserDataStream() throws ApiException { @@ -1274,7 +1188,7 @@ public void keepaliveUserDataStream() throws ApiException { * * * @see Start + * href="https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Start-User-Data-Stream">Start * User Data Stream (USER_STREAM) Documentation */ public ApiResponse startUserDataStream() throws ApiException { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java index 543e05fec..734740565 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApi.java @@ -22,9 +22,8 @@ import com.binance.connector.client.derivatives_trading_options.rest.model.CheckServerTimeResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.ExchangeInformationResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.HistoricalExerciseRecordsResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.IndexPriceTickerResponse; +import com.binance.connector.client.derivatives_trading_options.rest.model.IndexPriceResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.KlineCandlestickDataResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.OldTradesLookupResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OpenInterestResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OptionMarkPriceResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OrderBookResponse; @@ -53,7 +52,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -103,7 +102,7 @@ public void setCustomBaseUrl(String customBaseUrl) { * * * @see Check + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Check-Server-Time">Check * Server Time Documentation */ private okhttp3.Call checkServerTimeCall() throws ApiException { @@ -205,7 +204,7 @@ private okhttp3.Call checkServerTimeValidateBeforeCall() throws ApiException { * * * @see Check + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Check-Server-Time">Check * Server Time Documentation */ public ApiResponse checkServerTime() throws ApiException { @@ -228,7 +227,7 @@ public ApiResponse checkServerTime() throws ApiExceptio * * * @see Exchange + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Exchange-Information">Exchange * Information Documentation */ private okhttp3.Call exchangeInformationCall() throws ApiException { @@ -329,7 +328,7 @@ private okhttp3.Call exchangeInformationValidateBeforeCall() throws ApiException * * * @see Exchange + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Exchange-Information">Exchange * Information Documentation */ public ApiResponse exchangeInformation() throws ApiException { @@ -356,7 +355,7 @@ public ApiResponse exchangeInformation() throws Api * * * @see Historical + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Historical-Exercise-Records">Historical * Exercise Records Documentation */ private okhttp3.Call historicalExerciseRecordsCall( @@ -487,7 +486,7 @@ private okhttp3.Call historicalExerciseRecordsValidateBeforeCall( * * * @see Historical + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Historical-Exercise-Records">Historical * Exercise Records Documentation */ public ApiResponse historicalExerciseRecords( @@ -500,7 +499,7 @@ public ApiResponse historicalExerciseRecords( } /** - * Build call for indexPriceTicker + * Build call for indexPrice * * @param underlying Option underlying, e.g BTCUSDT (required) * @return Call to execute @@ -509,14 +508,14 @@ public ApiResponse historicalExerciseRecords( * * * - * + * *
Response Details
Status Code Description Response Headers
200 Index Price Ticker -
200 Index Price -
* * @see Index - * Price Ticker Documentation + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Symbol-Price-Ticker">Index + * Price Documentation */ - private okhttp3.Call indexPriceTickerCall(String underlying) throws ApiException { + private okhttp3.Call indexPriceCall(String underlying) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -575,7 +574,7 @@ private okhttp3.Call indexPriceTickerCall(String underlying) throws ApiException } @SuppressWarnings("rawtypes") - private okhttp3.Call indexPriceTickerValidateBeforeCall(String underlying) throws ApiException { + private okhttp3.Call indexPriceValidateBeforeCall(String underlying) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -586,12 +585,12 @@ private okhttp3.Call indexPriceTickerValidateBeforeCall(String underlying) throw ExecutableValidator executableValidator = validator.forExecutables(); Object[] parameterValues = {underlying}; - Method method = this.getClass().getMethod("indexPriceTicker", String.class); + Method method = this.getClass().getMethod("indexPrice", String.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return indexPriceTickerCall(underlying); + return indexPriceCall(underlying); } else { throw new ConstraintViolationException((Set) violations); } @@ -605,28 +604,28 @@ private okhttp3.Call indexPriceTickerValidateBeforeCall(String underlying) throw } /** - * Index Price Ticker Get spot index price for option underlying. Weight: 1 + * Index Price Get spot index price for option underlying. Weight: 1 * * @param underlying Option underlying, e.g BTCUSDT (required) - * @return ApiResponse<IndexPriceTickerResponse> + * @return ApiResponse<IndexPriceResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 Index Price Ticker -
200 Index Price -
* * @see Index - * Price Ticker Documentation + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Symbol-Price-Ticker">Index + * Price Documentation */ - public ApiResponse indexPriceTicker(@NotNull String underlying) + public ApiResponse indexPrice(@NotNull String underlying) throws ApiException { - okhttp3.Call localVarCall = indexPriceTickerValidateBeforeCall(underlying); + okhttp3.Call localVarCall = indexPriceValidateBeforeCall(underlying); java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -648,7 +647,7 @@ public ApiResponse indexPriceTicker(@NotNull String un * * * @see Kline/Candlestick + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Kline-Candlestick-Data">Kline/Candlestick * Data Documentation */ private okhttp3.Call klineCandlestickDataCall( @@ -788,7 +787,7 @@ private okhttp3.Call klineCandlestickDataValidateBeforeCall( * * * @see Kline/Candlestick + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Kline-Candlestick-Data">Kline/Candlestick * Data Documentation */ public ApiResponse klineCandlestickData( @@ -805,155 +804,6 @@ public ApiResponse klineCandlestickData( return localVarApiClient.execute(localVarCall, localVarReturnType); } - /** - * Build call for oldTradesLookup - * - * @param symbol Option trading pair, e.g BTC-200730-9000-C (required) - * @param fromId The UniqueId ID from which to return. The latest deal record is returned by - * default (optional) - * @param limit Number of result sets returned Default:100 Max:1000 (optional) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Old Trades Lookup -
- * - * @see Old - * Trades Lookup (MARKET_DATA) Documentation - */ - private okhttp3.Call oldTradesLookupCall(String symbol, Long fromId, Long limit) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/eapi/v1/historicalTrades"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (symbol != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); - } - - if (fromId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fromId", fromId)); - } - - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call oldTradesLookupValidateBeforeCall(String symbol, Long fromId, Long limit) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {symbol, fromId, limit}; - Method method = - this.getClass() - .getMethod("oldTradesLookup", String.class, Long.class, Long.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return oldTradesLookupCall(symbol, fromId, limit); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Old Trades Lookup (MARKET_DATA) Get older market historical trades. Weight: 20 - * - * @param symbol Option trading pair, e.g BTC-200730-9000-C (required) - * @param fromId The UniqueId ID from which to return. The latest deal record is returned by - * default (optional) - * @param limit Number of result sets returned Default:100 Max:1000 (optional) - * @return ApiResponse<OldTradesLookupResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Old Trades Lookup -
- * - * @see Old - * Trades Lookup (MARKET_DATA) Documentation - */ - public ApiResponse oldTradesLookup( - @NotNull String symbol, Long fromId, Long limit) throws ApiException { - okhttp3.Call localVarCall = oldTradesLookupValidateBeforeCall(symbol, fromId, limit); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - /** * Build call for openInterest * @@ -969,7 +819,7 @@ public ApiResponse oldTradesLookup( * * * @see Open + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Open-Interest">Open * Interest Documentation */ private okhttp3.Call openInterestCall(String underlyingAsset, String expiration) @@ -1084,7 +934,7 @@ private okhttp3.Call openInterestValidateBeforeCall(String underlyingAsset, Stri * * * @see Open + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Open-Interest">Open * Interest Documentation */ public ApiResponse openInterest( @@ -1109,7 +959,7 @@ public ApiResponse openInterest( * * * @see Option + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Option-Mark-Price">Option * Mark Price Documentation */ private okhttp3.Call optionMarkPriceCall(String symbol) throws ApiException { @@ -1215,7 +1065,7 @@ private okhttp3.Call optionMarkPriceValidateBeforeCall(String symbol) throws Api * * * @see Option + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Option-Mark-Price">Option * Mark Price Documentation */ public ApiResponse optionMarkPrice(String symbol) throws ApiException { @@ -1240,7 +1090,7 @@ public ApiResponse optionMarkPrice(String symbol) throw * * * @see Order + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Order-Book">Order * Book Documentation */ private okhttp3.Call orderBookCall(String symbol, Long limit) throws ApiException { @@ -1338,7 +1188,7 @@ private okhttp3.Call orderBookValidateBeforeCall(String symbol, Long limit) /** * Order Book Check orderbook depth on specific symbol Weight: limit | weight ------------ | - * ------------ 5, 10, 20, 50 | 2 100 | 5 500 | 10 1000 | 20 + * ------------ 5, 10, 20, 50 | 1 100 | 5 500 | 10 1000 | 20 * * @param symbol Option trading pair, e.g BTC-200730-9000-C (required) * @param limit Number of result sets returned Default:100 Max:1000 (optional) @@ -1353,7 +1203,7 @@ private okhttp3.Call orderBookValidateBeforeCall(String symbol, Long limit) * * * @see Order + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Order-Book">Order * Book Documentation */ public ApiResponse orderBook(@NotNull String symbol, Long limit) @@ -1378,7 +1228,7 @@ public ApiResponse orderBook(@NotNull String symbol, Long lim * * * @see Recent + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Block-Trade-List">Recent * Block Trades List Documentation */ private okhttp3.Call recentBlockTradesListCall(String symbol, Long limit) throws ApiException { @@ -1491,7 +1341,7 @@ private okhttp3.Call recentBlockTradesListValidateBeforeCall(String symbol, Long * * * @see Recent + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Block-Trade-List">Recent * Block Trades List Documentation */ public ApiResponse recentBlockTradesList( @@ -1517,7 +1367,7 @@ public ApiResponse recentBlockTradesList( * * * @see Recent + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Trades-List">Recent * Trades List Documentation */ private okhttp3.Call recentTradesListCall(String symbol, Long limit) throws ApiException { @@ -1629,7 +1479,7 @@ private okhttp3.Call recentTradesListValidateBeforeCall(String symbol, Long limi * * * @see Recent + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Recent-Trades-List">Recent * Trades List Documentation */ public ApiResponse recentTradesList( @@ -1653,7 +1503,7 @@ public ApiResponse recentTradesList( * * * @see Test + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Test-Connectivity">Test * Connectivity Documentation */ private okhttp3.Call testConnectivityCall() throws ApiException { @@ -1754,7 +1604,7 @@ private okhttp3.Call testConnectivityValidateBeforeCall() throws ApiException { * * * @see Test + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/Test-Connectivity">Test * Connectivity Documentation */ public ApiResponse testConnectivity() throws ApiException { @@ -1776,7 +1626,7 @@ public ApiResponse testConnectivity() throws ApiException { * * * @see 24hr + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/24hr-Ticker-Price-Change-Statistics">24hr * Ticker Price Change Statistics Documentation */ private okhttp3.Call ticker24hrPriceChangeStatisticsCall(String symbol) throws ApiException { @@ -1884,7 +1734,7 @@ private okhttp3.Call ticker24hrPriceChangeStatisticsValidateBeforeCall(String sy * * * @see 24hr + * href="https://developers.binance.com/docs/derivatives/options-trading/market-data/24hr-Ticker-Price-Change-Statistics">24hr * Ticker Price Change Statistics Documentation */ public ApiResponse ticker24hrPriceChangeStatistics( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java index 3cca64afc..3773a6ffd 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApi.java @@ -52,7 +52,7 @@ public class MarketMakerBlockTradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -103,7 +103,7 @@ public void setCustomBaseUrl(String customBaseUrl) { * * * @see Accept + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Accept-Block-Trade-Order">Accept * Block Trade Order (TRADE) Documentation */ private okhttp3.Call acceptBlockTradeOrderCall( @@ -220,7 +220,7 @@ private okhttp3.Call acceptBlockTradeOrderValidateBeforeCall( * * * @see Accept + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Accept-Block-Trade-Order">Accept * Block Trade Order (TRADE) Documentation */ public ApiResponse acceptBlockTradeOrder( @@ -250,7 +250,7 @@ public ApiResponse acceptBlockTradeOrder( * * * @see Account + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Account-Block-Trade-List">Account * Block Trade List (USER_DATA) Documentation */ private okhttp3.Call accountBlockTradeListCall( @@ -381,7 +381,7 @@ private okhttp3.Call accountBlockTradeListValidateBeforeCall( * * * @see Account + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Account-Block-Trade-List">Account * Block Trade List (USER_DATA) Documentation */ public ApiResponse accountBlockTradeList( @@ -408,7 +408,7 @@ public ApiResponse accountBlockTradeList( * * * @see Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Cancel-Block-Trade-Order">Cancel * Block Trade Order (TRADE) Documentation */ private okhttp3.Call cancelBlockTradeOrderCall(String blockOrderMatchingKey, Long recvWindow) @@ -525,7 +525,7 @@ private okhttp3.Call cancelBlockTradeOrderValidateBeforeCall( * * * @see Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Cancel-Block-Trade-Order">Cancel * Block Trade Order (TRADE) Documentation */ public ApiResponse cancelBlockTradeOrder( @@ -549,7 +549,7 @@ public ApiResponse cancelBlockTradeOrder( * * * @see Extend + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Extend-Block-Trade-Order">Extend * Block Trade Order (TRADE) Documentation */ private okhttp3.Call extendBlockTradeOrderCall( @@ -667,7 +667,7 @@ private okhttp3.Call extendBlockTradeOrderValidateBeforeCall( * * * @see Extend + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Extend-Block-Trade-Order">Extend * Block Trade Order (TRADE) Documentation */ public ApiResponse extendBlockTradeOrder( @@ -694,7 +694,7 @@ public ApiResponse extendBlockTradeOrder( * * * @see New + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/New-Block-Trade-Order">New * Block Trade Order (TRADE) Documentation */ private okhttp3.Call newBlockTradeOrderCall(NewBlockTradeOrderRequest newBlockTradeOrderRequest) @@ -814,7 +814,7 @@ private okhttp3.Call newBlockTradeOrderValidateBeforeCall( * * * @see New + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/New-Block-Trade-Order">New * Block Trade Order (TRADE) Documentation */ public ApiResponse newBlockTradeOrder( @@ -841,7 +841,7 @@ public ApiResponse newBlockTradeOrder( * * * @see Query + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Detail">Query * Block Trade Details (USER_DATA) Documentation */ private okhttp3.Call queryBlockTradeDetailsCall(String blockOrderMatchingKey, Long recvWindow) @@ -959,7 +959,7 @@ private okhttp3.Call queryBlockTradeDetailsValidateBeforeCall( * * * @see Query + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Detail">Query * Block Trade Details (USER_DATA) Documentation */ public ApiResponse queryBlockTradeDetails( @@ -990,7 +990,7 @@ public ApiResponse queryBlockTradeDetails( * * * @see Query + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Order">Query * Block Trade Order (TRADE) Documentation */ private okhttp3.Call queryBlockTradeOrderCall( @@ -1143,7 +1143,7 @@ private okhttp3.Call queryBlockTradeOrderValidateBeforeCall( * * * @see Query + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-block-trade/Query-Block-Trade-Order">Query * Block Trade Order (TRADE) Documentation */ public ApiResponse queryBlockTradeOrder( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java index 81ebe4c4a..f442c148a 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApi.java @@ -53,7 +53,7 @@ public class MarketMakerEndpointsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -104,7 +104,7 @@ public void setCustomBaseUrl(String customBaseUrl) { * * * @see Auto-Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat">Auto-Cancel * All Open Orders (Kill-Switch) Heartbeat (TRADE) Documentation */ private okhttp3.Call autoCancelAllOpenOrdersCall( @@ -226,7 +226,7 @@ private okhttp3.Call autoCancelAllOpenOrdersValidateBeforeCall( * * * @see Auto-Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Auto-Cancel-All-Open-Orders-Heartbeat">Auto-Cancel * All Open Orders (Kill-Switch) Heartbeat (TRADE) Documentation */ public ApiResponse autoCancelAllOpenOrders( @@ -254,7 +254,7 @@ public ApiResponse autoCancelAllOpenOrders( * * * @see Get + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config">Get * Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE) Documentation */ private okhttp3.Call getAutoCancelAllOpenOrdersCall(String underlying, Long recvWindow) @@ -374,7 +374,7 @@ private okhttp3.Call getAutoCancelAllOpenOrdersValidateBeforeCall( * * * @see Get + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Auto-Cancel-All-Open-Orders-Config">Get * Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE) Documentation */ public ApiResponse getAutoCancelAllOpenOrders( @@ -401,7 +401,7 @@ public ApiResponse getAutoCancelAllOpenOrder * * * @see Get + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Market-Maker-Protection-Config">Get * Market Maker Protection Config (TRADE) Documentation */ private okhttp3.Call getMarketMakerProtectionConfigCall(String underlying, Long recvWindow) @@ -517,7 +517,7 @@ private okhttp3.Call getMarketMakerProtectionConfigValidateBeforeCall( * * * @see Get + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Get-Market-Maker-Protection-Config">Get * Market Maker Protection Config (TRADE) Documentation */ public ApiResponse getMarketMakerProtectionConfig( @@ -543,7 +543,7 @@ public ApiResponse getMarketMakerProtect * * * @see Reset + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Reset-Market-Maker-Protection-Config">Reset * Market Maker Protection Config (TRADE) Documentation */ private okhttp3.Call resetMarketMakerProtectionConfigCall( @@ -665,7 +665,7 @@ private okhttp3.Call resetMarketMakerProtectionConfigValidateBeforeCall( * * * @see Reset + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Reset-Market-Maker-Protection-Config">Reset * Market Maker Protection Config (TRADE) Documentation */ public ApiResponse resetMarketMakerProtectionConfig( @@ -694,7 +694,7 @@ public ApiResponse resetMarketMakerPro * * * @see Set + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config">Set * Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE) Documentation */ private okhttp3.Call setAutoCancelAllOpenOrdersCall( @@ -832,7 +832,7 @@ private okhttp3.Call setAutoCancelAllOpenOrdersValidateBeforeCall( * * * @see Set + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Auto-Cancel-All-Open-Orders-Config">Set * Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE) Documentation */ public ApiResponse setAutoCancelAllOpenOrders( @@ -859,7 +859,7 @@ public ApiResponse setAutoCancelAllOpenOrder * * * @see Set + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Market-Maker-Protection-Config">Set * Market Maker Protection Config (TRADE) Documentation */ private okhttp3.Call setMarketMakerProtectionConfigCall( @@ -1011,7 +1011,7 @@ private okhttp3.Call setMarketMakerProtectionConfigValidateBeforeCall( * * * @see Set + * href="https://developers.binance.com/docs/derivatives/options-trading/market-maker-endpoints/Set-Market-Maker-Protection-Config">Set * Market Maker Protection Config (TRADE) Documentation */ public ApiResponse setMarketMakerProtectionConfig( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java index 204898877..b2476c393 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApi.java @@ -36,6 +36,7 @@ import com.binance.connector.client.derivatives_trading_options.rest.model.QueryCurrentOpenOptionOrdersResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.QueryOptionOrderHistoryResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.QuerySingleOrderResponse; +import com.binance.connector.client.derivatives_trading_options.rest.model.UserCommissionResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.UserExerciseRecordResponse; import com.google.gson.reflect.TypeToken; import jakarta.validation.ConstraintViolation; @@ -60,7 +61,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -101,8 +102,8 @@ public void setCustomBaseUrl(String customBaseUrl) { * Build call for accountTradeList * * @param symbol Option trading pair, e.g BTC-200730-9000-C (optional) - * @param fromId The UniqueId ID from which to return. The latest deal record is returned by - * default (optional) + * @param fromId Trade id to fetch from. Default gets most recent trades, e.g + * 4611875134427365376 (optional) * @param startTime Start Time, e.g 1593511200000 (optional) * @param endTime End Time, e.g 1593512200000 (optional) * @param limit Number of result sets returned Default:100 Max:1000 (optional) @@ -117,7 +118,7 @@ public void setCustomBaseUrl(String customBaseUrl) { * * * @see Account + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Account-Trade-List">Account * Trade List (USER_DATA) Documentation */ private okhttp3.Call accountTradeListCall( @@ -246,8 +247,8 @@ private okhttp3.Call accountTradeListValidateBeforeCall( * Account Trade List (USER_DATA) Get trades for a specific account and symbol. Weight: 5 * * @param symbol Option trading pair, e.g BTC-200730-9000-C (optional) - * @param fromId The UniqueId ID from which to return. The latest deal record is returned by - * default (optional) + * @param fromId Trade id to fetch from. Default gets most recent trades, e.g + * 4611875134427365376 (optional) * @param startTime Start Time, e.g 1593511200000 (optional) * @param endTime End Time, e.g 1593512200000 (optional) * @param limit Number of result sets returned Default:100 Max:1000 (optional) @@ -263,7 +264,7 @@ private okhttp3.Call accountTradeListValidateBeforeCall( * * * @see Account + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Account-Trade-List">Account * Trade List (USER_DATA) Documentation */ public ApiResponse accountTradeList( @@ -292,7 +293,7 @@ public ApiResponse accountTradeList( * * * @see Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-All-Option-Orders-By-Underlying">Cancel * All Option Orders By Underlying (TRADE) Documentation */ private okhttp3.Call cancelAllOptionOrdersByUnderlyingCall(String underlying, Long recvWindow) @@ -410,7 +411,7 @@ private okhttp3.Call cancelAllOptionOrdersByUnderlyingValidateBeforeCall( * * * @see Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-All-Option-Orders-By-Underlying">Cancel * All Option Orders By Underlying (TRADE) Documentation */ public ApiResponse cancelAllOptionOrdersByUnderlying( @@ -437,7 +438,7 @@ public ApiResponse cancelAllOptionOrd * * * @see Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-all-Option-orders-on-specific-symbol">Cancel * all Option orders on specific symbol (TRADE) Documentation */ private okhttp3.Call cancelAllOptionOrdersOnSpecificSymbolCall(String symbol, Long recvWindow) @@ -557,7 +558,7 @@ private okhttp3.Call cancelAllOptionOrdersOnSpecificSymbolValidateBeforeCall( * * * @see Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-all-Option-orders-on-specific-symbol">Cancel * all Option orders on specific symbol (TRADE) Documentation */ public ApiResponse @@ -588,7 +589,7 @@ private okhttp3.Call cancelAllOptionOrdersOnSpecificSymbolValidateBeforeCall( * * * @see Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Multiple-Option-Orders">Cancel * Multiple Option Orders (TRADE) Documentation */ private okhttp3.Call cancelMultipleOptionOrdersCall( @@ -707,8 +708,7 @@ private okhttp3.Call cancelMultipleOptionOrdersValidateBeforeCall( /** * Cancel Multiple Option Orders (TRADE) Cancel multiple orders. * At least one instance of - * `orderId` and `clientOrderId` must be sent. * Max 10 orders can be - * deleted in one request Weight: 1 + * `orderId` and `clientOrderId` must be sent. Weight: 1 * * @param symbol Option trading pair, e.g BTC-200730-9000-C (required) * @param orderIds Order ID, e.g [4611875134427365377,4611875134427365378] (optional) @@ -726,7 +726,7 @@ private okhttp3.Call cancelMultipleOptionOrdersValidateBeforeCall( * * * @see Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Multiple-Option-Orders">Cancel * Multiple Option Orders (TRADE) Documentation */ public ApiResponse cancelMultipleOptionOrders( @@ -760,7 +760,7 @@ public ApiResponse cancelMultipleOptionOrder * * * @see Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Option-Order">Cancel * Option Order (TRADE) Documentation */ private okhttp3.Call cancelOptionOrderCall( @@ -895,7 +895,7 @@ private okhttp3.Call cancelOptionOrderValidateBeforeCall( * * * @see Cancel + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Cancel-Option-Order">Cancel * Option Order (TRADE) Documentation */ public ApiResponse cancelOptionOrder( @@ -921,7 +921,8 @@ public ApiResponse cancelOptionOrder( * 200 New Order - * * - * @see New + * @see New * Order (TRADE) Documentation */ private okhttp3.Call newOrderCall(NewOrderRequest newOrderRequest) throws ApiException { @@ -1075,7 +1076,8 @@ private okhttp3.Call newOrderValidateBeforeCall(NewOrderRequest newOrderRequest) * 200 New Order - * * - * @see New + * @see New * Order (TRADE) Documentation */ public ApiResponse newOrder(@Valid @NotNull NewOrderRequest newOrderRequest) @@ -1100,7 +1102,7 @@ public ApiResponse newOrder(@Valid @NotNull NewOrderRequest ne * * * @see Option + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Option-Position-Information">Option * Position Information (USER_DATA) Documentation */ private okhttp3.Call optionPositionInformationCall(String symbol, Long recvWindow) @@ -1216,7 +1218,7 @@ private okhttp3.Call optionPositionInformationValidateBeforeCall(String symbol, * * * @see Option + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Option-Position-Information">Option * Position Information (USER_DATA) Documentation */ public ApiResponse optionPositionInformation( @@ -1241,7 +1243,7 @@ public ApiResponse optionPositionInformation( * * * @see Place + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Place-Multiple-Orders">Place * Multiple Orders(TRADE) Documentation */ private okhttp3.Call placeMultipleOrdersCall( @@ -1359,7 +1361,7 @@ private okhttp3.Call placeMultipleOrdersValidateBeforeCall( * * * @see Place + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Place-Multiple-Orders">Place * Multiple Orders(TRADE) Documentation */ public ApiResponse placeMultipleOrders( @@ -1390,7 +1392,7 @@ public ApiResponse placeMultipleOrders( * * * @see Query + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Current-Open-Option-Orders">Query * Current Open Option Orders (USER_DATA) Documentation */ private okhttp3.Call queryCurrentOpenOptionOrdersCall( @@ -1531,7 +1533,7 @@ private okhttp3.Call queryCurrentOpenOptionOrdersValidateBeforeCall( * * * @see Query + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Current-Open-Option-Orders">Query * Current Open Option Orders (USER_DATA) Documentation */ public ApiResponse queryCurrentOpenOptionOrders( @@ -1564,7 +1566,7 @@ public ApiResponse queryCurrentOpenOptionO * * * @see Query + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Option-Order-History">Query * Option Order History (TRADE) Documentation */ private okhttp3.Call queryOptionOrderHistoryCall( @@ -1711,7 +1713,7 @@ private okhttp3.Call queryOptionOrderHistoryValidateBeforeCall( * * * @see Query + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Option-Order-History">Query * Option Order History (TRADE) Documentation */ public ApiResponse queryOptionOrderHistory( @@ -1747,7 +1749,7 @@ public ApiResponse queryOptionOrderHistory( * * * @see Query + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Single-Order">Query * Single Order (TRADE) Documentation */ private okhttp3.Call querySingleOrderCall( @@ -1884,7 +1886,7 @@ private okhttp3.Call querySingleOrderValidateBeforeCall( * * * @see Query + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/Query-Single-Order">Query * Single Order (TRADE) Documentation */ public ApiResponse querySingleOrder( @@ -1897,6 +1899,137 @@ public ApiResponse querySingleOrder( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for userCommission + * + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 User Commission -
+ * + * @see User + * Commission (USER_DATA) Documentation + */ + private okhttp3.Call userCommissionCall(Long recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/eapi/v1/commission"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userCommissionValidateBeforeCall(Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {recvWindow}; + Method method = this.getClass().getMethod("userCommission", Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return userCommissionCall(recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * User Commission (USER_DATA) Get account commission. Weight: 5 + * + * @param recvWindow (optional) + * @return ApiResponse<UserCommissionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 User Commission -
+ * + * @see User + * Commission (USER_DATA) Documentation + */ + public ApiResponse userCommission(Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = userCommissionValidateBeforeCall(recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for userExerciseRecord * @@ -1915,7 +2048,7 @@ public ApiResponse querySingleOrder( * * * @see User + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/User-Exercise-Record">User * Exercise Record (USER_DATA) Documentation */ private okhttp3.Call userExerciseRecordCall( @@ -2054,7 +2187,7 @@ private okhttp3.Call userExerciseRecordValidateBeforeCall( * * * @see User + * href="https://developers.binance.com/docs/derivatives/options-trading/trade/User-Exercise-Record">User * Exercise Record (USER_DATA) Documentation */ public ApiResponse userExerciseRecord( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java index 485de5278..d737538f4 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApi.java @@ -42,7 +42,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -92,7 +92,7 @@ public void setCustomBaseUrl(String customBaseUrl) { * * * @see Close + * href="https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Close-User-Data-Stream">Close * User Data Stream (USER_STREAM) Documentation */ private okhttp3.Call closeUserDataStreamCall() throws ApiException { @@ -193,7 +193,7 @@ private okhttp3.Call closeUserDataStreamValidateBeforeCall() throws ApiException * * * @see Close + * href="https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Close-User-Data-Stream">Close * User Data Stream (USER_STREAM) Documentation */ public ApiResponse closeUserDataStream() throws ApiException { @@ -214,7 +214,7 @@ public ApiResponse closeUserDataStream() throws ApiException { * * * @see Keepalive + * href="https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Keepalive-User-Data-Stream">Keepalive * User Data Stream (USER_STREAM) Documentation */ private okhttp3.Call keepaliveUserDataStreamCall() throws ApiException { @@ -317,7 +317,7 @@ private okhttp3.Call keepaliveUserDataStreamValidateBeforeCall() throws ApiExcep * * * @see Keepalive + * href="https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Keepalive-User-Data-Stream">Keepalive * User Data Stream (USER_STREAM) Documentation */ public ApiResponse keepaliveUserDataStream() throws ApiException { @@ -338,7 +338,7 @@ public ApiResponse keepaliveUserDataStream() throws ApiException { * * * @see Start + * href="https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Start-User-Data-Stream">Start * User Data Stream (USER_STREAM) Documentation */ private okhttp3.Call startUserDataStreamCall() throws ApiException { @@ -442,7 +442,7 @@ private okhttp3.Call startUserDataStreamValidateBeforeCall() throws ApiException * * * @see Start + * href="https://developers.binance.com/docs/derivatives/options-trading/user-data-streams/Start-User-Data-Stream">Start * User Data Stream (USER_STREAM) Documentation */ public ApiResponse startUserDataStream() throws ApiException { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/AccountTradeListResponseInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/AccountTradeListResponseInner.java index 251955248..c6885fcda 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/AccountTradeListResponseInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/AccountTradeListResponseInner.java @@ -96,24 +96,12 @@ public class AccountTradeListResponseInner { @jakarta.annotation.Nullable private String type; - public static final String SERIALIZED_NAME_VOLATILITY = "volatility"; - - @SerializedName(SERIALIZED_NAME_VOLATILITY) - @jakarta.annotation.Nullable - private String volatility; - public static final String SERIALIZED_NAME_LIQUIDITY = "liquidity"; @SerializedName(SERIALIZED_NAME_LIQUIDITY) @jakarta.annotation.Nullable private String liquidity; - public static final String SERIALIZED_NAME_QUOTE_ASSET = "quoteAsset"; - - @SerializedName(SERIALIZED_NAME_QUOTE_ASSET) - @jakarta.annotation.Nullable - private String quoteAsset; - public static final String SERIALIZED_NAME_TIME = "time"; @SerializedName(SERIALIZED_NAME_TIME) @@ -138,6 +126,12 @@ public class AccountTradeListResponseInner { @jakarta.annotation.Nullable private String optionSide; + public static final String SERIALIZED_NAME_QUOTE_ASSET = "quoteAsset"; + + @SerializedName(SERIALIZED_NAME_QUOTE_ASSET) + @jakarta.annotation.Nullable + private String quoteAsset; + public AccountTradeListResponseInner() {} public AccountTradeListResponseInner id(@jakarta.annotation.Nullable Long id) { @@ -331,26 +325,6 @@ public void setType(@jakarta.annotation.Nullable String type) { this.type = type; } - public AccountTradeListResponseInner volatility( - @jakarta.annotation.Nullable String volatility) { - this.volatility = volatility; - return this; - } - - /** - * Get volatility - * - * @return volatility - */ - @jakarta.annotation.Nullable - public String getVolatility() { - return volatility; - } - - public void setVolatility(@jakarta.annotation.Nullable String volatility) { - this.volatility = volatility; - } - public AccountTradeListResponseInner liquidity(@jakarta.annotation.Nullable String liquidity) { this.liquidity = liquidity; return this; @@ -370,26 +344,6 @@ public void setLiquidity(@jakarta.annotation.Nullable String liquidity) { this.liquidity = liquidity; } - public AccountTradeListResponseInner quoteAsset( - @jakarta.annotation.Nullable String quoteAsset) { - this.quoteAsset = quoteAsset; - return this; - } - - /** - * Get quoteAsset - * - * @return quoteAsset - */ - @jakarta.annotation.Nullable - public String getQuoteAsset() { - return quoteAsset; - } - - public void setQuoteAsset(@jakarta.annotation.Nullable String quoteAsset) { - this.quoteAsset = quoteAsset; - } - public AccountTradeListResponseInner time(@jakarta.annotation.Nullable Long time) { this.time = time; return this; @@ -468,6 +422,26 @@ public void setOptionSide(@jakarta.annotation.Nullable String optionSide) { this.optionSide = optionSide; } + public AccountTradeListResponseInner quoteAsset( + @jakarta.annotation.Nullable String quoteAsset) { + this.quoteAsset = quoteAsset; + return this; + } + + /** + * Get quoteAsset + * + * @return quoteAsset + */ + @jakarta.annotation.Nullable + public String getQuoteAsset() { + return quoteAsset; + } + + public void setQuoteAsset(@jakarta.annotation.Nullable String quoteAsset) { + this.quoteAsset = quoteAsset; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -488,13 +462,12 @@ public boolean equals(Object o) { && Objects.equals(this.realizedProfit, accountTradeListResponseInner.realizedProfit) && Objects.equals(this.side, accountTradeListResponseInner.side) && Objects.equals(this.type, accountTradeListResponseInner.type) - && Objects.equals(this.volatility, accountTradeListResponseInner.volatility) && Objects.equals(this.liquidity, accountTradeListResponseInner.liquidity) - && Objects.equals(this.quoteAsset, accountTradeListResponseInner.quoteAsset) && Objects.equals(this.time, accountTradeListResponseInner.time) && Objects.equals(this.priceScale, accountTradeListResponseInner.priceScale) && Objects.equals(this.quantityScale, accountTradeListResponseInner.quantityScale) - && Objects.equals(this.optionSide, accountTradeListResponseInner.optionSide); + && Objects.equals(this.optionSide, accountTradeListResponseInner.optionSide) + && Objects.equals(this.quoteAsset, accountTradeListResponseInner.quoteAsset); } @Override @@ -510,13 +483,12 @@ public int hashCode() { realizedProfit, side, type, - volatility, liquidity, - quoteAsset, time, priceScale, quantityScale, - optionSide); + optionSide, + quoteAsset); } @Override @@ -533,13 +505,12 @@ public String toString() { sb.append(" realizedProfit: ").append(toIndentedString(realizedProfit)).append("\n"); sb.append(" side: ").append(toIndentedString(side)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" volatility: ").append(toIndentedString(volatility)).append("\n"); sb.append(" liquidity: ").append(toIndentedString(liquidity)).append("\n"); - sb.append(" quoteAsset: ").append(toIndentedString(quoteAsset)).append("\n"); sb.append(" time: ").append(toIndentedString(time)).append("\n"); sb.append(" priceScale: ").append(toIndentedString(priceScale)).append("\n"); sb.append(" quantityScale: ").append(toIndentedString(quantityScale)).append("\n"); sb.append(" optionSide: ").append(toIndentedString(optionSide)).append("\n"); + sb.append(" quoteAsset: ").append(toIndentedString(quoteAsset)).append("\n"); sb.append("}"); return sb.toString(); } @@ -587,18 +558,10 @@ public String toUrlQueryString() { String typeValueAsString = ""; typeValueAsString = typeValue.toString(); sb.append("type=").append(urlEncode(typeValueAsString)).append(""); - Object volatilityValue = getVolatility(); - String volatilityValueAsString = ""; - volatilityValueAsString = volatilityValue.toString(); - sb.append("volatility=").append(urlEncode(volatilityValueAsString)).append(""); Object liquidityValue = getLiquidity(); String liquidityValueAsString = ""; liquidityValueAsString = liquidityValue.toString(); sb.append("liquidity=").append(urlEncode(liquidityValueAsString)).append(""); - Object quoteAssetValue = getQuoteAsset(); - String quoteAssetValueAsString = ""; - quoteAssetValueAsString = quoteAssetValue.toString(); - sb.append("quoteAsset=").append(urlEncode(quoteAssetValueAsString)).append(""); Object timeValue = getTime(); String timeValueAsString = ""; timeValueAsString = timeValue.toString(); @@ -615,6 +578,10 @@ public String toUrlQueryString() { String optionSideValueAsString = ""; optionSideValueAsString = optionSideValue.toString(); sb.append("optionSide=").append(urlEncode(optionSideValueAsString)).append(""); + Object quoteAssetValue = getQuoteAsset(); + String quoteAssetValueAsString = ""; + quoteAssetValueAsString = quoteAssetValue.toString(); + sb.append("quoteAsset=").append(urlEncode(quoteAssetValueAsString)).append(""); return sb.toString(); } @@ -653,13 +620,12 @@ private String toIndentedString(Object o) { openapiFields.add("realizedProfit"); openapiFields.add("side"); openapiFields.add("type"); - openapiFields.add("volatility"); openapiFields.add("liquidity"); - openapiFields.add("quoteAsset"); openapiFields.add("time"); openapiFields.add("priceScale"); openapiFields.add("quantityScale"); openapiFields.add("optionSide"); + openapiFields.add("quoteAsset"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -740,14 +706,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("type").toString())); } - if ((jsonObj.get("volatility") != null && !jsonObj.get("volatility").isJsonNull()) - && !jsonObj.get("volatility").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `volatility` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("volatility").toString())); - } if ((jsonObj.get("liquidity") != null && !jsonObj.get("liquidity").isJsonNull()) && !jsonObj.get("liquidity").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -756,14 +714,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("liquidity").toString())); } - if ((jsonObj.get("quoteAsset") != null && !jsonObj.get("quoteAsset").isJsonNull()) - && !jsonObj.get("quoteAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `quoteAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("quoteAsset").toString())); - } if ((jsonObj.get("optionSide") != null && !jsonObj.get("optionSide").isJsonNull()) && !jsonObj.get("optionSide").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -772,6 +722,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("optionSide").toString())); } + if ((jsonObj.get("quoteAsset") != null && !jsonObj.get("quoteAsset").isJsonNull()) + && !jsonObj.get("quoteAsset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quoteAsset` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("quoteAsset").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelAllOptionOrdersByUnderlyingResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelAllOptionOrdersByUnderlyingResponse.java index dbe4f15a0..8669bc4df 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelAllOptionOrdersByUnderlyingResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelAllOptionOrdersByUnderlyingResponse.java @@ -48,12 +48,6 @@ public class CancelAllOptionOrdersByUnderlyingResponse { @jakarta.annotation.Nullable private String msg; - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - @jakarta.annotation.Nullable - private Long data; - public CancelAllOptionOrdersByUnderlyingResponse() {} public CancelAllOptionOrdersByUnderlyingResponse code(@jakarta.annotation.Nullable Long code) { @@ -94,25 +88,6 @@ public void setMsg(@jakarta.annotation.Nullable String msg) { this.msg = msg; } - public CancelAllOptionOrdersByUnderlyingResponse data(@jakarta.annotation.Nullable Long data) { - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @jakarta.annotation.Nullable - public Long getData() { - return data; - } - - public void setData(@jakarta.annotation.Nullable Long data) { - this.data = data; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -124,13 +99,12 @@ public boolean equals(Object o) { CancelAllOptionOrdersByUnderlyingResponse cancelAllOptionOrdersByUnderlyingResponse = (CancelAllOptionOrdersByUnderlyingResponse) o; return Objects.equals(this.code, cancelAllOptionOrdersByUnderlyingResponse.code) - && Objects.equals(this.msg, cancelAllOptionOrdersByUnderlyingResponse.msg) - && Objects.equals(this.data, cancelAllOptionOrdersByUnderlyingResponse.data); + && Objects.equals(this.msg, cancelAllOptionOrdersByUnderlyingResponse.msg); } @Override public int hashCode() { - return Objects.hash(code, msg, data); + return Objects.hash(code, msg); } @Override @@ -139,7 +113,6 @@ public String toString() { sb.append("class CancelAllOptionOrdersByUnderlyingResponse {\n"); sb.append(" code: ").append(toIndentedString(code)).append("\n"); sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append("}"); return sb.toString(); } @@ -155,10 +128,6 @@ public String toUrlQueryString() { String msgValueAsString = ""; msgValueAsString = msgValue.toString(); sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); - Object dataValue = getData(); - String dataValueAsString = ""; - dataValueAsString = dataValue.toString(); - sb.append("data=").append(urlEncode(dataValueAsString)).append(""); return sb.toString(); } @@ -189,7 +158,6 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("code"); openapiFields.add("msg"); - openapiFields.add("data"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelMultipleOptionOrdersResponseInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelMultipleOptionOrdersResponseInner.java index 88d0602e1..5c1a8976c 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelMultipleOptionOrdersResponseInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelMultipleOptionOrdersResponseInner.java @@ -66,12 +66,6 @@ public class CancelMultipleOptionOrdersResponseInner { @jakarta.annotation.Nullable private String executedQty; - public static final String SERIALIZED_NAME_FEE = "fee"; - - @SerializedName(SERIALIZED_NAME_FEE) - @jakarta.annotation.Nullable - private Long fee; - public static final String SERIALIZED_NAME_SIDE = "side"; @SerializedName(SERIALIZED_NAME_SIDE) @@ -90,12 +84,24 @@ public class CancelMultipleOptionOrdersResponseInner { @jakarta.annotation.Nullable private String timeInForce; + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; + + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @jakarta.annotation.Nullable + private Boolean reduceOnly; + public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; @SerializedName(SERIALIZED_NAME_CREATE_TIME) @jakarta.annotation.Nullable private Long createTime; + public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; + + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + @jakarta.annotation.Nullable + private Long updateTime; + public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) @@ -108,11 +114,11 @@ public class CancelMultipleOptionOrdersResponseInner { @jakarta.annotation.Nullable private String avgPrice; - public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; + public static final String SERIALIZED_NAME_SOURCE = "source"; - @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @SerializedName(SERIALIZED_NAME_SOURCE) @jakarta.annotation.Nullable - private Boolean reduceOnly; + private String source; public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; @@ -120,11 +126,35 @@ public class CancelMultipleOptionOrdersResponseInner { @jakarta.annotation.Nullable private String clientOrderId; - public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; + public static final String SERIALIZED_NAME_PRICE_SCALE = "priceScale"; - @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + @SerializedName(SERIALIZED_NAME_PRICE_SCALE) @jakarta.annotation.Nullable - private Long updateTime; + private Long priceScale; + + public static final String SERIALIZED_NAME_QUANTITY_SCALE = "quantityScale"; + + @SerializedName(SERIALIZED_NAME_QUANTITY_SCALE) + @jakarta.annotation.Nullable + private Long quantityScale; + + public static final String SERIALIZED_NAME_OPTION_SIDE = "optionSide"; + + @SerializedName(SERIALIZED_NAME_OPTION_SIDE) + @jakarta.annotation.Nullable + private String optionSide; + + public static final String SERIALIZED_NAME_QUOTE_ASSET = "quoteAsset"; + + @SerializedName(SERIALIZED_NAME_QUOTE_ASSET) + @jakarta.annotation.Nullable + private String quoteAsset; + + public static final String SERIALIZED_NAME_MMP = "mmp"; + + @SerializedName(SERIALIZED_NAME_MMP) + @jakarta.annotation.Nullable + private Boolean mmp; public CancelMultipleOptionOrdersResponseInner() {} @@ -228,25 +258,6 @@ public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { this.executedQty = executedQty; } - public CancelMultipleOptionOrdersResponseInner fee(@jakarta.annotation.Nullable Long fee) { - this.fee = fee; - return this; - } - - /** - * Get fee - * - * @return fee - */ - @jakarta.annotation.Nullable - public Long getFee() { - return fee; - } - - public void setFee(@jakarta.annotation.Nullable Long fee) { - this.fee = fee; - } - public CancelMultipleOptionOrdersResponseInner side(@jakarta.annotation.Nullable String side) { this.side = side; return this; @@ -305,6 +316,26 @@ public void setTimeInForce(@jakarta.annotation.Nullable String timeInForce) { this.timeInForce = timeInForce; } + public CancelMultipleOptionOrdersResponseInner reduceOnly( + @jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Get reduceOnly + * + * @return reduceOnly + */ + @jakarta.annotation.Nullable + public Boolean getReduceOnly() { + return reduceOnly; + } + + public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + } + public CancelMultipleOptionOrdersResponseInner createTime( @jakarta.annotation.Nullable Long createTime) { this.createTime = createTime; @@ -325,6 +356,26 @@ public void setCreateTime(@jakarta.annotation.Nullable Long createTime) { this.createTime = createTime; } + public CancelMultipleOptionOrdersResponseInner updateTime( + @jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Get updateTime + * + * @return updateTime + */ + @jakarta.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + } + public CancelMultipleOptionOrdersResponseInner status( @jakarta.annotation.Nullable String status) { this.status = status; @@ -365,24 +416,24 @@ public void setAvgPrice(@jakarta.annotation.Nullable String avgPrice) { this.avgPrice = avgPrice; } - public CancelMultipleOptionOrdersResponseInner reduceOnly( - @jakarta.annotation.Nullable Boolean reduceOnly) { - this.reduceOnly = reduceOnly; + public CancelMultipleOptionOrdersResponseInner source( + @jakarta.annotation.Nullable String source) { + this.source = source; return this; } /** - * Get reduceOnly + * Get source * - * @return reduceOnly + * @return source */ @jakarta.annotation.Nullable - public Boolean getReduceOnly() { - return reduceOnly; + public String getSource() { + return source; } - public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { - this.reduceOnly = reduceOnly; + public void setSource(@jakarta.annotation.Nullable String source) { + this.source = source; } public CancelMultipleOptionOrdersResponseInner clientOrderId( @@ -405,24 +456,103 @@ public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) this.clientOrderId = clientOrderId; } - public CancelMultipleOptionOrdersResponseInner updateTime( - @jakarta.annotation.Nullable Long updateTime) { - this.updateTime = updateTime; + public CancelMultipleOptionOrdersResponseInner priceScale( + @jakarta.annotation.Nullable Long priceScale) { + this.priceScale = priceScale; return this; } /** - * Get updateTime + * Get priceScale * - * @return updateTime + * @return priceScale */ @jakarta.annotation.Nullable - public Long getUpdateTime() { - return updateTime; + public Long getPriceScale() { + return priceScale; } - public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { - this.updateTime = updateTime; + public void setPriceScale(@jakarta.annotation.Nullable Long priceScale) { + this.priceScale = priceScale; + } + + public CancelMultipleOptionOrdersResponseInner quantityScale( + @jakarta.annotation.Nullable Long quantityScale) { + this.quantityScale = quantityScale; + return this; + } + + /** + * Get quantityScale + * + * @return quantityScale + */ + @jakarta.annotation.Nullable + public Long getQuantityScale() { + return quantityScale; + } + + public void setQuantityScale(@jakarta.annotation.Nullable Long quantityScale) { + this.quantityScale = quantityScale; + } + + public CancelMultipleOptionOrdersResponseInner optionSide( + @jakarta.annotation.Nullable String optionSide) { + this.optionSide = optionSide; + return this; + } + + /** + * Get optionSide + * + * @return optionSide + */ + @jakarta.annotation.Nullable + public String getOptionSide() { + return optionSide; + } + + public void setOptionSide(@jakarta.annotation.Nullable String optionSide) { + this.optionSide = optionSide; + } + + public CancelMultipleOptionOrdersResponseInner quoteAsset( + @jakarta.annotation.Nullable String quoteAsset) { + this.quoteAsset = quoteAsset; + return this; + } + + /** + * Get quoteAsset + * + * @return quoteAsset + */ + @jakarta.annotation.Nullable + public String getQuoteAsset() { + return quoteAsset; + } + + public void setQuoteAsset(@jakarta.annotation.Nullable String quoteAsset) { + this.quoteAsset = quoteAsset; + } + + public CancelMultipleOptionOrdersResponseInner mmp(@jakarta.annotation.Nullable Boolean mmp) { + this.mmp = mmp; + return this; + } + + /** + * Get mmp + * + * @return mmp + */ + @jakarta.annotation.Nullable + public Boolean getMmp() { + return mmp; + } + + public void setMmp(@jakarta.annotation.Nullable Boolean mmp) { + this.mmp = mmp; } @Override @@ -441,21 +571,30 @@ public boolean equals(Object o) { && Objects.equals(this.quantity, cancelMultipleOptionOrdersResponseInner.quantity) && Objects.equals( this.executedQty, cancelMultipleOptionOrdersResponseInner.executedQty) - && Objects.equals(this.fee, cancelMultipleOptionOrdersResponseInner.fee) && Objects.equals(this.side, cancelMultipleOptionOrdersResponseInner.side) && Objects.equals(this.type, cancelMultipleOptionOrdersResponseInner.type) && Objects.equals( this.timeInForce, cancelMultipleOptionOrdersResponseInner.timeInForce) + && Objects.equals( + this.reduceOnly, cancelMultipleOptionOrdersResponseInner.reduceOnly) && Objects.equals( this.createTime, cancelMultipleOptionOrdersResponseInner.createTime) + && Objects.equals( + this.updateTime, cancelMultipleOptionOrdersResponseInner.updateTime) && Objects.equals(this.status, cancelMultipleOptionOrdersResponseInner.status) && Objects.equals(this.avgPrice, cancelMultipleOptionOrdersResponseInner.avgPrice) - && Objects.equals( - this.reduceOnly, cancelMultipleOptionOrdersResponseInner.reduceOnly) + && Objects.equals(this.source, cancelMultipleOptionOrdersResponseInner.source) && Objects.equals( this.clientOrderId, cancelMultipleOptionOrdersResponseInner.clientOrderId) && Objects.equals( - this.updateTime, cancelMultipleOptionOrdersResponseInner.updateTime); + this.priceScale, cancelMultipleOptionOrdersResponseInner.priceScale) + && Objects.equals( + this.quantityScale, cancelMultipleOptionOrdersResponseInner.quantityScale) + && Objects.equals( + this.optionSide, cancelMultipleOptionOrdersResponseInner.optionSide) + && Objects.equals( + this.quoteAsset, cancelMultipleOptionOrdersResponseInner.quoteAsset) + && Objects.equals(this.mmp, cancelMultipleOptionOrdersResponseInner.mmp); } @Override @@ -466,16 +605,21 @@ public int hashCode() { price, quantity, executedQty, - fee, side, type, timeInForce, + reduceOnly, createTime, + updateTime, status, avgPrice, - reduceOnly, + source, clientOrderId, - updateTime); + priceScale, + quantityScale, + optionSide, + quoteAsset, + mmp); } @Override @@ -487,16 +631,21 @@ public String toString() { sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); - sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); sb.append(" side: ").append(toIndentedString(side)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" avgPrice: ").append(toIndentedString(avgPrice)).append("\n"); - sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); - sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" priceScale: ").append(toIndentedString(priceScale)).append("\n"); + sb.append(" quantityScale: ").append(toIndentedString(quantityScale)).append("\n"); + sb.append(" optionSide: ").append(toIndentedString(optionSide)).append("\n"); + sb.append(" quoteAsset: ").append(toIndentedString(quoteAsset)).append("\n"); + sb.append(" mmp: ").append(toIndentedString(mmp)).append("\n"); sb.append("}"); return sb.toString(); } @@ -524,10 +673,6 @@ public String toUrlQueryString() { String executedQtyValueAsString = ""; executedQtyValueAsString = executedQtyValue.toString(); sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); - Object feeValue = getFee(); - String feeValueAsString = ""; - feeValueAsString = feeValue.toString(); - sb.append("fee=").append(urlEncode(feeValueAsString)).append(""); Object sideValue = getSide(); String sideValueAsString = ""; sideValueAsString = sideValue.toString(); @@ -540,10 +685,18 @@ public String toUrlQueryString() { String timeInForceValueAsString = ""; timeInForceValueAsString = timeInForceValue.toString(); sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object reduceOnlyValue = getReduceOnly(); + String reduceOnlyValueAsString = ""; + reduceOnlyValueAsString = reduceOnlyValue.toString(); + sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); Object createTimeValue = getCreateTime(); String createTimeValueAsString = ""; createTimeValueAsString = createTimeValue.toString(); sb.append("createTime=").append(urlEncode(createTimeValueAsString)).append(""); + Object updateTimeValue = getUpdateTime(); + String updateTimeValueAsString = ""; + updateTimeValueAsString = updateTimeValue.toString(); + sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).append(""); Object statusValue = getStatus(); String statusValueAsString = ""; statusValueAsString = statusValue.toString(); @@ -552,18 +705,34 @@ public String toUrlQueryString() { String avgPriceValueAsString = ""; avgPriceValueAsString = avgPriceValue.toString(); sb.append("avgPrice=").append(urlEncode(avgPriceValueAsString)).append(""); - Object reduceOnlyValue = getReduceOnly(); - String reduceOnlyValueAsString = ""; - reduceOnlyValueAsString = reduceOnlyValue.toString(); - sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); + Object sourceValue = getSource(); + String sourceValueAsString = ""; + sourceValueAsString = sourceValue.toString(); + sb.append("source=").append(urlEncode(sourceValueAsString)).append(""); Object clientOrderIdValue = getClientOrderId(); String clientOrderIdValueAsString = ""; clientOrderIdValueAsString = clientOrderIdValue.toString(); sb.append("clientOrderId=").append(urlEncode(clientOrderIdValueAsString)).append(""); - Object updateTimeValue = getUpdateTime(); - String updateTimeValueAsString = ""; - updateTimeValueAsString = updateTimeValue.toString(); - sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).append(""); + Object priceScaleValue = getPriceScale(); + String priceScaleValueAsString = ""; + priceScaleValueAsString = priceScaleValue.toString(); + sb.append("priceScale=").append(urlEncode(priceScaleValueAsString)).append(""); + Object quantityScaleValue = getQuantityScale(); + String quantityScaleValueAsString = ""; + quantityScaleValueAsString = quantityScaleValue.toString(); + sb.append("quantityScale=").append(urlEncode(quantityScaleValueAsString)).append(""); + Object optionSideValue = getOptionSide(); + String optionSideValueAsString = ""; + optionSideValueAsString = optionSideValue.toString(); + sb.append("optionSide=").append(urlEncode(optionSideValueAsString)).append(""); + Object quoteAssetValue = getQuoteAsset(); + String quoteAssetValueAsString = ""; + quoteAssetValueAsString = quoteAssetValue.toString(); + sb.append("quoteAsset=").append(urlEncode(quoteAssetValueAsString)).append(""); + Object mmpValue = getMmp(); + String mmpValueAsString = ""; + mmpValueAsString = mmpValue.toString(); + sb.append("mmp=").append(urlEncode(mmpValueAsString)).append(""); return sb.toString(); } @@ -597,16 +766,21 @@ private String toIndentedString(Object o) { openapiFields.add("price"); openapiFields.add("quantity"); openapiFields.add("executedQty"); - openapiFields.add("fee"); openapiFields.add("side"); openapiFields.add("type"); openapiFields.add("timeInForce"); + openapiFields.add("reduceOnly"); openapiFields.add("createTime"); + openapiFields.add("updateTime"); openapiFields.add("status"); openapiFields.add("avgPrice"); - openapiFields.add("reduceOnly"); + openapiFields.add("source"); openapiFields.add("clientOrderId"); - openapiFields.add("updateTime"); + openapiFields.add("priceScale"); + openapiFields.add("quantityScale"); + openapiFields.add("optionSide"); + openapiFields.add("quoteAsset"); + openapiFields.add("mmp"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -705,6 +879,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("avgPrice").toString())); } + if ((jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) + && !jsonObj.get("source").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `source` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("source").toString())); + } if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) && !jsonObj.get("clientOrderId").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -713,6 +895,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("clientOrderId").toString())); } + if ((jsonObj.get("optionSide") != null && !jsonObj.get("optionSide").isJsonNull()) + && !jsonObj.get("optionSide").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `optionSide` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("optionSide").toString())); + } + if ((jsonObj.get("quoteAsset") != null && !jsonObj.get("quoteAsset").isJsonNull()) + && !jsonObj.get("quoteAsset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quoteAsset` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("quoteAsset").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelOptionOrderResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelOptionOrderResponse.java index 1921ddd0c..c24d7a506 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelOptionOrderResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/CancelOptionOrderResponse.java @@ -66,12 +66,6 @@ public class CancelOptionOrderResponse { @jakarta.annotation.Nullable private String executedQty; - public static final String SERIALIZED_NAME_FEE = "fee"; - - @SerializedName(SERIALIZED_NAME_FEE) - @jakarta.annotation.Nullable - private String fee; - public static final String SERIALIZED_NAME_SIDE = "side"; @SerializedName(SERIALIZED_NAME_SIDE) @@ -96,12 +90,6 @@ public class CancelOptionOrderResponse { @jakarta.annotation.Nullable private Boolean reduceOnly; - public static final String SERIALIZED_NAME_POST_ONLY = "postOnly"; - - @SerializedName(SERIALIZED_NAME_POST_ONLY) - @jakarta.annotation.Nullable - private Boolean postOnly; - public static final String SERIALIZED_NAME_CREATE_DATE = "createDate"; @SerializedName(SERIALIZED_NAME_CREATE_DATE) @@ -265,25 +253,6 @@ public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { this.executedQty = executedQty; } - public CancelOptionOrderResponse fee(@jakarta.annotation.Nullable String fee) { - this.fee = fee; - return this; - } - - /** - * Get fee - * - * @return fee - */ - @jakarta.annotation.Nullable - public String getFee() { - return fee; - } - - public void setFee(@jakarta.annotation.Nullable String fee) { - this.fee = fee; - } - public CancelOptionOrderResponse side(@jakarta.annotation.Nullable String side) { this.side = side; return this; @@ -360,25 +329,6 @@ public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { this.reduceOnly = reduceOnly; } - public CancelOptionOrderResponse postOnly(@jakarta.annotation.Nullable Boolean postOnly) { - this.postOnly = postOnly; - return this; - } - - /** - * Get postOnly - * - * @return postOnly - */ - @jakarta.annotation.Nullable - public Boolean getPostOnly() { - return postOnly; - } - - public void setPostOnly(@jakarta.annotation.Nullable Boolean postOnly) { - this.postOnly = postOnly; - } - public CancelOptionOrderResponse createDate(@jakarta.annotation.Nullable Long createDate) { this.createDate = createDate; return this; @@ -604,12 +554,10 @@ public boolean equals(Object o) { && Objects.equals(this.price, cancelOptionOrderResponse.price) && Objects.equals(this.quantity, cancelOptionOrderResponse.quantity) && Objects.equals(this.executedQty, cancelOptionOrderResponse.executedQty) - && Objects.equals(this.fee, cancelOptionOrderResponse.fee) && Objects.equals(this.side, cancelOptionOrderResponse.side) && Objects.equals(this.type, cancelOptionOrderResponse.type) && Objects.equals(this.timeInForce, cancelOptionOrderResponse.timeInForce) && Objects.equals(this.reduceOnly, cancelOptionOrderResponse.reduceOnly) - && Objects.equals(this.postOnly, cancelOptionOrderResponse.postOnly) && Objects.equals(this.createDate, cancelOptionOrderResponse.createDate) && Objects.equals(this.updateTime, cancelOptionOrderResponse.updateTime) && Objects.equals(this.status, cancelOptionOrderResponse.status) @@ -631,12 +579,10 @@ public int hashCode() { price, quantity, executedQty, - fee, side, type, timeInForce, reduceOnly, - postOnly, createDate, updateTime, status, @@ -659,12 +605,10 @@ public String toString() { sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); - sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); sb.append(" side: ").append(toIndentedString(side)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); - sb.append(" postOnly: ").append(toIndentedString(postOnly)).append("\n"); sb.append(" createDate: ").append(toIndentedString(createDate)).append("\n"); sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); @@ -703,10 +647,6 @@ public String toUrlQueryString() { String executedQtyValueAsString = ""; executedQtyValueAsString = executedQtyValue.toString(); sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); - Object feeValue = getFee(); - String feeValueAsString = ""; - feeValueAsString = feeValue.toString(); - sb.append("fee=").append(urlEncode(feeValueAsString)).append(""); Object sideValue = getSide(); String sideValueAsString = ""; sideValueAsString = sideValue.toString(); @@ -723,10 +663,6 @@ public String toUrlQueryString() { String reduceOnlyValueAsString = ""; reduceOnlyValueAsString = reduceOnlyValue.toString(); sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); - Object postOnlyValue = getPostOnly(); - String postOnlyValueAsString = ""; - postOnlyValueAsString = postOnlyValue.toString(); - sb.append("postOnly=").append(urlEncode(postOnlyValueAsString)).append(""); Object createDateValue = getCreateDate(); String createDateValueAsString = ""; createDateValueAsString = createDateValue.toString(); @@ -804,12 +740,10 @@ private String toIndentedString(Object o) { openapiFields.add("price"); openapiFields.add("quantity"); openapiFields.add("executedQty"); - openapiFields.add("fee"); openapiFields.add("side"); openapiFields.add("type"); openapiFields.add("timeInForce"); openapiFields.add("reduceOnly"); - openapiFields.add("postOnly"); openapiFields.add("createDate"); openapiFields.add("updateTime"); openapiFields.add("status"); @@ -876,14 +810,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("executedQty").toString())); } - if ((jsonObj.get("fee") != null && !jsonObj.get("fee").isJsonNull()) - && !jsonObj.get("fee").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `fee` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("fee").toString())); - } if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) && !jsonObj.get("side").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/ExchangeInformationResponseOptionSymbolsInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/ExchangeInformationResponseOptionSymbolsInner.java index f5944e59a..ef66a39fb 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/ExchangeInformationResponseOptionSymbolsInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/ExchangeInformationResponseOptionSymbolsInner.java @@ -84,18 +84,6 @@ public class ExchangeInformationResponseOptionSymbolsInner { @jakarta.annotation.Nullable private Long unit; - public static final String SERIALIZED_NAME_MAKER_FEE_RATE = "makerFeeRate"; - - @SerializedName(SERIALIZED_NAME_MAKER_FEE_RATE) - @jakarta.annotation.Nullable - private String makerFeeRate; - - public static final String SERIALIZED_NAME_TAKER_FEE_RATE = "takerFeeRate"; - - @SerializedName(SERIALIZED_NAME_TAKER_FEE_RATE) - @jakarta.annotation.Nullable - private String takerFeeRate; - public static final String SERIALIZED_NAME_LIQUIDATION_FEE_RATE = "liquidationFeeRate"; @SerializedName(SERIALIZED_NAME_LIQUIDATION_FEE_RATE) @@ -156,6 +144,12 @@ public class ExchangeInformationResponseOptionSymbolsInner { @jakarta.annotation.Nullable private String quoteAsset; + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private String status; + public ExchangeInformationResponseOptionSymbolsInner() {} public ExchangeInformationResponseOptionSymbolsInner expiryDate( @@ -313,46 +307,6 @@ public void setUnit(@jakarta.annotation.Nullable Long unit) { this.unit = unit; } - public ExchangeInformationResponseOptionSymbolsInner makerFeeRate( - @jakarta.annotation.Nullable String makerFeeRate) { - this.makerFeeRate = makerFeeRate; - return this; - } - - /** - * Get makerFeeRate - * - * @return makerFeeRate - */ - @jakarta.annotation.Nullable - public String getMakerFeeRate() { - return makerFeeRate; - } - - public void setMakerFeeRate(@jakarta.annotation.Nullable String makerFeeRate) { - this.makerFeeRate = makerFeeRate; - } - - public ExchangeInformationResponseOptionSymbolsInner takerFeeRate( - @jakarta.annotation.Nullable String takerFeeRate) { - this.takerFeeRate = takerFeeRate; - return this; - } - - /** - * Get takerFeeRate - * - * @return takerFeeRate - */ - @jakarta.annotation.Nullable - public String getTakerFeeRate() { - return takerFeeRate; - } - - public void setTakerFeeRate(@jakarta.annotation.Nullable String takerFeeRate) { - this.takerFeeRate = takerFeeRate; - } - public ExchangeInformationResponseOptionSymbolsInner liquidationFeeRate( @jakarta.annotation.Nullable String liquidationFeeRate) { this.liquidationFeeRate = liquidationFeeRate; @@ -553,6 +507,26 @@ public void setQuoteAsset(@jakarta.annotation.Nullable String quoteAsset) { this.quoteAsset = quoteAsset; } + public ExchangeInformationResponseOptionSymbolsInner status( + @jakarta.annotation.Nullable String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @jakarta.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(@jakarta.annotation.Nullable String status) { + this.status = status; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -575,12 +549,6 @@ public boolean equals(Object o) { && Objects.equals( this.underlying, exchangeInformationResponseOptionSymbolsInner.underlying) && Objects.equals(this.unit, exchangeInformationResponseOptionSymbolsInner.unit) - && Objects.equals( - this.makerFeeRate, - exchangeInformationResponseOptionSymbolsInner.makerFeeRate) - && Objects.equals( - this.takerFeeRate, - exchangeInformationResponseOptionSymbolsInner.takerFeeRate) && Objects.equals( this.liquidationFeeRate, exchangeInformationResponseOptionSymbolsInner.liquidationFeeRate) @@ -604,7 +572,9 @@ public boolean equals(Object o) { this.quantityScale, exchangeInformationResponseOptionSymbolsInner.quantityScale) && Objects.equals( - this.quoteAsset, exchangeInformationResponseOptionSymbolsInner.quoteAsset); + this.quoteAsset, exchangeInformationResponseOptionSymbolsInner.quoteAsset) + && Objects.equals( + this.status, exchangeInformationResponseOptionSymbolsInner.status); } @Override @@ -617,8 +587,6 @@ public int hashCode() { strikePrice, underlying, unit, - makerFeeRate, - takerFeeRate, liquidationFeeRate, minQty, maxQty, @@ -628,7 +596,8 @@ public int hashCode() { minMaintenanceMargin, priceScale, quantityScale, - quoteAsset); + quoteAsset, + status); } @Override @@ -642,8 +611,6 @@ public String toString() { sb.append(" strikePrice: ").append(toIndentedString(strikePrice)).append("\n"); sb.append(" underlying: ").append(toIndentedString(underlying)).append("\n"); sb.append(" unit: ").append(toIndentedString(unit)).append("\n"); - sb.append(" makerFeeRate: ").append(toIndentedString(makerFeeRate)).append("\n"); - sb.append(" takerFeeRate: ").append(toIndentedString(takerFeeRate)).append("\n"); sb.append(" liquidationFeeRate: ") .append(toIndentedString(liquidationFeeRate)) .append("\n"); @@ -658,6 +625,7 @@ public String toString() { sb.append(" priceScale: ").append(toIndentedString(priceScale)).append("\n"); sb.append(" quantityScale: ").append(toIndentedString(quantityScale)).append("\n"); sb.append(" quoteAsset: ").append(toIndentedString(quoteAsset)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append("}"); return sb.toString(); } @@ -696,14 +664,6 @@ public String toUrlQueryString() { String unitValueAsString = ""; unitValueAsString = unitValue.toString(); sb.append("unit=").append(urlEncode(unitValueAsString)).append(""); - Object makerFeeRateValue = getMakerFeeRate(); - String makerFeeRateValueAsString = ""; - makerFeeRateValueAsString = makerFeeRateValue.toString(); - sb.append("makerFeeRate=").append(urlEncode(makerFeeRateValueAsString)).append(""); - Object takerFeeRateValue = getTakerFeeRate(); - String takerFeeRateValueAsString = ""; - takerFeeRateValueAsString = takerFeeRateValue.toString(); - sb.append("takerFeeRate=").append(urlEncode(takerFeeRateValueAsString)).append(""); Object liquidationFeeRateValue = getLiquidationFeeRate(); String liquidationFeeRateValueAsString = ""; liquidationFeeRateValueAsString = liquidationFeeRateValue.toString(); @@ -750,6 +710,10 @@ public String toUrlQueryString() { String quoteAssetValueAsString = ""; quoteAssetValueAsString = quoteAssetValue.toString(); sb.append("quoteAsset=").append(urlEncode(quoteAssetValueAsString)).append(""); + Object statusValue = getStatus(); + String statusValueAsString = ""; + statusValueAsString = statusValue.toString(); + sb.append("status=").append(urlEncode(statusValueAsString)).append(""); return sb.toString(); } @@ -785,8 +749,6 @@ private String toIndentedString(Object o) { openapiFields.add("strikePrice"); openapiFields.add("underlying"); openapiFields.add("unit"); - openapiFields.add("makerFeeRate"); - openapiFields.add("takerFeeRate"); openapiFields.add("liquidationFeeRate"); openapiFields.add("minQty"); openapiFields.add("maxQty"); @@ -797,6 +759,7 @@ private String toIndentedString(Object o) { openapiFields.add("priceScale"); openapiFields.add("quantityScale"); openapiFields.add("quoteAsset"); + openapiFields.add("status"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -875,22 +838,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("underlying").toString())); } - if ((jsonObj.get("makerFeeRate") != null && !jsonObj.get("makerFeeRate").isJsonNull()) - && !jsonObj.get("makerFeeRate").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `makerFeeRate` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("makerFeeRate").toString())); - } - if ((jsonObj.get("takerFeeRate") != null && !jsonObj.get("takerFeeRate").isJsonNull()) - && !jsonObj.get("takerFeeRate").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `takerFeeRate` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("takerFeeRate").toString())); - } if ((jsonObj.get("liquidationFeeRate") != null && !jsonObj.get("liquidationFeeRate").isJsonNull()) && !jsonObj.get("liquidationFeeRate").isJsonPrimitive()) { @@ -959,6 +906,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("quoteAsset").toString())); } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/GetDownloadIdForOptionTransactionHistoryResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/GetDownloadIdForOptionTransactionHistoryResponse.java deleted file mode 100644 index 6c8a83d23..000000000 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/GetDownloadIdForOptionTransactionHistoryResponse.java +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Binance Derivatives Trading Options REST API - * OpenAPI Specification for the Binance Derivatives Trading Options REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_options.rest.model; - -import com.binance.connector.client.derivatives_trading_options.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Objects; -import org.hibernate.validator.constraints.*; - -/** GetDownloadIdForOptionTransactionHistoryResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class GetDownloadIdForOptionTransactionHistoryResponse { - public static final String SERIALIZED_NAME_AVG_COST_TIMESTAMP_OF_LAST30D = - "avgCostTimestampOfLast30d"; - - @SerializedName(SERIALIZED_NAME_AVG_COST_TIMESTAMP_OF_LAST30D) - @jakarta.annotation.Nullable - private Long avgCostTimestampOfLast30d; - - public static final String SERIALIZED_NAME_DOWNLOAD_ID = "downloadId"; - - @SerializedName(SERIALIZED_NAME_DOWNLOAD_ID) - @jakarta.annotation.Nullable - private String downloadId; - - public GetDownloadIdForOptionTransactionHistoryResponse() {} - - public GetDownloadIdForOptionTransactionHistoryResponse avgCostTimestampOfLast30d( - @jakarta.annotation.Nullable Long avgCostTimestampOfLast30d) { - this.avgCostTimestampOfLast30d = avgCostTimestampOfLast30d; - return this; - } - - /** - * Get avgCostTimestampOfLast30d - * - * @return avgCostTimestampOfLast30d - */ - @jakarta.annotation.Nullable - public Long getAvgCostTimestampOfLast30d() { - return avgCostTimestampOfLast30d; - } - - public void setAvgCostTimestampOfLast30d( - @jakarta.annotation.Nullable Long avgCostTimestampOfLast30d) { - this.avgCostTimestampOfLast30d = avgCostTimestampOfLast30d; - } - - public GetDownloadIdForOptionTransactionHistoryResponse downloadId( - @jakarta.annotation.Nullable String downloadId) { - this.downloadId = downloadId; - return this; - } - - /** - * Get downloadId - * - * @return downloadId - */ - @jakarta.annotation.Nullable - public String getDownloadId() { - return downloadId; - } - - public void setDownloadId(@jakarta.annotation.Nullable String downloadId) { - this.downloadId = downloadId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetDownloadIdForOptionTransactionHistoryResponse - getDownloadIdForOptionTransactionHistoryResponse = - (GetDownloadIdForOptionTransactionHistoryResponse) o; - return Objects.equals( - this.avgCostTimestampOfLast30d, - getDownloadIdForOptionTransactionHistoryResponse.avgCostTimestampOfLast30d) - && Objects.equals( - this.downloadId, - getDownloadIdForOptionTransactionHistoryResponse.downloadId); - } - - @Override - public int hashCode() { - return Objects.hash(avgCostTimestampOfLast30d, downloadId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDownloadIdForOptionTransactionHistoryResponse {\n"); - sb.append(" avgCostTimestampOfLast30d: ") - .append(toIndentedString(avgCostTimestampOfLast30d)) - .append("\n"); - sb.append(" downloadId: ").append(toIndentedString(downloadId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object avgCostTimestampOfLast30dValue = getAvgCostTimestampOfLast30d(); - String avgCostTimestampOfLast30dValueAsString = ""; - avgCostTimestampOfLast30dValueAsString = avgCostTimestampOfLast30dValue.toString(); - sb.append("avgCostTimestampOfLast30d=") - .append(urlEncode(avgCostTimestampOfLast30dValueAsString)) - .append(""); - Object downloadIdValue = getDownloadId(); - String downloadIdValueAsString = ""; - downloadIdValueAsString = downloadIdValue.toString(); - sb.append("downloadId=").append(urlEncode(downloadIdValueAsString)).append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("avgCostTimestampOfLast30d"); - openapiFields.add("downloadId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * GetDownloadIdForOptionTransactionHistoryResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetDownloadIdForOptionTransactionHistoryResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " GetDownloadIdForOptionTransactionHistoryResponse is not" - + " found in the empty JSON string", - GetDownloadIdForOptionTransactionHistoryResponse - .openapiRequiredFields - .toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) - && !jsonObj.get("downloadId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `downloadId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("downloadId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetDownloadIdForOptionTransactionHistoryResponse.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'GetDownloadIdForOptionTransactionHistoryResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get(GetDownloadIdForOptionTransactionHistoryResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, - GetDownloadIdForOptionTransactionHistoryResponse value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetDownloadIdForOptionTransactionHistoryResponse read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetDownloadIdForOptionTransactionHistoryResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetDownloadIdForOptionTransactionHistoryResponse - * @throws IOException if the JSON string is invalid with respect to - * GetDownloadIdForOptionTransactionHistoryResponse - */ - public static GetDownloadIdForOptionTransactionHistoryResponse fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, GetDownloadIdForOptionTransactionHistoryResponse.class); - } - - /** - * Convert an instance of GetDownloadIdForOptionTransactionHistoryResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/GetOptionTransactionHistoryDownloadLinkByIdResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/GetOptionTransactionHistoryDownloadLinkByIdResponse.java deleted file mode 100644 index 19228bd8f..000000000 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/GetOptionTransactionHistoryDownloadLinkByIdResponse.java +++ /dev/null @@ -1,431 +0,0 @@ -/* - * Binance Derivatives Trading Options REST API - * OpenAPI Specification for the Binance Derivatives Trading Options REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_options.rest.model; - -import com.binance.connector.client.derivatives_trading_options.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Objects; -import org.hibernate.validator.constraints.*; - -/** GetOptionTransactionHistoryDownloadLinkByIdResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class GetOptionTransactionHistoryDownloadLinkByIdResponse { - public static final String SERIALIZED_NAME_DOWNLOAD_ID = "downloadId"; - - @SerializedName(SERIALIZED_NAME_DOWNLOAD_ID) - @jakarta.annotation.Nullable - private String downloadId; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @jakarta.annotation.Nullable - private String status; - - public static final String SERIALIZED_NAME_URL = "url"; - - @SerializedName(SERIALIZED_NAME_URL) - @jakarta.annotation.Nullable - private String url; - - public static final String SERIALIZED_NAME_NOTIFIED = "notified"; - - @SerializedName(SERIALIZED_NAME_NOTIFIED) - @jakarta.annotation.Nullable - private Boolean notified; - - public static final String SERIALIZED_NAME_EXPIRATION_TIMESTAMP = "expirationTimestamp"; - - @SerializedName(SERIALIZED_NAME_EXPIRATION_TIMESTAMP) - @jakarta.annotation.Nullable - private Long expirationTimestamp; - - public static final String SERIALIZED_NAME_IS_EXPIRED = "isExpired"; - - @SerializedName(SERIALIZED_NAME_IS_EXPIRED) - @jakarta.annotation.Nullable - private String isExpired; - - public GetOptionTransactionHistoryDownloadLinkByIdResponse() {} - - public GetOptionTransactionHistoryDownloadLinkByIdResponse downloadId( - @jakarta.annotation.Nullable String downloadId) { - this.downloadId = downloadId; - return this; - } - - /** - * Get downloadId - * - * @return downloadId - */ - @jakarta.annotation.Nullable - public String getDownloadId() { - return downloadId; - } - - public void setDownloadId(@jakarta.annotation.Nullable String downloadId) { - this.downloadId = downloadId; - } - - public GetOptionTransactionHistoryDownloadLinkByIdResponse status( - @jakarta.annotation.Nullable String status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @jakarta.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(@jakarta.annotation.Nullable String status) { - this.status = status; - } - - public GetOptionTransactionHistoryDownloadLinkByIdResponse url( - @jakarta.annotation.Nullable String url) { - this.url = url; - return this; - } - - /** - * Get url - * - * @return url - */ - @jakarta.annotation.Nullable - public String getUrl() { - return url; - } - - public void setUrl(@jakarta.annotation.Nullable String url) { - this.url = url; - } - - public GetOptionTransactionHistoryDownloadLinkByIdResponse notified( - @jakarta.annotation.Nullable Boolean notified) { - this.notified = notified; - return this; - } - - /** - * Get notified - * - * @return notified - */ - @jakarta.annotation.Nullable - public Boolean getNotified() { - return notified; - } - - public void setNotified(@jakarta.annotation.Nullable Boolean notified) { - this.notified = notified; - } - - public GetOptionTransactionHistoryDownloadLinkByIdResponse expirationTimestamp( - @jakarta.annotation.Nullable Long expirationTimestamp) { - this.expirationTimestamp = expirationTimestamp; - return this; - } - - /** - * Get expirationTimestamp - * - * @return expirationTimestamp - */ - @jakarta.annotation.Nullable - public Long getExpirationTimestamp() { - return expirationTimestamp; - } - - public void setExpirationTimestamp(@jakarta.annotation.Nullable Long expirationTimestamp) { - this.expirationTimestamp = expirationTimestamp; - } - - public GetOptionTransactionHistoryDownloadLinkByIdResponse isExpired( - @jakarta.annotation.Nullable String isExpired) { - this.isExpired = isExpired; - return this; - } - - /** - * Get isExpired - * - * @return isExpired - */ - @jakarta.annotation.Nullable - public String getIsExpired() { - return isExpired; - } - - public void setIsExpired(@jakarta.annotation.Nullable String isExpired) { - this.isExpired = isExpired; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetOptionTransactionHistoryDownloadLinkByIdResponse - getOptionTransactionHistoryDownloadLinkByIdResponse = - (GetOptionTransactionHistoryDownloadLinkByIdResponse) o; - return Objects.equals( - this.downloadId, - getOptionTransactionHistoryDownloadLinkByIdResponse.downloadId) - && Objects.equals( - this.status, getOptionTransactionHistoryDownloadLinkByIdResponse.status) - && Objects.equals(this.url, getOptionTransactionHistoryDownloadLinkByIdResponse.url) - && Objects.equals( - this.notified, getOptionTransactionHistoryDownloadLinkByIdResponse.notified) - && Objects.equals( - this.expirationTimestamp, - getOptionTransactionHistoryDownloadLinkByIdResponse.expirationTimestamp) - && Objects.equals( - this.isExpired, - getOptionTransactionHistoryDownloadLinkByIdResponse.isExpired); - } - - @Override - public int hashCode() { - return Objects.hash(downloadId, status, url, notified, expirationTimestamp, isExpired); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetOptionTransactionHistoryDownloadLinkByIdResponse {\n"); - sb.append(" downloadId: ").append(toIndentedString(downloadId)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append(" notified: ").append(toIndentedString(notified)).append("\n"); - sb.append(" expirationTimestamp: ") - .append(toIndentedString(expirationTimestamp)) - .append("\n"); - sb.append(" isExpired: ").append(toIndentedString(isExpired)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object downloadIdValue = getDownloadId(); - String downloadIdValueAsString = ""; - downloadIdValueAsString = downloadIdValue.toString(); - sb.append("downloadId=").append(urlEncode(downloadIdValueAsString)).append(""); - Object statusValue = getStatus(); - String statusValueAsString = ""; - statusValueAsString = statusValue.toString(); - sb.append("status=").append(urlEncode(statusValueAsString)).append(""); - Object urlValue = getUrl(); - String urlValueAsString = ""; - urlValueAsString = urlValue.toString(); - sb.append("url=").append(urlEncode(urlValueAsString)).append(""); - Object notifiedValue = getNotified(); - String notifiedValueAsString = ""; - notifiedValueAsString = notifiedValue.toString(); - sb.append("notified=").append(urlEncode(notifiedValueAsString)).append(""); - Object expirationTimestampValue = getExpirationTimestamp(); - String expirationTimestampValueAsString = ""; - expirationTimestampValueAsString = expirationTimestampValue.toString(); - sb.append("expirationTimestamp=") - .append(urlEncode(expirationTimestampValueAsString)) - .append(""); - Object isExpiredValue = getIsExpired(); - String isExpiredValueAsString = ""; - isExpiredValueAsString = isExpiredValue.toString(); - sb.append("isExpired=").append(urlEncode(isExpiredValueAsString)).append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("downloadId"); - openapiFields.add("status"); - openapiFields.add("url"); - openapiFields.add("notified"); - openapiFields.add("expirationTimestamp"); - openapiFields.add("isExpired"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * GetOptionTransactionHistoryDownloadLinkByIdResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetOptionTransactionHistoryDownloadLinkByIdResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " GetOptionTransactionHistoryDownloadLinkByIdResponse is not" - + " found in the empty JSON string", - GetOptionTransactionHistoryDownloadLinkByIdResponse - .openapiRequiredFields - .toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("downloadId") != null && !jsonObj.get("downloadId").isJsonNull()) - && !jsonObj.get("downloadId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `downloadId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("downloadId").toString())); - } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) - && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `url` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("url").toString())); - } - if ((jsonObj.get("isExpired") != null && !jsonObj.get("isExpired").isJsonNull()) - && !jsonObj.get("isExpired").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `isExpired` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("isExpired").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetOptionTransactionHistoryDownloadLinkByIdResponse.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'GetOptionTransactionHistoryDownloadLinkByIdResponse' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get( - GetOptionTransactionHistoryDownloadLinkByIdResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, - GetOptionTransactionHistoryDownloadLinkByIdResponse value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetOptionTransactionHistoryDownloadLinkByIdResponse read( - JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetOptionTransactionHistoryDownloadLinkByIdResponse given an JSON - * string - * - * @param jsonString JSON string - * @return An instance of GetOptionTransactionHistoryDownloadLinkByIdResponse - * @throws IOException if the JSON string is invalid with respect to - * GetOptionTransactionHistoryDownloadLinkByIdResponse - */ - public static GetOptionTransactionHistoryDownloadLinkByIdResponse fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, GetOptionTransactionHistoryDownloadLinkByIdResponse.class); - } - - /** - * Convert an instance of GetOptionTransactionHistoryDownloadLinkByIdResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/IndexPriceTickerResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/IndexPriceResponse.java similarity index 80% rename from clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/IndexPriceTickerResponse.java rename to clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/IndexPriceResponse.java index 6ad248243..5ef11a33f 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/IndexPriceTickerResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/IndexPriceResponse.java @@ -31,11 +31,11 @@ import java.util.Objects; import org.hibernate.validator.constraints.*; -/** IndexPriceTickerResponse */ +/** IndexPriceResponse */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class IndexPriceTickerResponse { +public class IndexPriceResponse { public static final String SERIALIZED_NAME_TIME = "time"; @SerializedName(SERIALIZED_NAME_TIME) @@ -48,9 +48,9 @@ public class IndexPriceTickerResponse { @jakarta.annotation.Nullable private String indexPrice; - public IndexPriceTickerResponse() {} + public IndexPriceResponse() {} - public IndexPriceTickerResponse time(@jakarta.annotation.Nullable Long time) { + public IndexPriceResponse time(@jakarta.annotation.Nullable Long time) { this.time = time; return this; } @@ -69,7 +69,7 @@ public void setTime(@jakarta.annotation.Nullable Long time) { this.time = time; } - public IndexPriceTickerResponse indexPrice(@jakarta.annotation.Nullable String indexPrice) { + public IndexPriceResponse indexPrice(@jakarta.annotation.Nullable String indexPrice) { this.indexPrice = indexPrice; return this; } @@ -96,9 +96,9 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - IndexPriceTickerResponse indexPriceTickerResponse = (IndexPriceTickerResponse) o; - return Objects.equals(this.time, indexPriceTickerResponse.time) - && Objects.equals(this.indexPrice, indexPriceTickerResponse.indexPrice); + IndexPriceResponse indexPriceResponse = (IndexPriceResponse) o; + return Objects.equals(this.time, indexPriceResponse.time) + && Objects.equals(this.indexPrice, indexPriceResponse.indexPrice); } @Override @@ -109,7 +109,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class IndexPriceTickerResponse {\n"); + sb.append("class IndexPriceResponse {\n"); sb.append(" time: ").append(toIndentedString(time)).append("\n"); sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); sb.append("}"); @@ -166,17 +166,17 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to IndexPriceTickerResponse + * @throws IOException if the JSON Element is invalid with respect to IndexPriceResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!IndexPriceTickerResponse.openapiRequiredFields + if (!IndexPriceResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in IndexPriceTickerResponse is not found" - + " in the empty JSON string", - IndexPriceTickerResponse.openapiRequiredFields.toString())); + "The required field(s) %s in IndexPriceResponse is not found in the" + + " empty JSON string", + IndexPriceResponse.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -194,25 +194,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!IndexPriceTickerResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IndexPriceTickerResponse' and its - // subtypes + if (!IndexPriceResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IndexPriceResponse' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(IndexPriceTickerResponse.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(IndexPriceResponse.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, IndexPriceTickerResponse value) + public void write(JsonWriter out, IndexPriceResponse value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public IndexPriceTickerResponse read(JsonReader in) throws IOException { + public IndexPriceResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -222,18 +221,18 @@ public IndexPriceTickerResponse read(JsonReader in) throws IOException { } /** - * Create an instance of IndexPriceTickerResponse given an JSON string + * Create an instance of IndexPriceResponse given an JSON string * * @param jsonString JSON string - * @return An instance of IndexPriceTickerResponse - * @throws IOException if the JSON string is invalid with respect to IndexPriceTickerResponse + * @return An instance of IndexPriceResponse + * @throws IOException if the JSON string is invalid with respect to IndexPriceResponse */ - public static IndexPriceTickerResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IndexPriceTickerResponse.class); + public static IndexPriceResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IndexPriceResponse.class); } /** - * Convert an instance of IndexPriceTickerResponse to an JSON string + * Convert an instance of IndexPriceResponse to an JSON string * * @return JSON string */ diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/KlineCandlestickDataResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/KlineCandlestickDataResponse.java index beb994bb0..07ade08c4 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/KlineCandlestickDataResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/KlineCandlestickDataResponse.java @@ -35,7 +35,7 @@ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class KlineCandlestickDataResponse extends ArrayList { +public class KlineCandlestickDataResponse extends ArrayList { public KlineCandlestickDataResponse() {} @Override @@ -117,7 +117,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray array = jsonElement.getAsJsonArray(); // validate array items for (JsonElement element : array) { - KlineCandlestickDataResponseInner.validateJsonElement(element); + KlineCandlestickDataResponseItem.validateJsonElement(element); } if (jsonElement == null) { if (!KlineCandlestickDataResponse.openapiRequiredFields diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/KlineCandlestickDataResponseInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/KlineCandlestickDataResponseInner.java deleted file mode 100644 index 29285ddde..000000000 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/KlineCandlestickDataResponseInner.java +++ /dev/null @@ -1,650 +0,0 @@ -/* - * Binance Derivatives Trading Options REST API - * OpenAPI Specification for the Binance Derivatives Trading Options REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_options.rest.model; - -import com.binance.connector.client.derivatives_trading_options.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Objects; -import org.hibernate.validator.constraints.*; - -/** KlineCandlestickDataResponseInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class KlineCandlestickDataResponseInner { - public static final String SERIALIZED_NAME_OPEN = "open"; - - @SerializedName(SERIALIZED_NAME_OPEN) - @jakarta.annotation.Nullable - private String open; - - public static final String SERIALIZED_NAME_HIGH = "high"; - - @SerializedName(SERIALIZED_NAME_HIGH) - @jakarta.annotation.Nullable - private String high; - - public static final String SERIALIZED_NAME_LOW = "low"; - - @SerializedName(SERIALIZED_NAME_LOW) - @jakarta.annotation.Nullable - private String low; - - public static final String SERIALIZED_NAME_CLOSE = "close"; - - @SerializedName(SERIALIZED_NAME_CLOSE) - @jakarta.annotation.Nullable - private String close; - - public static final String SERIALIZED_NAME_VOLUME = "volume"; - - @SerializedName(SERIALIZED_NAME_VOLUME) - @jakarta.annotation.Nullable - private String volume; - - public static final String SERIALIZED_NAME_AMOUNT = "amount"; - - @SerializedName(SERIALIZED_NAME_AMOUNT) - @jakarta.annotation.Nullable - private String amount; - - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - - @SerializedName(SERIALIZED_NAME_INTERVAL) - @jakarta.annotation.Nullable - private String interval; - - public static final String SERIALIZED_NAME_TRADE_COUNT = "tradeCount"; - - @SerializedName(SERIALIZED_NAME_TRADE_COUNT) - @jakarta.annotation.Nullable - private Long tradeCount; - - public static final String SERIALIZED_NAME_TAKER_VOLUME = "takerVolume"; - - @SerializedName(SERIALIZED_NAME_TAKER_VOLUME) - @jakarta.annotation.Nullable - private String takerVolume; - - public static final String SERIALIZED_NAME_TAKER_AMOUNT = "takerAmount"; - - @SerializedName(SERIALIZED_NAME_TAKER_AMOUNT) - @jakarta.annotation.Nullable - private String takerAmount; - - public static final String SERIALIZED_NAME_OPEN_TIME = "openTime"; - - @SerializedName(SERIALIZED_NAME_OPEN_TIME) - @jakarta.annotation.Nullable - private Long openTime; - - public static final String SERIALIZED_NAME_CLOSE_TIME = "closeTime"; - - @SerializedName(SERIALIZED_NAME_CLOSE_TIME) - @jakarta.annotation.Nullable - private Long closeTime; - - public KlineCandlestickDataResponseInner() {} - - public KlineCandlestickDataResponseInner open(@jakarta.annotation.Nullable String open) { - this.open = open; - return this; - } - - /** - * Get open - * - * @return open - */ - @jakarta.annotation.Nullable - public String getOpen() { - return open; - } - - public void setOpen(@jakarta.annotation.Nullable String open) { - this.open = open; - } - - public KlineCandlestickDataResponseInner high(@jakarta.annotation.Nullable String high) { - this.high = high; - return this; - } - - /** - * Get high - * - * @return high - */ - @jakarta.annotation.Nullable - public String getHigh() { - return high; - } - - public void setHigh(@jakarta.annotation.Nullable String high) { - this.high = high; - } - - public KlineCandlestickDataResponseInner low(@jakarta.annotation.Nullable String low) { - this.low = low; - return this; - } - - /** - * Get low - * - * @return low - */ - @jakarta.annotation.Nullable - public String getLow() { - return low; - } - - public void setLow(@jakarta.annotation.Nullable String low) { - this.low = low; - } - - public KlineCandlestickDataResponseInner close(@jakarta.annotation.Nullable String close) { - this.close = close; - return this; - } - - /** - * Get close - * - * @return close - */ - @jakarta.annotation.Nullable - public String getClose() { - return close; - } - - public void setClose(@jakarta.annotation.Nullable String close) { - this.close = close; - } - - public KlineCandlestickDataResponseInner volume(@jakarta.annotation.Nullable String volume) { - this.volume = volume; - return this; - } - - /** - * Get volume - * - * @return volume - */ - @jakarta.annotation.Nullable - public String getVolume() { - return volume; - } - - public void setVolume(@jakarta.annotation.Nullable String volume) { - this.volume = volume; - } - - public KlineCandlestickDataResponseInner amount(@jakarta.annotation.Nullable String amount) { - this.amount = amount; - return this; - } - - /** - * Get amount - * - * @return amount - */ - @jakarta.annotation.Nullable - public String getAmount() { - return amount; - } - - public void setAmount(@jakarta.annotation.Nullable String amount) { - this.amount = amount; - } - - public KlineCandlestickDataResponseInner interval( - @jakarta.annotation.Nullable String interval) { - this.interval = interval; - return this; - } - - /** - * Get interval - * - * @return interval - */ - @jakarta.annotation.Nullable - public String getInterval() { - return interval; - } - - public void setInterval(@jakarta.annotation.Nullable String interval) { - this.interval = interval; - } - - public KlineCandlestickDataResponseInner tradeCount( - @jakarta.annotation.Nullable Long tradeCount) { - this.tradeCount = tradeCount; - return this; - } - - /** - * Get tradeCount - * - * @return tradeCount - */ - @jakarta.annotation.Nullable - public Long getTradeCount() { - return tradeCount; - } - - public void setTradeCount(@jakarta.annotation.Nullable Long tradeCount) { - this.tradeCount = tradeCount; - } - - public KlineCandlestickDataResponseInner takerVolume( - @jakarta.annotation.Nullable String takerVolume) { - this.takerVolume = takerVolume; - return this; - } - - /** - * Get takerVolume - * - * @return takerVolume - */ - @jakarta.annotation.Nullable - public String getTakerVolume() { - return takerVolume; - } - - public void setTakerVolume(@jakarta.annotation.Nullable String takerVolume) { - this.takerVolume = takerVolume; - } - - public KlineCandlestickDataResponseInner takerAmount( - @jakarta.annotation.Nullable String takerAmount) { - this.takerAmount = takerAmount; - return this; - } - - /** - * Get takerAmount - * - * @return takerAmount - */ - @jakarta.annotation.Nullable - public String getTakerAmount() { - return takerAmount; - } - - public void setTakerAmount(@jakarta.annotation.Nullable String takerAmount) { - this.takerAmount = takerAmount; - } - - public KlineCandlestickDataResponseInner openTime(@jakarta.annotation.Nullable Long openTime) { - this.openTime = openTime; - return this; - } - - /** - * Get openTime - * - * @return openTime - */ - @jakarta.annotation.Nullable - public Long getOpenTime() { - return openTime; - } - - public void setOpenTime(@jakarta.annotation.Nullable Long openTime) { - this.openTime = openTime; - } - - public KlineCandlestickDataResponseInner closeTime( - @jakarta.annotation.Nullable Long closeTime) { - this.closeTime = closeTime; - return this; - } - - /** - * Get closeTime - * - * @return closeTime - */ - @jakarta.annotation.Nullable - public Long getCloseTime() { - return closeTime; - } - - public void setCloseTime(@jakarta.annotation.Nullable Long closeTime) { - this.closeTime = closeTime; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - KlineCandlestickDataResponseInner klineCandlestickDataResponseInner = - (KlineCandlestickDataResponseInner) o; - return Objects.equals(this.open, klineCandlestickDataResponseInner.open) - && Objects.equals(this.high, klineCandlestickDataResponseInner.high) - && Objects.equals(this.low, klineCandlestickDataResponseInner.low) - && Objects.equals(this.close, klineCandlestickDataResponseInner.close) - && Objects.equals(this.volume, klineCandlestickDataResponseInner.volume) - && Objects.equals(this.amount, klineCandlestickDataResponseInner.amount) - && Objects.equals(this.interval, klineCandlestickDataResponseInner.interval) - && Objects.equals(this.tradeCount, klineCandlestickDataResponseInner.tradeCount) - && Objects.equals(this.takerVolume, klineCandlestickDataResponseInner.takerVolume) - && Objects.equals(this.takerAmount, klineCandlestickDataResponseInner.takerAmount) - && Objects.equals(this.openTime, klineCandlestickDataResponseInner.openTime) - && Objects.equals(this.closeTime, klineCandlestickDataResponseInner.closeTime); - } - - @Override - public int hashCode() { - return Objects.hash( - open, - high, - low, - close, - volume, - amount, - interval, - tradeCount, - takerVolume, - takerAmount, - openTime, - closeTime); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class KlineCandlestickDataResponseInner {\n"); - sb.append(" open: ").append(toIndentedString(open)).append("\n"); - sb.append(" high: ").append(toIndentedString(high)).append("\n"); - sb.append(" low: ").append(toIndentedString(low)).append("\n"); - sb.append(" close: ").append(toIndentedString(close)).append("\n"); - sb.append(" volume: ").append(toIndentedString(volume)).append("\n"); - sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); - sb.append(" tradeCount: ").append(toIndentedString(tradeCount)).append("\n"); - sb.append(" takerVolume: ").append(toIndentedString(takerVolume)).append("\n"); - sb.append(" takerAmount: ").append(toIndentedString(takerAmount)).append("\n"); - sb.append(" openTime: ").append(toIndentedString(openTime)).append("\n"); - sb.append(" closeTime: ").append(toIndentedString(closeTime)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object openValue = getOpen(); - String openValueAsString = ""; - openValueAsString = openValue.toString(); - sb.append("open=").append(urlEncode(openValueAsString)).append(""); - Object highValue = getHigh(); - String highValueAsString = ""; - highValueAsString = highValue.toString(); - sb.append("high=").append(urlEncode(highValueAsString)).append(""); - Object lowValue = getLow(); - String lowValueAsString = ""; - lowValueAsString = lowValue.toString(); - sb.append("low=").append(urlEncode(lowValueAsString)).append(""); - Object closeValue = getClose(); - String closeValueAsString = ""; - closeValueAsString = closeValue.toString(); - sb.append("close=").append(urlEncode(closeValueAsString)).append(""); - Object volumeValue = getVolume(); - String volumeValueAsString = ""; - volumeValueAsString = volumeValue.toString(); - sb.append("volume=").append(urlEncode(volumeValueAsString)).append(""); - Object amountValue = getAmount(); - String amountValueAsString = ""; - amountValueAsString = amountValue.toString(); - sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); - Object intervalValue = getInterval(); - String intervalValueAsString = ""; - intervalValueAsString = intervalValue.toString(); - sb.append("interval=").append(urlEncode(intervalValueAsString)).append(""); - Object tradeCountValue = getTradeCount(); - String tradeCountValueAsString = ""; - tradeCountValueAsString = tradeCountValue.toString(); - sb.append("tradeCount=").append(urlEncode(tradeCountValueAsString)).append(""); - Object takerVolumeValue = getTakerVolume(); - String takerVolumeValueAsString = ""; - takerVolumeValueAsString = takerVolumeValue.toString(); - sb.append("takerVolume=").append(urlEncode(takerVolumeValueAsString)).append(""); - Object takerAmountValue = getTakerAmount(); - String takerAmountValueAsString = ""; - takerAmountValueAsString = takerAmountValue.toString(); - sb.append("takerAmount=").append(urlEncode(takerAmountValueAsString)).append(""); - Object openTimeValue = getOpenTime(); - String openTimeValueAsString = ""; - openTimeValueAsString = openTimeValue.toString(); - sb.append("openTime=").append(urlEncode(openTimeValueAsString)).append(""); - Object closeTimeValue = getCloseTime(); - String closeTimeValueAsString = ""; - closeTimeValueAsString = closeTimeValue.toString(); - sb.append("closeTime=").append(urlEncode(closeTimeValueAsString)).append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("open"); - openapiFields.add("high"); - openapiFields.add("low"); - openapiFields.add("close"); - openapiFields.add("volume"); - openapiFields.add("amount"); - openapiFields.add("interval"); - openapiFields.add("tradeCount"); - openapiFields.add("takerVolume"); - openapiFields.add("takerAmount"); - openapiFields.add("openTime"); - openapiFields.add("closeTime"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * KlineCandlestickDataResponseInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!KlineCandlestickDataResponseInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in KlineCandlestickDataResponseInner is" - + " not found in the empty JSON string", - KlineCandlestickDataResponseInner.openapiRequiredFields - .toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("open") != null && !jsonObj.get("open").isJsonNull()) - && !jsonObj.get("open").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `open` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("open").toString())); - } - if ((jsonObj.get("high") != null && !jsonObj.get("high").isJsonNull()) - && !jsonObj.get("high").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `high` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("high").toString())); - } - if ((jsonObj.get("low") != null && !jsonObj.get("low").isJsonNull()) - && !jsonObj.get("low").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `low` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("low").toString())); - } - if ((jsonObj.get("close") != null && !jsonObj.get("close").isJsonNull()) - && !jsonObj.get("close").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `close` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("close").toString())); - } - if ((jsonObj.get("volume") != null && !jsonObj.get("volume").isJsonNull()) - && !jsonObj.get("volume").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `volume` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("volume").toString())); - } - if ((jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonNull()) - && !jsonObj.get("amount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `amount` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("amount").toString())); - } - if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) - && !jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); - } - if ((jsonObj.get("takerVolume") != null && !jsonObj.get("takerVolume").isJsonNull()) - && !jsonObj.get("takerVolume").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `takerVolume` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("takerVolume").toString())); - } - if ((jsonObj.get("takerAmount") != null && !jsonObj.get("takerAmount").isJsonNull()) - && !jsonObj.get("takerAmount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `takerAmount` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("takerAmount").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!KlineCandlestickDataResponseInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'KlineCandlestickDataResponseInner' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(KlineCandlestickDataResponseInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, KlineCandlestickDataResponseInner value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public KlineCandlestickDataResponseInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of KlineCandlestickDataResponseInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of KlineCandlestickDataResponseInner - * @throws IOException if the JSON string is invalid with respect to - * KlineCandlestickDataResponseInner - */ - public static KlineCandlestickDataResponseInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, KlineCandlestickDataResponseInner.class); - } - - /** - * Convert an instance of KlineCandlestickDataResponseInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OldTradesLookupResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/KlineCandlestickDataResponseItem.java similarity index 72% rename from clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OldTradesLookupResponse.java rename to clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/KlineCandlestickDataResponseItem.java index 810450cd1..0e6c237c9 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OldTradesLookupResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/KlineCandlestickDataResponseItem.java @@ -31,12 +31,12 @@ import java.util.Objects; import org.hibernate.validator.constraints.*; -/** OldTradesLookupResponse */ +/** KlineCandlestickDataResponseItem */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class OldTradesLookupResponse extends ArrayList { - public OldTradesLookupResponse() {} +public class KlineCandlestickDataResponseItem extends ArrayList { + public KlineCandlestickDataResponseItem() {} @Override public boolean equals(Object o) { @@ -57,7 +57,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class OldTradesLookupResponse {\n"); + sb.append("class KlineCandlestickDataResponseItem {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append("}"); return sb.toString(); @@ -103,7 +103,8 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to OldTradesLookupResponse + * @throws IOException if the JSON Element is invalid with respect to + * KlineCandlestickDataResponseItem */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (!jsonElement.isJsonArray()) { @@ -116,16 +117,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray array = jsonElement.getAsJsonArray(); // validate array items for (JsonElement element : array) { - OldTradesLookupResponseInner.validateJsonElement(element); + KlineCandlestickDataResponseItemInner.validateJsonElement(element); } if (jsonElement == null) { - if (!OldTradesLookupResponse.openapiRequiredFields + if (!KlineCandlestickDataResponseItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in OldTradesLookupResponse is not found" - + " in the empty JSON string", - OldTradesLookupResponse.openapiRequiredFields.toString())); + "The required field(s) %s in KlineCandlestickDataResponseItem is" + + " not found in the empty JSON string", + KlineCandlestickDataResponseItem.openapiRequiredFields.toString())); } } } @@ -134,25 +135,27 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!OldTradesLookupResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OldTradesLookupResponse' and its - // subtypes + if (!KlineCandlestickDataResponseItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'KlineCandlestickDataResponseItem' and + // its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(OldTradesLookupResponse.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(KlineCandlestickDataResponseItem.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, OldTradesLookupResponse value) + public void write(JsonWriter out, KlineCandlestickDataResponseItem value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); elementAdapter.write(out, obj); } @Override - public OldTradesLookupResponse read(JsonReader in) throws IOException { + public KlineCandlestickDataResponseItem read(JsonReader in) + throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -162,18 +165,19 @@ public OldTradesLookupResponse read(JsonReader in) throws IOException { } /** - * Create an instance of OldTradesLookupResponse given an JSON string + * Create an instance of KlineCandlestickDataResponseItem given an JSON string * * @param jsonString JSON string - * @return An instance of OldTradesLookupResponse - * @throws IOException if the JSON string is invalid with respect to OldTradesLookupResponse + * @return An instance of KlineCandlestickDataResponseItem + * @throws IOException if the JSON string is invalid with respect to + * KlineCandlestickDataResponseItem */ - public static OldTradesLookupResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OldTradesLookupResponse.class); + public static KlineCandlestickDataResponseItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, KlineCandlestickDataResponseItem.class); } /** - * Convert an instance of OldTradesLookupResponse to an JSON string + * Convert an instance of KlineCandlestickDataResponseItem to an JSON string * * @return JSON string */ diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/KlineCandlestickDataResponseItemInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/KlineCandlestickDataResponseItemInner.java new file mode 100644 index 000000000..a44ce9b34 --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/KlineCandlestickDataResponseItemInner.java @@ -0,0 +1,314 @@ +/* + * Binance Derivatives Trading Options REST API + * OpenAPI Specification for the Binance Derivatives Trading Options REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_options.rest.model; + +import com.binance.connector.client.common.AbstractOpenApiSchema; +import com.binance.connector.client.derivatives_trading_options.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonPrimitive; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.hibernate.validator.constraints.*; + +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class KlineCandlestickDataResponseItemInner extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(KlineCandlestickDataResponseItemInner.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!KlineCandlestickDataResponseItemInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'KlineCandlestickDataResponseItemInner' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterLong = + gson.getDelegateAdapter(this, TypeToken.get(Long.class)); + final TypeAdapter adapterString = + gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, KlineCandlestickDataResponseItemInner value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Long` + if (value.getActualInstance() instanceof Long) { + JsonPrimitive primitive = + adapterLong + .toJsonTree((Long) value.getActualInstance()) + .getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = + adapterString + .toJsonTree((String) value.getActualInstance()) + .getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " Long, String"); + } + + @Override + public KlineCandlestickDataResponseItemInner read(JsonReader in) + throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Long + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be of type Number in" + + " the JSON string but got `%s`", + jsonElement.toString())); + } + actualAdapter = adapterLong; + match++; + log.log(Level.FINER, "Input data matches schema 'Long'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for Long failed with `%s`.", + e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Long'", e); + } + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be of type String in" + + " the JSON string but got `%s`", + jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for String failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'String'", + e); + } + + if (match == 1) { + KlineCandlestickDataResponseItemInner ret = + new KlineCandlestickDataResponseItemInner(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for" + + " KlineCandlestickDataResponseItemInner: %d" + + " classes match result, expected 1. Detailed" + + " failure message for oneOf schemas: %s. JSON:" + + " %s", + match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public KlineCandlestickDataResponseItemInner() { + super("oneOf", Boolean.FALSE); + } + + public KlineCandlestickDataResponseItemInner(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Long", Long.class); + schemas.put("String", String.class); + } + + @Override + public Map> getSchemas() { + return KlineCandlestickDataResponseItemInner.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: Long, String + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Long) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Long, String"); + } + + /** + * Get the actual instance, which can be the following: Long, String + * + * @return The actual instance (Long, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Long`. If the actual instance is not `Long`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `Long` + * @throws ClassCastException if the instance is not `Long` + */ + public Long getLong() throws ClassCastException { + return (Long) super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * KlineCandlestickDataResponseItemInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Long + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be of type Number in the JSON string but" + + " got `%s`", + jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format("Deserialization for Long failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be of type String in the JSON string but" + + " got `%s`", + jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "The JSON string is invalid for KlineCandlestickDataResponseItemInner" + + " with oneOf schemas: Long, String. %d class(es) match the" + + " result, expected 1. Detailed failure message for oneOf schemas:" + + " %s. JSON: %s", + validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of KlineCandlestickDataResponseItemInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of KlineCandlestickDataResponseItemInner + * @throws IOException if the JSON string is invalid with respect to + * KlineCandlestickDataResponseItemInner + */ + public static KlineCandlestickDataResponseItemInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, KlineCandlestickDataResponseItemInner.class); + } + + /** + * Convert an instance of KlineCandlestickDataResponseItemInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/NewOrderResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/NewOrderResponse.java index aca31cd22..7aa7e8f2b 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/NewOrderResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/NewOrderResponse.java @@ -60,6 +60,12 @@ public class NewOrderResponse { @jakarta.annotation.Nullable private String quantity; + public static final String SERIALIZED_NAME_EXECUTED_QTY = "executedQty"; + + @SerializedName(SERIALIZED_NAME_EXECUTED_QTY) + @jakarta.annotation.Nullable + private String executedQty; + public static final String SERIALIZED_NAME_SIDE = "side"; @SerializedName(SERIALIZED_NAME_SIDE) @@ -72,11 +78,11 @@ public class NewOrderResponse { @jakarta.annotation.Nullable private String type; - public static final String SERIALIZED_NAME_CREATE_DATE = "createDate"; + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; - @SerializedName(SERIALIZED_NAME_CREATE_DATE) + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) @jakarta.annotation.Nullable - private Long createDate; + private String timeInForce; public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; @@ -84,36 +90,6 @@ public class NewOrderResponse { @jakarta.annotation.Nullable private Boolean reduceOnly; - public static final String SERIALIZED_NAME_POST_ONLY = "postOnly"; - - @SerializedName(SERIALIZED_NAME_POST_ONLY) - @jakarta.annotation.Nullable - private Boolean postOnly; - - public static final String SERIALIZED_NAME_MMP = "mmp"; - - @SerializedName(SERIALIZED_NAME_MMP) - @jakarta.annotation.Nullable - private Boolean mmp; - - public static final String SERIALIZED_NAME_EXECUTED_QTY = "executedQty"; - - @SerializedName(SERIALIZED_NAME_EXECUTED_QTY) - @jakarta.annotation.Nullable - private String executedQty; - - public static final String SERIALIZED_NAME_FEE = "fee"; - - @SerializedName(SERIALIZED_NAME_FEE) - @jakarta.annotation.Nullable - private String fee; - - public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; - - @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) - @jakarta.annotation.Nullable - private String timeInForce; - public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; @SerializedName(SERIALIZED_NAME_CREATE_TIME) @@ -138,6 +114,12 @@ public class NewOrderResponse { @jakarta.annotation.Nullable private String avgPrice; + public static final String SERIALIZED_NAME_SOURCE = "source"; + + @SerializedName(SERIALIZED_NAME_SOURCE) + @jakarta.annotation.Nullable + private String source; + public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) @@ -168,6 +150,12 @@ public class NewOrderResponse { @jakarta.annotation.Nullable private String quoteAsset; + public static final String SERIALIZED_NAME_MMP = "mmp"; + + @SerializedName(SERIALIZED_NAME_MMP) + @jakarta.annotation.Nullable + private Boolean mmp; + public NewOrderResponse() {} public NewOrderResponse orderId(@jakarta.annotation.Nullable Long orderId) { @@ -246,6 +234,25 @@ public void setQuantity(@jakarta.annotation.Nullable String quantity) { this.quantity = quantity; } + public NewOrderResponse executedQty(@jakarta.annotation.Nullable String executedQty) { + this.executedQty = executedQty; + return this; + } + + /** + * Get executedQty + * + * @return executedQty + */ + @jakarta.annotation.Nullable + public String getExecutedQty() { + return executedQty; + } + + public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { + this.executedQty = executedQty; + } + public NewOrderResponse side(@jakarta.annotation.Nullable String side) { this.side = side; return this; @@ -284,23 +291,23 @@ public void setType(@jakarta.annotation.Nullable String type) { this.type = type; } - public NewOrderResponse createDate(@jakarta.annotation.Nullable Long createDate) { - this.createDate = createDate; + public NewOrderResponse timeInForce(@jakarta.annotation.Nullable String timeInForce) { + this.timeInForce = timeInForce; return this; } /** - * Get createDate + * Get timeInForce * - * @return createDate + * @return timeInForce */ @jakarta.annotation.Nullable - public Long getCreateDate() { - return createDate; + public String getTimeInForce() { + return timeInForce; } - public void setCreateDate(@jakarta.annotation.Nullable Long createDate) { - this.createDate = createDate; + public void setTimeInForce(@jakarta.annotation.Nullable String timeInForce) { + this.timeInForce = timeInForce; } public NewOrderResponse reduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { @@ -322,101 +329,6 @@ public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { this.reduceOnly = reduceOnly; } - public NewOrderResponse postOnly(@jakarta.annotation.Nullable Boolean postOnly) { - this.postOnly = postOnly; - return this; - } - - /** - * Get postOnly - * - * @return postOnly - */ - @jakarta.annotation.Nullable - public Boolean getPostOnly() { - return postOnly; - } - - public void setPostOnly(@jakarta.annotation.Nullable Boolean postOnly) { - this.postOnly = postOnly; - } - - public NewOrderResponse mmp(@jakarta.annotation.Nullable Boolean mmp) { - this.mmp = mmp; - return this; - } - - /** - * Get mmp - * - * @return mmp - */ - @jakarta.annotation.Nullable - public Boolean getMmp() { - return mmp; - } - - public void setMmp(@jakarta.annotation.Nullable Boolean mmp) { - this.mmp = mmp; - } - - public NewOrderResponse executedQty(@jakarta.annotation.Nullable String executedQty) { - this.executedQty = executedQty; - return this; - } - - /** - * Get executedQty - * - * @return executedQty - */ - @jakarta.annotation.Nullable - public String getExecutedQty() { - return executedQty; - } - - public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { - this.executedQty = executedQty; - } - - public NewOrderResponse fee(@jakarta.annotation.Nullable String fee) { - this.fee = fee; - return this; - } - - /** - * Get fee - * - * @return fee - */ - @jakarta.annotation.Nullable - public String getFee() { - return fee; - } - - public void setFee(@jakarta.annotation.Nullable String fee) { - this.fee = fee; - } - - public NewOrderResponse timeInForce(@jakarta.annotation.Nullable String timeInForce) { - this.timeInForce = timeInForce; - return this; - } - - /** - * Get timeInForce - * - * @return timeInForce - */ - @jakarta.annotation.Nullable - public String getTimeInForce() { - return timeInForce; - } - - public void setTimeInForce(@jakarta.annotation.Nullable String timeInForce) { - this.timeInForce = timeInForce; - } - public NewOrderResponse createTime(@jakarta.annotation.Nullable Long createTime) { this.createTime = createTime; return this; @@ -493,6 +405,25 @@ public void setAvgPrice(@jakarta.annotation.Nullable String avgPrice) { this.avgPrice = avgPrice; } + public NewOrderResponse source(@jakarta.annotation.Nullable String source) { + this.source = source; + return this; + } + + /** + * Get source + * + * @return source + */ + @jakarta.annotation.Nullable + public String getSource() { + return source; + } + + public void setSource(@jakarta.annotation.Nullable String source) { + this.source = source; + } + public NewOrderResponse clientOrderId(@jakarta.annotation.Nullable String clientOrderId) { this.clientOrderId = clientOrderId; return this; @@ -588,6 +519,25 @@ public void setQuoteAsset(@jakarta.annotation.Nullable String quoteAsset) { this.quoteAsset = quoteAsset; } + public NewOrderResponse mmp(@jakarta.annotation.Nullable Boolean mmp) { + this.mmp = mmp; + return this; + } + + /** + * Get mmp + * + * @return mmp + */ + @jakarta.annotation.Nullable + public Boolean getMmp() { + return mmp; + } + + public void setMmp(@jakarta.annotation.Nullable Boolean mmp) { + this.mmp = mmp; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -601,24 +551,22 @@ public boolean equals(Object o) { && Objects.equals(this.symbol, newOrderResponse.symbol) && Objects.equals(this.price, newOrderResponse.price) && Objects.equals(this.quantity, newOrderResponse.quantity) + && Objects.equals(this.executedQty, newOrderResponse.executedQty) && Objects.equals(this.side, newOrderResponse.side) && Objects.equals(this.type, newOrderResponse.type) - && Objects.equals(this.createDate, newOrderResponse.createDate) - && Objects.equals(this.reduceOnly, newOrderResponse.reduceOnly) - && Objects.equals(this.postOnly, newOrderResponse.postOnly) - && Objects.equals(this.mmp, newOrderResponse.mmp) - && Objects.equals(this.executedQty, newOrderResponse.executedQty) - && Objects.equals(this.fee, newOrderResponse.fee) && Objects.equals(this.timeInForce, newOrderResponse.timeInForce) + && Objects.equals(this.reduceOnly, newOrderResponse.reduceOnly) && Objects.equals(this.createTime, newOrderResponse.createTime) && Objects.equals(this.updateTime, newOrderResponse.updateTime) && Objects.equals(this.status, newOrderResponse.status) && Objects.equals(this.avgPrice, newOrderResponse.avgPrice) + && Objects.equals(this.source, newOrderResponse.source) && Objects.equals(this.clientOrderId, newOrderResponse.clientOrderId) && Objects.equals(this.priceScale, newOrderResponse.priceScale) && Objects.equals(this.quantityScale, newOrderResponse.quantityScale) && Objects.equals(this.optionSide, newOrderResponse.optionSide) - && Objects.equals(this.quoteAsset, newOrderResponse.quoteAsset); + && Objects.equals(this.quoteAsset, newOrderResponse.quoteAsset) + && Objects.equals(this.mmp, newOrderResponse.mmp); } @Override @@ -628,24 +576,22 @@ public int hashCode() { symbol, price, quantity, + executedQty, side, type, - createDate, - reduceOnly, - postOnly, - mmp, - executedQty, - fee, timeInForce, + reduceOnly, createTime, updateTime, status, avgPrice, + source, clientOrderId, priceScale, quantityScale, optionSide, - quoteAsset); + quoteAsset, + mmp); } @Override @@ -656,24 +602,22 @@ public String toString() { sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); sb.append(" side: ").append(toIndentedString(side)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" createDate: ").append(toIndentedString(createDate)).append("\n"); - sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); - sb.append(" postOnly: ").append(toIndentedString(postOnly)).append("\n"); - sb.append(" mmp: ").append(toIndentedString(mmp)).append("\n"); - sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); - sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" avgPrice: ").append(toIndentedString(avgPrice)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); sb.append(" priceScale: ").append(toIndentedString(priceScale)).append("\n"); sb.append(" quantityScale: ").append(toIndentedString(quantityScale)).append("\n"); sb.append(" optionSide: ").append(toIndentedString(optionSide)).append("\n"); sb.append(" quoteAsset: ").append(toIndentedString(quoteAsset)).append("\n"); + sb.append(" mmp: ").append(toIndentedString(mmp)).append("\n"); sb.append("}"); return sb.toString(); } @@ -697,6 +641,10 @@ public String toUrlQueryString() { String quantityValueAsString = ""; quantityValueAsString = quantityValue.toString(); sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); + Object executedQtyValue = getExecutedQty(); + String executedQtyValueAsString = ""; + executedQtyValueAsString = executedQtyValue.toString(); + sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); Object sideValue = getSide(); String sideValueAsString = ""; sideValueAsString = sideValue.toString(); @@ -705,34 +653,14 @@ public String toUrlQueryString() { String typeValueAsString = ""; typeValueAsString = typeValue.toString(); sb.append("type=").append(urlEncode(typeValueAsString)).append(""); - Object createDateValue = getCreateDate(); - String createDateValueAsString = ""; - createDateValueAsString = createDateValue.toString(); - sb.append("createDate=").append(urlEncode(createDateValueAsString)).append(""); - Object reduceOnlyValue = getReduceOnly(); - String reduceOnlyValueAsString = ""; - reduceOnlyValueAsString = reduceOnlyValue.toString(); - sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); - Object postOnlyValue = getPostOnly(); - String postOnlyValueAsString = ""; - postOnlyValueAsString = postOnlyValue.toString(); - sb.append("postOnly=").append(urlEncode(postOnlyValueAsString)).append(""); - Object mmpValue = getMmp(); - String mmpValueAsString = ""; - mmpValueAsString = mmpValue.toString(); - sb.append("mmp=").append(urlEncode(mmpValueAsString)).append(""); - Object executedQtyValue = getExecutedQty(); - String executedQtyValueAsString = ""; - executedQtyValueAsString = executedQtyValue.toString(); - sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); - Object feeValue = getFee(); - String feeValueAsString = ""; - feeValueAsString = feeValue.toString(); - sb.append("fee=").append(urlEncode(feeValueAsString)).append(""); Object timeInForceValue = getTimeInForce(); String timeInForceValueAsString = ""; timeInForceValueAsString = timeInForceValue.toString(); sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object reduceOnlyValue = getReduceOnly(); + String reduceOnlyValueAsString = ""; + reduceOnlyValueAsString = reduceOnlyValue.toString(); + sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); Object createTimeValue = getCreateTime(); String createTimeValueAsString = ""; createTimeValueAsString = createTimeValue.toString(); @@ -749,6 +677,10 @@ public String toUrlQueryString() { String avgPriceValueAsString = ""; avgPriceValueAsString = avgPriceValue.toString(); sb.append("avgPrice=").append(urlEncode(avgPriceValueAsString)).append(""); + Object sourceValue = getSource(); + String sourceValueAsString = ""; + sourceValueAsString = sourceValue.toString(); + sb.append("source=").append(urlEncode(sourceValueAsString)).append(""); Object clientOrderIdValue = getClientOrderId(); String clientOrderIdValueAsString = ""; clientOrderIdValueAsString = clientOrderIdValue.toString(); @@ -769,6 +701,10 @@ public String toUrlQueryString() { String quoteAssetValueAsString = ""; quoteAssetValueAsString = quoteAssetValue.toString(); sb.append("quoteAsset=").append(urlEncode(quoteAssetValueAsString)).append(""); + Object mmpValue = getMmp(); + String mmpValueAsString = ""; + mmpValueAsString = mmpValue.toString(); + sb.append("mmp=").append(urlEncode(mmpValueAsString)).append(""); return sb.toString(); } @@ -801,24 +737,22 @@ private String toIndentedString(Object o) { openapiFields.add("symbol"); openapiFields.add("price"); openapiFields.add("quantity"); + openapiFields.add("executedQty"); openapiFields.add("side"); openapiFields.add("type"); - openapiFields.add("createDate"); - openapiFields.add("reduceOnly"); - openapiFields.add("postOnly"); - openapiFields.add("mmp"); - openapiFields.add("executedQty"); - openapiFields.add("fee"); openapiFields.add("timeInForce"); + openapiFields.add("reduceOnly"); openapiFields.add("createTime"); openapiFields.add("updateTime"); openapiFields.add("status"); openapiFields.add("avgPrice"); + openapiFields.add("source"); openapiFields.add("clientOrderId"); openapiFields.add("priceScale"); openapiFields.add("quantityScale"); openapiFields.add("optionSide"); openapiFields.add("quoteAsset"); + openapiFields.add("mmp"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -866,6 +800,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("quantity").toString())); } + if ((jsonObj.get("executedQty") != null && !jsonObj.get("executedQty").isJsonNull()) + && !jsonObj.get("executedQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `executedQty` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("executedQty").toString())); + } if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) && !jsonObj.get("side").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -882,22 +824,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("type").toString())); } - if ((jsonObj.get("executedQty") != null && !jsonObj.get("executedQty").isJsonNull()) - && !jsonObj.get("executedQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `executedQty` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("executedQty").toString())); - } - if ((jsonObj.get("fee") != null && !jsonObj.get("fee").isJsonNull()) - && !jsonObj.get("fee").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `fee` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("fee").toString())); - } if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) && !jsonObj.get("timeInForce").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -922,6 +848,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("avgPrice").toString())); } + if ((jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) + && !jsonObj.get("source").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `source` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("source").toString())); + } if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) && !jsonObj.get("clientOrderId").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OldTradesLookupResponseInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OldTradesLookupResponseInner.java deleted file mode 100644 index 3dc7940c9..000000000 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OldTradesLookupResponseInner.java +++ /dev/null @@ -1,439 +0,0 @@ -/* - * Binance Derivatives Trading Options REST API - * OpenAPI Specification for the Binance Derivatives Trading Options REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_options.rest.model; - -import com.binance.connector.client.derivatives_trading_options.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Objects; -import org.hibernate.validator.constraints.*; - -/** OldTradesLookupResponseInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class OldTradesLookupResponseInner { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @jakarta.annotation.Nullable - private String id; - - public static final String SERIALIZED_NAME_TRADE_ID = "tradeId"; - - @SerializedName(SERIALIZED_NAME_TRADE_ID) - @jakarta.annotation.Nullable - private String tradeId; - - public static final String SERIALIZED_NAME_PRICE = "price"; - - @SerializedName(SERIALIZED_NAME_PRICE) - @jakarta.annotation.Nullable - private String price; - - public static final String SERIALIZED_NAME_QTY = "qty"; - - @SerializedName(SERIALIZED_NAME_QTY) - @jakarta.annotation.Nullable - private String qty; - - public static final String SERIALIZED_NAME_QUOTE_QTY = "quoteQty"; - - @SerializedName(SERIALIZED_NAME_QUOTE_QTY) - @jakarta.annotation.Nullable - private String quoteQty; - - public static final String SERIALIZED_NAME_SIDE = "side"; - - @SerializedName(SERIALIZED_NAME_SIDE) - @jakarta.annotation.Nullable - private Long side; - - public static final String SERIALIZED_NAME_TIME = "time"; - - @SerializedName(SERIALIZED_NAME_TIME) - @jakarta.annotation.Nullable - private Long time; - - public OldTradesLookupResponseInner() {} - - public OldTradesLookupResponseInner id(@jakarta.annotation.Nullable String id) { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id - */ - @jakarta.annotation.Nullable - public String getId() { - return id; - } - - public void setId(@jakarta.annotation.Nullable String id) { - this.id = id; - } - - public OldTradesLookupResponseInner tradeId(@jakarta.annotation.Nullable String tradeId) { - this.tradeId = tradeId; - return this; - } - - /** - * Get tradeId - * - * @return tradeId - */ - @jakarta.annotation.Nullable - public String getTradeId() { - return tradeId; - } - - public void setTradeId(@jakarta.annotation.Nullable String tradeId) { - this.tradeId = tradeId; - } - - public OldTradesLookupResponseInner price(@jakarta.annotation.Nullable String price) { - this.price = price; - return this; - } - - /** - * Get price - * - * @return price - */ - @jakarta.annotation.Nullable - public String getPrice() { - return price; - } - - public void setPrice(@jakarta.annotation.Nullable String price) { - this.price = price; - } - - public OldTradesLookupResponseInner qty(@jakarta.annotation.Nullable String qty) { - this.qty = qty; - return this; - } - - /** - * Get qty - * - * @return qty - */ - @jakarta.annotation.Nullable - public String getQty() { - return qty; - } - - public void setQty(@jakarta.annotation.Nullable String qty) { - this.qty = qty; - } - - public OldTradesLookupResponseInner quoteQty(@jakarta.annotation.Nullable String quoteQty) { - this.quoteQty = quoteQty; - return this; - } - - /** - * Get quoteQty - * - * @return quoteQty - */ - @jakarta.annotation.Nullable - public String getQuoteQty() { - return quoteQty; - } - - public void setQuoteQty(@jakarta.annotation.Nullable String quoteQty) { - this.quoteQty = quoteQty; - } - - public OldTradesLookupResponseInner side(@jakarta.annotation.Nullable Long side) { - this.side = side; - return this; - } - - /** - * Get side - * - * @return side - */ - @jakarta.annotation.Nullable - public Long getSide() { - return side; - } - - public void setSide(@jakarta.annotation.Nullable Long side) { - this.side = side; - } - - public OldTradesLookupResponseInner time(@jakarta.annotation.Nullable Long time) { - this.time = time; - return this; - } - - /** - * Get time - * - * @return time - */ - @jakarta.annotation.Nullable - public Long getTime() { - return time; - } - - public void setTime(@jakarta.annotation.Nullable Long time) { - this.time = time; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OldTradesLookupResponseInner oldTradesLookupResponseInner = - (OldTradesLookupResponseInner) o; - return Objects.equals(this.id, oldTradesLookupResponseInner.id) - && Objects.equals(this.tradeId, oldTradesLookupResponseInner.tradeId) - && Objects.equals(this.price, oldTradesLookupResponseInner.price) - && Objects.equals(this.qty, oldTradesLookupResponseInner.qty) - && Objects.equals(this.quoteQty, oldTradesLookupResponseInner.quoteQty) - && Objects.equals(this.side, oldTradesLookupResponseInner.side) - && Objects.equals(this.time, oldTradesLookupResponseInner.time); - } - - @Override - public int hashCode() { - return Objects.hash(id, tradeId, price, qty, quoteQty, side, time); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OldTradesLookupResponseInner {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" tradeId: ").append(toIndentedString(tradeId)).append("\n"); - sb.append(" price: ").append(toIndentedString(price)).append("\n"); - sb.append(" qty: ").append(toIndentedString(qty)).append("\n"); - sb.append(" quoteQty: ").append(toIndentedString(quoteQty)).append("\n"); - sb.append(" side: ").append(toIndentedString(side)).append("\n"); - sb.append(" time: ").append(toIndentedString(time)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object idValue = getId(); - String idValueAsString = ""; - idValueAsString = idValue.toString(); - sb.append("id=").append(urlEncode(idValueAsString)).append(""); - Object tradeIdValue = getTradeId(); - String tradeIdValueAsString = ""; - tradeIdValueAsString = tradeIdValue.toString(); - sb.append("tradeId=").append(urlEncode(tradeIdValueAsString)).append(""); - Object priceValue = getPrice(); - String priceValueAsString = ""; - priceValueAsString = priceValue.toString(); - sb.append("price=").append(urlEncode(priceValueAsString)).append(""); - Object qtyValue = getQty(); - String qtyValueAsString = ""; - qtyValueAsString = qtyValue.toString(); - sb.append("qty=").append(urlEncode(qtyValueAsString)).append(""); - Object quoteQtyValue = getQuoteQty(); - String quoteQtyValueAsString = ""; - quoteQtyValueAsString = quoteQtyValue.toString(); - sb.append("quoteQty=").append(urlEncode(quoteQtyValueAsString)).append(""); - Object sideValue = getSide(); - String sideValueAsString = ""; - sideValueAsString = sideValue.toString(); - sb.append("side=").append(urlEncode(sideValueAsString)).append(""); - Object timeValue = getTime(); - String timeValueAsString = ""; - timeValueAsString = timeValue.toString(); - sb.append("time=").append(urlEncode(timeValueAsString)).append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("tradeId"); - openapiFields.add("price"); - openapiFields.add("qty"); - openapiFields.add("quoteQty"); - openapiFields.add("side"); - openapiFields.add("time"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * OldTradesLookupResponseInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OldTradesLookupResponseInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in OldTradesLookupResponseInner is not" - + " found in the empty JSON string", - OldTradesLookupResponseInner.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("tradeId") != null && !jsonObj.get("tradeId").isJsonNull()) - && !jsonObj.get("tradeId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `tradeId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("tradeId").toString())); - } - if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) - && !jsonObj.get("price").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `price` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("price").toString())); - } - if ((jsonObj.get("qty") != null && !jsonObj.get("qty").isJsonNull()) - && !jsonObj.get("qty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `qty` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("qty").toString())); - } - if ((jsonObj.get("quoteQty") != null && !jsonObj.get("quoteQty").isJsonNull()) - && !jsonObj.get("quoteQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `quoteQty` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("quoteQty").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OldTradesLookupResponseInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OldTradesLookupResponseInner' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(OldTradesLookupResponseInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, OldTradesLookupResponseInner value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public OldTradesLookupResponseInner read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of OldTradesLookupResponseInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of OldTradesLookupResponseInner - * @throws IOException if the JSON string is invalid with respect to - * OldTradesLookupResponseInner - */ - public static OldTradesLookupResponseInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OldTradesLookupResponseInner.class); - } - - /** - * Convert an instance of OldTradesLookupResponseInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionAccountInformationResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionAccountInformationResponse.java deleted file mode 100644 index 6f9de923d..000000000 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionAccountInformationResponse.java +++ /dev/null @@ -1,393 +0,0 @@ -/* - * Binance Derivatives Trading Options REST API - * OpenAPI Specification for the Binance Derivatives Trading Options REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_options.rest.model; - -import com.binance.connector.client.derivatives_trading_options.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** OptionAccountInformationResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class OptionAccountInformationResponse { - public static final String SERIALIZED_NAME_ASSET = "asset"; - - @SerializedName(SERIALIZED_NAME_ASSET) - @jakarta.annotation.Nullable - private List<@Valid OptionAccountInformationResponseAssetInner> asset; - - public static final String SERIALIZED_NAME_GREEK = "greek"; - - @SerializedName(SERIALIZED_NAME_GREEK) - @jakarta.annotation.Nullable - private List<@Valid OptionAccountInformationResponseGreekInner> greek; - - public static final String SERIALIZED_NAME_TIME = "time"; - - @SerializedName(SERIALIZED_NAME_TIME) - @jakarta.annotation.Nullable - private Long time; - - public static final String SERIALIZED_NAME_RISK_LEVEL = "riskLevel"; - - @SerializedName(SERIALIZED_NAME_RISK_LEVEL) - @jakarta.annotation.Nullable - private String riskLevel; - - public OptionAccountInformationResponse() {} - - public OptionAccountInformationResponse asset( - @jakarta.annotation.Nullable - List<@Valid OptionAccountInformationResponseAssetInner> asset) { - this.asset = asset; - return this; - } - - public OptionAccountInformationResponse addAssetItem( - OptionAccountInformationResponseAssetInner assetItem) { - if (this.asset == null) { - this.asset = new ArrayList<>(); - } - this.asset.add(assetItem); - return this; - } - - /** - * Get asset - * - * @return asset - */ - @jakarta.annotation.Nullable - @Valid - public List<@Valid OptionAccountInformationResponseAssetInner> getAsset() { - return asset; - } - - public void setAsset( - @jakarta.annotation.Nullable - List<@Valid OptionAccountInformationResponseAssetInner> asset) { - this.asset = asset; - } - - public OptionAccountInformationResponse greek( - @jakarta.annotation.Nullable - List<@Valid OptionAccountInformationResponseGreekInner> greek) { - this.greek = greek; - return this; - } - - public OptionAccountInformationResponse addGreekItem( - OptionAccountInformationResponseGreekInner greekItem) { - if (this.greek == null) { - this.greek = new ArrayList<>(); - } - this.greek.add(greekItem); - return this; - } - - /** - * Get greek - * - * @return greek - */ - @jakarta.annotation.Nullable - @Valid - public List<@Valid OptionAccountInformationResponseGreekInner> getGreek() { - return greek; - } - - public void setGreek( - @jakarta.annotation.Nullable - List<@Valid OptionAccountInformationResponseGreekInner> greek) { - this.greek = greek; - } - - public OptionAccountInformationResponse time(@jakarta.annotation.Nullable Long time) { - this.time = time; - return this; - } - - /** - * Get time - * - * @return time - */ - @jakarta.annotation.Nullable - public Long getTime() { - return time; - } - - public void setTime(@jakarta.annotation.Nullable Long time) { - this.time = time; - } - - public OptionAccountInformationResponse riskLevel( - @jakarta.annotation.Nullable String riskLevel) { - this.riskLevel = riskLevel; - return this; - } - - /** - * Get riskLevel - * - * @return riskLevel - */ - @jakarta.annotation.Nullable - public String getRiskLevel() { - return riskLevel; - } - - public void setRiskLevel(@jakarta.annotation.Nullable String riskLevel) { - this.riskLevel = riskLevel; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OptionAccountInformationResponse optionAccountInformationResponse = - (OptionAccountInformationResponse) o; - return Objects.equals(this.asset, optionAccountInformationResponse.asset) - && Objects.equals(this.greek, optionAccountInformationResponse.greek) - && Objects.equals(this.time, optionAccountInformationResponse.time) - && Objects.equals(this.riskLevel, optionAccountInformationResponse.riskLevel); - } - - @Override - public int hashCode() { - return Objects.hash(asset, greek, time, riskLevel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OptionAccountInformationResponse {\n"); - sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); - sb.append(" greek: ").append(toIndentedString(greek)).append("\n"); - sb.append(" time: ").append(toIndentedString(time)).append("\n"); - sb.append(" riskLevel: ").append(toIndentedString(riskLevel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object assetValue = getAsset(); - String assetValueAsString = ""; - assetValueAsString = - (String) - ((Collection) assetValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); - sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); - Object greekValue = getGreek(); - String greekValueAsString = ""; - greekValueAsString = - (String) - ((Collection) greekValue) - .stream().map(Object::toString).collect(Collectors.joining(",")); - sb.append("greek=").append(urlEncode(greekValueAsString)).append(""); - Object timeValue = getTime(); - String timeValueAsString = ""; - timeValueAsString = timeValue.toString(); - sb.append("time=").append(urlEncode(timeValueAsString)).append(""); - Object riskLevelValue = getRiskLevel(); - String riskLevelValueAsString = ""; - riskLevelValueAsString = riskLevelValue.toString(); - sb.append("riskLevel=").append(urlEncode(riskLevelValueAsString)).append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("asset"); - openapiFields.add("greek"); - openapiFields.add("time"); - openapiFields.add("riskLevel"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * OptionAccountInformationResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OptionAccountInformationResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in OptionAccountInformationResponse is" - + " not found in the empty JSON string", - OptionAccountInformationResponse.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) { - JsonArray jsonArrayasset = jsonObj.getAsJsonArray("asset"); - if (jsonArrayasset != null) { - // ensure the json data is an array - if (!jsonObj.get("asset").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `asset` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("asset").toString())); - } - - // validate the optional field `asset` (array) - for (int i = 0; i < jsonArrayasset.size(); i++) { - OptionAccountInformationResponseAssetInner.validateJsonElement( - jsonArrayasset.get(i)); - } - ; - } - } - if (jsonObj.get("greek") != null && !jsonObj.get("greek").isJsonNull()) { - JsonArray jsonArraygreek = jsonObj.getAsJsonArray("greek"); - if (jsonArraygreek != null) { - // ensure the json data is an array - if (!jsonObj.get("greek").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `greek` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("greek").toString())); - } - - // validate the optional field `greek` (array) - for (int i = 0; i < jsonArraygreek.size(); i++) { - OptionAccountInformationResponseGreekInner.validateJsonElement( - jsonArraygreek.get(i)); - } - ; - } - } - if ((jsonObj.get("riskLevel") != null && !jsonObj.get("riskLevel").isJsonNull()) - && !jsonObj.get("riskLevel").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `riskLevel` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("riskLevel").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OptionAccountInformationResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OptionAccountInformationResponse' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(OptionAccountInformationResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, OptionAccountInformationResponse value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public OptionAccountInformationResponse read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of OptionAccountInformationResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of OptionAccountInformationResponse - * @throws IOException if the JSON string is invalid with respect to - * OptionAccountInformationResponse - */ - public static OptionAccountInformationResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OptionAccountInformationResponse.class); - } - - /** - * Convert an instance of OptionAccountInformationResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionAccountInformationResponseAssetInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionAccountInformationResponseAssetInner.java deleted file mode 100644 index 12cb7eecc..000000000 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionAccountInformationResponseAssetInner.java +++ /dev/null @@ -1,433 +0,0 @@ -/* - * Binance Derivatives Trading Options REST API - * OpenAPI Specification for the Binance Derivatives Trading Options REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_options.rest.model; - -import com.binance.connector.client.derivatives_trading_options.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Objects; -import org.hibernate.validator.constraints.*; - -/** OptionAccountInformationResponseAssetInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class OptionAccountInformationResponseAssetInner { - public static final String SERIALIZED_NAME_ASSET = "asset"; - - @SerializedName(SERIALIZED_NAME_ASSET) - @jakarta.annotation.Nullable - private String asset; - - public static final String SERIALIZED_NAME_MARGIN_BALANCE = "marginBalance"; - - @SerializedName(SERIALIZED_NAME_MARGIN_BALANCE) - @jakarta.annotation.Nullable - private String marginBalance; - - public static final String SERIALIZED_NAME_EQUITY = "equity"; - - @SerializedName(SERIALIZED_NAME_EQUITY) - @jakarta.annotation.Nullable - private String equity; - - public static final String SERIALIZED_NAME_AVAILABLE = "available"; - - @SerializedName(SERIALIZED_NAME_AVAILABLE) - @jakarta.annotation.Nullable - private String available; - - public static final String SERIALIZED_NAME_LOCKED = "locked"; - - @SerializedName(SERIALIZED_NAME_LOCKED) - @jakarta.annotation.Nullable - private String locked; - - public static final String SERIALIZED_NAME_UNREALIZED_P_N_L = "unrealizedPNL"; - - @SerializedName(SERIALIZED_NAME_UNREALIZED_P_N_L) - @jakarta.annotation.Nullable - private String unrealizedPNL; - - public OptionAccountInformationResponseAssetInner() {} - - public OptionAccountInformationResponseAssetInner asset( - @jakarta.annotation.Nullable String asset) { - this.asset = asset; - return this; - } - - /** - * Get asset - * - * @return asset - */ - @jakarta.annotation.Nullable - public String getAsset() { - return asset; - } - - public void setAsset(@jakarta.annotation.Nullable String asset) { - this.asset = asset; - } - - public OptionAccountInformationResponseAssetInner marginBalance( - @jakarta.annotation.Nullable String marginBalance) { - this.marginBalance = marginBalance; - return this; - } - - /** - * Get marginBalance - * - * @return marginBalance - */ - @jakarta.annotation.Nullable - public String getMarginBalance() { - return marginBalance; - } - - public void setMarginBalance(@jakarta.annotation.Nullable String marginBalance) { - this.marginBalance = marginBalance; - } - - public OptionAccountInformationResponseAssetInner equity( - @jakarta.annotation.Nullable String equity) { - this.equity = equity; - return this; - } - - /** - * Get equity - * - * @return equity - */ - @jakarta.annotation.Nullable - public String getEquity() { - return equity; - } - - public void setEquity(@jakarta.annotation.Nullable String equity) { - this.equity = equity; - } - - public OptionAccountInformationResponseAssetInner available( - @jakarta.annotation.Nullable String available) { - this.available = available; - return this; - } - - /** - * Get available - * - * @return available - */ - @jakarta.annotation.Nullable - public String getAvailable() { - return available; - } - - public void setAvailable(@jakarta.annotation.Nullable String available) { - this.available = available; - } - - public OptionAccountInformationResponseAssetInner locked( - @jakarta.annotation.Nullable String locked) { - this.locked = locked; - return this; - } - - /** - * Get locked - * - * @return locked - */ - @jakarta.annotation.Nullable - public String getLocked() { - return locked; - } - - public void setLocked(@jakarta.annotation.Nullable String locked) { - this.locked = locked; - } - - public OptionAccountInformationResponseAssetInner unrealizedPNL( - @jakarta.annotation.Nullable String unrealizedPNL) { - this.unrealizedPNL = unrealizedPNL; - return this; - } - - /** - * Get unrealizedPNL - * - * @return unrealizedPNL - */ - @jakarta.annotation.Nullable - public String getUnrealizedPNL() { - return unrealizedPNL; - } - - public void setUnrealizedPNL(@jakarta.annotation.Nullable String unrealizedPNL) { - this.unrealizedPNL = unrealizedPNL; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OptionAccountInformationResponseAssetInner optionAccountInformationResponseAssetInner = - (OptionAccountInformationResponseAssetInner) o; - return Objects.equals(this.asset, optionAccountInformationResponseAssetInner.asset) - && Objects.equals( - this.marginBalance, - optionAccountInformationResponseAssetInner.marginBalance) - && Objects.equals(this.equity, optionAccountInformationResponseAssetInner.equity) - && Objects.equals( - this.available, optionAccountInformationResponseAssetInner.available) - && Objects.equals(this.locked, optionAccountInformationResponseAssetInner.locked) - && Objects.equals( - this.unrealizedPNL, - optionAccountInformationResponseAssetInner.unrealizedPNL); - } - - @Override - public int hashCode() { - return Objects.hash(asset, marginBalance, equity, available, locked, unrealizedPNL); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OptionAccountInformationResponseAssetInner {\n"); - sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); - sb.append(" marginBalance: ").append(toIndentedString(marginBalance)).append("\n"); - sb.append(" equity: ").append(toIndentedString(equity)).append("\n"); - sb.append(" available: ").append(toIndentedString(available)).append("\n"); - sb.append(" locked: ").append(toIndentedString(locked)).append("\n"); - sb.append(" unrealizedPNL: ").append(toIndentedString(unrealizedPNL)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object assetValue = getAsset(); - String assetValueAsString = ""; - assetValueAsString = assetValue.toString(); - sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); - Object marginBalanceValue = getMarginBalance(); - String marginBalanceValueAsString = ""; - marginBalanceValueAsString = marginBalanceValue.toString(); - sb.append("marginBalance=").append(urlEncode(marginBalanceValueAsString)).append(""); - Object equityValue = getEquity(); - String equityValueAsString = ""; - equityValueAsString = equityValue.toString(); - sb.append("equity=").append(urlEncode(equityValueAsString)).append(""); - Object availableValue = getAvailable(); - String availableValueAsString = ""; - availableValueAsString = availableValue.toString(); - sb.append("available=").append(urlEncode(availableValueAsString)).append(""); - Object lockedValue = getLocked(); - String lockedValueAsString = ""; - lockedValueAsString = lockedValue.toString(); - sb.append("locked=").append(urlEncode(lockedValueAsString)).append(""); - Object unrealizedPNLValue = getUnrealizedPNL(); - String unrealizedPNLValueAsString = ""; - unrealizedPNLValueAsString = unrealizedPNLValue.toString(); - sb.append("unrealizedPNL=").append(urlEncode(unrealizedPNLValueAsString)).append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("asset"); - openapiFields.add("marginBalance"); - openapiFields.add("equity"); - openapiFields.add("available"); - openapiFields.add("locked"); - openapiFields.add("unrealizedPNL"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * OptionAccountInformationResponseAssetInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OptionAccountInformationResponseAssetInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " OptionAccountInformationResponseAssetInner is not found in" - + " the empty JSON string", - OptionAccountInformationResponseAssetInner.openapiRequiredFields - .toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) - && !jsonObj.get("asset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `asset` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("asset").toString())); - } - if ((jsonObj.get("marginBalance") != null && !jsonObj.get("marginBalance").isJsonNull()) - && !jsonObj.get("marginBalance").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `marginBalance` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("marginBalance").toString())); - } - if ((jsonObj.get("equity") != null && !jsonObj.get("equity").isJsonNull()) - && !jsonObj.get("equity").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `equity` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("equity").toString())); - } - if ((jsonObj.get("available") != null && !jsonObj.get("available").isJsonNull()) - && !jsonObj.get("available").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `available` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("available").toString())); - } - if ((jsonObj.get("locked") != null && !jsonObj.get("locked").isJsonNull()) - && !jsonObj.get("locked").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `locked` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("locked").toString())); - } - if ((jsonObj.get("unrealizedPNL") != null && !jsonObj.get("unrealizedPNL").isJsonNull()) - && !jsonObj.get("unrealizedPNL").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `unrealizedPNL` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("unrealizedPNL").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OptionAccountInformationResponseAssetInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'OptionAccountInformationResponseAssetInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(OptionAccountInformationResponseAssetInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, OptionAccountInformationResponseAssetInner value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public OptionAccountInformationResponseAssetInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of OptionAccountInformationResponseAssetInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of OptionAccountInformationResponseAssetInner - * @throws IOException if the JSON string is invalid with respect to - * OptionAccountInformationResponseAssetInner - */ - public static OptionAccountInformationResponseAssetInner fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, OptionAccountInformationResponseAssetInner.class); - } - - /** - * Convert an instance of OptionAccountInformationResponseAssetInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionMarginAccountInformationResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionMarginAccountInformationResponse.java index d2d46d993..71a3f4a0a 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionMarginAccountInformationResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionMarginAccountInformationResponse.java @@ -52,7 +52,7 @@ public class OptionMarginAccountInformationResponse { @SerializedName(SERIALIZED_NAME_GREEK) @jakarta.annotation.Nullable - private List<@Valid OptionAccountInformationResponseGreekInner> greek; + private List<@Valid OptionMarginAccountInformationResponseGreekInner> greek; public static final String SERIALIZED_NAME_TIME = "time"; @@ -60,6 +60,30 @@ public class OptionMarginAccountInformationResponse { @jakarta.annotation.Nullable private Long time; + public static final String SERIALIZED_NAME_CAN_TRADE = "canTrade"; + + @SerializedName(SERIALIZED_NAME_CAN_TRADE) + @jakarta.annotation.Nullable + private Boolean canTrade; + + public static final String SERIALIZED_NAME_CAN_DEPOSIT = "canDeposit"; + + @SerializedName(SERIALIZED_NAME_CAN_DEPOSIT) + @jakarta.annotation.Nullable + private Boolean canDeposit; + + public static final String SERIALIZED_NAME_CAN_WITHDRAW = "canWithdraw"; + + @SerializedName(SERIALIZED_NAME_CAN_WITHDRAW) + @jakarta.annotation.Nullable + private Boolean canWithdraw; + + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; + + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @jakarta.annotation.Nullable + private Boolean reduceOnly; + public OptionMarginAccountInformationResponse() {} public OptionMarginAccountInformationResponse asset( @@ -97,13 +121,13 @@ public void setAsset( public OptionMarginAccountInformationResponse greek( @jakarta.annotation.Nullable - List<@Valid OptionAccountInformationResponseGreekInner> greek) { + List<@Valid OptionMarginAccountInformationResponseGreekInner> greek) { this.greek = greek; return this; } public OptionMarginAccountInformationResponse addGreekItem( - OptionAccountInformationResponseGreekInner greekItem) { + OptionMarginAccountInformationResponseGreekInner greekItem) { if (this.greek == null) { this.greek = new ArrayList<>(); } @@ -118,13 +142,13 @@ public OptionMarginAccountInformationResponse addGreekItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid OptionAccountInformationResponseGreekInner> getGreek() { + public List<@Valid OptionMarginAccountInformationResponseGreekInner> getGreek() { return greek; } public void setGreek( @jakarta.annotation.Nullable - List<@Valid OptionAccountInformationResponseGreekInner> greek) { + List<@Valid OptionMarginAccountInformationResponseGreekInner> greek) { this.greek = greek; } @@ -147,6 +171,86 @@ public void setTime(@jakarta.annotation.Nullable Long time) { this.time = time; } + public OptionMarginAccountInformationResponse canTrade( + @jakarta.annotation.Nullable Boolean canTrade) { + this.canTrade = canTrade; + return this; + } + + /** + * Get canTrade + * + * @return canTrade + */ + @jakarta.annotation.Nullable + public Boolean getCanTrade() { + return canTrade; + } + + public void setCanTrade(@jakarta.annotation.Nullable Boolean canTrade) { + this.canTrade = canTrade; + } + + public OptionMarginAccountInformationResponse canDeposit( + @jakarta.annotation.Nullable Boolean canDeposit) { + this.canDeposit = canDeposit; + return this; + } + + /** + * Get canDeposit + * + * @return canDeposit + */ + @jakarta.annotation.Nullable + public Boolean getCanDeposit() { + return canDeposit; + } + + public void setCanDeposit(@jakarta.annotation.Nullable Boolean canDeposit) { + this.canDeposit = canDeposit; + } + + public OptionMarginAccountInformationResponse canWithdraw( + @jakarta.annotation.Nullable Boolean canWithdraw) { + this.canWithdraw = canWithdraw; + return this; + } + + /** + * Get canWithdraw + * + * @return canWithdraw + */ + @jakarta.annotation.Nullable + public Boolean getCanWithdraw() { + return canWithdraw; + } + + public void setCanWithdraw(@jakarta.annotation.Nullable Boolean canWithdraw) { + this.canWithdraw = canWithdraw; + } + + public OptionMarginAccountInformationResponse reduceOnly( + @jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Get reduceOnly + * + * @return reduceOnly + */ + @jakarta.annotation.Nullable + public Boolean getReduceOnly() { + return reduceOnly; + } + + public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { + this.reduceOnly = reduceOnly; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -159,12 +263,19 @@ public boolean equals(Object o) { (OptionMarginAccountInformationResponse) o; return Objects.equals(this.asset, optionMarginAccountInformationResponse.asset) && Objects.equals(this.greek, optionMarginAccountInformationResponse.greek) - && Objects.equals(this.time, optionMarginAccountInformationResponse.time); + && Objects.equals(this.time, optionMarginAccountInformationResponse.time) + && Objects.equals(this.canTrade, optionMarginAccountInformationResponse.canTrade) + && Objects.equals( + this.canDeposit, optionMarginAccountInformationResponse.canDeposit) + && Objects.equals( + this.canWithdraw, optionMarginAccountInformationResponse.canWithdraw) + && Objects.equals( + this.reduceOnly, optionMarginAccountInformationResponse.reduceOnly); } @Override public int hashCode() { - return Objects.hash(asset, greek, time); + return Objects.hash(asset, greek, time, canTrade, canDeposit, canWithdraw, reduceOnly); } @Override @@ -174,6 +285,10 @@ public String toString() { sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); sb.append(" greek: ").append(toIndentedString(greek)).append("\n"); sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" canTrade: ").append(toIndentedString(canTrade)).append("\n"); + sb.append(" canDeposit: ").append(toIndentedString(canDeposit)).append("\n"); + sb.append(" canWithdraw: ").append(toIndentedString(canWithdraw)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); sb.append("}"); return sb.toString(); } @@ -199,6 +314,22 @@ public String toUrlQueryString() { String timeValueAsString = ""; timeValueAsString = timeValue.toString(); sb.append("time=").append(urlEncode(timeValueAsString)).append(""); + Object canTradeValue = getCanTrade(); + String canTradeValueAsString = ""; + canTradeValueAsString = canTradeValue.toString(); + sb.append("canTrade=").append(urlEncode(canTradeValueAsString)).append(""); + Object canDepositValue = getCanDeposit(); + String canDepositValueAsString = ""; + canDepositValueAsString = canDepositValue.toString(); + sb.append("canDeposit=").append(urlEncode(canDepositValueAsString)).append(""); + Object canWithdrawValue = getCanWithdraw(); + String canWithdrawValueAsString = ""; + canWithdrawValueAsString = canWithdrawValue.toString(); + sb.append("canWithdraw=").append(urlEncode(canWithdrawValueAsString)).append(""); + Object reduceOnlyValue = getReduceOnly(); + String reduceOnlyValueAsString = ""; + reduceOnlyValueAsString = reduceOnlyValue.toString(); + sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); return sb.toString(); } @@ -230,6 +361,10 @@ private String toIndentedString(Object o) { openapiFields.add("asset"); openapiFields.add("greek"); openapiFields.add("time"); + openapiFields.add("canTrade"); + openapiFields.add("canDeposit"); + openapiFields.add("canWithdraw"); + openapiFields.add("reduceOnly"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -289,7 +424,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `greek` (array) for (int i = 0; i < jsonArraygreek.size(); i++) { - OptionAccountInformationResponseGreekInner.validateJsonElement( + OptionMarginAccountInformationResponseGreekInner.validateJsonElement( jsonArraygreek.get(i)); } ; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionAccountInformationResponseGreekInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionMarginAccountInformationResponseGreekInner.java similarity index 78% rename from clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionAccountInformationResponseGreekInner.java rename to clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionMarginAccountInformationResponseGreekInner.java index 834bbfa48..00eb6b4a6 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionAccountInformationResponseGreekInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionMarginAccountInformationResponseGreekInner.java @@ -31,11 +31,11 @@ import java.util.Objects; import org.hibernate.validator.constraints.*; -/** OptionAccountInformationResponseGreekInner */ +/** OptionMarginAccountInformationResponseGreekInner */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class OptionAccountInformationResponseGreekInner { +public class OptionMarginAccountInformationResponseGreekInner { public static final String SERIALIZED_NAME_UNDERLYING = "underlying"; @SerializedName(SERIALIZED_NAME_UNDERLYING) @@ -48,27 +48,27 @@ public class OptionAccountInformationResponseGreekInner { @jakarta.annotation.Nullable private String delta; - public static final String SERIALIZED_NAME_GAMMA = "gamma"; - - @SerializedName(SERIALIZED_NAME_GAMMA) - @jakarta.annotation.Nullable - private String gamma; - public static final String SERIALIZED_NAME_THETA = "theta"; @SerializedName(SERIALIZED_NAME_THETA) @jakarta.annotation.Nullable private String theta; + public static final String SERIALIZED_NAME_GAMMA = "gamma"; + + @SerializedName(SERIALIZED_NAME_GAMMA) + @jakarta.annotation.Nullable + private String gamma; + public static final String SERIALIZED_NAME_VEGA = "vega"; @SerializedName(SERIALIZED_NAME_VEGA) @jakarta.annotation.Nullable private String vega; - public OptionAccountInformationResponseGreekInner() {} + public OptionMarginAccountInformationResponseGreekInner() {} - public OptionAccountInformationResponseGreekInner underlying( + public OptionMarginAccountInformationResponseGreekInner underlying( @jakarta.annotation.Nullable String underlying) { this.underlying = underlying; return this; @@ -88,7 +88,7 @@ public void setUnderlying(@jakarta.annotation.Nullable String underlying) { this.underlying = underlying; } - public OptionAccountInformationResponseGreekInner delta( + public OptionMarginAccountInformationResponseGreekInner delta( @jakarta.annotation.Nullable String delta) { this.delta = delta; return this; @@ -108,47 +108,47 @@ public void setDelta(@jakarta.annotation.Nullable String delta) { this.delta = delta; } - public OptionAccountInformationResponseGreekInner gamma( - @jakarta.annotation.Nullable String gamma) { - this.gamma = gamma; + public OptionMarginAccountInformationResponseGreekInner theta( + @jakarta.annotation.Nullable String theta) { + this.theta = theta; return this; } /** - * Get gamma + * Get theta * - * @return gamma + * @return theta */ @jakarta.annotation.Nullable - public String getGamma() { - return gamma; + public String getTheta() { + return theta; } - public void setGamma(@jakarta.annotation.Nullable String gamma) { - this.gamma = gamma; + public void setTheta(@jakarta.annotation.Nullable String theta) { + this.theta = theta; } - public OptionAccountInformationResponseGreekInner theta( - @jakarta.annotation.Nullable String theta) { - this.theta = theta; + public OptionMarginAccountInformationResponseGreekInner gamma( + @jakarta.annotation.Nullable String gamma) { + this.gamma = gamma; return this; } /** - * Get theta + * Get gamma * - * @return theta + * @return gamma */ @jakarta.annotation.Nullable - public String getTheta() { - return theta; + public String getGamma() { + return gamma; } - public void setTheta(@jakarta.annotation.Nullable String theta) { - this.theta = theta; + public void setGamma(@jakarta.annotation.Nullable String gamma) { + this.gamma = gamma; } - public OptionAccountInformationResponseGreekInner vega( + public OptionMarginAccountInformationResponseGreekInner vega( @jakarta.annotation.Nullable String vega) { this.vega = vega; return this; @@ -176,29 +176,34 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - OptionAccountInformationResponseGreekInner optionAccountInformationResponseGreekInner = - (OptionAccountInformationResponseGreekInner) o; + OptionMarginAccountInformationResponseGreekInner + optionMarginAccountInformationResponseGreekInner = + (OptionMarginAccountInformationResponseGreekInner) o; return Objects.equals( - this.underlying, optionAccountInformationResponseGreekInner.underlying) - && Objects.equals(this.delta, optionAccountInformationResponseGreekInner.delta) - && Objects.equals(this.gamma, optionAccountInformationResponseGreekInner.gamma) - && Objects.equals(this.theta, optionAccountInformationResponseGreekInner.theta) - && Objects.equals(this.vega, optionAccountInformationResponseGreekInner.vega); + this.underlying, + optionMarginAccountInformationResponseGreekInner.underlying) + && Objects.equals( + this.delta, optionMarginAccountInformationResponseGreekInner.delta) + && Objects.equals( + this.theta, optionMarginAccountInformationResponseGreekInner.theta) + && Objects.equals( + this.gamma, optionMarginAccountInformationResponseGreekInner.gamma) + && Objects.equals(this.vega, optionMarginAccountInformationResponseGreekInner.vega); } @Override public int hashCode() { - return Objects.hash(underlying, delta, gamma, theta, vega); + return Objects.hash(underlying, delta, theta, gamma, vega); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class OptionAccountInformationResponseGreekInner {\n"); + sb.append("class OptionMarginAccountInformationResponseGreekInner {\n"); sb.append(" underlying: ").append(toIndentedString(underlying)).append("\n"); sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); - sb.append(" gamma: ").append(toIndentedString(gamma)).append("\n"); sb.append(" theta: ").append(toIndentedString(theta)).append("\n"); + sb.append(" gamma: ").append(toIndentedString(gamma)).append("\n"); sb.append(" vega: ").append(toIndentedString(vega)).append("\n"); sb.append("}"); return sb.toString(); @@ -215,14 +220,14 @@ public String toUrlQueryString() { String deltaValueAsString = ""; deltaValueAsString = deltaValue.toString(); sb.append("delta=").append(urlEncode(deltaValueAsString)).append(""); - Object gammaValue = getGamma(); - String gammaValueAsString = ""; - gammaValueAsString = gammaValue.toString(); - sb.append("gamma=").append(urlEncode(gammaValueAsString)).append(""); Object thetaValue = getTheta(); String thetaValueAsString = ""; thetaValueAsString = thetaValue.toString(); sb.append("theta=").append(urlEncode(thetaValueAsString)).append(""); + Object gammaValue = getGamma(); + String gammaValueAsString = ""; + gammaValueAsString = gammaValue.toString(); + sb.append("gamma=").append(urlEncode(gammaValueAsString)).append(""); Object vegaValue = getVega(); String vegaValueAsString = ""; vegaValueAsString = vegaValue.toString(); @@ -257,8 +262,8 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("underlying"); openapiFields.add("delta"); - openapiFields.add("gamma"); openapiFields.add("theta"); + openapiFields.add("gamma"); openapiFields.add("vega"); // a set of required properties/fields (JSON key names) @@ -270,18 +275,19 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * OptionAccountInformationResponseGreekInner + * OptionMarginAccountInformationResponseGreekInner */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!OptionAccountInformationResponseGreekInner.openapiRequiredFields + if (!OptionMarginAccountInformationResponseGreekInner.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" - + " OptionAccountInformationResponseGreekInner is not found in" - + " the empty JSON string", - OptionAccountInformationResponseGreekInner.openapiRequiredFields + + " OptionMarginAccountInformationResponseGreekInner is not" + + " found in the empty JSON string", + OptionMarginAccountInformationResponseGreekInner + .openapiRequiredFields .toString())); } } @@ -302,14 +308,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("delta").toString())); } - if ((jsonObj.get("gamma") != null && !jsonObj.get("gamma").isJsonNull()) - && !jsonObj.get("gamma").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `gamma` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("gamma").toString())); - } if ((jsonObj.get("theta") != null && !jsonObj.get("theta").isJsonNull()) && !jsonObj.get("theta").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -318,6 +316,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("theta").toString())); } + if ((jsonObj.get("gamma") != null && !jsonObj.get("gamma").isJsonNull()) + && !jsonObj.get("gamma").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `gamma` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("gamma").toString())); + } if ((jsonObj.get("vega") != null && !jsonObj.get("vega").isJsonNull()) && !jsonObj.get("vega").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -332,28 +338,30 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!OptionAccountInformationResponseGreekInner.class.isAssignableFrom( + if (!OptionMarginAccountInformationResponseGreekInner.class.isAssignableFrom( type.getRawType())) { return null; // this class only serializes - // 'OptionAccountInformationResponseGreekInner' and its subtypes + // 'OptionMarginAccountInformationResponseGreekInner' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = + final TypeAdapter thisAdapter = gson.getDelegateAdapter( - this, TypeToken.get(OptionAccountInformationResponseGreekInner.class)); + this, + TypeToken.get(OptionMarginAccountInformationResponseGreekInner.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override public void write( - JsonWriter out, OptionAccountInformationResponseGreekInner value) + JsonWriter out, + OptionMarginAccountInformationResponseGreekInner value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public OptionAccountInformationResponseGreekInner read(JsonReader in) + public OptionMarginAccountInformationResponseGreekInner read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); @@ -364,21 +372,21 @@ public OptionAccountInformationResponseGreekInner read(JsonReader in) } /** - * Create an instance of OptionAccountInformationResponseGreekInner given an JSON string + * Create an instance of OptionMarginAccountInformationResponseGreekInner given an JSON string * * @param jsonString JSON string - * @return An instance of OptionAccountInformationResponseGreekInner + * @return An instance of OptionMarginAccountInformationResponseGreekInner * @throws IOException if the JSON string is invalid with respect to - * OptionAccountInformationResponseGreekInner + * OptionMarginAccountInformationResponseGreekInner */ - public static OptionAccountInformationResponseGreekInner fromJson(String jsonString) + public static OptionMarginAccountInformationResponseGreekInner fromJson(String jsonString) throws IOException { return JSON.getGson() - .fromJson(jsonString, OptionAccountInformationResponseGreekInner.class); + .fromJson(jsonString, OptionMarginAccountInformationResponseGreekInner.class); } /** - * Convert an instance of OptionAccountInformationResponseGreekInner to an JSON string + * Convert an instance of OptionMarginAccountInformationResponseGreekInner to an JSON string * * @return JSON string */ diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionPositionInformationResponseInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionPositionInformationResponseInner.java index a9011a3b4..c37f8db96 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionPositionInformationResponseInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OptionPositionInformationResponseInner.java @@ -60,24 +60,12 @@ public class OptionPositionInformationResponseInner { @jakarta.annotation.Nullable private String quantity; - public static final String SERIALIZED_NAME_REDUCIBLE_QTY = "reducibleQty"; - - @SerializedName(SERIALIZED_NAME_REDUCIBLE_QTY) - @jakarta.annotation.Nullable - private String reducibleQty; - public static final String SERIALIZED_NAME_MARK_VALUE = "markValue"; @SerializedName(SERIALIZED_NAME_MARK_VALUE) @jakarta.annotation.Nullable private String markValue; - public static final String SERIALIZED_NAME_ROR = "ror"; - - @SerializedName(SERIALIZED_NAME_ROR) - @jakarta.annotation.Nullable - private String ror; - public static final String SERIALIZED_NAME_UNREALIZED_P_N_L = "unrealizedPNL"; @SerializedName(SERIALIZED_NAME_UNREALIZED_P_N_L) @@ -96,12 +84,6 @@ public class OptionPositionInformationResponseInner { @jakarta.annotation.Nullable private String strikePrice; - public static final String SERIALIZED_NAME_POSITION_COST = "positionCost"; - - @SerializedName(SERIALIZED_NAME_POSITION_COST) - @jakarta.annotation.Nullable - private String positionCost; - public static final String SERIALIZED_NAME_EXPIRY_DATE = "expiryDate"; @SerializedName(SERIALIZED_NAME_EXPIRY_DATE) @@ -132,6 +114,24 @@ public class OptionPositionInformationResponseInner { @jakarta.annotation.Nullable private String quoteAsset; + public static final String SERIALIZED_NAME_TIME = "time"; + + @SerializedName(SERIALIZED_NAME_TIME) + @jakarta.annotation.Nullable + private Long time; + + public static final String SERIALIZED_NAME_BID_QUANTITY = "bidQuantity"; + + @SerializedName(SERIALIZED_NAME_BID_QUANTITY) + @jakarta.annotation.Nullable + private String bidQuantity; + + public static final String SERIALIZED_NAME_ASK_QUANTITY = "askQuantity"; + + @SerializedName(SERIALIZED_NAME_ASK_QUANTITY) + @jakarta.annotation.Nullable + private String askQuantity; + public OptionPositionInformationResponseInner() {} public OptionPositionInformationResponseInner entryPrice( @@ -213,26 +213,6 @@ public void setQuantity(@jakarta.annotation.Nullable String quantity) { this.quantity = quantity; } - public OptionPositionInformationResponseInner reducibleQty( - @jakarta.annotation.Nullable String reducibleQty) { - this.reducibleQty = reducibleQty; - return this; - } - - /** - * Get reducibleQty - * - * @return reducibleQty - */ - @jakarta.annotation.Nullable - public String getReducibleQty() { - return reducibleQty; - } - - public void setReducibleQty(@jakarta.annotation.Nullable String reducibleQty) { - this.reducibleQty = reducibleQty; - } - public OptionPositionInformationResponseInner markValue( @jakarta.annotation.Nullable String markValue) { this.markValue = markValue; @@ -253,25 +233,6 @@ public void setMarkValue(@jakarta.annotation.Nullable String markValue) { this.markValue = markValue; } - public OptionPositionInformationResponseInner ror(@jakarta.annotation.Nullable String ror) { - this.ror = ror; - return this; - } - - /** - * Get ror - * - * @return ror - */ - @jakarta.annotation.Nullable - public String getRor() { - return ror; - } - - public void setRor(@jakarta.annotation.Nullable String ror) { - this.ror = ror; - } - public OptionPositionInformationResponseInner unrealizedPNL( @jakarta.annotation.Nullable String unrealizedPNL) { this.unrealizedPNL = unrealizedPNL; @@ -332,26 +293,6 @@ public void setStrikePrice(@jakarta.annotation.Nullable String strikePrice) { this.strikePrice = strikePrice; } - public OptionPositionInformationResponseInner positionCost( - @jakarta.annotation.Nullable String positionCost) { - this.positionCost = positionCost; - return this; - } - - /** - * Get positionCost - * - * @return positionCost - */ - @jakarta.annotation.Nullable - public String getPositionCost() { - return positionCost; - } - - public void setPositionCost(@jakarta.annotation.Nullable String positionCost) { - this.positionCost = positionCost; - } - public OptionPositionInformationResponseInner expiryDate( @jakarta.annotation.Nullable Long expiryDate) { this.expiryDate = expiryDate; @@ -452,6 +393,65 @@ public void setQuoteAsset(@jakarta.annotation.Nullable String quoteAsset) { this.quoteAsset = quoteAsset; } + public OptionPositionInformationResponseInner time(@jakarta.annotation.Nullable Long time) { + this.time = time; + return this; + } + + /** + * Get time + * + * @return time + */ + @jakarta.annotation.Nullable + public Long getTime() { + return time; + } + + public void setTime(@jakarta.annotation.Nullable Long time) { + this.time = time; + } + + public OptionPositionInformationResponseInner bidQuantity( + @jakarta.annotation.Nullable String bidQuantity) { + this.bidQuantity = bidQuantity; + return this; + } + + /** + * Get bidQuantity + * + * @return bidQuantity + */ + @jakarta.annotation.Nullable + public String getBidQuantity() { + return bidQuantity; + } + + public void setBidQuantity(@jakarta.annotation.Nullable String bidQuantity) { + this.bidQuantity = bidQuantity; + } + + public OptionPositionInformationResponseInner askQuantity( + @jakarta.annotation.Nullable String askQuantity) { + this.askQuantity = askQuantity; + return this; + } + + /** + * Get askQuantity + * + * @return askQuantity + */ + @jakarta.annotation.Nullable + public String getAskQuantity() { + return askQuantity; + } + + public void setAskQuantity(@jakarta.annotation.Nullable String askQuantity) { + this.askQuantity = askQuantity; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -466,17 +466,12 @@ public boolean equals(Object o) { && Objects.equals(this.symbol, optionPositionInformationResponseInner.symbol) && Objects.equals(this.side, optionPositionInformationResponseInner.side) && Objects.equals(this.quantity, optionPositionInformationResponseInner.quantity) - && Objects.equals( - this.reducibleQty, optionPositionInformationResponseInner.reducibleQty) && Objects.equals(this.markValue, optionPositionInformationResponseInner.markValue) - && Objects.equals(this.ror, optionPositionInformationResponseInner.ror) && Objects.equals( this.unrealizedPNL, optionPositionInformationResponseInner.unrealizedPNL) && Objects.equals(this.markPrice, optionPositionInformationResponseInner.markPrice) && Objects.equals( this.strikePrice, optionPositionInformationResponseInner.strikePrice) - && Objects.equals( - this.positionCost, optionPositionInformationResponseInner.positionCost) && Objects.equals( this.expiryDate, optionPositionInformationResponseInner.expiryDate) && Objects.equals( @@ -486,7 +481,12 @@ public boolean equals(Object o) { && Objects.equals( this.optionSide, optionPositionInformationResponseInner.optionSide) && Objects.equals( - this.quoteAsset, optionPositionInformationResponseInner.quoteAsset); + this.quoteAsset, optionPositionInformationResponseInner.quoteAsset) + && Objects.equals(this.time, optionPositionInformationResponseInner.time) + && Objects.equals( + this.bidQuantity, optionPositionInformationResponseInner.bidQuantity) + && Objects.equals( + this.askQuantity, optionPositionInformationResponseInner.askQuantity); } @Override @@ -496,18 +496,18 @@ public int hashCode() { symbol, side, quantity, - reducibleQty, markValue, - ror, unrealizedPNL, markPrice, strikePrice, - positionCost, expiryDate, priceScale, quantityScale, optionSide, - quoteAsset); + quoteAsset, + time, + bidQuantity, + askQuantity); } @Override @@ -518,18 +518,18 @@ public String toString() { sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); sb.append(" side: ").append(toIndentedString(side)).append("\n"); sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" reducibleQty: ").append(toIndentedString(reducibleQty)).append("\n"); sb.append(" markValue: ").append(toIndentedString(markValue)).append("\n"); - sb.append(" ror: ").append(toIndentedString(ror)).append("\n"); sb.append(" unrealizedPNL: ").append(toIndentedString(unrealizedPNL)).append("\n"); sb.append(" markPrice: ").append(toIndentedString(markPrice)).append("\n"); sb.append(" strikePrice: ").append(toIndentedString(strikePrice)).append("\n"); - sb.append(" positionCost: ").append(toIndentedString(positionCost)).append("\n"); sb.append(" expiryDate: ").append(toIndentedString(expiryDate)).append("\n"); sb.append(" priceScale: ").append(toIndentedString(priceScale)).append("\n"); sb.append(" quantityScale: ").append(toIndentedString(quantityScale)).append("\n"); sb.append(" optionSide: ").append(toIndentedString(optionSide)).append("\n"); sb.append(" quoteAsset: ").append(toIndentedString(quoteAsset)).append("\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" bidQuantity: ").append(toIndentedString(bidQuantity)).append("\n"); + sb.append(" askQuantity: ").append(toIndentedString(askQuantity)).append("\n"); sb.append("}"); return sb.toString(); } @@ -553,18 +553,10 @@ public String toUrlQueryString() { String quantityValueAsString = ""; quantityValueAsString = quantityValue.toString(); sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); - Object reducibleQtyValue = getReducibleQty(); - String reducibleQtyValueAsString = ""; - reducibleQtyValueAsString = reducibleQtyValue.toString(); - sb.append("reducibleQty=").append(urlEncode(reducibleQtyValueAsString)).append(""); Object markValueValue = getMarkValue(); String markValueValueAsString = ""; markValueValueAsString = markValueValue.toString(); sb.append("markValue=").append(urlEncode(markValueValueAsString)).append(""); - Object rorValue = getRor(); - String rorValueAsString = ""; - rorValueAsString = rorValue.toString(); - sb.append("ror=").append(urlEncode(rorValueAsString)).append(""); Object unrealizedPNLValue = getUnrealizedPNL(); String unrealizedPNLValueAsString = ""; unrealizedPNLValueAsString = unrealizedPNLValue.toString(); @@ -577,10 +569,6 @@ public String toUrlQueryString() { String strikePriceValueAsString = ""; strikePriceValueAsString = strikePriceValue.toString(); sb.append("strikePrice=").append(urlEncode(strikePriceValueAsString)).append(""); - Object positionCostValue = getPositionCost(); - String positionCostValueAsString = ""; - positionCostValueAsString = positionCostValue.toString(); - sb.append("positionCost=").append(urlEncode(positionCostValueAsString)).append(""); Object expiryDateValue = getExpiryDate(); String expiryDateValueAsString = ""; expiryDateValueAsString = expiryDateValue.toString(); @@ -601,6 +589,18 @@ public String toUrlQueryString() { String quoteAssetValueAsString = ""; quoteAssetValueAsString = quoteAssetValue.toString(); sb.append("quoteAsset=").append(urlEncode(quoteAssetValueAsString)).append(""); + Object timeValue = getTime(); + String timeValueAsString = ""; + timeValueAsString = timeValue.toString(); + sb.append("time=").append(urlEncode(timeValueAsString)).append(""); + Object bidQuantityValue = getBidQuantity(); + String bidQuantityValueAsString = ""; + bidQuantityValueAsString = bidQuantityValue.toString(); + sb.append("bidQuantity=").append(urlEncode(bidQuantityValueAsString)).append(""); + Object askQuantityValue = getAskQuantity(); + String askQuantityValueAsString = ""; + askQuantityValueAsString = askQuantityValue.toString(); + sb.append("askQuantity=").append(urlEncode(askQuantityValueAsString)).append(""); return sb.toString(); } @@ -633,18 +633,18 @@ private String toIndentedString(Object o) { openapiFields.add("symbol"); openapiFields.add("side"); openapiFields.add("quantity"); - openapiFields.add("reducibleQty"); openapiFields.add("markValue"); - openapiFields.add("ror"); openapiFields.add("unrealizedPNL"); openapiFields.add("markPrice"); openapiFields.add("strikePrice"); - openapiFields.add("positionCost"); openapiFields.add("expiryDate"); openapiFields.add("priceScale"); openapiFields.add("quantityScale"); openapiFields.add("optionSide"); openapiFields.add("quoteAsset"); + openapiFields.add("time"); + openapiFields.add("bidQuantity"); + openapiFields.add("askQuantity"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -702,14 +702,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("quantity").toString())); } - if ((jsonObj.get("reducibleQty") != null && !jsonObj.get("reducibleQty").isJsonNull()) - && !jsonObj.get("reducibleQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `reducibleQty` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("reducibleQty").toString())); - } if ((jsonObj.get("markValue") != null && !jsonObj.get("markValue").isJsonNull()) && !jsonObj.get("markValue").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -718,14 +710,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("markValue").toString())); } - if ((jsonObj.get("ror") != null && !jsonObj.get("ror").isJsonNull()) - && !jsonObj.get("ror").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `ror` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("ror").toString())); - } if ((jsonObj.get("unrealizedPNL") != null && !jsonObj.get("unrealizedPNL").isJsonNull()) && !jsonObj.get("unrealizedPNL").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -750,14 +734,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("strikePrice").toString())); } - if ((jsonObj.get("positionCost") != null && !jsonObj.get("positionCost").isJsonNull()) - && !jsonObj.get("positionCost").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `positionCost` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("positionCost").toString())); - } if ((jsonObj.get("optionSide") != null && !jsonObj.get("optionSide").isJsonNull()) && !jsonObj.get("optionSide").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -774,6 +750,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("quoteAsset").toString())); } + if ((jsonObj.get("bidQuantity") != null && !jsonObj.get("bidQuantity").isJsonNull()) + && !jsonObj.get("bidQuantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bidQuantity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("bidQuantity").toString())); + } + if ((jsonObj.get("askQuantity") != null && !jsonObj.get("askQuantity").isJsonNull()) + && !jsonObj.get("askQuantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `askQuantity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("askQuantity").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OrderBookResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OrderBookResponse.java index 96dde7b88..1fd6aca76 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OrderBookResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OrderBookResponse.java @@ -41,18 +41,6 @@ value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class OrderBookResponse { - public static final String SERIALIZED_NAME_T = "T"; - - @SerializedName(SERIALIZED_NAME_T) - @jakarta.annotation.Nullable - private Long T; - - public static final String SERIALIZED_NAME_U_LOWER_CASE = "u"; - - @SerializedName(SERIALIZED_NAME_U_LOWER_CASE) - @jakarta.annotation.Nullable - private Long uLowerCase; - public static final String SERIALIZED_NAME_BIDS = "bids"; @SerializedName(SERIALIZED_NAME_BIDS) @@ -65,45 +53,19 @@ public class OrderBookResponse { @jakarta.annotation.Nullable private List asks; - public OrderBookResponse() {} - - public OrderBookResponse T(@jakarta.annotation.Nullable Long T) { - this.T = T; - return this; - } + public static final String SERIALIZED_NAME_T = "T"; - /** - * Get T - * - * @return T - */ + @SerializedName(SERIALIZED_NAME_T) @jakarta.annotation.Nullable - public Long getT() { - return T; - } - - public void setT(@jakarta.annotation.Nullable Long T) { - this.T = T; - } + private Long T; - public OrderBookResponse uLowerCase(@jakarta.annotation.Nullable Long uLowerCase) { - this.uLowerCase = uLowerCase; - return this; - } + public static final String SERIALIZED_NAME_LAST_UPDATE_ID = "lastUpdateId"; - /** - * Get uLowerCase - * - * @return uLowerCase - */ + @SerializedName(SERIALIZED_NAME_LAST_UPDATE_ID) @jakarta.annotation.Nullable - public Long getuLowerCase() { - return uLowerCase; - } + private Long lastUpdateId; - public void setuLowerCase(@jakarta.annotation.Nullable Long uLowerCase) { - this.uLowerCase = uLowerCase; - } + public OrderBookResponse() {} public OrderBookResponse bids( @jakarta.annotation.Nullable List bids) { @@ -163,6 +125,44 @@ public void setAsks(@jakarta.annotation.Nullable List this.asks = asks; } + public OrderBookResponse T(@jakarta.annotation.Nullable Long T) { + this.T = T; + return this; + } + + /** + * Get T + * + * @return T + */ + @jakarta.annotation.Nullable + public Long getT() { + return T; + } + + public void setT(@jakarta.annotation.Nullable Long T) { + this.T = T; + } + + public OrderBookResponse lastUpdateId(@jakarta.annotation.Nullable Long lastUpdateId) { + this.lastUpdateId = lastUpdateId; + return this; + } + + /** + * Get lastUpdateId + * + * @return lastUpdateId + */ + @jakarta.annotation.Nullable + public Long getLastUpdateId() { + return lastUpdateId; + } + + public void setLastUpdateId(@jakarta.annotation.Nullable Long lastUpdateId) { + this.lastUpdateId = lastUpdateId; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -172,25 +172,25 @@ public boolean equals(Object o) { return false; } OrderBookResponse orderBookResponse = (OrderBookResponse) o; - return Objects.equals(this.T, orderBookResponse.T) - && Objects.equals(this.uLowerCase, orderBookResponse.uLowerCase) - && Objects.equals(this.bids, orderBookResponse.bids) - && Objects.equals(this.asks, orderBookResponse.asks); + return Objects.equals(this.bids, orderBookResponse.bids) + && Objects.equals(this.asks, orderBookResponse.asks) + && Objects.equals(this.T, orderBookResponse.T) + && Objects.equals(this.lastUpdateId, orderBookResponse.lastUpdateId); } @Override public int hashCode() { - return Objects.hash(T, uLowerCase, bids, asks); + return Objects.hash(bids, asks, T, lastUpdateId); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class OrderBookResponse {\n"); - sb.append(" T: ").append(toIndentedString(T)).append("\n"); - sb.append(" uLowerCase: ").append(toIndentedString(uLowerCase)).append("\n"); sb.append(" bids: ").append(toIndentedString(bids)).append("\n"); sb.append(" asks: ").append(toIndentedString(asks)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" lastUpdateId: ").append(toIndentedString(lastUpdateId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -198,14 +198,6 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); - Object TValue = getT(); - String TValueAsString = ""; - TValueAsString = TValue.toString(); - sb.append("T=").append(urlEncode(TValueAsString)).append(""); - Object uLowerCaseValue = getuLowerCase(); - String uLowerCaseValueAsString = ""; - uLowerCaseValueAsString = uLowerCaseValue.toString(); - sb.append("uLowerCase=").append(urlEncode(uLowerCaseValueAsString)).append(""); Object bidsValue = getBids(); String bidsValueAsString = ""; bidsValueAsString = @@ -220,6 +212,14 @@ public String toUrlQueryString() { ((Collection) asksValue) .stream().map(Object::toString).collect(Collectors.joining(",")); sb.append("asks=").append(urlEncode(asksValueAsString)).append(""); + Object TValue = getT(); + String TValueAsString = ""; + TValueAsString = TValue.toString(); + sb.append("T=").append(urlEncode(TValueAsString)).append(""); + Object lastUpdateIdValue = getLastUpdateId(); + String lastUpdateIdValueAsString = ""; + lastUpdateIdValueAsString = lastUpdateIdValue.toString(); + sb.append("lastUpdateId=").append(urlEncode(lastUpdateIdValueAsString)).append(""); return sb.toString(); } @@ -248,10 +248,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("T"); - openapiFields.add("u"); openapiFields.add("bids"); openapiFields.add("asks"); + openapiFields.add("T"); + openapiFields.add("lastUpdateId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OrdersInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OrdersInner.java index 771f2388c..593f46bf0 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OrdersInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/OrdersInner.java @@ -174,7 +174,9 @@ public enum TimeInForceEnum { IOC("IOC"), - FOK("FOK"); + FOK("FOK"), + + GTX("GTX"); private String value; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/PlaceMultipleOrdersResponseInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/PlaceMultipleOrdersResponseInner.java index c38fcd225..6e3607605 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/PlaceMultipleOrdersResponseInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/PlaceMultipleOrdersResponseInner.java @@ -60,6 +60,12 @@ public class PlaceMultipleOrdersResponseInner { @jakarta.annotation.Nullable private String quantity; + public static final String SERIALIZED_NAME_EXECUTED_QTY = "executedQty"; + + @SerializedName(SERIALIZED_NAME_EXECUTED_QTY) + @jakarta.annotation.Nullable + private String executedQty; + public static final String SERIALIZED_NAME_SIDE = "side"; @SerializedName(SERIALIZED_NAME_SIDE) @@ -72,17 +78,47 @@ public class PlaceMultipleOrdersResponseInner { @jakarta.annotation.Nullable private String type; + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private String timeInForce; + public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) @jakarta.annotation.Nullable private Boolean reduceOnly; - public static final String SERIALIZED_NAME_POST_ONLY = "postOnly"; + public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; + + @SerializedName(SERIALIZED_NAME_CREATE_TIME) + @jakarta.annotation.Nullable + private Long createTime; + + public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; + + @SerializedName(SERIALIZED_NAME_UPDATE_TIME) + @jakarta.annotation.Nullable + private Long updateTime; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private String status; + + public static final String SERIALIZED_NAME_AVG_PRICE = "avgPrice"; - @SerializedName(SERIALIZED_NAME_POST_ONLY) + @SerializedName(SERIALIZED_NAME_AVG_PRICE) @jakarta.annotation.Nullable - private Boolean postOnly; + private String avgPrice; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + + @SerializedName(SERIALIZED_NAME_SOURCE) + @jakarta.annotation.Nullable + private String source; public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; @@ -90,6 +126,30 @@ public class PlaceMultipleOrdersResponseInner { @jakarta.annotation.Nullable private String clientOrderId; + public static final String SERIALIZED_NAME_PRICE_SCALE = "priceScale"; + + @SerializedName(SERIALIZED_NAME_PRICE_SCALE) + @jakarta.annotation.Nullable + private Long priceScale; + + public static final String SERIALIZED_NAME_QUANTITY_SCALE = "quantityScale"; + + @SerializedName(SERIALIZED_NAME_QUANTITY_SCALE) + @jakarta.annotation.Nullable + private Long quantityScale; + + public static final String SERIALIZED_NAME_OPTION_SIDE = "optionSide"; + + @SerializedName(SERIALIZED_NAME_OPTION_SIDE) + @jakarta.annotation.Nullable + private String optionSide; + + public static final String SERIALIZED_NAME_QUOTE_ASSET = "quoteAsset"; + + @SerializedName(SERIALIZED_NAME_QUOTE_ASSET) + @jakarta.annotation.Nullable + private String quoteAsset; + public static final String SERIALIZED_NAME_MMP = "mmp"; @SerializedName(SERIALIZED_NAME_MMP) @@ -174,6 +234,26 @@ public void setQuantity(@jakarta.annotation.Nullable String quantity) { this.quantity = quantity; } + public PlaceMultipleOrdersResponseInner executedQty( + @jakarta.annotation.Nullable String executedQty) { + this.executedQty = executedQty; + return this; + } + + /** + * Get executedQty + * + * @return executedQty + */ + @jakarta.annotation.Nullable + public String getExecutedQty() { + return executedQty; + } + + public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { + this.executedQty = executedQty; + } + public PlaceMultipleOrdersResponseInner side(@jakarta.annotation.Nullable String side) { this.side = side; return this; @@ -212,6 +292,26 @@ public void setType(@jakarta.annotation.Nullable String type) { this.type = type; } + public PlaceMultipleOrdersResponseInner timeInForce( + @jakarta.annotation.Nullable String timeInForce) { + this.timeInForce = timeInForce; + return this; + } + + /** + * Get timeInForce + * + * @return timeInForce + */ + @jakarta.annotation.Nullable + public String getTimeInForce() { + return timeInForce; + } + + public void setTimeInForce(@jakarta.annotation.Nullable String timeInForce) { + this.timeInForce = timeInForce; + } + public PlaceMultipleOrdersResponseInner reduceOnly( @jakarta.annotation.Nullable Boolean reduceOnly) { this.reduceOnly = reduceOnly; @@ -232,24 +332,101 @@ public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { this.reduceOnly = reduceOnly; } - public PlaceMultipleOrdersResponseInner postOnly( - @jakarta.annotation.Nullable Boolean postOnly) { - this.postOnly = postOnly; + public PlaceMultipleOrdersResponseInner createTime( + @jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get createTime + * + * @return createTime + */ + @jakarta.annotation.Nullable + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(@jakarta.annotation.Nullable Long createTime) { + this.createTime = createTime; + } + + public PlaceMultipleOrdersResponseInner updateTime( + @jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + return this; + } + + /** + * Get updateTime + * + * @return updateTime + */ + @jakarta.annotation.Nullable + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { + this.updateTime = updateTime; + } + + public PlaceMultipleOrdersResponseInner status(@jakarta.annotation.Nullable String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @jakarta.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(@jakarta.annotation.Nullable String status) { + this.status = status; + } + + public PlaceMultipleOrdersResponseInner avgPrice(@jakarta.annotation.Nullable String avgPrice) { + this.avgPrice = avgPrice; return this; } /** - * Get postOnly + * Get avgPrice * - * @return postOnly + * @return avgPrice */ @jakarta.annotation.Nullable - public Boolean getPostOnly() { - return postOnly; + public String getAvgPrice() { + return avgPrice; } - public void setPostOnly(@jakarta.annotation.Nullable Boolean postOnly) { - this.postOnly = postOnly; + public void setAvgPrice(@jakarta.annotation.Nullable String avgPrice) { + this.avgPrice = avgPrice; + } + + public PlaceMultipleOrdersResponseInner source(@jakarta.annotation.Nullable String source) { + this.source = source; + return this; + } + + /** + * Get source + * + * @return source + */ + @jakarta.annotation.Nullable + public String getSource() { + return source; + } + + public void setSource(@jakarta.annotation.Nullable String source) { + this.source = source; } public PlaceMultipleOrdersResponseInner clientOrderId( @@ -272,6 +449,86 @@ public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) this.clientOrderId = clientOrderId; } + public PlaceMultipleOrdersResponseInner priceScale( + @jakarta.annotation.Nullable Long priceScale) { + this.priceScale = priceScale; + return this; + } + + /** + * Get priceScale + * + * @return priceScale + */ + @jakarta.annotation.Nullable + public Long getPriceScale() { + return priceScale; + } + + public void setPriceScale(@jakarta.annotation.Nullable Long priceScale) { + this.priceScale = priceScale; + } + + public PlaceMultipleOrdersResponseInner quantityScale( + @jakarta.annotation.Nullable Long quantityScale) { + this.quantityScale = quantityScale; + return this; + } + + /** + * Get quantityScale + * + * @return quantityScale + */ + @jakarta.annotation.Nullable + public Long getQuantityScale() { + return quantityScale; + } + + public void setQuantityScale(@jakarta.annotation.Nullable Long quantityScale) { + this.quantityScale = quantityScale; + } + + public PlaceMultipleOrdersResponseInner optionSide( + @jakarta.annotation.Nullable String optionSide) { + this.optionSide = optionSide; + return this; + } + + /** + * Get optionSide + * + * @return optionSide + */ + @jakarta.annotation.Nullable + public String getOptionSide() { + return optionSide; + } + + public void setOptionSide(@jakarta.annotation.Nullable String optionSide) { + this.optionSide = optionSide; + } + + public PlaceMultipleOrdersResponseInner quoteAsset( + @jakarta.annotation.Nullable String quoteAsset) { + this.quoteAsset = quoteAsset; + return this; + } + + /** + * Get quoteAsset + * + * @return quoteAsset + */ + @jakarta.annotation.Nullable + public String getQuoteAsset() { + return quoteAsset; + } + + public void setQuoteAsset(@jakarta.annotation.Nullable String quoteAsset) { + this.quoteAsset = quoteAsset; + } + public PlaceMultipleOrdersResponseInner mmp(@jakarta.annotation.Nullable Boolean mmp) { this.mmp = mmp; return this; @@ -305,12 +562,23 @@ public boolean equals(Object o) { && Objects.equals(this.symbol, placeMultipleOrdersResponseInner.symbol) && Objects.equals(this.price, placeMultipleOrdersResponseInner.price) && Objects.equals(this.quantity, placeMultipleOrdersResponseInner.quantity) + && Objects.equals(this.executedQty, placeMultipleOrdersResponseInner.executedQty) && Objects.equals(this.side, placeMultipleOrdersResponseInner.side) && Objects.equals(this.type, placeMultipleOrdersResponseInner.type) + && Objects.equals(this.timeInForce, placeMultipleOrdersResponseInner.timeInForce) && Objects.equals(this.reduceOnly, placeMultipleOrdersResponseInner.reduceOnly) - && Objects.equals(this.postOnly, placeMultipleOrdersResponseInner.postOnly) + && Objects.equals(this.createTime, placeMultipleOrdersResponseInner.createTime) + && Objects.equals(this.updateTime, placeMultipleOrdersResponseInner.updateTime) + && Objects.equals(this.status, placeMultipleOrdersResponseInner.status) + && Objects.equals(this.avgPrice, placeMultipleOrdersResponseInner.avgPrice) + && Objects.equals(this.source, placeMultipleOrdersResponseInner.source) && Objects.equals( this.clientOrderId, placeMultipleOrdersResponseInner.clientOrderId) + && Objects.equals(this.priceScale, placeMultipleOrdersResponseInner.priceScale) + && Objects.equals( + this.quantityScale, placeMultipleOrdersResponseInner.quantityScale) + && Objects.equals(this.optionSide, placeMultipleOrdersResponseInner.optionSide) + && Objects.equals(this.quoteAsset, placeMultipleOrdersResponseInner.quoteAsset) && Objects.equals(this.mmp, placeMultipleOrdersResponseInner.mmp); } @@ -321,11 +589,21 @@ public int hashCode() { symbol, price, quantity, + executedQty, side, type, + timeInForce, reduceOnly, - postOnly, + createTime, + updateTime, + status, + avgPrice, + source, clientOrderId, + priceScale, + quantityScale, + optionSide, + quoteAsset, mmp); } @@ -337,11 +615,21 @@ public String toString() { sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); sb.append(" side: ").append(toIndentedString(side)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); - sb.append(" postOnly: ").append(toIndentedString(postOnly)).append("\n"); + sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); + sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" avgPrice: ").append(toIndentedString(avgPrice)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); + sb.append(" priceScale: ").append(toIndentedString(priceScale)).append("\n"); + sb.append(" quantityScale: ").append(toIndentedString(quantityScale)).append("\n"); + sb.append(" optionSide: ").append(toIndentedString(optionSide)).append("\n"); + sb.append(" quoteAsset: ").append(toIndentedString(quoteAsset)).append("\n"); sb.append(" mmp: ").append(toIndentedString(mmp)).append("\n"); sb.append("}"); return sb.toString(); @@ -366,6 +654,10 @@ public String toUrlQueryString() { String quantityValueAsString = ""; quantityValueAsString = quantityValue.toString(); sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); + Object executedQtyValue = getExecutedQty(); + String executedQtyValueAsString = ""; + executedQtyValueAsString = executedQtyValue.toString(); + sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); Object sideValue = getSide(); String sideValueAsString = ""; sideValueAsString = sideValue.toString(); @@ -374,18 +666,54 @@ public String toUrlQueryString() { String typeValueAsString = ""; typeValueAsString = typeValue.toString(); sb.append("type=").append(urlEncode(typeValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); Object reduceOnlyValue = getReduceOnly(); String reduceOnlyValueAsString = ""; reduceOnlyValueAsString = reduceOnlyValue.toString(); sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); - Object postOnlyValue = getPostOnly(); - String postOnlyValueAsString = ""; - postOnlyValueAsString = postOnlyValue.toString(); - sb.append("postOnly=").append(urlEncode(postOnlyValueAsString)).append(""); + Object createTimeValue = getCreateTime(); + String createTimeValueAsString = ""; + createTimeValueAsString = createTimeValue.toString(); + sb.append("createTime=").append(urlEncode(createTimeValueAsString)).append(""); + Object updateTimeValue = getUpdateTime(); + String updateTimeValueAsString = ""; + updateTimeValueAsString = updateTimeValue.toString(); + sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).append(""); + Object statusValue = getStatus(); + String statusValueAsString = ""; + statusValueAsString = statusValue.toString(); + sb.append("status=").append(urlEncode(statusValueAsString)).append(""); + Object avgPriceValue = getAvgPrice(); + String avgPriceValueAsString = ""; + avgPriceValueAsString = avgPriceValue.toString(); + sb.append("avgPrice=").append(urlEncode(avgPriceValueAsString)).append(""); + Object sourceValue = getSource(); + String sourceValueAsString = ""; + sourceValueAsString = sourceValue.toString(); + sb.append("source=").append(urlEncode(sourceValueAsString)).append(""); Object clientOrderIdValue = getClientOrderId(); String clientOrderIdValueAsString = ""; clientOrderIdValueAsString = clientOrderIdValue.toString(); sb.append("clientOrderId=").append(urlEncode(clientOrderIdValueAsString)).append(""); + Object priceScaleValue = getPriceScale(); + String priceScaleValueAsString = ""; + priceScaleValueAsString = priceScaleValue.toString(); + sb.append("priceScale=").append(urlEncode(priceScaleValueAsString)).append(""); + Object quantityScaleValue = getQuantityScale(); + String quantityScaleValueAsString = ""; + quantityScaleValueAsString = quantityScaleValue.toString(); + sb.append("quantityScale=").append(urlEncode(quantityScaleValueAsString)).append(""); + Object optionSideValue = getOptionSide(); + String optionSideValueAsString = ""; + optionSideValueAsString = optionSideValue.toString(); + sb.append("optionSide=").append(urlEncode(optionSideValueAsString)).append(""); + Object quoteAssetValue = getQuoteAsset(); + String quoteAssetValueAsString = ""; + quoteAssetValueAsString = quoteAssetValue.toString(); + sb.append("quoteAsset=").append(urlEncode(quoteAssetValueAsString)).append(""); Object mmpValue = getMmp(); String mmpValueAsString = ""; mmpValueAsString = mmpValue.toString(); @@ -422,11 +750,21 @@ private String toIndentedString(Object o) { openapiFields.add("symbol"); openapiFields.add("price"); openapiFields.add("quantity"); + openapiFields.add("executedQty"); openapiFields.add("side"); openapiFields.add("type"); + openapiFields.add("timeInForce"); openapiFields.add("reduceOnly"); - openapiFields.add("postOnly"); + openapiFields.add("createTime"); + openapiFields.add("updateTime"); + openapiFields.add("status"); + openapiFields.add("avgPrice"); + openapiFields.add("source"); openapiFields.add("clientOrderId"); + openapiFields.add("priceScale"); + openapiFields.add("quantityScale"); + openapiFields.add("optionSide"); + openapiFields.add("quoteAsset"); openapiFields.add("mmp"); // a set of required properties/fields (JSON key names) @@ -476,6 +814,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("quantity").toString())); } + if ((jsonObj.get("executedQty") != null && !jsonObj.get("executedQty").isJsonNull()) + && !jsonObj.get("executedQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `executedQty` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("executedQty").toString())); + } if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) && !jsonObj.get("side").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -492,6 +838,38 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("type").toString())); } + if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) + && !jsonObj.get("timeInForce").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timeInForce` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timeInForce").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) + && !jsonObj.get("avgPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `avgPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("avgPrice").toString())); + } + if ((jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) + && !jsonObj.get("source").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `source` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("source").toString())); + } if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) && !jsonObj.get("clientOrderId").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -500,6 +878,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("clientOrderId").toString())); } + if ((jsonObj.get("optionSide") != null && !jsonObj.get("optionSide").isJsonNull()) + && !jsonObj.get("optionSide").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `optionSide` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("optionSide").toString())); + } + if ((jsonObj.get("quoteAsset") != null && !jsonObj.get("quoteAsset").isJsonNull()) + && !jsonObj.get("quoteAsset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `quoteAsset` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("quoteAsset").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QueryCurrentOpenOptionOrdersResponseInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QueryCurrentOpenOptionOrdersResponseInner.java index 63c4dc4fa..843d45ca4 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QueryCurrentOpenOptionOrdersResponseInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QueryCurrentOpenOptionOrdersResponseInner.java @@ -66,12 +66,6 @@ public class QueryCurrentOpenOptionOrdersResponseInner { @jakarta.annotation.Nullable private String executedQty; - public static final String SERIALIZED_NAME_FEE = "fee"; - - @SerializedName(SERIALIZED_NAME_FEE) - @jakarta.annotation.Nullable - private String fee; - public static final String SERIALIZED_NAME_SIDE = "side"; @SerializedName(SERIALIZED_NAME_SIDE) @@ -96,12 +90,6 @@ public class QueryCurrentOpenOptionOrdersResponseInner { @jakarta.annotation.Nullable private Boolean reduceOnly; - public static final String SERIALIZED_NAME_POST_ONLY = "postOnly"; - - @SerializedName(SERIALIZED_NAME_POST_ONLY) - @jakarta.annotation.Nullable - private Boolean postOnly; - public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; @SerializedName(SERIALIZED_NAME_CREATE_TIME) @@ -264,25 +252,6 @@ public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { this.executedQty = executedQty; } - public QueryCurrentOpenOptionOrdersResponseInner fee(@jakarta.annotation.Nullable String fee) { - this.fee = fee; - return this; - } - - /** - * Get fee - * - * @return fee - */ - @jakarta.annotation.Nullable - public String getFee() { - return fee; - } - - public void setFee(@jakarta.annotation.Nullable String fee) { - this.fee = fee; - } - public QueryCurrentOpenOptionOrdersResponseInner side( @jakarta.annotation.Nullable String side) { this.side = side; @@ -363,26 +332,6 @@ public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { this.reduceOnly = reduceOnly; } - public QueryCurrentOpenOptionOrdersResponseInner postOnly( - @jakarta.annotation.Nullable Boolean postOnly) { - this.postOnly = postOnly; - return this; - } - - /** - * Get postOnly - * - * @return postOnly - */ - @jakarta.annotation.Nullable - public Boolean getPostOnly() { - return postOnly; - } - - public void setPostOnly(@jakarta.annotation.Nullable Boolean postOnly) { - this.postOnly = postOnly; - } - public QueryCurrentOpenOptionOrdersResponseInner createTime( @jakarta.annotation.Nullable Long createTime) { this.createTime = createTime; @@ -598,14 +547,12 @@ public boolean equals(Object o) { && Objects.equals(this.quantity, queryCurrentOpenOptionOrdersResponseInner.quantity) && Objects.equals( this.executedQty, queryCurrentOpenOptionOrdersResponseInner.executedQty) - && Objects.equals(this.fee, queryCurrentOpenOptionOrdersResponseInner.fee) && Objects.equals(this.side, queryCurrentOpenOptionOrdersResponseInner.side) && Objects.equals(this.type, queryCurrentOpenOptionOrdersResponseInner.type) && Objects.equals( this.timeInForce, queryCurrentOpenOptionOrdersResponseInner.timeInForce) && Objects.equals( this.reduceOnly, queryCurrentOpenOptionOrdersResponseInner.reduceOnly) - && Objects.equals(this.postOnly, queryCurrentOpenOptionOrdersResponseInner.postOnly) && Objects.equals( this.createTime, queryCurrentOpenOptionOrdersResponseInner.createTime) && Objects.equals( @@ -633,12 +580,10 @@ public int hashCode() { price, quantity, executedQty, - fee, side, type, timeInForce, reduceOnly, - postOnly, createTime, updateTime, status, @@ -660,12 +605,10 @@ public String toString() { sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); - sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); sb.append(" side: ").append(toIndentedString(side)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); - sb.append(" postOnly: ").append(toIndentedString(postOnly)).append("\n"); sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); @@ -703,10 +646,6 @@ public String toUrlQueryString() { String executedQtyValueAsString = ""; executedQtyValueAsString = executedQtyValue.toString(); sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); - Object feeValue = getFee(); - String feeValueAsString = ""; - feeValueAsString = feeValue.toString(); - sb.append("fee=").append(urlEncode(feeValueAsString)).append(""); Object sideValue = getSide(); String sideValueAsString = ""; sideValueAsString = sideValue.toString(); @@ -723,10 +662,6 @@ public String toUrlQueryString() { String reduceOnlyValueAsString = ""; reduceOnlyValueAsString = reduceOnlyValue.toString(); sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); - Object postOnlyValue = getPostOnly(); - String postOnlyValueAsString = ""; - postOnlyValueAsString = postOnlyValue.toString(); - sb.append("postOnly=").append(urlEncode(postOnlyValueAsString)).append(""); Object createTimeValue = getCreateTime(); String createTimeValueAsString = ""; createTimeValueAsString = createTimeValue.toString(); @@ -800,12 +735,10 @@ private String toIndentedString(Object o) { openapiFields.add("price"); openapiFields.add("quantity"); openapiFields.add("executedQty"); - openapiFields.add("fee"); openapiFields.add("side"); openapiFields.add("type"); openapiFields.add("timeInForce"); openapiFields.add("reduceOnly"); - openapiFields.add("postOnly"); openapiFields.add("createTime"); openapiFields.add("updateTime"); openapiFields.add("status"); @@ -874,14 +807,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("executedQty").toString())); } - if ((jsonObj.get("fee") != null && !jsonObj.get("fee").isJsonNull()) - && !jsonObj.get("fee").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `fee` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("fee").toString())); - } if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) && !jsonObj.get("side").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QueryOptionOrderHistoryResponseInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QueryOptionOrderHistoryResponseInner.java index 59555b3d8..557dc3b94 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QueryOptionOrderHistoryResponseInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QueryOptionOrderHistoryResponseInner.java @@ -66,12 +66,6 @@ public class QueryOptionOrderHistoryResponseInner { @jakarta.annotation.Nullable private String executedQty; - public static final String SERIALIZED_NAME_FEE = "fee"; - - @SerializedName(SERIALIZED_NAME_FEE) - @jakarta.annotation.Nullable - private String fee; - public static final String SERIALIZED_NAME_SIDE = "side"; @SerializedName(SERIALIZED_NAME_SIDE) @@ -96,12 +90,6 @@ public class QueryOptionOrderHistoryResponseInner { @jakarta.annotation.Nullable private Boolean reduceOnly; - public static final String SERIALIZED_NAME_POST_ONLY = "postOnly"; - - @SerializedName(SERIALIZED_NAME_POST_ONLY) - @jakarta.annotation.Nullable - private Boolean postOnly; - public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; @SerializedName(SERIALIZED_NAME_CREATE_TIME) @@ -120,24 +108,12 @@ public class QueryOptionOrderHistoryResponseInner { @jakarta.annotation.Nullable private String status; - public static final String SERIALIZED_NAME_REASON = "reason"; - - @SerializedName(SERIALIZED_NAME_REASON) - @jakarta.annotation.Nullable - private String reason; - public static final String SERIALIZED_NAME_AVG_PRICE = "avgPrice"; @SerializedName(SERIALIZED_NAME_AVG_PRICE) @jakarta.annotation.Nullable private String avgPrice; - public static final String SERIALIZED_NAME_SOURCE = "source"; - - @SerializedName(SERIALIZED_NAME_SOURCE) - @jakarta.annotation.Nullable - private String source; - public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) @@ -273,25 +249,6 @@ public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { this.executedQty = executedQty; } - public QueryOptionOrderHistoryResponseInner fee(@jakarta.annotation.Nullable String fee) { - this.fee = fee; - return this; - } - - /** - * Get fee - * - * @return fee - */ - @jakarta.annotation.Nullable - public String getFee() { - return fee; - } - - public void setFee(@jakarta.annotation.Nullable String fee) { - this.fee = fee; - } - public QueryOptionOrderHistoryResponseInner side(@jakarta.annotation.Nullable String side) { this.side = side; return this; @@ -370,26 +327,6 @@ public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { this.reduceOnly = reduceOnly; } - public QueryOptionOrderHistoryResponseInner postOnly( - @jakarta.annotation.Nullable Boolean postOnly) { - this.postOnly = postOnly; - return this; - } - - /** - * Get postOnly - * - * @return postOnly - */ - @jakarta.annotation.Nullable - public Boolean getPostOnly() { - return postOnly; - } - - public void setPostOnly(@jakarta.annotation.Nullable Boolean postOnly) { - this.postOnly = postOnly; - } - public QueryOptionOrderHistoryResponseInner createTime( @jakarta.annotation.Nullable Long createTime) { this.createTime = createTime; @@ -449,25 +386,6 @@ public void setStatus(@jakarta.annotation.Nullable String status) { this.status = status; } - public QueryOptionOrderHistoryResponseInner reason(@jakarta.annotation.Nullable String reason) { - this.reason = reason; - return this; - } - - /** - * Get reason - * - * @return reason - */ - @jakarta.annotation.Nullable - public String getReason() { - return reason; - } - - public void setReason(@jakarta.annotation.Nullable String reason) { - this.reason = reason; - } - public QueryOptionOrderHistoryResponseInner avgPrice( @jakarta.annotation.Nullable String avgPrice) { this.avgPrice = avgPrice; @@ -488,25 +406,6 @@ public void setAvgPrice(@jakarta.annotation.Nullable String avgPrice) { this.avgPrice = avgPrice; } - public QueryOptionOrderHistoryResponseInner source(@jakarta.annotation.Nullable String source) { - this.source = source; - return this; - } - - /** - * Get source - * - * @return source - */ - @jakarta.annotation.Nullable - public String getSource() { - return source; - } - - public void setSource(@jakarta.annotation.Nullable String source) { - this.source = source; - } - public QueryOptionOrderHistoryResponseInner clientOrderId( @jakarta.annotation.Nullable String clientOrderId) { this.clientOrderId = clientOrderId; @@ -642,19 +541,15 @@ public boolean equals(Object o) { && Objects.equals(this.quantity, queryOptionOrderHistoryResponseInner.quantity) && Objects.equals( this.executedQty, queryOptionOrderHistoryResponseInner.executedQty) - && Objects.equals(this.fee, queryOptionOrderHistoryResponseInner.fee) && Objects.equals(this.side, queryOptionOrderHistoryResponseInner.side) && Objects.equals(this.type, queryOptionOrderHistoryResponseInner.type) && Objects.equals( this.timeInForce, queryOptionOrderHistoryResponseInner.timeInForce) && Objects.equals(this.reduceOnly, queryOptionOrderHistoryResponseInner.reduceOnly) - && Objects.equals(this.postOnly, queryOptionOrderHistoryResponseInner.postOnly) && Objects.equals(this.createTime, queryOptionOrderHistoryResponseInner.createTime) && Objects.equals(this.updateTime, queryOptionOrderHistoryResponseInner.updateTime) && Objects.equals(this.status, queryOptionOrderHistoryResponseInner.status) - && Objects.equals(this.reason, queryOptionOrderHistoryResponseInner.reason) && Objects.equals(this.avgPrice, queryOptionOrderHistoryResponseInner.avgPrice) - && Objects.equals(this.source, queryOptionOrderHistoryResponseInner.source) && Objects.equals( this.clientOrderId, queryOptionOrderHistoryResponseInner.clientOrderId) && Objects.equals(this.priceScale, queryOptionOrderHistoryResponseInner.priceScale) @@ -673,18 +568,14 @@ public int hashCode() { price, quantity, executedQty, - fee, side, type, timeInForce, reduceOnly, - postOnly, createTime, updateTime, status, - reason, avgPrice, - source, clientOrderId, priceScale, quantityScale, @@ -702,18 +593,14 @@ public String toString() { sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); - sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); sb.append(" side: ").append(toIndentedString(side)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); - sb.append(" postOnly: ").append(toIndentedString(postOnly)).append("\n"); sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); sb.append(" avgPrice: ").append(toIndentedString(avgPrice)).append("\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); sb.append(" priceScale: ").append(toIndentedString(priceScale)).append("\n"); sb.append(" quantityScale: ").append(toIndentedString(quantityScale)).append("\n"); @@ -747,10 +634,6 @@ public String toUrlQueryString() { String executedQtyValueAsString = ""; executedQtyValueAsString = executedQtyValue.toString(); sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); - Object feeValue = getFee(); - String feeValueAsString = ""; - feeValueAsString = feeValue.toString(); - sb.append("fee=").append(urlEncode(feeValueAsString)).append(""); Object sideValue = getSide(); String sideValueAsString = ""; sideValueAsString = sideValue.toString(); @@ -767,10 +650,6 @@ public String toUrlQueryString() { String reduceOnlyValueAsString = ""; reduceOnlyValueAsString = reduceOnlyValue.toString(); sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); - Object postOnlyValue = getPostOnly(); - String postOnlyValueAsString = ""; - postOnlyValueAsString = postOnlyValue.toString(); - sb.append("postOnly=").append(urlEncode(postOnlyValueAsString)).append(""); Object createTimeValue = getCreateTime(); String createTimeValueAsString = ""; createTimeValueAsString = createTimeValue.toString(); @@ -783,18 +662,10 @@ public String toUrlQueryString() { String statusValueAsString = ""; statusValueAsString = statusValue.toString(); sb.append("status=").append(urlEncode(statusValueAsString)).append(""); - Object reasonValue = getReason(); - String reasonValueAsString = ""; - reasonValueAsString = reasonValue.toString(); - sb.append("reason=").append(urlEncode(reasonValueAsString)).append(""); Object avgPriceValue = getAvgPrice(); String avgPriceValueAsString = ""; avgPriceValueAsString = avgPriceValue.toString(); sb.append("avgPrice=").append(urlEncode(avgPriceValueAsString)).append(""); - Object sourceValue = getSource(); - String sourceValueAsString = ""; - sourceValueAsString = sourceValue.toString(); - sb.append("source=").append(urlEncode(sourceValueAsString)).append(""); Object clientOrderIdValue = getClientOrderId(); String clientOrderIdValueAsString = ""; clientOrderIdValueAsString = clientOrderIdValue.toString(); @@ -852,18 +723,14 @@ private String toIndentedString(Object o) { openapiFields.add("price"); openapiFields.add("quantity"); openapiFields.add("executedQty"); - openapiFields.add("fee"); openapiFields.add("side"); openapiFields.add("type"); openapiFields.add("timeInForce"); openapiFields.add("reduceOnly"); - openapiFields.add("postOnly"); openapiFields.add("createTime"); openapiFields.add("updateTime"); openapiFields.add("status"); - openapiFields.add("reason"); openapiFields.add("avgPrice"); - openapiFields.add("source"); openapiFields.add("clientOrderId"); openapiFields.add("priceScale"); openapiFields.add("quantityScale"); @@ -927,14 +794,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("executedQty").toString())); } - if ((jsonObj.get("fee") != null && !jsonObj.get("fee").isJsonNull()) - && !jsonObj.get("fee").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `fee` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("fee").toString())); - } if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) && !jsonObj.get("side").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -967,14 +826,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("status").toString())); } - if ((jsonObj.get("reason") != null && !jsonObj.get("reason").isJsonNull()) - && !jsonObj.get("reason").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `reason` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("reason").toString())); - } if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) && !jsonObj.get("avgPrice").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -983,14 +834,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("avgPrice").toString())); } - if ((jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) - && !jsonObj.get("source").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `source` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("source").toString())); - } if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) && !jsonObj.get("clientOrderId").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QuerySingleOrderResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QuerySingleOrderResponse.java index a86c2de18..204a442c7 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QuerySingleOrderResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/QuerySingleOrderResponse.java @@ -66,12 +66,6 @@ public class QuerySingleOrderResponse { @jakarta.annotation.Nullable private String executedQty; - public static final String SERIALIZED_NAME_FEE = "fee"; - - @SerializedName(SERIALIZED_NAME_FEE) - @jakarta.annotation.Nullable - private String fee; - public static final String SERIALIZED_NAME_SIDE = "side"; @SerializedName(SERIALIZED_NAME_SIDE) @@ -96,12 +90,6 @@ public class QuerySingleOrderResponse { @jakarta.annotation.Nullable private Boolean reduceOnly; - public static final String SERIALIZED_NAME_POST_ONLY = "postOnly"; - - @SerializedName(SERIALIZED_NAME_POST_ONLY) - @jakarta.annotation.Nullable - private Boolean postOnly; - public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; @SerializedName(SERIALIZED_NAME_CREATE_TIME) @@ -126,12 +114,6 @@ public class QuerySingleOrderResponse { @jakarta.annotation.Nullable private String avgPrice; - public static final String SERIALIZED_NAME_SOURCE = "source"; - - @SerializedName(SERIALIZED_NAME_SOURCE) - @jakarta.annotation.Nullable - private String source; - public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) @@ -265,25 +247,6 @@ public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { this.executedQty = executedQty; } - public QuerySingleOrderResponse fee(@jakarta.annotation.Nullable String fee) { - this.fee = fee; - return this; - } - - /** - * Get fee - * - * @return fee - */ - @jakarta.annotation.Nullable - public String getFee() { - return fee; - } - - public void setFee(@jakarta.annotation.Nullable String fee) { - this.fee = fee; - } - public QuerySingleOrderResponse side(@jakarta.annotation.Nullable String side) { this.side = side; return this; @@ -360,25 +323,6 @@ public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { this.reduceOnly = reduceOnly; } - public QuerySingleOrderResponse postOnly(@jakarta.annotation.Nullable Boolean postOnly) { - this.postOnly = postOnly; - return this; - } - - /** - * Get postOnly - * - * @return postOnly - */ - @jakarta.annotation.Nullable - public Boolean getPostOnly() { - return postOnly; - } - - public void setPostOnly(@jakarta.annotation.Nullable Boolean postOnly) { - this.postOnly = postOnly; - } - public QuerySingleOrderResponse createTime(@jakarta.annotation.Nullable Long createTime) { this.createTime = createTime; return this; @@ -455,25 +399,6 @@ public void setAvgPrice(@jakarta.annotation.Nullable String avgPrice) { this.avgPrice = avgPrice; } - public QuerySingleOrderResponse source(@jakarta.annotation.Nullable String source) { - this.source = source; - return this; - } - - /** - * Get source - * - * @return source - */ - @jakarta.annotation.Nullable - public String getSource() { - return source; - } - - public void setSource(@jakarta.annotation.Nullable String source) { - this.source = source; - } - public QuerySingleOrderResponse clientOrderId( @jakarta.annotation.Nullable String clientOrderId) { this.clientOrderId = clientOrderId; @@ -603,17 +528,14 @@ public boolean equals(Object o) { && Objects.equals(this.price, querySingleOrderResponse.price) && Objects.equals(this.quantity, querySingleOrderResponse.quantity) && Objects.equals(this.executedQty, querySingleOrderResponse.executedQty) - && Objects.equals(this.fee, querySingleOrderResponse.fee) && Objects.equals(this.side, querySingleOrderResponse.side) && Objects.equals(this.type, querySingleOrderResponse.type) && Objects.equals(this.timeInForce, querySingleOrderResponse.timeInForce) && Objects.equals(this.reduceOnly, querySingleOrderResponse.reduceOnly) - && Objects.equals(this.postOnly, querySingleOrderResponse.postOnly) && Objects.equals(this.createTime, querySingleOrderResponse.createTime) && Objects.equals(this.updateTime, querySingleOrderResponse.updateTime) && Objects.equals(this.status, querySingleOrderResponse.status) && Objects.equals(this.avgPrice, querySingleOrderResponse.avgPrice) - && Objects.equals(this.source, querySingleOrderResponse.source) && Objects.equals(this.clientOrderId, querySingleOrderResponse.clientOrderId) && Objects.equals(this.priceScale, querySingleOrderResponse.priceScale) && Objects.equals(this.quantityScale, querySingleOrderResponse.quantityScale) @@ -630,17 +552,14 @@ public int hashCode() { price, quantity, executedQty, - fee, side, type, timeInForce, reduceOnly, - postOnly, createTime, updateTime, status, avgPrice, - source, clientOrderId, priceScale, quantityScale, @@ -658,17 +577,14 @@ public String toString() { sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); - sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); sb.append(" side: ").append(toIndentedString(side)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); - sb.append(" postOnly: ").append(toIndentedString(postOnly)).append("\n"); sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" avgPrice: ").append(toIndentedString(avgPrice)).append("\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); sb.append(" priceScale: ").append(toIndentedString(priceScale)).append("\n"); sb.append(" quantityScale: ").append(toIndentedString(quantityScale)).append("\n"); @@ -702,10 +618,6 @@ public String toUrlQueryString() { String executedQtyValueAsString = ""; executedQtyValueAsString = executedQtyValue.toString(); sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); - Object feeValue = getFee(); - String feeValueAsString = ""; - feeValueAsString = feeValue.toString(); - sb.append("fee=").append(urlEncode(feeValueAsString)).append(""); Object sideValue = getSide(); String sideValueAsString = ""; sideValueAsString = sideValue.toString(); @@ -722,10 +634,6 @@ public String toUrlQueryString() { String reduceOnlyValueAsString = ""; reduceOnlyValueAsString = reduceOnlyValue.toString(); sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); - Object postOnlyValue = getPostOnly(); - String postOnlyValueAsString = ""; - postOnlyValueAsString = postOnlyValue.toString(); - sb.append("postOnly=").append(urlEncode(postOnlyValueAsString)).append(""); Object createTimeValue = getCreateTime(); String createTimeValueAsString = ""; createTimeValueAsString = createTimeValue.toString(); @@ -742,10 +650,6 @@ public String toUrlQueryString() { String avgPriceValueAsString = ""; avgPriceValueAsString = avgPriceValue.toString(); sb.append("avgPrice=").append(urlEncode(avgPriceValueAsString)).append(""); - Object sourceValue = getSource(); - String sourceValueAsString = ""; - sourceValueAsString = sourceValue.toString(); - sb.append("source=").append(urlEncode(sourceValueAsString)).append(""); Object clientOrderIdValue = getClientOrderId(); String clientOrderIdValueAsString = ""; clientOrderIdValueAsString = clientOrderIdValue.toString(); @@ -803,17 +707,14 @@ private String toIndentedString(Object o) { openapiFields.add("price"); openapiFields.add("quantity"); openapiFields.add("executedQty"); - openapiFields.add("fee"); openapiFields.add("side"); openapiFields.add("type"); openapiFields.add("timeInForce"); openapiFields.add("reduceOnly"); - openapiFields.add("postOnly"); openapiFields.add("createTime"); openapiFields.add("updateTime"); openapiFields.add("status"); openapiFields.add("avgPrice"); - openapiFields.add("source"); openapiFields.add("clientOrderId"); openapiFields.add("priceScale"); openapiFields.add("quantityScale"); @@ -875,14 +776,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("executedQty").toString())); } - if ((jsonObj.get("fee") != null && !jsonObj.get("fee").isJsonNull()) - && !jsonObj.get("fee").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `fee` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("fee").toString())); - } if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) && !jsonObj.get("side").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -923,14 +816,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("avgPrice").toString())); } - if ((jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) - && !jsonObj.get("source").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `source` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("source").toString())); - } if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) && !jsonObj.get("clientOrderId").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/RecentTradesListResponseInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/RecentTradesListResponseInner.java index b675df65e..aaaecdef0 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/RecentTradesListResponseInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/RecentTradesListResponseInner.java @@ -40,7 +40,13 @@ public class RecentTradesListResponseInner { @SerializedName(SERIALIZED_NAME_ID) @jakarta.annotation.Nullable - private String id; + private Long id; + + public static final String SERIALIZED_NAME_TRADE_ID = "tradeId"; + + @SerializedName(SERIALIZED_NAME_TRADE_ID) + @jakarta.annotation.Nullable + private Long tradeId; public static final String SERIALIZED_NAME_SYMBOL = "symbol"; @@ -80,7 +86,7 @@ public class RecentTradesListResponseInner { public RecentTradesListResponseInner() {} - public RecentTradesListResponseInner id(@jakarta.annotation.Nullable String id) { + public RecentTradesListResponseInner id(@jakarta.annotation.Nullable Long id) { this.id = id; return this; } @@ -91,14 +97,33 @@ public RecentTradesListResponseInner id(@jakarta.annotation.Nullable String id) * @return id */ @jakarta.annotation.Nullable - public String getId() { + public Long getId() { return id; } - public void setId(@jakarta.annotation.Nullable String id) { + public void setId(@jakarta.annotation.Nullable Long id) { this.id = id; } + public RecentTradesListResponseInner tradeId(@jakarta.annotation.Nullable Long tradeId) { + this.tradeId = tradeId; + return this; + } + + /** + * Get tradeId + * + * @return tradeId + */ + @jakarta.annotation.Nullable + public Long getTradeId() { + return tradeId; + } + + public void setTradeId(@jakarta.annotation.Nullable Long tradeId) { + this.tradeId = tradeId; + } + public RecentTradesListResponseInner symbol(@jakarta.annotation.Nullable String symbol) { this.symbol = symbol; return this; @@ -224,6 +249,7 @@ public boolean equals(Object o) { RecentTradesListResponseInner recentTradesListResponseInner = (RecentTradesListResponseInner) o; return Objects.equals(this.id, recentTradesListResponseInner.id) + && Objects.equals(this.tradeId, recentTradesListResponseInner.tradeId) && Objects.equals(this.symbol, recentTradesListResponseInner.symbol) && Objects.equals(this.price, recentTradesListResponseInner.price) && Objects.equals(this.qty, recentTradesListResponseInner.qty) @@ -234,7 +260,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(id, symbol, price, qty, quoteQty, side, time); + return Objects.hash(id, tradeId, symbol, price, qty, quoteQty, side, time); } @Override @@ -242,6 +268,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class RecentTradesListResponseInner {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" tradeId: ").append(toIndentedString(tradeId)).append("\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" qty: ").append(toIndentedString(qty)).append("\n"); @@ -259,6 +286,10 @@ public String toUrlQueryString() { String idValueAsString = ""; idValueAsString = idValue.toString(); sb.append("id=").append(urlEncode(idValueAsString)).append(""); + Object tradeIdValue = getTradeId(); + String tradeIdValueAsString = ""; + tradeIdValueAsString = tradeIdValue.toString(); + sb.append("tradeId=").append(urlEncode(tradeIdValueAsString)).append(""); Object symbolValue = getSymbol(); String symbolValueAsString = ""; symbolValueAsString = symbolValue.toString(); @@ -312,6 +343,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("id"); + openapiFields.add("tradeId"); openapiFields.add("symbol"); openapiFields.add("price"); openapiFields.add("qty"); @@ -342,14 +374,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) && !jsonObj.get("symbol").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/StartUserDataStreamResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/StartUserDataStreamResponse.java index aa9300811..d2d015e2d 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/StartUserDataStreamResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/StartUserDataStreamResponse.java @@ -42,6 +42,12 @@ public class StartUserDataStreamResponse { @jakarta.annotation.Nullable private String listenKey; + public static final String SERIALIZED_NAME_EXPIRATION = "expiration"; + + @SerializedName(SERIALIZED_NAME_EXPIRATION) + @jakarta.annotation.Nullable + private Long expiration; + public StartUserDataStreamResponse() {} public StartUserDataStreamResponse listenKey(@jakarta.annotation.Nullable String listenKey) { @@ -63,6 +69,25 @@ public void setListenKey(@jakarta.annotation.Nullable String listenKey) { this.listenKey = listenKey; } + public StartUserDataStreamResponse expiration(@jakarta.annotation.Nullable Long expiration) { + this.expiration = expiration; + return this; + } + + /** + * Get expiration + * + * @return expiration + */ + @jakarta.annotation.Nullable + public Long getExpiration() { + return expiration; + } + + public void setExpiration(@jakarta.annotation.Nullable Long expiration) { + this.expiration = expiration; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -72,12 +97,13 @@ public boolean equals(Object o) { return false; } StartUserDataStreamResponse startUserDataStreamResponse = (StartUserDataStreamResponse) o; - return Objects.equals(this.listenKey, startUserDataStreamResponse.listenKey); + return Objects.equals(this.listenKey, startUserDataStreamResponse.listenKey) + && Objects.equals(this.expiration, startUserDataStreamResponse.expiration); } @Override public int hashCode() { - return Objects.hash(listenKey); + return Objects.hash(listenKey, expiration); } @Override @@ -85,6 +111,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class StartUserDataStreamResponse {\n"); sb.append(" listenKey: ").append(toIndentedString(listenKey)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); sb.append("}"); return sb.toString(); } @@ -96,6 +123,10 @@ public String toUrlQueryString() { String listenKeyValueAsString = ""; listenKeyValueAsString = listenKeyValue.toString(); sb.append("listenKey=").append(urlEncode(listenKeyValueAsString)).append(""); + Object expirationValue = getExpiration(); + String expirationValueAsString = ""; + expirationValueAsString = expirationValue.toString(); + sb.append("expiration=").append(urlEncode(expirationValueAsString)).append(""); return sb.toString(); } @@ -125,6 +156,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("listenKey"); + openapiFields.add("expiration"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/TimeInForce.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/TimeInForce.java index 7a538e4c5..5d8be4275 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/TimeInForce.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/TimeInForce.java @@ -28,7 +28,9 @@ public enum TimeInForce { IOC("IOC"), - FOK("FOK"); + FOK("FOK"), + + GTX("GTX"); private String value; diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/SymbolPriceTickerResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/UserCommissionResponse.java similarity index 51% rename from clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/SymbolPriceTickerResponse.java rename to clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/UserCommissionResponse.java index 70408cfbd..733fce6d5 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/SymbolPriceTickerResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/UserCommissionResponse.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_options.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; @@ -22,70 +23,64 @@ import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; import jakarta.validation.constraints.*; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; import java.util.HashSet; +import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; -/** SymbolPriceTickerResponse */ +/** UserCommissionResponse */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class SymbolPriceTickerResponse { - public static final String SERIALIZED_NAME_TIME = "time"; +public class UserCommissionResponse { + public static final String SERIALIZED_NAME_COMMISSIONS = "commissions"; - @SerializedName(SERIALIZED_NAME_TIME) + @SerializedName(SERIALIZED_NAME_COMMISSIONS) @jakarta.annotation.Nullable - private Long time; + private List<@Valid UserCommissionResponseCommissionsInner> commissions; - public static final String SERIALIZED_NAME_INDEX_PRICE = "indexPrice"; + public UserCommissionResponse() {} - @SerializedName(SERIALIZED_NAME_INDEX_PRICE) - @jakarta.annotation.Nullable - private String indexPrice; - - public SymbolPriceTickerResponse() {} - - public SymbolPriceTickerResponse time(@jakarta.annotation.Nullable Long time) { - this.time = time; + public UserCommissionResponse commissions( + @jakarta.annotation.Nullable + List<@Valid UserCommissionResponseCommissionsInner> commissions) { + this.commissions = commissions; return this; } - /** - * Get time - * - * @return time - */ - @jakarta.annotation.Nullable - public Long getTime() { - return time; - } - - public void setTime(@jakarta.annotation.Nullable Long time) { - this.time = time; - } - - public SymbolPriceTickerResponse indexPrice(@jakarta.annotation.Nullable String indexPrice) { - this.indexPrice = indexPrice; + public UserCommissionResponse addCommissionsItem( + UserCommissionResponseCommissionsInner commissionsItem) { + if (this.commissions == null) { + this.commissions = new ArrayList<>(); + } + this.commissions.add(commissionsItem); return this; } /** - * Get indexPrice + * Get commissions * - * @return indexPrice + * @return commissions */ @jakarta.annotation.Nullable - public String getIndexPrice() { - return indexPrice; + @Valid + public List<@Valid UserCommissionResponseCommissionsInner> getCommissions() { + return commissions; } - public void setIndexPrice(@jakarta.annotation.Nullable String indexPrice) { - this.indexPrice = indexPrice; + public void setCommissions( + @jakarta.annotation.Nullable + List<@Valid UserCommissionResponseCommissionsInner> commissions) { + this.commissions = commissions; } @Override @@ -96,22 +91,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SymbolPriceTickerResponse symbolPriceTickerResponse = (SymbolPriceTickerResponse) o; - return Objects.equals(this.time, symbolPriceTickerResponse.time) - && Objects.equals(this.indexPrice, symbolPriceTickerResponse.indexPrice); + UserCommissionResponse userCommissionResponse = (UserCommissionResponse) o; + return Objects.equals(this.commissions, userCommissionResponse.commissions); } @Override public int hashCode() { - return Objects.hash(time, indexPrice); + return Objects.hash(commissions); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class SymbolPriceTickerResponse {\n"); - sb.append(" time: ").append(toIndentedString(time)).append("\n"); - sb.append(" indexPrice: ").append(toIndentedString(indexPrice)).append("\n"); + sb.append("class UserCommissionResponse {\n"); + sb.append(" commissions: ").append(toIndentedString(commissions)).append("\n"); sb.append("}"); return sb.toString(); } @@ -119,14 +112,13 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); - Object timeValue = getTime(); - String timeValueAsString = ""; - timeValueAsString = timeValue.toString(); - sb.append("time=").append(urlEncode(timeValueAsString)).append(""); - Object indexPriceValue = getIndexPrice(); - String indexPriceValueAsString = ""; - indexPriceValueAsString = indexPriceValue.toString(); - sb.append("indexPrice=").append(urlEncode(indexPriceValueAsString)).append(""); + Object commissionsValue = getCommissions(); + String commissionsValueAsString = ""; + commissionsValueAsString = + (String) + ((Collection) commissionsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("commissions=").append(urlEncode(commissionsValueAsString)).append(""); return sb.toString(); } @@ -155,8 +147,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("time"); - openapiFields.add("indexPrice"); + openapiFields.add("commissions"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -166,27 +157,39 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SymbolPriceTickerResponse + * @throws IOException if the JSON Element is invalid with respect to UserCommissionResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!SymbolPriceTickerResponse.openapiRequiredFields + if (!UserCommissionResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in SymbolPriceTickerResponse is not found" - + " in the empty JSON string", - SymbolPriceTickerResponse.openapiRequiredFields.toString())); + "The required field(s) %s in UserCommissionResponse is not found in" + + " the empty JSON string", + UserCommissionResponse.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("indexPrice") != null && !jsonObj.get("indexPrice").isJsonNull()) - && !jsonObj.get("indexPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `indexPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("indexPrice").toString())); + if (jsonObj.get("commissions") != null && !jsonObj.get("commissions").isJsonNull()) { + JsonArray jsonArraycommissions = jsonObj.getAsJsonArray("commissions"); + if (jsonArraycommissions != null) { + // ensure the json data is an array + if (!jsonObj.get("commissions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `commissions` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("commissions").toString())); + } + + // validate the optional field `commissions` (array) + for (int i = 0; i < jsonArraycommissions.size(); i++) { + UserCommissionResponseCommissionsInner.validateJsonElement( + jsonArraycommissions.get(i)); + } + ; + } } } @@ -194,25 +197,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!SymbolPriceTickerResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SymbolPriceTickerResponse' and its - // subtypes + if (!UserCommissionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserCommissionResponse' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(SymbolPriceTickerResponse.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UserCommissionResponse.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, SymbolPriceTickerResponse value) + public void write(JsonWriter out, UserCommissionResponse value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public SymbolPriceTickerResponse read(JsonReader in) throws IOException { + public UserCommissionResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -222,18 +224,18 @@ public SymbolPriceTickerResponse read(JsonReader in) throws IOException { } /** - * Create an instance of SymbolPriceTickerResponse given an JSON string + * Create an instance of UserCommissionResponse given an JSON string * * @param jsonString JSON string - * @return An instance of SymbolPriceTickerResponse - * @throws IOException if the JSON string is invalid with respect to SymbolPriceTickerResponse + * @return An instance of UserCommissionResponse + * @throws IOException if the JSON string is invalid with respect to UserCommissionResponse */ - public static SymbolPriceTickerResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SymbolPriceTickerResponse.class); + public static UserCommissionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserCommissionResponse.class); } /** - * Convert an instance of SymbolPriceTickerResponse to an JSON string + * Convert an instance of UserCommissionResponse to an JSON string * * @return JSON string */ diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/UserCommissionResponseCommissionsInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/UserCommissionResponseCommissionsInner.java new file mode 100644 index 000000000..46f8f529a --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/UserCommissionResponseCommissionsInner.java @@ -0,0 +1,302 @@ +/* + * Binance Derivatives Trading Options REST API + * OpenAPI Specification for the Binance Derivatives Trading Options REST API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_options.rest.model; + +import com.binance.connector.client.derivatives_trading_options.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** UserCommissionResponseCommissionsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class UserCommissionResponseCommissionsInner { + public static final String SERIALIZED_NAME_UNDERLYING = "underlying"; + + @SerializedName(SERIALIZED_NAME_UNDERLYING) + @jakarta.annotation.Nullable + private String underlying; + + public static final String SERIALIZED_NAME_MAKER_FEE = "makerFee"; + + @SerializedName(SERIALIZED_NAME_MAKER_FEE) + @jakarta.annotation.Nullable + private String makerFee; + + public static final String SERIALIZED_NAME_TAKER_FEE = "takerFee"; + + @SerializedName(SERIALIZED_NAME_TAKER_FEE) + @jakarta.annotation.Nullable + private String takerFee; + + public UserCommissionResponseCommissionsInner() {} + + public UserCommissionResponseCommissionsInner underlying( + @jakarta.annotation.Nullable String underlying) { + this.underlying = underlying; + return this; + } + + /** + * Get underlying + * + * @return underlying + */ + @jakarta.annotation.Nullable + public String getUnderlying() { + return underlying; + } + + public void setUnderlying(@jakarta.annotation.Nullable String underlying) { + this.underlying = underlying; + } + + public UserCommissionResponseCommissionsInner makerFee( + @jakarta.annotation.Nullable String makerFee) { + this.makerFee = makerFee; + return this; + } + + /** + * Get makerFee + * + * @return makerFee + */ + @jakarta.annotation.Nullable + public String getMakerFee() { + return makerFee; + } + + public void setMakerFee(@jakarta.annotation.Nullable String makerFee) { + this.makerFee = makerFee; + } + + public UserCommissionResponseCommissionsInner takerFee( + @jakarta.annotation.Nullable String takerFee) { + this.takerFee = takerFee; + return this; + } + + /** + * Get takerFee + * + * @return takerFee + */ + @jakarta.annotation.Nullable + public String getTakerFee() { + return takerFee; + } + + public void setTakerFee(@jakarta.annotation.Nullable String takerFee) { + this.takerFee = takerFee; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserCommissionResponseCommissionsInner userCommissionResponseCommissionsInner = + (UserCommissionResponseCommissionsInner) o; + return Objects.equals(this.underlying, userCommissionResponseCommissionsInner.underlying) + && Objects.equals(this.makerFee, userCommissionResponseCommissionsInner.makerFee) + && Objects.equals(this.takerFee, userCommissionResponseCommissionsInner.takerFee); + } + + @Override + public int hashCode() { + return Objects.hash(underlying, makerFee, takerFee); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserCommissionResponseCommissionsInner {\n"); + sb.append(" underlying: ").append(toIndentedString(underlying)).append("\n"); + sb.append(" makerFee: ").append(toIndentedString(makerFee)).append("\n"); + sb.append(" takerFee: ").append(toIndentedString(takerFee)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object underlyingValue = getUnderlying(); + String underlyingValueAsString = ""; + underlyingValueAsString = underlyingValue.toString(); + sb.append("underlying=").append(urlEncode(underlyingValueAsString)).append(""); + Object makerFeeValue = getMakerFee(); + String makerFeeValueAsString = ""; + makerFeeValueAsString = makerFeeValue.toString(); + sb.append("makerFee=").append(urlEncode(makerFeeValueAsString)).append(""); + Object takerFeeValue = getTakerFee(); + String takerFeeValueAsString = ""; + takerFeeValueAsString = takerFeeValue.toString(); + sb.append("takerFee=").append(urlEncode(takerFeeValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("underlying"); + openapiFields.add("makerFee"); + openapiFields.add("takerFee"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * UserCommissionResponseCommissionsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserCommissionResponseCommissionsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UserCommissionResponseCommissionsInner" + + " is not found in the empty JSON string", + UserCommissionResponseCommissionsInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("underlying") != null && !jsonObj.get("underlying").isJsonNull()) + && !jsonObj.get("underlying").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `underlying` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("underlying").toString())); + } + if ((jsonObj.get("makerFee") != null && !jsonObj.get("makerFee").isJsonNull()) + && !jsonObj.get("makerFee").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `makerFee` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("makerFee").toString())); + } + if ((jsonObj.get("takerFee") != null && !jsonObj.get("takerFee").isJsonNull()) + && !jsonObj.get("takerFee").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `takerFee` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("takerFee").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserCommissionResponseCommissionsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserCommissionResponseCommissionsInner' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UserCommissionResponseCommissionsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UserCommissionResponseCommissionsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserCommissionResponseCommissionsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UserCommissionResponseCommissionsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserCommissionResponseCommissionsInner + * @throws IOException if the JSON string is invalid with respect to + * UserCommissionResponseCommissionsInner + */ + public static UserCommissionResponseCommissionsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UserCommissionResponseCommissionsInner.class); + } + + /** + * Convert an instance of UserCommissionResponseCommissionsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/UserExerciseRecordResponseInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/UserExerciseRecordResponseInner.java index 3ef535786..de2953c2c 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/UserExerciseRecordResponseInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/model/UserExerciseRecordResponseInner.java @@ -60,12 +60,6 @@ public class UserExerciseRecordResponseInner { @jakarta.annotation.Nullable private String exercisePrice; - public static final String SERIALIZED_NAME_MARK_PRICE = "markPrice"; - - @SerializedName(SERIALIZED_NAME_MARK_PRICE) - @jakarta.annotation.Nullable - private String markPrice; - public static final String SERIALIZED_NAME_QUANTITY = "quantity"; @SerializedName(SERIALIZED_NAME_QUANTITY) @@ -199,26 +193,6 @@ public void setExercisePrice(@jakarta.annotation.Nullable String exercisePrice) this.exercisePrice = exercisePrice; } - public UserExerciseRecordResponseInner markPrice( - @jakarta.annotation.Nullable String markPrice) { - this.markPrice = markPrice; - return this; - } - - /** - * Get markPrice - * - * @return markPrice - */ - @jakarta.annotation.Nullable - public String getMarkPrice() { - return markPrice; - } - - public void setMarkPrice(@jakarta.annotation.Nullable String markPrice) { - this.markPrice = markPrice; - } - public UserExerciseRecordResponseInner quantity(@jakarta.annotation.Nullable String quantity) { this.quantity = quantity; return this; @@ -410,7 +384,6 @@ public boolean equals(Object o) { && Objects.equals(this.currency, userExerciseRecordResponseInner.currency) && Objects.equals(this.symbol, userExerciseRecordResponseInner.symbol) && Objects.equals(this.exercisePrice, userExerciseRecordResponseInner.exercisePrice) - && Objects.equals(this.markPrice, userExerciseRecordResponseInner.markPrice) && Objects.equals(this.quantity, userExerciseRecordResponseInner.quantity) && Objects.equals(this.amount, userExerciseRecordResponseInner.amount) && Objects.equals(this.fee, userExerciseRecordResponseInner.fee) @@ -429,7 +402,6 @@ public int hashCode() { currency, symbol, exercisePrice, - markPrice, quantity, amount, fee, @@ -449,7 +421,6 @@ public String toString() { sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); sb.append(" exercisePrice: ").append(toIndentedString(exercisePrice)).append("\n"); - sb.append(" markPrice: ").append(toIndentedString(markPrice)).append("\n"); sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); @@ -482,10 +453,6 @@ public String toUrlQueryString() { String exercisePriceValueAsString = ""; exercisePriceValueAsString = exercisePriceValue.toString(); sb.append("exercisePrice=").append(urlEncode(exercisePriceValueAsString)).append(""); - Object markPriceValue = getMarkPrice(); - String markPriceValueAsString = ""; - markPriceValueAsString = markPriceValue.toString(); - sb.append("markPrice=").append(urlEncode(markPriceValueAsString)).append(""); Object quantityValue = getQuantity(); String quantityValueAsString = ""; quantityValueAsString = quantityValue.toString(); @@ -554,7 +521,6 @@ private String toIndentedString(Object o) { openapiFields.add("currency"); openapiFields.add("symbol"); openapiFields.add("exercisePrice"); - openapiFields.add("markPrice"); openapiFields.add("quantity"); openapiFields.add("amount"); openapiFields.add("fee"); @@ -620,14 +586,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("exercisePrice").toString())); } - if ((jsonObj.get("markPrice") != null && !jsonObj.get("markPrice").isJsonNull()) - && !jsonObj.get("markPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `markPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("markPrice").toString())); - } if ((jsonObj.get("quantity") != null && !jsonObj.get("quantity").isJsonNull()) && !jsonObj.get("quantity").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/DerivativesTradingOptionsWebSocketStreamsUtil.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/DerivativesTradingOptionsWebSocketStreamsUtil.java index 985e091e4..3768d6202 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/DerivativesTradingOptionsWebSocketStreamsUtil.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/DerivativesTradingOptionsWebSocketStreamsUtil.java @@ -3,15 +3,19 @@ import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; public class DerivativesTradingOptionsWebSocketStreamsUtil { - private static final String BASE_URL = "wss://nbstream.binance.com/eoptions"; + private static final String BASE_URL = "wss://fstream.binance.com"; private static final boolean HAS_TIME_UNIT = false; public static WebSocketClientConfiguration getClientConfiguration() { + return getClientConfiguration(""); + } + + public static WebSocketClientConfiguration getClientConfiguration(String path) { WebSocketClientConfiguration clientConfiguration = new WebSocketClientConfiguration(); if (!HAS_TIME_UNIT) { clientConfiguration.setTimeUnit(null); } - clientConfiguration.setUrl(BASE_URL + "/stream"); + clientConfiguration.setUrl(BASE_URL + path + "/stream"); clientConfiguration.setAutoLogon(false); return clientConfiguration; } diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/JSON.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/JSON.java index 0cc03a10f..ddd312f04 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/JSON.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/JSON.java @@ -14,6 +14,7 @@ import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.service.DeserializeExclusionStrategy; +import com.binance.connector.client.common.websocket.service.RequestIdModifierFactory; import com.binance.connector.client.common.websocket.service.SerializeExclusionStrategy; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -80,10 +81,15 @@ public static GsonBuilder createGson() { Map classByDiscriminatorValue = new HashMap(); classByDiscriminatorValue.put( - "ACCOUNT_UPDATE", + "BALANCE_POSITION_UPDATE", com.binance.connector.client .derivatives_trading_options.websocket - .stream.model.AccountUpdate.class); + .stream.model.BalancePositionUpdate.class); + classByDiscriminatorValue.put( + "GREEK_UPDATE", + com.binance.connector.client + .derivatives_trading_options.websocket + .stream.model.GreekUpdate.class); classByDiscriminatorValue.put( "ORDER_TRADE_UPDATE", com.binance.connector.client @@ -95,10 +101,25 @@ public static GsonBuilder createGson() { .derivatives_trading_options.websocket .stream.model.RiskLevelChange.class); classByDiscriminatorValue.put( - "accountUpdate", + "listenKeyExpired", + com.binance.connector.client + .derivatives_trading_options.websocket + .stream.model.Listenkeyexpired.class); + classByDiscriminatorValue.put( + "balancePositionUpdate", com.binance.connector.client .derivatives_trading_options.websocket - .stream.model.AccountUpdate.class); + .stream.model.BalancePositionUpdate.class); + classByDiscriminatorValue.put( + "greekUpdate", + com.binance.connector.client + .derivatives_trading_options.websocket + .stream.model.GreekUpdate.class); + classByDiscriminatorValue.put( + "listenkeyexpired", + com.binance.connector.client + .derivatives_trading_options.websocket + .stream.model.Listenkeyexpired.class); classByDiscriminatorValue.put( "orderTradeUpdate", com.binance.connector.client @@ -171,22 +192,46 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model - .AccountUpdate.CustomTypeAdapterFactory()); + .BalancePositionUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.websocket.stream.model + .BalancePositionUpdateBInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.websocket.stream.model + .BalancePositionUpdatePInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.websocket.stream.model + .DiffBookDepthStreamsRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.websocket.stream.model + .DiffBookDepthStreamsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.websocket.stream.model + .DiffBookDepthStreamsResponseAItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model - .AccountUpdateBInner.CustomTypeAdapterFactory()); + .DiffBookDepthStreamsResponseBItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model - .AccountUpdateGInner.CustomTypeAdapterFactory()); + .GreekUpdate.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model - .AccountUpdatePInner.CustomTypeAdapterFactory()); + .GreekUpdateGInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model .IndexPriceStreamsRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model .IndexPriceStreamsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.websocket.stream.model + .IndexPriceStreamsResponseInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.websocket.stream.model + .IndividualSymbolBookTickerStreamsRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.websocket.stream.model + .IndividualSymbolBookTickerStreamsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model .KlineCandlestickStreamsRequest.CustomTypeAdapterFactory()); @@ -196,6 +241,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model .KlineCandlestickStreamsResponseK.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_options.websocket.stream.model + .Listenkeyexpired.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model .MarkPriceRequest.CustomTypeAdapterFactory()); @@ -225,10 +273,7 @@ private static Class getClassByDiscriminator( .OrderTradeUpdate.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model - .OrderTradeUpdateOInner.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_options.websocket.stream.model - .OrderTradeUpdateOInnerFiInner.CustomTypeAdapterFactory()); + .OrderTradeUpdateO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model .PartialBookDepthStreamsRequest.CustomTypeAdapterFactory()); @@ -244,18 +289,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model .RiskLevelChange.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_options.websocket.stream.model - .Ticker24HourByUnderlyingAssetAndExpirationDataRequest - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_options.websocket.stream.model - .Ticker24HourByUnderlyingAssetAndExpirationDataResponse - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_options.websocket.stream.model - .Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model .Ticker24HourRequest.CustomTypeAdapterFactory()); @@ -271,6 +304,7 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_options.websocket.stream.model .UserDataStreamEventsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new RequestIdModifierFactory()); gson = gsonBuilder.create(); } diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/DerivativesTradingOptionsWebSocketStreams.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/DerivativesTradingOptionsWebSocketStreams.java index 85b7ef910..10e3b2348 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/DerivativesTradingOptionsWebSocketStreams.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/DerivativesTradingOptionsWebSocketStreams.java @@ -10,8 +10,12 @@ import com.binance.connector.client.common.websocket.service.StreamBlockingQueue; import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.DiffBookDepthStreamsRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.DiffBookDepthStreamsResponse; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.IndexPriceStreamsRequest; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.IndexPriceStreamsResponse; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.IndividualSymbolBookTickerStreamsRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.IndividualSymbolBookTickerStreamsResponse; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.KlineCandlestickStreamsRequest; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.KlineCandlestickStreamsResponse; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.MarkPriceRequest; @@ -22,8 +26,6 @@ import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.OpenInterestResponse; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.PartialBookDepthStreamsRequest; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.PartialBookDepthStreamsResponse; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourByUnderlyingAssetAndExpirationDataRequest; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourByUnderlyingAssetAndExpirationDataResponse; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourRequest; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourResponse; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.TradeStreamsRequest; @@ -32,83 +34,119 @@ import com.google.gson.reflect.TypeToken; import java.util.Collections; import java.util.Map; +import java.util.Random; import java.util.Set; -import java.util.UUID; public class DerivativesTradingOptionsWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-options/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-options/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); - private final StreamConnectionInterface connection; + private WebSocketClientConfiguration clientConfiguration; + private StreamConnectionInterface connection; - private WebsocketMarketStreamsApi websocketMarketStreamsApi; + private MarketApi marketApi; + private PublicApi publicApi; public DerivativesTradingOptionsWebSocketStreams(WebSocketClientConfiguration configuration) { - this( - configuration.getUsePool() - ? new StreamConnectionPoolWrapper(configuration, JSON.getGson()) - : new StreamConnectionWrapper(configuration, JSON.getGson())); + this.clientConfiguration = configuration; } - public DerivativesTradingOptionsWebSocketStreams(StreamConnectionInterface connection) { - connection.setUserAgent(USER_AGENT); - if (!connection.isConnected()) { - connection.connect(); + public StreamConnectionInterface getConnection() { + if (connection == null) { + WebSocketClientConfiguration configuration = + (WebSocketClientConfiguration) clientConfiguration.clone(); + if (configuration.getUrl().endsWith("/stream") + && !configuration.getUrl().endsWith("/private/stream")) { + configuration.setUrl(configuration.getUrl().replace("/stream", "/private/stream")); + } + connection = + clientConfiguration.getUsePool() + ? new StreamConnectionPoolWrapper(clientConfiguration, JSON.getGson()) + : new StreamConnectionWrapper(clientConfiguration, JSON.getGson()); } - this.connection = connection; + return connection; + } - this.websocketMarketStreamsApi = new WebsocketMarketStreamsApi(connection); + public MarketApi getMarketApi() { + if (marketApi == null) { + WebSocketClientConfiguration configuration = + (WebSocketClientConfiguration) clientConfiguration.clone(); + if (configuration.getUrl().endsWith("/stream") + && !configuration.getUrl().endsWith("/market/stream")) { + configuration.setUrl(configuration.getUrl().replace("/stream", "/market/stream")); + } + marketApi = new MarketApi(configuration); + } + return marketApi; + } + + public PublicApi getPublicApi() { + if (publicApi == null) { + WebSocketClientConfiguration configuration = + (WebSocketClientConfiguration) clientConfiguration.clone(); + if (configuration.getUrl().endsWith("/stream") + && !configuration.getUrl().endsWith("/public/stream")) { + configuration.setUrl(configuration.getUrl().replace("/stream", "/public/stream")); + } + publicApi = new PublicApi(configuration); + } + return publicApi; } public StreamBlockingQueueWrapper indexPriceStreams( IndexPriceStreamsRequest indexPriceStreamsRequest) throws ApiException { - return websocketMarketStreamsApi.indexPriceStreams(indexPriceStreamsRequest); + return getMarketApi().indexPriceStreams(indexPriceStreamsRequest); } public StreamBlockingQueueWrapper klineCandlestickStreams( KlineCandlestickStreamsRequest klineCandlestickStreamsRequest) throws ApiException { - return websocketMarketStreamsApi.klineCandlestickStreams(klineCandlestickStreamsRequest); + return getMarketApi().klineCandlestickStreams(klineCandlestickStreamsRequest); } public StreamBlockingQueueWrapper markPrice( MarkPriceRequest markPriceRequest) throws ApiException { - return websocketMarketStreamsApi.markPrice(markPriceRequest); + return getMarketApi().markPrice(markPriceRequest); } public StreamBlockingQueueWrapper newSymbolInfo( NewSymbolInfoRequest newSymbolInfoRequest) throws ApiException { - return websocketMarketStreamsApi.newSymbolInfo(newSymbolInfoRequest); + return getMarketApi().newSymbolInfo(newSymbolInfoRequest); } public StreamBlockingQueueWrapper openInterest( OpenInterestRequest openInterestRequest) throws ApiException { - return websocketMarketStreamsApi.openInterest(openInterestRequest); + return getMarketApi().openInterest(openInterestRequest); + } + + public StreamBlockingQueueWrapper diffBookDepthStreams( + DiffBookDepthStreamsRequest diffBookDepthStreamsRequest) throws ApiException { + return getPublicApi().diffBookDepthStreams(diffBookDepthStreamsRequest); + } + + public StreamBlockingQueueWrapper + individualSymbolBookTickerStreams( + IndividualSymbolBookTickerStreamsRequest + individualSymbolBookTickerStreamsRequest) + throws ApiException { + return getPublicApi() + .individualSymbolBookTickerStreams(individualSymbolBookTickerStreamsRequest); } public StreamBlockingQueueWrapper partialBookDepthStreams( PartialBookDepthStreamsRequest partialBookDepthStreamsRequest) throws ApiException { - return websocketMarketStreamsApi.partialBookDepthStreams(partialBookDepthStreamsRequest); + return getPublicApi().partialBookDepthStreams(partialBookDepthStreamsRequest); } public StreamBlockingQueueWrapper ticker24Hour( Ticker24HourRequest ticker24HourRequest) throws ApiException { - return websocketMarketStreamsApi.ticker24Hour(ticker24HourRequest); - } - - public StreamBlockingQueueWrapper - ticker24HourByUnderlyingAssetAndExpirationData( - Ticker24HourByUnderlyingAssetAndExpirationDataRequest - ticker24HourByUnderlyingAssetAndExpirationDataRequest) - throws ApiException { - return websocketMarketStreamsApi.ticker24HourByUnderlyingAssetAndExpirationData( - ticker24HourByUnderlyingAssetAndExpirationDataRequest); + return getPublicApi().ticker24Hour(ticker24HourRequest); } public StreamBlockingQueueWrapper tradeStreams( TradeStreamsRequest tradeStreamsRequest) throws ApiException { - return websocketMarketStreamsApi.tradeStreams(tradeStreamsRequest); + return getPublicApi().tradeStreams(tradeStreamsRequest); } /** @@ -125,7 +163,7 @@ public StreamBlockingQueueWrapper userData(String .params(Collections.singleton(listenKey)) .build(); Map> queuesMap = - connection.subscribe(requestWrapperDTO); + getConnection().subscribe(requestWrapperDTO); TypeToken typeToken = new TypeToken<>() {}; StreamBlockingQueue queue = queuesMap.get(listenKey); @@ -133,6 +171,7 @@ public StreamBlockingQueueWrapper userData(String } public String getRequestID() { - return UUID.randomUUID().toString(); + Random rand = new Random(); + return Integer.toString(Math.abs(rand.nextInt())); } } diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/MarketApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/MarketApi.java new file mode 100644 index 000000000..a66244250 --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/MarketApi.java @@ -0,0 +1,489 @@ +/* + * Binance Derivatives Trading Options WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Options WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_options.websocket.stream.api; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.SystemUtil; +import com.binance.connector.client.common.exception.ConstraintViolationException; +import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionInterface; +import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionPoolWrapper; +import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionWrapper; +import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; +import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO; +import com.binance.connector.client.common.websocket.service.StreamBlockingQueue; +import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.IndexPriceStreamsRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.IndexPriceStreamsResponse; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.KlineCandlestickStreamsRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.KlineCandlestickStreamsResponse; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.MarkPriceRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.MarkPriceResponse; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.NewSymbolInfoRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.NewSymbolInfoResponse; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.OpenInterestRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.OpenInterestResponse; +import com.google.gson.reflect.TypeToken; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.constraints.*; +import java.util.Collections; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; + +public class MarketApi { + private static final String USER_AGENT = + String.format( + "binance-derivatives-trading-options/6.0.0 (Java/%s; %s; %s)", + SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + + private StreamConnectionInterface connection; + + public MarketApi() {} + + public MarketApi(WebSocketClientConfiguration configuration) { + this( + configuration.getUsePool() + ? new StreamConnectionPoolWrapper(configuration, JSON.getGson()) + : new StreamConnectionWrapper(configuration, JSON.getGson())); + } + + public MarketApi(StreamConnectionInterface connection) { + connection.setUserAgent(USER_AGENT); + if (!connection.isConnected()) { + connection.connect(); + } + this.connection = connection; + } + + /** + * Index Price Streams Underlying(e.g ETHUSDT) index stream. Update Speed: 1000ms + * + * @param indexPriceStreamsRequest (required) + * @return IndexPriceStreamsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Index Price Streams -
+ * + * @see Index + * Price Streams Documentation + */ + public StreamBlockingQueueWrapper indexPriceStreams( + IndexPriceStreamsRequest indexPriceStreamsRequest) throws ApiException { + StreamBlockingQueue queue = indexPriceStreamsRaw(indexPriceStreamsRequest); + + TypeToken typeToken = + new TypeToken() {}; + + return new StreamBlockingQueueWrapper<>(queue, typeToken); + } + + public StreamBlockingQueue indexPriceStreamsRaw( + IndexPriceStreamsRequest indexPriceStreamsRequest) throws ApiException { + indexPriceStreamsValidateBeforeCall(indexPriceStreamsRequest); + + String methodName = + "/!index@arr" + .substring(1) + .replace( + "", + indexPriceStreamsRequest.getId() != null + ? indexPriceStreamsRequest.getId().toString() + : ""); + if ("@".equals(methodName.substring(methodName.length() - 1))) { + methodName = methodName.substring(0, methodName.length() - 1); + } + + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(methodName)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + return queuesMap.get(methodName); + } + + @SuppressWarnings("rawtypes") + private void indexPriceStreamsValidateBeforeCall( + IndexPriceStreamsRequest indexPriceStreamsRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(indexPriceStreamsRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Kline/Candlestick Streams The Kline/Candlestick Stream push updates to the current + * klines/candlestick every 1000 milliseconds (if existing). Update Speed: 1000ms + * + * @param klineCandlestickStreamsRequest (required) + * @return KlineCandlestickStreamsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Kline/Candlestick Streams -
+ * + * @see Kline/Candlestick + * Streams Documentation + */ + public StreamBlockingQueueWrapper klineCandlestickStreams( + KlineCandlestickStreamsRequest klineCandlestickStreamsRequest) throws ApiException { + StreamBlockingQueue queue = + klineCandlestickStreamsRaw(klineCandlestickStreamsRequest); + + TypeToken typeToken = + new TypeToken() {}; + + return new StreamBlockingQueueWrapper<>(queue, typeToken); + } + + public StreamBlockingQueue klineCandlestickStreamsRaw( + KlineCandlestickStreamsRequest klineCandlestickStreamsRequest) throws ApiException { + klineCandlestickStreamsValidateBeforeCall(klineCandlestickStreamsRequest); + + String methodName = + "/@kline_" + .substring(1) + .replace( + "", + klineCandlestickStreamsRequest.getId() != null + ? klineCandlestickStreamsRequest.getId().toString() + : "") + .replace( + "", + klineCandlestickStreamsRequest.getSymbol() != null + ? klineCandlestickStreamsRequest.getSymbol().toString() + : "") + .replace( + "", + klineCandlestickStreamsRequest.getInterval() != null + ? klineCandlestickStreamsRequest.getInterval().toString() + : ""); + if ("@".equals(methodName.substring(methodName.length() - 1))) { + methodName = methodName.substring(0, methodName.length() - 1); + } + + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(methodName)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + return queuesMap.get(methodName); + } + + @SuppressWarnings("rawtypes") + private void klineCandlestickStreamsValidateBeforeCall( + KlineCandlestickStreamsRequest klineCandlestickStreamsRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(klineCandlestickStreamsRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Mark Price The mark price for all option symbols on specific underlying asset. + * E.g.[btcusdt@optionMarkPrice](wss://fstream.binance.com/market/stream?streams=btcusdt@optionMarkPrice) + * Update Speed: 1000ms + * + * @param markPriceRequest (required) + * @return MarkPriceResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Mark Price -
+ * + * @see Mark + * Price Documentation + */ + public StreamBlockingQueueWrapper markPrice( + MarkPriceRequest markPriceRequest) throws ApiException { + StreamBlockingQueue queue = markPriceRaw(markPriceRequest); + + TypeToken typeToken = new TypeToken() {}; + + return new StreamBlockingQueueWrapper<>(queue, typeToken); + } + + public StreamBlockingQueue markPriceRaw(MarkPriceRequest markPriceRequest) + throws ApiException { + markPriceValidateBeforeCall(markPriceRequest); + + String methodName = + "/@optionMarkPrice" + .substring(1) + .replace( + "", + markPriceRequest.getId() != null + ? markPriceRequest.getId().toString() + : "") + .replace( + "", + markPriceRequest.getUnderlying() != null + ? markPriceRequest.getUnderlying().toString() + : ""); + if ("@".equals(methodName.substring(methodName.length() - 1))) { + methodName = methodName.substring(0, methodName.length() - 1); + } + + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(methodName)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + return queuesMap.get(methodName); + } + + @SuppressWarnings("rawtypes") + private void markPriceValidateBeforeCall(MarkPriceRequest markPriceRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(markPriceRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * New Symbol Info New symbol listing stream. Update Speed: 50ms + * + * @param newSymbolInfoRequest (required) + * @return NewSymbolInfoResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 New Symbol Info -
+ * + * @see New + * Symbol Info Documentation + */ + public StreamBlockingQueueWrapper newSymbolInfo( + NewSymbolInfoRequest newSymbolInfoRequest) throws ApiException { + StreamBlockingQueue queue = newSymbolInfoRaw(newSymbolInfoRequest); + + TypeToken typeToken = new TypeToken() {}; + + return new StreamBlockingQueueWrapper<>(queue, typeToken); + } + + public StreamBlockingQueue newSymbolInfoRaw(NewSymbolInfoRequest newSymbolInfoRequest) + throws ApiException { + newSymbolInfoValidateBeforeCall(newSymbolInfoRequest); + + String methodName = + "/!optionSymbol" + .substring(1) + .replace( + "", + newSymbolInfoRequest.getId() != null + ? newSymbolInfoRequest.getId().toString() + : ""); + if ("@".equals(methodName.substring(methodName.length() - 1))) { + methodName = methodName.substring(0, methodName.length() - 1); + } + + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(methodName)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + return queuesMap.get(methodName); + } + + @SuppressWarnings("rawtypes") + private void newSymbolInfoValidateBeforeCall(NewSymbolInfoRequest newSymbolInfoRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(newSymbolInfoRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Open Interest Option open interest for specific underlying asset on specific expiration date. + * E.g.[ethusdt@openInterest@221125](wss://fstream.binance.com/market/stream?streams=ethusdt@openInterest@221125) + * Update Speed: 60s + * + * @param openInterestRequest (required) + * @return OpenInterestResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Open Interest -
+ * + * @see Open + * Interest Documentation + */ + public StreamBlockingQueueWrapper openInterest( + OpenInterestRequest openInterestRequest) throws ApiException { + StreamBlockingQueue queue = openInterestRaw(openInterestRequest); + + TypeToken typeToken = new TypeToken() {}; + + return new StreamBlockingQueueWrapper<>(queue, typeToken); + } + + public StreamBlockingQueue openInterestRaw(OpenInterestRequest openInterestRequest) + throws ApiException { + openInterestValidateBeforeCall(openInterestRequest); + + String methodName = + "/underlying@optionOpenInterest@" + .substring(1) + .replace( + "", + openInterestRequest.getId() != null + ? openInterestRequest.getId().toString() + : "") + .replace( + "", + openInterestRequest.getExpirationDate() != null + ? openInterestRequest.getExpirationDate().toString() + : ""); + if ("@".equals(methodName.substring(methodName.length() - 1))) { + methodName = methodName.substring(0, methodName.length() - 1); + } + + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(methodName)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + return queuesMap.get(methodName); + } + + @SuppressWarnings("rawtypes") + private void openInterestValidateBeforeCall(OpenInterestRequest openInterestRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(openInterestRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + public String getRequestID() { + Random rand = new Random(); + return Integer.toString(Math.abs(rand.nextInt())); + } +} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/PublicApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/PublicApi.java new file mode 100644 index 000000000..28030899c --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/PublicApi.java @@ -0,0 +1,523 @@ +/* + * Binance Derivatives Trading Options WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Options WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_options.websocket.stream.api; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.SystemUtil; +import com.binance.connector.client.common.exception.ConstraintViolationException; +import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionInterface; +import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionPoolWrapper; +import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionWrapper; +import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; +import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO; +import com.binance.connector.client.common.websocket.service.StreamBlockingQueue; +import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.DiffBookDepthStreamsRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.DiffBookDepthStreamsResponse; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.IndividualSymbolBookTickerStreamsRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.IndividualSymbolBookTickerStreamsResponse; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.PartialBookDepthStreamsRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.PartialBookDepthStreamsResponse; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourResponse; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.TradeStreamsRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.TradeStreamsResponse; +import com.google.gson.reflect.TypeToken; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.constraints.*; +import java.util.Collections; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; + +public class PublicApi { + private static final String USER_AGENT = + String.format( + "binance-derivatives-trading-options/6.0.0 (Java/%s; %s; %s)", + SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + + private StreamConnectionInterface connection; + + public PublicApi() {} + + public PublicApi(WebSocketClientConfiguration configuration) { + this( + configuration.getUsePool() + ? new StreamConnectionPoolWrapper(configuration, JSON.getGson()) + : new StreamConnectionWrapper(configuration, JSON.getGson())); + } + + public PublicApi(StreamConnectionInterface connection) { + connection.setUserAgent(USER_AGENT); + if (!connection.isConnected()) { + connection.connect(); + } + this.connection = connection; + } + + /** + * Diff Book Depth Streams Bids and asks, pushed every 500 milliseconds, 100 milliseconds (if + * existing) Update Speed: 100ms or 500ms + * + * @param diffBookDepthStreamsRequest (required) + * @return DiffBookDepthStreamsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Diff Book Depth Streams -
+ * + * @see Diff + * Book Depth Streams Documentation + */ + public StreamBlockingQueueWrapper diffBookDepthStreams( + DiffBookDepthStreamsRequest diffBookDepthStreamsRequest) throws ApiException { + StreamBlockingQueue queue = diffBookDepthStreamsRaw(diffBookDepthStreamsRequest); + + TypeToken typeToken = + new TypeToken() {}; + + return new StreamBlockingQueueWrapper<>(queue, typeToken); + } + + public StreamBlockingQueue diffBookDepthStreamsRaw( + DiffBookDepthStreamsRequest diffBookDepthStreamsRequest) throws ApiException { + diffBookDepthStreamsValidateBeforeCall(diffBookDepthStreamsRequest); + + String methodName = + "/@depth@" + .substring(1) + .replace( + "", + diffBookDepthStreamsRequest.getId() != null + ? diffBookDepthStreamsRequest.getId().toString() + : "") + .replace( + "", + diffBookDepthStreamsRequest.getSymbol() != null + ? diffBookDepthStreamsRequest.getSymbol().toString() + : "") + .replace( + "", + diffBookDepthStreamsRequest.getUpdateSpeed() != null + ? diffBookDepthStreamsRequest.getUpdateSpeed().toString() + : ""); + if ("@".equals(methodName.substring(methodName.length() - 1))) { + methodName = methodName.substring(0, methodName.length() - 1); + } + + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(methodName)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + return queuesMap.get(methodName); + } + + @SuppressWarnings("rawtypes") + private void diffBookDepthStreamsValidateBeforeCall( + DiffBookDepthStreamsRequest diffBookDepthStreamsRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(diffBookDepthStreamsRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Individual Symbol Book Ticker Streams Pushes any update to the best bid or ask's price or + * quantity in real-time for a specified symbol. Update Speed: Real-Time + * + * @param individualSymbolBookTickerStreamsRequest (required) + * @return IndividualSymbolBookTickerStreamsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Individual Symbol Book Ticker Streams -
+ * + * @see Individual + * Symbol Book Ticker Streams Documentation + */ + public StreamBlockingQueueWrapper + individualSymbolBookTickerStreams( + IndividualSymbolBookTickerStreamsRequest + individualSymbolBookTickerStreamsRequest) + throws ApiException { + StreamBlockingQueue queue = + individualSymbolBookTickerStreamsRaw(individualSymbolBookTickerStreamsRequest); + + TypeToken typeToken = + new TypeToken() {}; + + return new StreamBlockingQueueWrapper<>(queue, typeToken); + } + + public StreamBlockingQueue individualSymbolBookTickerStreamsRaw( + IndividualSymbolBookTickerStreamsRequest individualSymbolBookTickerStreamsRequest) + throws ApiException { + individualSymbolBookTickerStreamsValidateBeforeCall( + individualSymbolBookTickerStreamsRequest); + + String methodName = + "/@bookTicker" + .substring(1) + .replace( + "", + individualSymbolBookTickerStreamsRequest.getId() != null + ? individualSymbolBookTickerStreamsRequest + .getId() + .toString() + : "") + .replace( + "", + individualSymbolBookTickerStreamsRequest.getSymbol() != null + ? individualSymbolBookTickerStreamsRequest + .getSymbol() + .toString() + : ""); + if ("@".equals(methodName.substring(methodName.length() - 1))) { + methodName = methodName.substring(0, methodName.length() - 1); + } + + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(methodName)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + return queuesMap.get(methodName); + } + + @SuppressWarnings("rawtypes") + private void individualSymbolBookTickerStreamsValidateBeforeCall( + IndividualSymbolBookTickerStreamsRequest individualSymbolBookTickerStreamsRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(individualSymbolBookTickerStreamsRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Partial Book Depth Streams Top **<levels\\>** bids and asks, Valid levels are + * **<levels\\>** are 5, 10, 20. Update Speed: 100ms or 500ms + * + * @param partialBookDepthStreamsRequest (required) + * @return PartialBookDepthStreamsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Partial Book Depth Streams -
+ * + * @see Partial + * Book Depth Streams Documentation + */ + public StreamBlockingQueueWrapper partialBookDepthStreams( + PartialBookDepthStreamsRequest partialBookDepthStreamsRequest) throws ApiException { + StreamBlockingQueue queue = + partialBookDepthStreamsRaw(partialBookDepthStreamsRequest); + + TypeToken typeToken = + new TypeToken() {}; + + return new StreamBlockingQueueWrapper<>(queue, typeToken); + } + + public StreamBlockingQueue partialBookDepthStreamsRaw( + PartialBookDepthStreamsRequest partialBookDepthStreamsRequest) throws ApiException { + partialBookDepthStreamsValidateBeforeCall(partialBookDepthStreamsRequest); + + String methodName = + "/@depth@" + .substring(1) + .replace( + "", + partialBookDepthStreamsRequest.getId() != null + ? partialBookDepthStreamsRequest.getId().toString() + : "") + .replace( + "", + partialBookDepthStreamsRequest.getSymbol() != null + ? partialBookDepthStreamsRequest.getSymbol().toString() + : "") + .replace( + "", + partialBookDepthStreamsRequest.getLevel() != null + ? partialBookDepthStreamsRequest.getLevel().toString() + : "") + .replace( + "", + partialBookDepthStreamsRequest.getUpdateSpeed() != null + ? partialBookDepthStreamsRequest.getUpdateSpeed().toString() + : ""); + if ("@".equals(methodName.substring(methodName.length() - 1))) { + methodName = methodName.substring(0, methodName.length() - 1); + } + + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(methodName)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + return queuesMap.get(methodName); + } + + @SuppressWarnings("rawtypes") + private void partialBookDepthStreamsValidateBeforeCall( + PartialBookDepthStreamsRequest partialBookDepthStreamsRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(partialBookDepthStreamsRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * 24-hour TICKER 24hr ticker info for all symbols. Only symbols whose ticker info changed will + * be sent. Update Speed: 1000ms + * + * @param ticker24HourRequest (required) + * @return Ticker24HourResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 24-hour TICKER -
+ * + * @see 24-hour + * TICKER Documentation + */ + public StreamBlockingQueueWrapper ticker24Hour( + Ticker24HourRequest ticker24HourRequest) throws ApiException { + StreamBlockingQueue queue = ticker24HourRaw(ticker24HourRequest); + + TypeToken typeToken = new TypeToken() {}; + + return new StreamBlockingQueueWrapper<>(queue, typeToken); + } + + public StreamBlockingQueue ticker24HourRaw(Ticker24HourRequest ticker24HourRequest) + throws ApiException { + ticker24HourValidateBeforeCall(ticker24HourRequest); + + String methodName = + "/@optionTicker" + .substring(1) + .replace( + "", + ticker24HourRequest.getId() != null + ? ticker24HourRequest.getId().toString() + : "") + .replace( + "", + ticker24HourRequest.getSymbol() != null + ? ticker24HourRequest.getSymbol().toString() + : ""); + if ("@".equals(methodName.substring(methodName.length() - 1))) { + methodName = methodName.substring(0, methodName.length() - 1); + } + + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(methodName)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + return queuesMap.get(methodName); + } + + @SuppressWarnings("rawtypes") + private void ticker24HourValidateBeforeCall(Ticker24HourRequest ticker24HourRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(ticker24HourRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Trade Streams The Trade Streams push raw trade information for specific symbol or underlying + * asset. + * E.g.[btcusdt@optionTrade](wss://fstream.binance.com/public/stream?streams=btcusdt@optionTrade) + * Update Speed: 50ms + * + * @param tradeStreamsRequest (required) + * @return TradeStreamsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Trade Streams -
+ * + * @see Trade + * Streams Documentation + */ + public StreamBlockingQueueWrapper tradeStreams( + TradeStreamsRequest tradeStreamsRequest) throws ApiException { + StreamBlockingQueue queue = tradeStreamsRaw(tradeStreamsRequest); + + TypeToken typeToken = new TypeToken() {}; + + return new StreamBlockingQueueWrapper<>(queue, typeToken); + } + + public StreamBlockingQueue tradeStreamsRaw(TradeStreamsRequest tradeStreamsRequest) + throws ApiException { + tradeStreamsValidateBeforeCall(tradeStreamsRequest); + + String methodName = + "/@optionTrade" + .substring(1) + .replace( + "", + tradeStreamsRequest.getId() != null + ? tradeStreamsRequest.getId().toString() + : "") + .replace( + "", + tradeStreamsRequest.getSymbol() != null + ? tradeStreamsRequest.getSymbol().toString() + : ""); + if ("@".equals(methodName.substring(methodName.length() - 1))) { + methodName = methodName.substring(0, methodName.length() - 1); + } + + RequestWrapperDTO, Object> requestWrapperDTO = + new RequestWrapperDTO.Builder, Object>() + .id(getRequestID()) + .method("SUBSCRIBE") + .params(Collections.singleton(methodName)) + .build(); + Map> queuesMap = + connection.subscribe(requestWrapperDTO); + return queuesMap.get(methodName); + } + + @SuppressWarnings("rawtypes") + private void tradeStreamsValidateBeforeCall(TradeStreamsRequest tradeStreamsRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(tradeStreamsRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + public String getRequestID() { + Random rand = new Random(); + return Integer.toString(Math.abs(rand.nextInt())); + } +} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/WebsocketMarketStreamsApi.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/WebsocketMarketStreamsApi.java deleted file mode 100644 index 011539e0e..000000000 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/WebsocketMarketStreamsApi.java +++ /dev/null @@ -1,862 +0,0 @@ -/* - * Binance Derivatives Trading Options WebSocket Market Streams - * OpenAPI Specification for the Binance Derivatives Trading Options WebSocket Market Streams - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_options.websocket.stream.api; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.exception.ConstraintViolationException; -import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionInterface; -import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueue; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.IndexPriceStreamsRequest; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.IndexPriceStreamsResponse; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.KlineCandlestickStreamsRequest; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.KlineCandlestickStreamsResponse; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.MarkPriceRequest; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.MarkPriceResponse; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.NewSymbolInfoRequest; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.NewSymbolInfoResponse; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.OpenInterestRequest; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.OpenInterestResponse; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.PartialBookDepthStreamsRequest; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.PartialBookDepthStreamsResponse; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourByUnderlyingAssetAndExpirationDataRequest; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourByUnderlyingAssetAndExpirationDataResponse; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourRequest; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourResponse; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.TradeStreamsRequest; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.TradeStreamsResponse; -import com.google.gson.reflect.TypeToken; -import jakarta.validation.ConstraintViolation; -import jakarta.validation.Validation; -import jakarta.validation.Validator; -import jakarta.validation.constraints.*; -import java.util.Collections; -import java.util.Map; -import java.util.Set; -import java.util.UUID; -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; - -public class WebsocketMarketStreamsApi { - private StreamConnectionInterface connection; - - public WebsocketMarketStreamsApi() {} - - public WebsocketMarketStreamsApi(StreamConnectionInterface connection) { - this.connection = connection; - } - - /** - * Index Price Streams Underlying(e.g ETHUSDT) index stream. Update Speed: 1000ms - * - * @param indexPriceStreamsRequest (required) - * @return IndexPriceStreamsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Index Price Streams -
- * - * @see Index - * Price Streams Documentation - */ - public StreamBlockingQueueWrapper indexPriceStreams( - IndexPriceStreamsRequest indexPriceStreamsRequest) throws ApiException { - StreamBlockingQueue queue = indexPriceStreamsRaw(indexPriceStreamsRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue indexPriceStreamsRaw( - IndexPriceStreamsRequest indexPriceStreamsRequest) throws ApiException { - indexPriceStreamsValidateBeforeCall(indexPriceStreamsRequest); - - String methodName = - "/@index" - .substring(1) - .replace( - "", - indexPriceStreamsRequest.getId() != null - ? indexPriceStreamsRequest.getId().toString() - : "") - .replace( - "", - indexPriceStreamsRequest.getSymbol() != null - ? indexPriceStreamsRequest.getSymbol().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void indexPriceStreamsValidateBeforeCall( - IndexPriceStreamsRequest indexPriceStreamsRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(indexPriceStreamsRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Kline/Candlestick Streams The Kline/Candlestick Stream push updates to the current - * klines/candlestick every 1000 milliseconds (if existing). Update Speed: 1000ms - * - * @param klineCandlestickStreamsRequest (required) - * @return KlineCandlestickStreamsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Kline/Candlestick Streams -
- * - * @see Kline/Candlestick - * Streams Documentation - */ - public StreamBlockingQueueWrapper klineCandlestickStreams( - KlineCandlestickStreamsRequest klineCandlestickStreamsRequest) throws ApiException { - StreamBlockingQueue queue = - klineCandlestickStreamsRaw(klineCandlestickStreamsRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue klineCandlestickStreamsRaw( - KlineCandlestickStreamsRequest klineCandlestickStreamsRequest) throws ApiException { - klineCandlestickStreamsValidateBeforeCall(klineCandlestickStreamsRequest); - - String methodName = - "/@kline_" - .substring(1) - .replace( - "", - klineCandlestickStreamsRequest.getId() != null - ? klineCandlestickStreamsRequest.getId().toString() - : "") - .replace( - "", - klineCandlestickStreamsRequest.getSymbol() != null - ? klineCandlestickStreamsRequest.getSymbol().toString() - : "") - .replace( - "", - klineCandlestickStreamsRequest.getInterval() != null - ? klineCandlestickStreamsRequest.getInterval().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void klineCandlestickStreamsValidateBeforeCall( - KlineCandlestickStreamsRequest klineCandlestickStreamsRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(klineCandlestickStreamsRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Mark Price The mark price for all option symbols on specific underlying asset. - * E.g.[ETH@markPrice](wss://nbstream.binance.com/eoptions/stream?streams=ETH@markPrice) - * Update Speed: 1000ms - * - * @param markPriceRequest (required) - * @return MarkPriceResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Mark Price -
- * - * @see Mark - * Price Documentation - */ - public StreamBlockingQueueWrapper markPrice( - MarkPriceRequest markPriceRequest) throws ApiException { - StreamBlockingQueue queue = markPriceRaw(markPriceRequest); - - TypeToken typeToken = new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue markPriceRaw(MarkPriceRequest markPriceRequest) - throws ApiException { - markPriceValidateBeforeCall(markPriceRequest); - - String methodName = - "/@markPrice" - .substring(1) - .replace( - "", - markPriceRequest.getId() != null - ? markPriceRequest.getId().toString() - : "") - .replace( - "", - markPriceRequest.getUnderlyingAsset() != null - ? markPriceRequest.getUnderlyingAsset().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void markPriceValidateBeforeCall(MarkPriceRequest markPriceRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(markPriceRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * New Symbol Info New symbol listing stream. Update Speed: 50ms - * - * @param newSymbolInfoRequest (required) - * @return NewSymbolInfoResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 New Symbol Info -
- * - * @see New - * Symbol Info Documentation - */ - public StreamBlockingQueueWrapper newSymbolInfo( - NewSymbolInfoRequest newSymbolInfoRequest) throws ApiException { - StreamBlockingQueue queue = newSymbolInfoRaw(newSymbolInfoRequest); - - TypeToken typeToken = new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue newSymbolInfoRaw(NewSymbolInfoRequest newSymbolInfoRequest) - throws ApiException { - newSymbolInfoValidateBeforeCall(newSymbolInfoRequest); - - String methodName = - "/option_pair" - .substring(1) - .replace( - "", - newSymbolInfoRequest.getId() != null - ? newSymbolInfoRequest.getId().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void newSymbolInfoValidateBeforeCall(NewSymbolInfoRequest newSymbolInfoRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(newSymbolInfoRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Open Interest Option open interest for specific underlying asset on specific expiration date. - * E.g.[ETH@openInterest@221125](wss://nbstream.binance.com/eoptions/stream?streams=ETH@openInterest@221125) - * Update Speed: 60s - * - * @param openInterestRequest (required) - * @return OpenInterestResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Open Interest -
- * - * @see Open - * Interest Documentation - */ - public StreamBlockingQueueWrapper openInterest( - OpenInterestRequest openInterestRequest) throws ApiException { - StreamBlockingQueue queue = openInterestRaw(openInterestRequest); - - TypeToken typeToken = new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue openInterestRaw(OpenInterestRequest openInterestRequest) - throws ApiException { - openInterestValidateBeforeCall(openInterestRequest); - - String methodName = - "/@openInterest@" - .substring(1) - .replace( - "", - openInterestRequest.getId() != null - ? openInterestRequest.getId().toString() - : "") - .replace( - "", - openInterestRequest.getUnderlyingAsset() != null - ? openInterestRequest.getUnderlyingAsset().toString() - : "") - .replace( - "", - openInterestRequest.getExpirationDate() != null - ? openInterestRequest.getExpirationDate().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void openInterestValidateBeforeCall(OpenInterestRequest openInterestRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(openInterestRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Partial Book Depth Streams Top **<levels\\>** bids and asks, Valid levels are - * **<levels\\>** are 10, 20, 50, 100. Update Speed: 100ms or 1000ms, 500ms(default when - * update speed isn't used) - * - * @param partialBookDepthStreamsRequest (required) - * @return PartialBookDepthStreamsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Partial Book Depth Streams -
- * - * @see Partial - * Book Depth Streams Documentation - */ - public StreamBlockingQueueWrapper partialBookDepthStreams( - PartialBookDepthStreamsRequest partialBookDepthStreamsRequest) throws ApiException { - StreamBlockingQueue queue = - partialBookDepthStreamsRaw(partialBookDepthStreamsRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue partialBookDepthStreamsRaw( - PartialBookDepthStreamsRequest partialBookDepthStreamsRequest) throws ApiException { - partialBookDepthStreamsValidateBeforeCall(partialBookDepthStreamsRequest); - - String methodName = - "/@depth@" - .substring(1) - .replace( - "", - partialBookDepthStreamsRequest.getId() != null - ? partialBookDepthStreamsRequest.getId().toString() - : "") - .replace( - "", - partialBookDepthStreamsRequest.getSymbol() != null - ? partialBookDepthStreamsRequest.getSymbol().toString() - : "") - .replace( - "", - partialBookDepthStreamsRequest.getLevels() != null - ? partialBookDepthStreamsRequest.getLevels().toString() - : "") - .replace( - "", - partialBookDepthStreamsRequest.getUpdateSpeed() != null - ? partialBookDepthStreamsRequest.getUpdateSpeed().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void partialBookDepthStreamsValidateBeforeCall( - PartialBookDepthStreamsRequest partialBookDepthStreamsRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(partialBookDepthStreamsRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * 24-hour TICKER 24hr ticker info for all symbols. Only symbols whose ticker info changed will - * be sent. Update Speed: 1000ms - * - * @param ticker24HourRequest (required) - * @return Ticker24HourResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 24-hour TICKER -
- * - * @see 24-hour - * TICKER Documentation - */ - public StreamBlockingQueueWrapper ticker24Hour( - Ticker24HourRequest ticker24HourRequest) throws ApiException { - StreamBlockingQueue queue = ticker24HourRaw(ticker24HourRequest); - - TypeToken typeToken = new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue ticker24HourRaw(Ticker24HourRequest ticker24HourRequest) - throws ApiException { - ticker24HourValidateBeforeCall(ticker24HourRequest); - - String methodName = - "/@ticker" - .substring(1) - .replace( - "", - ticker24HourRequest.getId() != null - ? ticker24HourRequest.getId().toString() - : "") - .replace( - "", - ticker24HourRequest.getSymbol() != null - ? ticker24HourRequest.getSymbol().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void ticker24HourValidateBeforeCall(Ticker24HourRequest ticker24HourRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(ticker24HourRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * 24-hour TICKER by underlying asset and expiration data 24hr ticker info by underlying asset - * and expiration date. - * E.g.[ETH@ticker@220930](wss://nbstream.binance.com/eoptions/stream?streams=ETH@ticker@220930) - * Update Speed: 1000ms - * - * @param ticker24HourByUnderlyingAssetAndExpirationDataRequest (required) - * @return Ticker24HourByUnderlyingAssetAndExpirationDataResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 24-hour TICKER by underlying asset and expiration data -
- * - * @see 24-hour - * TICKER by underlying asset and expiration data Documentation - */ - public StreamBlockingQueueWrapper - ticker24HourByUnderlyingAssetAndExpirationData( - Ticker24HourByUnderlyingAssetAndExpirationDataRequest - ticker24HourByUnderlyingAssetAndExpirationDataRequest) - throws ApiException { - StreamBlockingQueue queue = - ticker24HourByUnderlyingAssetAndExpirationDataRaw( - ticker24HourByUnderlyingAssetAndExpirationDataRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue ticker24HourByUnderlyingAssetAndExpirationDataRaw( - Ticker24HourByUnderlyingAssetAndExpirationDataRequest - ticker24HourByUnderlyingAssetAndExpirationDataRequest) - throws ApiException { - ticker24HourByUnderlyingAssetAndExpirationDataValidateBeforeCall( - ticker24HourByUnderlyingAssetAndExpirationDataRequest); - - String methodName = - "/@ticker@" - .substring(1) - .replace( - "", - ticker24HourByUnderlyingAssetAndExpirationDataRequest.getId() - != null - ? ticker24HourByUnderlyingAssetAndExpirationDataRequest - .getId() - .toString() - : "") - .replace( - "", - ticker24HourByUnderlyingAssetAndExpirationDataRequest - .getUnderlyingAsset() - != null - ? ticker24HourByUnderlyingAssetAndExpirationDataRequest - .getUnderlyingAsset() - .toString() - : "") - .replace( - "", - ticker24HourByUnderlyingAssetAndExpirationDataRequest - .getExpirationDate() - != null - ? ticker24HourByUnderlyingAssetAndExpirationDataRequest - .getExpirationDate() - .toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void ticker24HourByUnderlyingAssetAndExpirationDataValidateBeforeCall( - Ticker24HourByUnderlyingAssetAndExpirationDataRequest - ticker24HourByUnderlyingAssetAndExpirationDataRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> - violations = - validator.validate( - ticker24HourByUnderlyingAssetAndExpirationDataRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Trade Streams The Trade Streams push raw trade information for specific symbol or underlying - * asset. E.g.[ETH@trade](wss://nbstream.binance.com/eoptions/stream?streams=ETH@trade) - * Update Speed: 50ms - * - * @param tradeStreamsRequest (required) - * @return TradeStreamsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Trade Streams -
- * - * @see Trade - * Streams Documentation - */ - public StreamBlockingQueueWrapper tradeStreams( - TradeStreamsRequest tradeStreamsRequest) throws ApiException { - StreamBlockingQueue queue = tradeStreamsRaw(tradeStreamsRequest); - - TypeToken typeToken = new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue tradeStreamsRaw(TradeStreamsRequest tradeStreamsRequest) - throws ApiException { - tradeStreamsValidateBeforeCall(tradeStreamsRequest); - - String methodName = - "/@trade" - .substring(1) - .replace( - "", - tradeStreamsRequest.getId() != null - ? tradeStreamsRequest.getId().toString() - : "") - .replace( - "", - tradeStreamsRequest.getSymbol() != null - ? tradeStreamsRequest.getSymbol().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void tradeStreamsValidateBeforeCall(TradeStreamsRequest tradeStreamsRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(tradeStreamsRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - public String getRequestID() { - return UUID.randomUUID().toString(); - } -} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdate.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/BalancePositionUpdate.java similarity index 64% rename from clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdate.java rename to clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/BalancePositionUpdate.java index 792f01f69..843cb3e52 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdate.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/BalancePositionUpdate.java @@ -38,44 +38,44 @@ import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; -/** AccountUpdate */ +/** BalancePositionUpdate */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class AccountUpdate extends BaseDTO { +public class BalancePositionUpdate extends BaseDTO { public static final String SERIALIZED_NAME_E = "E"; @SerializedName(SERIALIZED_NAME_E) @jakarta.annotation.Nullable private Long E; - public static final String SERIALIZED_NAME_B = "B"; + public static final String SERIALIZED_NAME_T = "T"; - @SerializedName(SERIALIZED_NAME_B) + @SerializedName(SERIALIZED_NAME_T) @jakarta.annotation.Nullable - private List<@Valid AccountUpdateBInner> B; + private Long T; - public static final String SERIALIZED_NAME_G = "G"; + public static final String SERIALIZED_NAME_M_LOWER_CASE = "m"; - @SerializedName(SERIALIZED_NAME_G) + @SerializedName(SERIALIZED_NAME_M_LOWER_CASE) @jakarta.annotation.Nullable - private List<@Valid AccountUpdateGInner> G; + private String mLowerCase; - public static final String SERIALIZED_NAME_P = "P"; + public static final String SERIALIZED_NAME_B = "B"; - @SerializedName(SERIALIZED_NAME_P) + @SerializedName(SERIALIZED_NAME_B) @jakarta.annotation.Nullable - private List<@Valid AccountUpdatePInner> P; + private List<@Valid BalancePositionUpdateBInner> B; - public static final String SERIALIZED_NAME_UID = "uid"; + public static final String SERIALIZED_NAME_P = "P"; - @SerializedName(SERIALIZED_NAME_UID) + @SerializedName(SERIALIZED_NAME_P) @jakarta.annotation.Nullable - private Long uid; + private List<@Valid BalancePositionUpdatePInner> P; - public AccountUpdate() {} + public BalancePositionUpdate() {} - public AccountUpdate E(@jakarta.annotation.Nullable Long E) { + public BalancePositionUpdate E(@jakarta.annotation.Nullable Long E) { this.E = E; return this; } @@ -94,68 +94,80 @@ public void setE(@jakarta.annotation.Nullable Long E) { this.E = E; } - public AccountUpdate B(@jakarta.annotation.Nullable List<@Valid AccountUpdateBInner> B) { - this.B = B; + public BalancePositionUpdate T(@jakarta.annotation.Nullable Long T) { + this.T = T; return this; } - public AccountUpdate addBItem(AccountUpdateBInner BItem) { - if (this.B == null) { - this.B = new ArrayList<>(); - } - this.B.add(BItem); + /** + * Get T + * + * @return T + */ + @jakarta.annotation.Nullable + public Long getT() { + return T; + } + + public void setT(@jakarta.annotation.Nullable Long T) { + this.T = T; + } + + public BalancePositionUpdate mLowerCase(@jakarta.annotation.Nullable String mLowerCase) { + this.mLowerCase = mLowerCase; return this; } /** - * Get B + * Get mLowerCase * - * @return B + * @return mLowerCase */ @jakarta.annotation.Nullable - @Valid - public List<@Valid AccountUpdateBInner> getB() { - return B; + public String getmLowerCase() { + return mLowerCase; } - public void setB(@jakarta.annotation.Nullable List<@Valid AccountUpdateBInner> B) { - this.B = B; + public void setmLowerCase(@jakarta.annotation.Nullable String mLowerCase) { + this.mLowerCase = mLowerCase; } - public AccountUpdate G(@jakarta.annotation.Nullable List<@Valid AccountUpdateGInner> G) { - this.G = G; + public BalancePositionUpdate B( + @jakarta.annotation.Nullable List<@Valid BalancePositionUpdateBInner> B) { + this.B = B; return this; } - public AccountUpdate addGItem(AccountUpdateGInner GItem) { - if (this.G == null) { - this.G = new ArrayList<>(); + public BalancePositionUpdate addBItem(BalancePositionUpdateBInner BItem) { + if (this.B == null) { + this.B = new ArrayList<>(); } - this.G.add(GItem); + this.B.add(BItem); return this; } /** - * Get G + * Get B * - * @return G + * @return B */ @jakarta.annotation.Nullable @Valid - public List<@Valid AccountUpdateGInner> getG() { - return G; + public List<@Valid BalancePositionUpdateBInner> getB() { + return B; } - public void setG(@jakarta.annotation.Nullable List<@Valid AccountUpdateGInner> G) { - this.G = G; + public void setB(@jakarta.annotation.Nullable List<@Valid BalancePositionUpdateBInner> B) { + this.B = B; } - public AccountUpdate P(@jakarta.annotation.Nullable List<@Valid AccountUpdatePInner> P) { + public BalancePositionUpdate P( + @jakarta.annotation.Nullable List<@Valid BalancePositionUpdatePInner> P) { this.P = P; return this; } - public AccountUpdate addPItem(AccountUpdatePInner PItem) { + public BalancePositionUpdate addPItem(BalancePositionUpdatePInner PItem) { if (this.P == null) { this.P = new ArrayList<>(); } @@ -170,33 +182,14 @@ public AccountUpdate addPItem(AccountUpdatePInner PItem) { */ @jakarta.annotation.Nullable @Valid - public List<@Valid AccountUpdatePInner> getP() { + public List<@Valid BalancePositionUpdatePInner> getP() { return P; } - public void setP(@jakarta.annotation.Nullable List<@Valid AccountUpdatePInner> P) { + public void setP(@jakarta.annotation.Nullable List<@Valid BalancePositionUpdatePInner> P) { this.P = P; } - public AccountUpdate uid(@jakarta.annotation.Nullable Long uid) { - this.uid = uid; - return this; - } - - /** - * Get uid - * - * @return uid - */ - @jakarta.annotation.Nullable - public Long getUid() { - return uid; - } - - public void setUid(@jakarta.annotation.Nullable Long uid) { - this.uid = uid; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -205,28 +198,28 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - AccountUpdate accountUpdate = (AccountUpdate) o; - return Objects.equals(this.E, accountUpdate.E) - && Objects.equals(this.B, accountUpdate.B) - && Objects.equals(this.G, accountUpdate.G) - && Objects.equals(this.P, accountUpdate.P) - && Objects.equals(this.uid, accountUpdate.uid); + BalancePositionUpdate balancePositionUpdate = (BalancePositionUpdate) o; + return Objects.equals(this.E, balancePositionUpdate.E) + && Objects.equals(this.T, balancePositionUpdate.T) + && Objects.equals(this.mLowerCase, balancePositionUpdate.mLowerCase) + && Objects.equals(this.B, balancePositionUpdate.B) + && Objects.equals(this.P, balancePositionUpdate.P); } @Override public int hashCode() { - return Objects.hash(E, B, G, P, uid); + return Objects.hash(E, T, mLowerCase, B, P); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class AccountUpdate {\n"); + sb.append("class BalancePositionUpdate {\n"); sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" mLowerCase: ").append(toIndentedString(mLowerCase)).append("\n"); sb.append(" B: ").append(toIndentedString(B)).append("\n"); - sb.append(" G: ").append(toIndentedString(G)).append("\n"); sb.append(" P: ").append(toIndentedString(P)).append("\n"); - sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); sb.append("}"); return sb.toString(); } @@ -240,26 +233,26 @@ public String toUrlQueryString() { String EValueAsString = EValue.toString(); valMap.put("E", EValueAsString); } - List<@Valid AccountUpdateBInner> BValue = getB(); + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + String mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + String mLowerCaseValueAsString = mLowerCaseValue.toString(); + valMap.put("mLowerCase", mLowerCaseValueAsString); + } + List<@Valid BalancePositionUpdateBInner> BValue = getB(); if (BValue != null) { String BValueAsString = JSON.getGson().toJson(BValue); valMap.put("B", BValueAsString); } - List<@Valid AccountUpdateGInner> GValue = getG(); - if (GValue != null) { - String GValueAsString = JSON.getGson().toJson(GValue); - valMap.put("G", GValueAsString); - } - List<@Valid AccountUpdatePInner> PValue = getP(); + List<@Valid BalancePositionUpdatePInner> PValue = getP(); if (PValue != null) { String PValueAsString = JSON.getGson().toJson(PValue); valMap.put("P", PValueAsString); } - Long uidValue = getUid(); - if (uidValue != null) { - String uidValueAsString = uidValue.toString(); - valMap.put("uid", uidValueAsString); - } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -275,22 +268,22 @@ public Map toMap() { if (EValue != null) { valMap.put("E", EValue); } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + valMap.put("mLowerCase", mLowerCaseValue); + } Object BValue = getB(); if (BValue != null) { valMap.put("B", BValue); } - Object GValue = getG(); - if (GValue != null) { - valMap.put("G", GValue); - } Object PValue = getP(); if (PValue != null) { valMap.put("P", PValue); } - Object uidValue = getUid(); - if (uidValue != null) { - valMap.put("uid", uidValue); - } valMap.put("timestamp", getTimestamp()); return valMap; @@ -318,10 +311,10 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("E"); + openapiFields.add("T"); + openapiFields.add("m"); openapiFields.add("B"); - openapiFields.add("G"); openapiFields.add("P"); - openapiFields.add("uid"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -331,32 +324,40 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AccountUpdate + * @throws IOException if the JSON Element is invalid with respect to BalancePositionUpdate */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!AccountUpdate.openapiRequiredFields + if (!BalancePositionUpdate.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in AccountUpdate is not found in the" - + " empty JSON string", - AccountUpdate.openapiRequiredFields.toString())); + "The required field(s) %s in BalancePositionUpdate is not found in" + + " the empty JSON string", + BalancePositionUpdate.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!AccountUpdate.openapiFields.contains(entry.getKey())) { + if (!BalancePositionUpdate.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `AccountUpdate` properties. JSON: %s", + + " `BalancePositionUpdate` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("m") != null && !jsonObj.get("m").isJsonNull()) + && !jsonObj.get("m").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `m` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("m").toString())); + } if (jsonObj.get("B") != null && !jsonObj.get("B").isJsonNull()) { JsonArray jsonArrayB = jsonObj.getAsJsonArray("B"); if (jsonArrayB != null) { @@ -371,26 +372,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `B` (array) for (int i = 0; i < jsonArrayB.size(); i++) { - AccountUpdateBInner.validateJsonElement(jsonArrayB.get(i)); - } - ; - } - } - if (jsonObj.get("G") != null && !jsonObj.get("G").isJsonNull()) { - JsonArray jsonArrayG = jsonObj.getAsJsonArray("G"); - if (jsonArrayG != null) { - // ensure the json data is an array - if (!jsonObj.get("G").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `G` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("G").toString())); - } - - // validate the optional field `G` (array) - for (int i = 0; i < jsonArrayG.size(); i++) { - AccountUpdateGInner.validateJsonElement(jsonArrayG.get(i)); + BalancePositionUpdateBInner.validateJsonElement(jsonArrayB.get(i)); } ; } @@ -409,7 +391,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `P` (array) for (int i = 0; i < jsonArrayP.size(); i++) { - AccountUpdatePInner.validateJsonElement(jsonArrayP.get(i)); + BalancePositionUpdatePInner.validateJsonElement(jsonArrayP.get(i)); } ; } @@ -420,23 +402,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!AccountUpdate.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AccountUpdate' and its subtypes + if (!BalancePositionUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BalancePositionUpdate' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AccountUpdate.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(BalancePositionUpdate.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, AccountUpdate value) throws IOException { + public void write(JsonWriter out, BalancePositionUpdate value) + throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public AccountUpdate read(JsonReader in) throws IOException { + public BalancePositionUpdate read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -446,18 +429,18 @@ public AccountUpdate read(JsonReader in) throws IOException { } /** - * Create an instance of AccountUpdate given an JSON string + * Create an instance of BalancePositionUpdate given an JSON string * * @param jsonString JSON string - * @return An instance of AccountUpdate - * @throws IOException if the JSON string is invalid with respect to AccountUpdate + * @return An instance of BalancePositionUpdate + * @throws IOException if the JSON string is invalid with respect to BalancePositionUpdate */ - public static AccountUpdate fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AccountUpdate.class); + public static BalancePositionUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BalancePositionUpdate.class); } /** - * Convert an instance of AccountUpdate to an JSON string + * Convert an instance of BalancePositionUpdate to an JSON string * * @return JSON string */ diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/BalancePositionUpdateBInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/BalancePositionUpdateBInner.java new file mode 100644 index 000000000..2bec2e297 --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/BalancePositionUpdateBInner.java @@ -0,0 +1,332 @@ +/* + * Binance Derivatives Trading Options WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Options WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_options.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** BalancePositionUpdateBInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class BalancePositionUpdateBInner extends BaseDTO { + public static final String SERIALIZED_NAME_A_LOWER_CASE = "a"; + + @SerializedName(SERIALIZED_NAME_A_LOWER_CASE) + @jakarta.annotation.Nullable + private String aLowerCase; + + public static final String SERIALIZED_NAME_B_LOWER_CASE = "b"; + + @SerializedName(SERIALIZED_NAME_B_LOWER_CASE) + @jakarta.annotation.Nullable + private String bLowerCase; + + public static final String SERIALIZED_NAME_BC = "bc"; + + @SerializedName(SERIALIZED_NAME_BC) + @jakarta.annotation.Nullable + private String bc; + + public BalancePositionUpdateBInner() {} + + public BalancePositionUpdateBInner aLowerCase(@jakarta.annotation.Nullable String aLowerCase) { + this.aLowerCase = aLowerCase; + return this; + } + + /** + * Get aLowerCase + * + * @return aLowerCase + */ + @jakarta.annotation.Nullable + public String getaLowerCase() { + return aLowerCase; + } + + public void setaLowerCase(@jakarta.annotation.Nullable String aLowerCase) { + this.aLowerCase = aLowerCase; + } + + public BalancePositionUpdateBInner bLowerCase(@jakarta.annotation.Nullable String bLowerCase) { + this.bLowerCase = bLowerCase; + return this; + } + + /** + * Get bLowerCase + * + * @return bLowerCase + */ + @jakarta.annotation.Nullable + public String getbLowerCase() { + return bLowerCase; + } + + public void setbLowerCase(@jakarta.annotation.Nullable String bLowerCase) { + this.bLowerCase = bLowerCase; + } + + public BalancePositionUpdateBInner bc(@jakarta.annotation.Nullable String bc) { + this.bc = bc; + return this; + } + + /** + * Get bc + * + * @return bc + */ + @jakarta.annotation.Nullable + public String getBc() { + return bc; + } + + public void setBc(@jakarta.annotation.Nullable String bc) { + this.bc = bc; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BalancePositionUpdateBInner balancePositionUpdateBInner = (BalancePositionUpdateBInner) o; + return Objects.equals(this.aLowerCase, balancePositionUpdateBInner.aLowerCase) + && Objects.equals(this.bLowerCase, balancePositionUpdateBInner.bLowerCase) + && Objects.equals(this.bc, balancePositionUpdateBInner.bc); + } + + @Override + public int hashCode() { + return Objects.hash(aLowerCase, bLowerCase, bc); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BalancePositionUpdateBInner {\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" bLowerCase: ").append(toIndentedString(bLowerCase)).append("\n"); + sb.append(" bc: ").append(toIndentedString(bc)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + String aLowerCaseValueAsString = aLowerCaseValue.toString(); + valMap.put("aLowerCase", aLowerCaseValueAsString); + } + String bLowerCaseValue = getbLowerCase(); + if (bLowerCaseValue != null) { + String bLowerCaseValueAsString = bLowerCaseValue.toString(); + valMap.put("bLowerCase", bLowerCaseValueAsString); + } + String bcValue = getBc(); + if (bcValue != null) { + String bcValueAsString = bcValue.toString(); + valMap.put("bc", bcValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + valMap.put("aLowerCase", aLowerCaseValue); + } + Object bLowerCaseValue = getbLowerCase(); + if (bLowerCaseValue != null) { + valMap.put("bLowerCase", bLowerCaseValue); + } + Object bcValue = getBc(); + if (bcValue != null) { + valMap.put("bc", bcValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("a"); + openapiFields.add("b"); + openapiFields.add("bc"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * BalancePositionUpdateBInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BalancePositionUpdateBInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in BalancePositionUpdateBInner is not" + + " found in the empty JSON string", + BalancePositionUpdateBInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!BalancePositionUpdateBInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `BalancePositionUpdateBInner` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("a") != null && !jsonObj.get("a").isJsonNull()) + && !jsonObj.get("a").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `a` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("a").toString())); + } + if ((jsonObj.get("b") != null && !jsonObj.get("b").isJsonNull()) + && !jsonObj.get("b").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `b` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("b").toString())); + } + if ((jsonObj.get("bc") != null && !jsonObj.get("bc").isJsonNull()) + && !jsonObj.get("bc").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bc` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("bc").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BalancePositionUpdateBInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BalancePositionUpdateBInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(BalancePositionUpdateBInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BalancePositionUpdateBInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BalancePositionUpdateBInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BalancePositionUpdateBInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of BalancePositionUpdateBInner + * @throws IOException if the JSON string is invalid with respect to BalancePositionUpdateBInner + */ + public static BalancePositionUpdateBInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BalancePositionUpdateBInner.class); + } + + /** + * Convert an instance of BalancePositionUpdateBInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdatePInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/BalancePositionUpdatePInner.java similarity index 73% rename from clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdatePInner.java rename to clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/BalancePositionUpdatePInner.java index e5cb3672a..42367eb33 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdatePInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/BalancePositionUpdatePInner.java @@ -34,11 +34,11 @@ import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; -/** AccountUpdatePInner */ +/** BalancePositionUpdatePInner */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class AccountUpdatePInner extends BaseDTO { +public class BalancePositionUpdatePInner extends BaseDTO { public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) @@ -51,12 +51,6 @@ public class AccountUpdatePInner extends BaseDTO { @jakarta.annotation.Nullable private String cLowerCase; - public static final String SERIALIZED_NAME_R_LOWER_CASE = "r"; - - @SerializedName(SERIALIZED_NAME_R_LOWER_CASE) - @jakarta.annotation.Nullable - private String rLowerCase; - public static final String SERIALIZED_NAME_P_LOWER_CASE = "p"; @SerializedName(SERIALIZED_NAME_P_LOWER_CASE) @@ -69,9 +63,9 @@ public class AccountUpdatePInner extends BaseDTO { @jakarta.annotation.Nullable private String aLowerCase; - public AccountUpdatePInner() {} + public BalancePositionUpdatePInner() {} - public AccountUpdatePInner sLowerCase(@jakarta.annotation.Nullable String sLowerCase) { + public BalancePositionUpdatePInner sLowerCase(@jakarta.annotation.Nullable String sLowerCase) { this.sLowerCase = sLowerCase; return this; } @@ -90,7 +84,7 @@ public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { this.sLowerCase = sLowerCase; } - public AccountUpdatePInner cLowerCase(@jakarta.annotation.Nullable String cLowerCase) { + public BalancePositionUpdatePInner cLowerCase(@jakarta.annotation.Nullable String cLowerCase) { this.cLowerCase = cLowerCase; return this; } @@ -109,26 +103,7 @@ public void setcLowerCase(@jakarta.annotation.Nullable String cLowerCase) { this.cLowerCase = cLowerCase; } - public AccountUpdatePInner rLowerCase(@jakarta.annotation.Nullable String rLowerCase) { - this.rLowerCase = rLowerCase; - return this; - } - - /** - * Get rLowerCase - * - * @return rLowerCase - */ - @jakarta.annotation.Nullable - public String getrLowerCase() { - return rLowerCase; - } - - public void setrLowerCase(@jakarta.annotation.Nullable String rLowerCase) { - this.rLowerCase = rLowerCase; - } - - public AccountUpdatePInner pLowerCase(@jakarta.annotation.Nullable String pLowerCase) { + public BalancePositionUpdatePInner pLowerCase(@jakarta.annotation.Nullable String pLowerCase) { this.pLowerCase = pLowerCase; return this; } @@ -147,7 +122,7 @@ public void setpLowerCase(@jakarta.annotation.Nullable String pLowerCase) { this.pLowerCase = pLowerCase; } - public AccountUpdatePInner aLowerCase(@jakarta.annotation.Nullable String aLowerCase) { + public BalancePositionUpdatePInner aLowerCase(@jakarta.annotation.Nullable String aLowerCase) { this.aLowerCase = aLowerCase; return this; } @@ -174,26 +149,24 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - AccountUpdatePInner accountUpdatePInner = (AccountUpdatePInner) o; - return Objects.equals(this.sLowerCase, accountUpdatePInner.sLowerCase) - && Objects.equals(this.cLowerCase, accountUpdatePInner.cLowerCase) - && Objects.equals(this.rLowerCase, accountUpdatePInner.rLowerCase) - && Objects.equals(this.pLowerCase, accountUpdatePInner.pLowerCase) - && Objects.equals(this.aLowerCase, accountUpdatePInner.aLowerCase); + BalancePositionUpdatePInner balancePositionUpdatePInner = (BalancePositionUpdatePInner) o; + return Objects.equals(this.sLowerCase, balancePositionUpdatePInner.sLowerCase) + && Objects.equals(this.cLowerCase, balancePositionUpdatePInner.cLowerCase) + && Objects.equals(this.pLowerCase, balancePositionUpdatePInner.pLowerCase) + && Objects.equals(this.aLowerCase, balancePositionUpdatePInner.aLowerCase); } @Override public int hashCode() { - return Objects.hash(sLowerCase, cLowerCase, rLowerCase, pLowerCase, aLowerCase); + return Objects.hash(sLowerCase, cLowerCase, pLowerCase, aLowerCase); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class AccountUpdatePInner {\n"); + sb.append("class BalancePositionUpdatePInner {\n"); sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); sb.append(" cLowerCase: ").append(toIndentedString(cLowerCase)).append("\n"); - sb.append(" rLowerCase: ").append(toIndentedString(rLowerCase)).append("\n"); sb.append(" pLowerCase: ").append(toIndentedString(pLowerCase)).append("\n"); sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); sb.append("}"); @@ -214,11 +187,6 @@ public String toUrlQueryString() { String cLowerCaseValueAsString = cLowerCaseValue.toString(); valMap.put("cLowerCase", cLowerCaseValueAsString); } - String rLowerCaseValue = getrLowerCase(); - if (rLowerCaseValue != null) { - String rLowerCaseValueAsString = rLowerCaseValue.toString(); - valMap.put("rLowerCase", rLowerCaseValueAsString); - } String pLowerCaseValue = getpLowerCase(); if (pLowerCaseValue != null) { String pLowerCaseValueAsString = pLowerCaseValue.toString(); @@ -248,10 +216,6 @@ public Map toMap() { if (cLowerCaseValue != null) { valMap.put("cLowerCase", cLowerCaseValue); } - Object rLowerCaseValue = getrLowerCase(); - if (rLowerCaseValue != null) { - valMap.put("rLowerCase", rLowerCaseValue); - } Object pLowerCaseValue = getpLowerCase(); if (pLowerCaseValue != null) { valMap.put("pLowerCase", pLowerCaseValue); @@ -288,7 +252,6 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("s"); openapiFields.add("c"); - openapiFields.add("r"); openapiFields.add("p"); openapiFields.add("a"); @@ -300,28 +263,29 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AccountUpdatePInner + * @throws IOException if the JSON Element is invalid with respect to + * BalancePositionUpdatePInner */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!AccountUpdatePInner.openapiRequiredFields + if (!BalancePositionUpdatePInner.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in AccountUpdatePInner is not found in" - + " the empty JSON string", - AccountUpdatePInner.openapiRequiredFields.toString())); + "The required field(s) %s in BalancePositionUpdatePInner is not" + + " found in the empty JSON string", + BalancePositionUpdatePInner.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!AccountUpdatePInner.openapiFields.contains(entry.getKey())) { + if (!BalancePositionUpdatePInner.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `AccountUpdatePInner` properties. JSON: %s", + + " `BalancePositionUpdatePInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } @@ -342,14 +306,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("c").toString())); } - if ((jsonObj.get("r") != null && !jsonObj.get("r").isJsonNull()) - && !jsonObj.get("r").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `r` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("r").toString())); - } if ((jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) && !jsonObj.get("p").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -372,24 +328,25 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!AccountUpdatePInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AccountUpdatePInner' and its subtypes + if (!BalancePositionUpdatePInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BalancePositionUpdatePInner' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AccountUpdatePInner.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(BalancePositionUpdatePInner.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, AccountUpdatePInner value) + public void write(JsonWriter out, BalancePositionUpdatePInner value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public AccountUpdatePInner read(JsonReader in) throws IOException { + public BalancePositionUpdatePInner read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -399,18 +356,18 @@ public AccountUpdatePInner read(JsonReader in) throws IOException { } /** - * Create an instance of AccountUpdatePInner given an JSON string + * Create an instance of BalancePositionUpdatePInner given an JSON string * * @param jsonString JSON string - * @return An instance of AccountUpdatePInner - * @throws IOException if the JSON string is invalid with respect to AccountUpdatePInner + * @return An instance of BalancePositionUpdatePInner + * @throws IOException if the JSON string is invalid with respect to BalancePositionUpdatePInner */ - public static AccountUpdatePInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AccountUpdatePInner.class); + public static BalancePositionUpdatePInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BalancePositionUpdatePInner.class); } /** - * Convert an instance of AccountUpdatePInner to an JSON string + * Convert an instance of BalancePositionUpdatePInner to an JSON string * * @return JSON string */ diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/DiffBookDepthStreamsRequest.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/DiffBookDepthStreamsRequest.java new file mode 100644 index 000000000..e0c11d2f5 --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/DiffBookDepthStreamsRequest.java @@ -0,0 +1,336 @@ +/* + * Binance Derivatives Trading Options WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Options WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_options.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** DiffBookDepthStreamsRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DiffBookDepthStreamsRequest extends BaseDTO { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @jakarta.annotation.Nullable + private Integer id; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nonnull + private String symbol; + + public static final String SERIALIZED_NAME_UPDATE_SPEED = "updateSpeed"; + + @SerializedName(SERIALIZED_NAME_UPDATE_SPEED) + @jakarta.annotation.Nullable + private String updateSpeed; + + public DiffBookDepthStreamsRequest() {} + + public DiffBookDepthStreamsRequest id(@jakarta.annotation.Nullable Integer id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @jakarta.annotation.Nullable + public Integer getId() { + return id; + } + + public void setId(@jakarta.annotation.Nullable Integer id) { + this.id = id; + } + + public DiffBookDepthStreamsRequest symbol(@jakarta.annotation.Nonnull String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nonnull + @NotNull + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nonnull String symbol) { + this.symbol = symbol; + } + + public DiffBookDepthStreamsRequest updateSpeed( + @jakarta.annotation.Nullable String updateSpeed) { + this.updateSpeed = updateSpeed; + return this; + } + + /** + * Get updateSpeed + * + * @return updateSpeed + */ + @jakarta.annotation.Nullable + public String getUpdateSpeed() { + return updateSpeed; + } + + public void setUpdateSpeed(@jakarta.annotation.Nullable String updateSpeed) { + this.updateSpeed = updateSpeed; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DiffBookDepthStreamsRequest diffBookDepthStreamsRequest = (DiffBookDepthStreamsRequest) o; + return Objects.equals(this.id, diffBookDepthStreamsRequest.id) + && Objects.equals(this.symbol, diffBookDepthStreamsRequest.symbol) + && Objects.equals(this.updateSpeed, diffBookDepthStreamsRequest.updateSpeed); + } + + @Override + public int hashCode() { + return Objects.hash(id, symbol, updateSpeed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DiffBookDepthStreamsRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" updateSpeed: ").append(toIndentedString(updateSpeed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Integer idValue = getId(); + if (idValue != null) { + String idValueAsString = idValue.toString(); + valMap.put("id", idValueAsString); + } + String symbolValue = getSymbol(); + if (symbolValue != null) { + String symbolValueAsString = symbolValue.toString(); + valMap.put("symbol", symbolValueAsString); + } + String updateSpeedValue = getUpdateSpeed(); + if (updateSpeedValue != null) { + String updateSpeedValueAsString = updateSpeedValue.toString(); + valMap.put("updateSpeed", updateSpeedValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object idValue = getId(); + if (idValue != null) { + valMap.put("id", idValue); + } + Object symbolValue = getSymbol(); + if (symbolValue != null) { + valMap.put("symbol", symbolValue); + } + Object updateSpeedValue = getUpdateSpeed(); + if (updateSpeedValue != null) { + valMap.put("updateSpeed", updateSpeedValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("symbol"); + openapiFields.add("updateSpeed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("symbol"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * DiffBookDepthStreamsRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DiffBookDepthStreamsRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DiffBookDepthStreamsRequest is not" + + " found in the empty JSON string", + DiffBookDepthStreamsRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DiffBookDepthStreamsRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DiffBookDepthStreamsRequest` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DiffBookDepthStreamsRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + if ((jsonObj.get("updateSpeed") != null && !jsonObj.get("updateSpeed").isJsonNull()) + && !jsonObj.get("updateSpeed").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updateSpeed` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updateSpeed").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DiffBookDepthStreamsRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DiffBookDepthStreamsRequest' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DiffBookDepthStreamsRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DiffBookDepthStreamsRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DiffBookDepthStreamsRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DiffBookDepthStreamsRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of DiffBookDepthStreamsRequest + * @throws IOException if the JSON string is invalid with respect to DiffBookDepthStreamsRequest + */ + public static DiffBookDepthStreamsRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DiffBookDepthStreamsRequest.class); + } + + /** + * Convert an instance of DiffBookDepthStreamsRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/DiffBookDepthStreamsResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/DiffBookDepthStreamsResponse.java new file mode 100644 index 000000000..a3fe9f38e --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/DiffBookDepthStreamsResponse.java @@ -0,0 +1,595 @@ +/* + * Binance Derivatives Trading Options WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Options WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_options.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** DiffBookDepthStreamsResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DiffBookDepthStreamsResponse extends BaseDTO { + public static final String SERIALIZED_NAME_E_LOWER_CASE = "e"; + + @SerializedName(SERIALIZED_NAME_E_LOWER_CASE) + @jakarta.annotation.Nullable + private String eLowerCase; + + public static final String SERIALIZED_NAME_E = "E"; + + @SerializedName(SERIALIZED_NAME_E) + @jakarta.annotation.Nullable + private Long E; + + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; + + @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) + @jakarta.annotation.Nullable + private String sLowerCase; + + public static final String SERIALIZED_NAME_U = "U"; + + @SerializedName(SERIALIZED_NAME_U) + @jakarta.annotation.Nullable + private Long U; + + public static final String SERIALIZED_NAME_U_LOWER_CASE = "u"; + + @SerializedName(SERIALIZED_NAME_U_LOWER_CASE) + @jakarta.annotation.Nullable + private Long uLowerCase; + + public static final String SERIALIZED_NAME_PU = "pu"; + + @SerializedName(SERIALIZED_NAME_PU) + @jakarta.annotation.Nullable + private Long pu; + + public static final String SERIALIZED_NAME_B_LOWER_CASE = "b"; + + @SerializedName(SERIALIZED_NAME_B_LOWER_CASE) + @jakarta.annotation.Nullable + private List bLowerCase; + + public static final String SERIALIZED_NAME_A_LOWER_CASE = "a"; + + @SerializedName(SERIALIZED_NAME_A_LOWER_CASE) + @jakarta.annotation.Nullable + private List aLowerCase; + + public DiffBookDepthStreamsResponse() {} + + public DiffBookDepthStreamsResponse eLowerCase(@jakarta.annotation.Nullable String eLowerCase) { + this.eLowerCase = eLowerCase; + return this; + } + + /** + * Get eLowerCase + * + * @return eLowerCase + */ + @jakarta.annotation.Nullable + public String geteLowerCase() { + return eLowerCase; + } + + public void seteLowerCase(@jakarta.annotation.Nullable String eLowerCase) { + this.eLowerCase = eLowerCase; + } + + public DiffBookDepthStreamsResponse E(@jakarta.annotation.Nullable Long E) { + this.E = E; + return this; + } + + /** + * Get E + * + * @return E + */ + @jakarta.annotation.Nullable + public Long getE() { + return E; + } + + public void setE(@jakarta.annotation.Nullable Long E) { + this.E = E; + } + + public DiffBookDepthStreamsResponse T(@jakarta.annotation.Nullable Long T) { + this.T = T; + return this; + } + + /** + * Get T + * + * @return T + */ + @jakarta.annotation.Nullable + public Long getT() { + return T; + } + + public void setT(@jakarta.annotation.Nullable Long T) { + this.T = T; + } + + public DiffBookDepthStreamsResponse sLowerCase(@jakarta.annotation.Nullable String sLowerCase) { + this.sLowerCase = sLowerCase; + return this; + } + + /** + * Get sLowerCase + * + * @return sLowerCase + */ + @jakarta.annotation.Nullable + public String getsLowerCase() { + return sLowerCase; + } + + public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { + this.sLowerCase = sLowerCase; + } + + public DiffBookDepthStreamsResponse U(@jakarta.annotation.Nullable Long U) { + this.U = U; + return this; + } + + /** + * Get U + * + * @return U + */ + @jakarta.annotation.Nullable + public Long getU() { + return U; + } + + public void setU(@jakarta.annotation.Nullable Long U) { + this.U = U; + } + + public DiffBookDepthStreamsResponse uLowerCase(@jakarta.annotation.Nullable Long uLowerCase) { + this.uLowerCase = uLowerCase; + return this; + } + + /** + * Get uLowerCase + * + * @return uLowerCase + */ + @jakarta.annotation.Nullable + public Long getuLowerCase() { + return uLowerCase; + } + + public void setuLowerCase(@jakarta.annotation.Nullable Long uLowerCase) { + this.uLowerCase = uLowerCase; + } + + public DiffBookDepthStreamsResponse pu(@jakarta.annotation.Nullable Long pu) { + this.pu = pu; + return this; + } + + /** + * Get pu + * + * @return pu + */ + @jakarta.annotation.Nullable + public Long getPu() { + return pu; + } + + public void setPu(@jakarta.annotation.Nullable Long pu) { + this.pu = pu; + } + + public DiffBookDepthStreamsResponse bLowerCase( + @jakarta.annotation.Nullable List bLowerCase) { + this.bLowerCase = bLowerCase; + return this; + } + + public DiffBookDepthStreamsResponse addBLowerCaseItem( + DiffBookDepthStreamsResponseBItem bLowerCaseItem) { + if (this.bLowerCase == null) { + this.bLowerCase = new ArrayList<>(); + } + this.bLowerCase.add(bLowerCaseItem); + return this; + } + + /** + * Get bLowerCase + * + * @return bLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public List getbLowerCase() { + return bLowerCase; + } + + public void setbLowerCase( + @jakarta.annotation.Nullable List bLowerCase) { + this.bLowerCase = bLowerCase; + } + + public DiffBookDepthStreamsResponse aLowerCase( + @jakarta.annotation.Nullable List aLowerCase) { + this.aLowerCase = aLowerCase; + return this; + } + + public DiffBookDepthStreamsResponse addALowerCaseItem( + DiffBookDepthStreamsResponseAItem aLowerCaseItem) { + if (this.aLowerCase == null) { + this.aLowerCase = new ArrayList<>(); + } + this.aLowerCase.add(aLowerCaseItem); + return this; + } + + /** + * Get aLowerCase + * + * @return aLowerCase + */ + @jakarta.annotation.Nullable + @Valid + public List getaLowerCase() { + return aLowerCase; + } + + public void setaLowerCase( + @jakarta.annotation.Nullable List aLowerCase) { + this.aLowerCase = aLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DiffBookDepthStreamsResponse diffBookDepthStreamsResponse = + (DiffBookDepthStreamsResponse) o; + return Objects.equals(this.eLowerCase, diffBookDepthStreamsResponse.eLowerCase) + && Objects.equals(this.E, diffBookDepthStreamsResponse.E) + && Objects.equals(this.T, diffBookDepthStreamsResponse.T) + && Objects.equals(this.sLowerCase, diffBookDepthStreamsResponse.sLowerCase) + && Objects.equals(this.U, diffBookDepthStreamsResponse.U) + && Objects.equals(this.uLowerCase, diffBookDepthStreamsResponse.uLowerCase) + && Objects.equals(this.pu, diffBookDepthStreamsResponse.pu) + && Objects.equals(this.bLowerCase, diffBookDepthStreamsResponse.bLowerCase) + && Objects.equals(this.aLowerCase, diffBookDepthStreamsResponse.aLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash( + eLowerCase, E, T, sLowerCase, U, uLowerCase, pu, bLowerCase, aLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DiffBookDepthStreamsResponse {\n"); + sb.append(" eLowerCase: ").append(toIndentedString(eLowerCase)).append("\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" U: ").append(toIndentedString(U)).append("\n"); + sb.append(" uLowerCase: ").append(toIndentedString(uLowerCase)).append("\n"); + sb.append(" pu: ").append(toIndentedString(pu)).append("\n"); + sb.append(" bLowerCase: ").append(toIndentedString(bLowerCase)).append("\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String eLowerCaseValue = geteLowerCase(); + if (eLowerCaseValue != null) { + String eLowerCaseValueAsString = eLowerCaseValue.toString(); + valMap.put("eLowerCase", eLowerCaseValueAsString); + } + Long EValue = getE(); + if (EValue != null) { + String EValueAsString = EValue.toString(); + valMap.put("E", EValueAsString); + } + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); + } + Long UValue = getU(); + if (UValue != null) { + String UValueAsString = UValue.toString(); + valMap.put("U", UValueAsString); + } + Long uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + String uLowerCaseValueAsString = uLowerCaseValue.toString(); + valMap.put("uLowerCase", uLowerCaseValueAsString); + } + Long puValue = getPu(); + if (puValue != null) { + String puValueAsString = puValue.toString(); + valMap.put("pu", puValueAsString); + } + List bLowerCaseValue = getbLowerCase(); + if (bLowerCaseValue != null) { + String bLowerCaseValueAsString = JSON.getGson().toJson(bLowerCaseValue); + valMap.put("bLowerCase", bLowerCaseValueAsString); + } + List aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + String aLowerCaseValueAsString = JSON.getGson().toJson(aLowerCaseValue); + valMap.put("aLowerCase", aLowerCaseValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object eLowerCaseValue = geteLowerCase(); + if (eLowerCaseValue != null) { + valMap.put("eLowerCase", eLowerCaseValue); + } + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + Object UValue = getU(); + if (UValue != null) { + valMap.put("U", UValue); + } + Object uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + valMap.put("uLowerCase", uLowerCaseValue); + } + Object puValue = getPu(); + if (puValue != null) { + valMap.put("pu", puValue); + } + Object bLowerCaseValue = getbLowerCase(); + if (bLowerCaseValue != null) { + valMap.put("bLowerCase", bLowerCaseValue); + } + Object aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + valMap.put("aLowerCase", aLowerCaseValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("e"); + openapiFields.add("E"); + openapiFields.add("T"); + openapiFields.add("s"); + openapiFields.add("U"); + openapiFields.add("u"); + openapiFields.add("pu"); + openapiFields.add("b"); + openapiFields.add("a"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * DiffBookDepthStreamsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DiffBookDepthStreamsResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DiffBookDepthStreamsResponse is not" + + " found in the empty JSON string", + DiffBookDepthStreamsResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DiffBookDepthStreamsResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DiffBookDepthStreamsResponse` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("e") != null && !jsonObj.get("e").isJsonNull()) + && !jsonObj.get("e").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `e` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("e").toString())); + } + if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) + && !jsonObj.get("s").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `s` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("s").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("b") != null + && !jsonObj.get("b").isJsonNull() + && !jsonObj.get("b").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `b` to be an array in the JSON string but got `%s`", + jsonObj.get("b").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("a") != null + && !jsonObj.get("a").isJsonNull() + && !jsonObj.get("a").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `a` to be an array in the JSON string but got `%s`", + jsonObj.get("a").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DiffBookDepthStreamsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DiffBookDepthStreamsResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DiffBookDepthStreamsResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DiffBookDepthStreamsResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DiffBookDepthStreamsResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DiffBookDepthStreamsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DiffBookDepthStreamsResponse + * @throws IOException if the JSON string is invalid with respect to + * DiffBookDepthStreamsResponse + */ + public static DiffBookDepthStreamsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DiffBookDepthStreamsResponse.class); + } + + /** + * Convert an instance of DiffBookDepthStreamsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Ticker24HourByUnderlyingAssetAndExpirationDataResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/DiffBookDepthStreamsResponseAItem.java similarity index 65% rename from clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Ticker24HourByUnderlyingAssetAndExpirationDataResponse.java rename to clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/DiffBookDepthStreamsResponseAItem.java index a438a3322..43eabe775 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Ticker24HourByUnderlyingAssetAndExpirationDataResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/DiffBookDepthStreamsResponseAItem.java @@ -32,13 +32,12 @@ import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; -/** Ticker24HourByUnderlyingAssetAndExpirationDataResponse */ +/** DiffBookDepthStreamsResponseAItem */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class Ticker24HourByUnderlyingAssetAndExpirationDataResponse - extends ArrayList { - public Ticker24HourByUnderlyingAssetAndExpirationDataResponse() {} +public class DiffBookDepthStreamsResponseAItem extends ArrayList { + public DiffBookDepthStreamsResponseAItem() {} @Override public boolean equals(Object o) { @@ -59,7 +58,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Ticker24HourByUnderlyingAssetAndExpirationDataResponse {\n"); + sb.append("class DiffBookDepthStreamsResponseAItem {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append("}"); return sb.toString(); @@ -112,19 +111,17 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * Ticker24HourByUnderlyingAssetAndExpirationDataResponse + * DiffBookDepthStreamsResponseAItem */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!Ticker24HourByUnderlyingAssetAndExpirationDataResponse.openapiRequiredFields + if (!DiffBookDepthStreamsResponseAItem.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in" - + " Ticker24HourByUnderlyingAssetAndExpirationDataResponse is" - + " not found in the empty JSON string", - Ticker24HourByUnderlyingAssetAndExpirationDataResponse - .openapiRequiredFields + "The required field(s) %s in DiffBookDepthStreamsResponseAItem is" + + " not found in the empty JSON string", + DiffBookDepthStreamsResponseAItem.openapiRequiredFields .toString())); } } @@ -132,13 +129,11 @@ 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 (!Ticker24HourByUnderlyingAssetAndExpirationDataResponse.openapiFields.contains( - entry.getKey())) { + if (!DiffBookDepthStreamsResponseAItem.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `Ticker24HourByUnderlyingAssetAndExpirationDataResponse`" - + " properties. JSON: %s", + + " `DiffBookDepthStreamsResponseAItem` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } @@ -148,33 +143,27 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!Ticker24HourByUnderlyingAssetAndExpirationDataResponse.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'Ticker24HourByUnderlyingAssetAndExpirationDataResponse' and its - // subtypes + if (!DiffBookDepthStreamsResponseAItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DiffBookDepthStreamsResponseAItem' and + // its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = + final TypeAdapter thisAdapter = gson.getDelegateAdapter( - this, - TypeToken.get( - Ticker24HourByUnderlyingAssetAndExpirationDataResponse.class)); + this, TypeToken.get(DiffBookDepthStreamsResponseAItem.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write( - JsonWriter out, - Ticker24HourByUnderlyingAssetAndExpirationDataResponse value) + public void write(JsonWriter out, DiffBookDepthStreamsResponseAItem value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); elementAdapter.write(out, obj); } @Override - public Ticker24HourByUnderlyingAssetAndExpirationDataResponse read( - JsonReader in) throws IOException { + public DiffBookDepthStreamsResponseAItem read(JsonReader in) + throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -184,23 +173,19 @@ public Ticker24HourByUnderlyingAssetAndExpirationDataResponse read( } /** - * Create an instance of Ticker24HourByUnderlyingAssetAndExpirationDataResponse given an JSON - * string + * Create an instance of DiffBookDepthStreamsResponseAItem given an JSON string * * @param jsonString JSON string - * @return An instance of Ticker24HourByUnderlyingAssetAndExpirationDataResponse + * @return An instance of DiffBookDepthStreamsResponseAItem * @throws IOException if the JSON string is invalid with respect to - * Ticker24HourByUnderlyingAssetAndExpirationDataResponse + * DiffBookDepthStreamsResponseAItem */ - public static Ticker24HourByUnderlyingAssetAndExpirationDataResponse fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, Ticker24HourByUnderlyingAssetAndExpirationDataResponse.class); + public static DiffBookDepthStreamsResponseAItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DiffBookDepthStreamsResponseAItem.class); } /** - * Convert an instance of Ticker24HourByUnderlyingAssetAndExpirationDataResponse to an JSON - * string + * Convert an instance of DiffBookDepthStreamsResponseAItem to an JSON string * * @return JSON string */ diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/DiffBookDepthStreamsResponseBItem.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/DiffBookDepthStreamsResponseBItem.java new file mode 100644 index 000000000..495418f35 --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/DiffBookDepthStreamsResponseBItem.java @@ -0,0 +1,195 @@ +/* + * Binance Derivatives Trading Options WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Options WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_options.websocket.stream.model; + +import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** DiffBookDepthStreamsResponseBItem */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DiffBookDepthStreamsResponseBItem extends ArrayList { + public DiffBookDepthStreamsResponseBItem() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DiffBookDepthStreamsResponseBItem {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * DiffBookDepthStreamsResponseBItem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DiffBookDepthStreamsResponseBItem.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DiffBookDepthStreamsResponseBItem is" + + " not found in the empty JSON string", + DiffBookDepthStreamsResponseBItem.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DiffBookDepthStreamsResponseBItem.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DiffBookDepthStreamsResponseBItem` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DiffBookDepthStreamsResponseBItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DiffBookDepthStreamsResponseBItem' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DiffBookDepthStreamsResponseBItem.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DiffBookDepthStreamsResponseBItem value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + elementAdapter.write(out, obj); + } + + @Override + public DiffBookDepthStreamsResponseBItem read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DiffBookDepthStreamsResponseBItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of DiffBookDepthStreamsResponseBItem + * @throws IOException if the JSON string is invalid with respect to + * DiffBookDepthStreamsResponseBItem + */ + public static DiffBookDepthStreamsResponseBItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DiffBookDepthStreamsResponseBItem.class); + } + + /** + * Convert an instance of DiffBookDepthStreamsResponseBItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/GreekUpdate.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/GreekUpdate.java new file mode 100644 index 000000000..532349d23 --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/GreekUpdate.java @@ -0,0 +1,337 @@ +/* + * Binance Derivatives Trading Options WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Options WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_options.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GreekUpdate */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GreekUpdate extends BaseDTO { + public static final String SERIALIZED_NAME_E = "E"; + + @SerializedName(SERIALIZED_NAME_E) + @jakarta.annotation.Nullable + private Long E; + + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public static final String SERIALIZED_NAME_G = "G"; + + @SerializedName(SERIALIZED_NAME_G) + @jakarta.annotation.Nullable + private List<@Valid GreekUpdateGInner> G; + + public GreekUpdate() {} + + public GreekUpdate E(@jakarta.annotation.Nullable Long E) { + this.E = E; + return this; + } + + /** + * Get E + * + * @return E + */ + @jakarta.annotation.Nullable + public Long getE() { + return E; + } + + public void setE(@jakarta.annotation.Nullable Long E) { + this.E = E; + } + + public GreekUpdate T(@jakarta.annotation.Nullable Long T) { + this.T = T; + return this; + } + + /** + * Get T + * + * @return T + */ + @jakarta.annotation.Nullable + public Long getT() { + return T; + } + + public void setT(@jakarta.annotation.Nullable Long T) { + this.T = T; + } + + public GreekUpdate G(@jakarta.annotation.Nullable List<@Valid GreekUpdateGInner> G) { + this.G = G; + return this; + } + + public GreekUpdate addGItem(GreekUpdateGInner GItem) { + if (this.G == null) { + this.G = new ArrayList<>(); + } + this.G.add(GItem); + return this; + } + + /** + * Get G + * + * @return G + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GreekUpdateGInner> getG() { + return G; + } + + public void setG(@jakarta.annotation.Nullable List<@Valid GreekUpdateGInner> G) { + this.G = G; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GreekUpdate greekUpdate = (GreekUpdate) o; + return Objects.equals(this.E, greekUpdate.E) + && Objects.equals(this.T, greekUpdate.T) + && Objects.equals(this.G, greekUpdate.G); + } + + @Override + public int hashCode() { + return Objects.hash(E, T, G); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GreekUpdate {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" G: ").append(toIndentedString(G)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Long EValue = getE(); + if (EValue != null) { + String EValueAsString = EValue.toString(); + valMap.put("E", EValueAsString); + } + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + List<@Valid GreekUpdateGInner> GValue = getG(); + if (GValue != null) { + String GValueAsString = JSON.getGson().toJson(GValue); + valMap.put("G", GValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object GValue = getG(); + if (GValue != null) { + valMap.put("G", GValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("E"); + openapiFields.add("T"); + openapiFields.add("G"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GreekUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GreekUpdate.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GreekUpdate is not found in the empty" + + " JSON string", + GreekUpdate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GreekUpdate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GreekUpdate` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("G") != null && !jsonObj.get("G").isJsonNull()) { + JsonArray jsonArrayG = jsonObj.getAsJsonArray("G"); + if (jsonArrayG != null) { + // ensure the json data is an array + if (!jsonObj.get("G").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `G` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("G").toString())); + } + + // validate the optional field `G` (array) + for (int i = 0; i < jsonArrayG.size(); i++) { + GreekUpdateGInner.validateJsonElement(jsonArrayG.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GreekUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GreekUpdate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GreekUpdate.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GreekUpdate value) throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GreekUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GreekUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of GreekUpdate + * @throws IOException if the JSON string is invalid with respect to GreekUpdate + */ + public static GreekUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GreekUpdate.class); + } + + /** + * Convert an instance of GreekUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdateGInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/GreekUpdateGInner.java similarity index 58% rename from clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdateGInner.java rename to clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/GreekUpdateGInner.java index 70b1741ae..912feca56 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdateGInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/GreekUpdateGInner.java @@ -12,7 +12,6 @@ package com.binance.connector.client.derivatives_trading_options.websocket.stream.model; -import com.binance.connector.client.common.DecimalFormatter; import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; import com.google.gson.Gson; @@ -24,7 +23,6 @@ import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; import jakarta.validation.constraints.*; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -36,63 +34,63 @@ import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; -/** AccountUpdateGInner */ +/** GreekUpdateGInner */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class AccountUpdateGInner extends BaseDTO { - public static final String SERIALIZED_NAME_UI = "ui"; +public class GreekUpdateGInner extends BaseDTO { + public static final String SERIALIZED_NAME_U_LOWER_CASE = "u"; - @SerializedName(SERIALIZED_NAME_UI) + @SerializedName(SERIALIZED_NAME_U_LOWER_CASE) @jakarta.annotation.Nullable - private String ui; + private String uLowerCase; public static final String SERIALIZED_NAME_D_LOWER_CASE = "d"; @SerializedName(SERIALIZED_NAME_D_LOWER_CASE) @jakarta.annotation.Nullable - private Double dLowerCase; + private String dLowerCase; - public static final String SERIALIZED_NAME_T_LOWER_CASE = "t"; + public static final String SERIALIZED_NAME_G_LOWER_CASE = "g"; - @SerializedName(SERIALIZED_NAME_T_LOWER_CASE) + @SerializedName(SERIALIZED_NAME_G_LOWER_CASE) @jakarta.annotation.Nullable - private Double tLowerCase; + private String gLowerCase; - public static final String SERIALIZED_NAME_G_LOWER_CASE = "g"; + public static final String SERIALIZED_NAME_T_LOWER_CASE = "t"; - @SerializedName(SERIALIZED_NAME_G_LOWER_CASE) + @SerializedName(SERIALIZED_NAME_T_LOWER_CASE) @jakarta.annotation.Nullable - private Double gLowerCase; + private String tLowerCase; public static final String SERIALIZED_NAME_V_LOWER_CASE = "v"; @SerializedName(SERIALIZED_NAME_V_LOWER_CASE) @jakarta.annotation.Nullable - private Double vLowerCase; + private String vLowerCase; - public AccountUpdateGInner() {} + public GreekUpdateGInner() {} - public AccountUpdateGInner ui(@jakarta.annotation.Nullable String ui) { - this.ui = ui; + public GreekUpdateGInner uLowerCase(@jakarta.annotation.Nullable String uLowerCase) { + this.uLowerCase = uLowerCase; return this; } /** - * Get ui + * Get uLowerCase * - * @return ui + * @return uLowerCase */ @jakarta.annotation.Nullable - public String getUi() { - return ui; + public String getuLowerCase() { + return uLowerCase; } - public void setUi(@jakarta.annotation.Nullable String ui) { - this.ui = ui; + public void setuLowerCase(@jakarta.annotation.Nullable String uLowerCase) { + this.uLowerCase = uLowerCase; } - public AccountUpdateGInner dLowerCase(@jakarta.annotation.Nullable Double dLowerCase) { + public GreekUpdateGInner dLowerCase(@jakarta.annotation.Nullable String dLowerCase) { this.dLowerCase = dLowerCase; return this; } @@ -103,56 +101,53 @@ public AccountUpdateGInner dLowerCase(@jakarta.annotation.Nullable Double dLower * @return dLowerCase */ @jakarta.annotation.Nullable - @Valid - public Double getdLowerCase() { + public String getdLowerCase() { return dLowerCase; } - public void setdLowerCase(@jakarta.annotation.Nullable Double dLowerCase) { + public void setdLowerCase(@jakarta.annotation.Nullable String dLowerCase) { this.dLowerCase = dLowerCase; } - public AccountUpdateGInner tLowerCase(@jakarta.annotation.Nullable Double tLowerCase) { - this.tLowerCase = tLowerCase; + public GreekUpdateGInner gLowerCase(@jakarta.annotation.Nullable String gLowerCase) { + this.gLowerCase = gLowerCase; return this; } /** - * Get tLowerCase + * Get gLowerCase * - * @return tLowerCase + * @return gLowerCase */ @jakarta.annotation.Nullable - @Valid - public Double gettLowerCase() { - return tLowerCase; + public String getgLowerCase() { + return gLowerCase; } - public void settLowerCase(@jakarta.annotation.Nullable Double tLowerCase) { - this.tLowerCase = tLowerCase; + public void setgLowerCase(@jakarta.annotation.Nullable String gLowerCase) { + this.gLowerCase = gLowerCase; } - public AccountUpdateGInner gLowerCase(@jakarta.annotation.Nullable Double gLowerCase) { - this.gLowerCase = gLowerCase; + public GreekUpdateGInner tLowerCase(@jakarta.annotation.Nullable String tLowerCase) { + this.tLowerCase = tLowerCase; return this; } /** - * Get gLowerCase + * Get tLowerCase * - * @return gLowerCase + * @return tLowerCase */ @jakarta.annotation.Nullable - @Valid - public Double getgLowerCase() { - return gLowerCase; + public String gettLowerCase() { + return tLowerCase; } - public void setgLowerCase(@jakarta.annotation.Nullable Double gLowerCase) { - this.gLowerCase = gLowerCase; + public void settLowerCase(@jakarta.annotation.Nullable String tLowerCase) { + this.tLowerCase = tLowerCase; } - public AccountUpdateGInner vLowerCase(@jakarta.annotation.Nullable Double vLowerCase) { + public GreekUpdateGInner vLowerCase(@jakarta.annotation.Nullable String vLowerCase) { this.vLowerCase = vLowerCase; return this; } @@ -163,12 +158,11 @@ public AccountUpdateGInner vLowerCase(@jakarta.annotation.Nullable Double vLower * @return vLowerCase */ @jakarta.annotation.Nullable - @Valid - public Double getvLowerCase() { + public String getvLowerCase() { return vLowerCase; } - public void setvLowerCase(@jakarta.annotation.Nullable Double vLowerCase) { + public void setvLowerCase(@jakarta.annotation.Nullable String vLowerCase) { this.vLowerCase = vLowerCase; } @@ -180,27 +174,27 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - AccountUpdateGInner accountUpdateGInner = (AccountUpdateGInner) o; - return Objects.equals(this.ui, accountUpdateGInner.ui) - && Objects.equals(this.dLowerCase, accountUpdateGInner.dLowerCase) - && Objects.equals(this.tLowerCase, accountUpdateGInner.tLowerCase) - && Objects.equals(this.gLowerCase, accountUpdateGInner.gLowerCase) - && Objects.equals(this.vLowerCase, accountUpdateGInner.vLowerCase); + GreekUpdateGInner greekUpdateGInner = (GreekUpdateGInner) o; + return Objects.equals(this.uLowerCase, greekUpdateGInner.uLowerCase) + && Objects.equals(this.dLowerCase, greekUpdateGInner.dLowerCase) + && Objects.equals(this.gLowerCase, greekUpdateGInner.gLowerCase) + && Objects.equals(this.tLowerCase, greekUpdateGInner.tLowerCase) + && Objects.equals(this.vLowerCase, greekUpdateGInner.vLowerCase); } @Override public int hashCode() { - return Objects.hash(ui, dLowerCase, tLowerCase, gLowerCase, vLowerCase); + return Objects.hash(uLowerCase, dLowerCase, gLowerCase, tLowerCase, vLowerCase); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class AccountUpdateGInner {\n"); - sb.append(" ui: ").append(toIndentedString(ui)).append("\n"); + sb.append("class GreekUpdateGInner {\n"); + sb.append(" uLowerCase: ").append(toIndentedString(uLowerCase)).append("\n"); sb.append(" dLowerCase: ").append(toIndentedString(dLowerCase)).append("\n"); - sb.append(" tLowerCase: ").append(toIndentedString(tLowerCase)).append("\n"); sb.append(" gLowerCase: ").append(toIndentedString(gLowerCase)).append("\n"); + sb.append(" tLowerCase: ").append(toIndentedString(tLowerCase)).append("\n"); sb.append(" vLowerCase: ").append(toIndentedString(vLowerCase)).append("\n"); sb.append("}"); return sb.toString(); @@ -210,33 +204,29 @@ public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - String uiValue = getUi(); - if (uiValue != null) { - String uiValueAsString = uiValue.toString(); - valMap.put("ui", uiValueAsString); + String uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + String uLowerCaseValueAsString = uLowerCaseValue.toString(); + valMap.put("uLowerCase", uLowerCaseValueAsString); } - Double dLowerCaseValue = getdLowerCase(); + String dLowerCaseValue = getdLowerCase(); if (dLowerCaseValue != null) { - String dLowerCaseValueAsString = - DecimalFormatter.getFormatter().format(dLowerCaseValue); + String dLowerCaseValueAsString = dLowerCaseValue.toString(); valMap.put("dLowerCase", dLowerCaseValueAsString); } - Double tLowerCaseValue = gettLowerCase(); - if (tLowerCaseValue != null) { - String tLowerCaseValueAsString = - DecimalFormatter.getFormatter().format(tLowerCaseValue); - valMap.put("tLowerCase", tLowerCaseValueAsString); - } - Double gLowerCaseValue = getgLowerCase(); + String gLowerCaseValue = getgLowerCase(); if (gLowerCaseValue != null) { - String gLowerCaseValueAsString = - DecimalFormatter.getFormatter().format(gLowerCaseValue); + String gLowerCaseValueAsString = gLowerCaseValue.toString(); valMap.put("gLowerCase", gLowerCaseValueAsString); } - Double vLowerCaseValue = getvLowerCase(); + String tLowerCaseValue = gettLowerCase(); + if (tLowerCaseValue != null) { + String tLowerCaseValueAsString = tLowerCaseValue.toString(); + valMap.put("tLowerCase", tLowerCaseValueAsString); + } + String vLowerCaseValue = getvLowerCase(); if (vLowerCaseValue != null) { - String vLowerCaseValueAsString = - DecimalFormatter.getFormatter().format(vLowerCaseValue); + String vLowerCaseValueAsString = vLowerCaseValue.toString(); valMap.put("vLowerCase", vLowerCaseValueAsString); } @@ -250,22 +240,22 @@ public String toUrlQueryString() { public Map toMap() { Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - Object uiValue = getUi(); - if (uiValue != null) { - valMap.put("ui", uiValue); + Object uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + valMap.put("uLowerCase", uLowerCaseValue); } Object dLowerCaseValue = getdLowerCase(); if (dLowerCaseValue != null) { valMap.put("dLowerCase", dLowerCaseValue); } - Object tLowerCaseValue = gettLowerCase(); - if (tLowerCaseValue != null) { - valMap.put("tLowerCase", tLowerCaseValue); - } Object gLowerCaseValue = getgLowerCase(); if (gLowerCaseValue != null) { valMap.put("gLowerCase", gLowerCaseValue); } + Object tLowerCaseValue = gettLowerCase(); + if (tLowerCaseValue != null) { + valMap.put("tLowerCase", tLowerCaseValue); + } Object vLowerCaseValue = getvLowerCase(); if (vLowerCaseValue != null) { valMap.put("vLowerCase", vLowerCaseValue); @@ -296,10 +286,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("ui"); + openapiFields.add("u"); openapiFields.add("d"); - openapiFields.add("t"); openapiFields.add("g"); + openapiFields.add("t"); openapiFields.add("v"); // a set of required properties/fields (JSON key names) @@ -310,39 +300,71 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AccountUpdateGInner + * @throws IOException if the JSON Element is invalid with respect to GreekUpdateGInner */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!AccountUpdateGInner.openapiRequiredFields + if (!GreekUpdateGInner.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in AccountUpdateGInner is not found in" - + " the empty JSON string", - AccountUpdateGInner.openapiRequiredFields.toString())); + "The required field(s) %s in GreekUpdateGInner is not found in the" + + " empty JSON string", + GreekUpdateGInner.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!AccountUpdateGInner.openapiFields.contains(entry.getKey())) { + if (!GreekUpdateGInner.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `AccountUpdateGInner` properties. JSON: %s", + + " `GreekUpdateGInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("ui") != null && !jsonObj.get("ui").isJsonNull()) - && !jsonObj.get("ui").isJsonPrimitive()) { + if ((jsonObj.get("u") != null && !jsonObj.get("u").isJsonNull()) + && !jsonObj.get("u").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `u` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("u").toString())); + } + if ((jsonObj.get("d") != null && !jsonObj.get("d").isJsonNull()) + && !jsonObj.get("d").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `d` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("d").toString())); + } + if ((jsonObj.get("g") != null && !jsonObj.get("g").isJsonNull()) + && !jsonObj.get("g").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `g` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("g").toString())); + } + if ((jsonObj.get("t") != null && !jsonObj.get("t").isJsonNull()) + && !jsonObj.get("t").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `t` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("t").toString())); + } + if ((jsonObj.get("v") != null && !jsonObj.get("v").isJsonNull()) + && !jsonObj.get("v").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `ui` to be a primitive type in the JSON string but" + "Expected the field `v` to be a primitive type in the JSON string but" + " got `%s`", - jsonObj.get("ui").toString())); + jsonObj.get("v").toString())); } } @@ -350,24 +372,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!AccountUpdateGInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AccountUpdateGInner' and its subtypes + if (!GreekUpdateGInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GreekUpdateGInner' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AccountUpdateGInner.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GreekUpdateGInner.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, AccountUpdateGInner value) + public void write(JsonWriter out, GreekUpdateGInner value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public AccountUpdateGInner read(JsonReader in) throws IOException { + public GreekUpdateGInner read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -377,18 +399,18 @@ public AccountUpdateGInner read(JsonReader in) throws IOException { } /** - * Create an instance of AccountUpdateGInner given an JSON string + * Create an instance of GreekUpdateGInner given an JSON string * * @param jsonString JSON string - * @return An instance of AccountUpdateGInner - * @throws IOException if the JSON string is invalid with respect to AccountUpdateGInner + * @return An instance of GreekUpdateGInner + * @throws IOException if the JSON string is invalid with respect to GreekUpdateGInner */ - public static AccountUpdateGInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AccountUpdateGInner.class); + public static GreekUpdateGInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GreekUpdateGInner.class); } /** - * Convert an instance of AccountUpdateGInner to an JSON string + * Convert an instance of GreekUpdateGInner to an JSON string * * @return JSON string */ diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/IndexPriceStreamsRequest.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/IndexPriceStreamsRequest.java index 6b7d5497c..f8badc4d7 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/IndexPriceStreamsRequest.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/IndexPriceStreamsRequest.java @@ -43,17 +43,11 @@ public class IndexPriceStreamsRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_ID) @jakarta.annotation.Nullable - private String id; - - public static final String SERIALIZED_NAME_SYMBOL = "symbol"; - - @SerializedName(SERIALIZED_NAME_SYMBOL) - @jakarta.annotation.Nonnull - private String symbol; + private Integer id; public IndexPriceStreamsRequest() {} - public IndexPriceStreamsRequest id(@jakarta.annotation.Nullable String id) { + public IndexPriceStreamsRequest id(@jakarta.annotation.Nullable Integer id) { this.id = id; return this; } @@ -64,34 +58,14 @@ public IndexPriceStreamsRequest id(@jakarta.annotation.Nullable String id) { * @return id */ @jakarta.annotation.Nullable - public String getId() { + public Integer getId() { return id; } - public void setId(@jakarta.annotation.Nullable String id) { + public void setId(@jakarta.annotation.Nullable Integer id) { this.id = id; } - public IndexPriceStreamsRequest symbol(@jakarta.annotation.Nonnull String symbol) { - this.symbol = symbol; - return this; - } - - /** - * Get symbol - * - * @return symbol - */ - @jakarta.annotation.Nonnull - @NotNull - public String getSymbol() { - return symbol; - } - - public void setSymbol(@jakarta.annotation.Nonnull String symbol) { - this.symbol = symbol; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -101,13 +75,12 @@ public boolean equals(Object o) { return false; } IndexPriceStreamsRequest indexPriceStreamsRequest = (IndexPriceStreamsRequest) o; - return Objects.equals(this.id, indexPriceStreamsRequest.id) - && Objects.equals(this.symbol, indexPriceStreamsRequest.symbol); + return Objects.equals(this.id, indexPriceStreamsRequest.id); } @Override public int hashCode() { - return Objects.hash(id, symbol); + return Objects.hash(id); } @Override @@ -115,7 +88,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class IndexPriceStreamsRequest {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); sb.append("}"); return sb.toString(); } @@ -124,16 +96,11 @@ public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - String idValue = getId(); + Integer idValue = getId(); if (idValue != null) { String idValueAsString = idValue.toString(); valMap.put("id", idValueAsString); } - String symbolValue = getSymbol(); - if (symbolValue != null) { - String symbolValueAsString = symbolValue.toString(); - valMap.put("symbol", symbolValueAsString); - } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -149,10 +116,6 @@ public Map toMap() { if (idValue != null) { valMap.put("id", idValue); } - Object symbolValue = getSymbol(); - if (symbolValue != null) { - valMap.put("symbol", symbolValue); - } valMap.put("timestamp", getTimestamp()); return valMap; @@ -180,11 +143,9 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("id"); - openapiFields.add("symbol"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("symbol"); } /** @@ -216,32 +177,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti entry.getKey(), jsonElement.toString())); } } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : IndexPriceStreamsRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("symbol").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `symbol` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("symbol").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/IndexPriceStreamsResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/IndexPriceStreamsResponse.java index 5f2f1e5e7..706b66e81 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/IndexPriceStreamsResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/IndexPriceStreamsResponse.java @@ -12,20 +12,18 @@ package com.binance.connector.client.derivatives_trading_options.websocket.stream.model; -import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import jakarta.validation.constraints.*; import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; import java.util.HashSet; import java.util.Map; import java.util.Objects; @@ -38,109 +36,9 @@ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class IndexPriceStreamsResponse extends BaseDTO { - public static final String SERIALIZED_NAME_E_LOWER_CASE = "e"; - - @SerializedName(SERIALIZED_NAME_E_LOWER_CASE) - @jakarta.annotation.Nullable - private String eLowerCase; - - public static final String SERIALIZED_NAME_E = "E"; - - @SerializedName(SERIALIZED_NAME_E) - @jakarta.annotation.Nullable - private Long E; - - public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; - - @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) - @jakarta.annotation.Nullable - private String sLowerCase; - - public static final String SERIALIZED_NAME_P_LOWER_CASE = "p"; - - @SerializedName(SERIALIZED_NAME_P_LOWER_CASE) - @jakarta.annotation.Nullable - private String pLowerCase; - +public class IndexPriceStreamsResponse extends ArrayList { public IndexPriceStreamsResponse() {} - public IndexPriceStreamsResponse eLowerCase(@jakarta.annotation.Nullable String eLowerCase) { - this.eLowerCase = eLowerCase; - return this; - } - - /** - * Get eLowerCase - * - * @return eLowerCase - */ - @jakarta.annotation.Nullable - public String geteLowerCase() { - return eLowerCase; - } - - public void seteLowerCase(@jakarta.annotation.Nullable String eLowerCase) { - this.eLowerCase = eLowerCase; - } - - public IndexPriceStreamsResponse E(@jakarta.annotation.Nullable Long E) { - this.E = E; - return this; - } - - /** - * Get E - * - * @return E - */ - @jakarta.annotation.Nullable - public Long getE() { - return E; - } - - public void setE(@jakarta.annotation.Nullable Long E) { - this.E = E; - } - - public IndexPriceStreamsResponse sLowerCase(@jakarta.annotation.Nullable String sLowerCase) { - this.sLowerCase = sLowerCase; - return this; - } - - /** - * Get sLowerCase - * - * @return sLowerCase - */ - @jakarta.annotation.Nullable - public String getsLowerCase() { - return sLowerCase; - } - - public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { - this.sLowerCase = sLowerCase; - } - - public IndexPriceStreamsResponse pLowerCase(@jakarta.annotation.Nullable String pLowerCase) { - this.pLowerCase = pLowerCase; - return this; - } - - /** - * Get pLowerCase - * - * @return pLowerCase - */ - @jakarta.annotation.Nullable - public String getpLowerCase() { - return pLowerCase; - } - - public void setpLowerCase(@jakarta.annotation.Nullable String pLowerCase) { - this.pLowerCase = pLowerCase; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -149,26 +47,19 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - IndexPriceStreamsResponse indexPriceStreamsResponse = (IndexPriceStreamsResponse) o; - return Objects.equals(this.eLowerCase, indexPriceStreamsResponse.eLowerCase) - && Objects.equals(this.E, indexPriceStreamsResponse.E) - && Objects.equals(this.sLowerCase, indexPriceStreamsResponse.sLowerCase) - && Objects.equals(this.pLowerCase, indexPriceStreamsResponse.pLowerCase); + return super.equals(o); } @Override public int hashCode() { - return Objects.hash(eLowerCase, E, sLowerCase, pLowerCase); + return Objects.hash(super.hashCode()); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class IndexPriceStreamsResponse {\n"); - sb.append(" eLowerCase: ").append(toIndentedString(eLowerCase)).append("\n"); - sb.append(" E: ").append(toIndentedString(E)).append("\n"); - sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); - sb.append(" pLowerCase: ").append(toIndentedString(pLowerCase)).append("\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append("}"); return sb.toString(); } @@ -176,29 +67,7 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String eLowerCaseValue = geteLowerCase(); - if (eLowerCaseValue != null) { - String eLowerCaseValueAsString = eLowerCaseValue.toString(); - valMap.put("eLowerCase", eLowerCaseValueAsString); - } - Long EValue = getE(); - if (EValue != null) { - String EValueAsString = EValue.toString(); - valMap.put("E", EValueAsString); - } - String sLowerCaseValue = getsLowerCase(); - if (sLowerCaseValue != null) { - String sLowerCaseValueAsString = sLowerCaseValue.toString(); - valMap.put("sLowerCase", sLowerCaseValueAsString); - } - String pLowerCaseValue = getpLowerCase(); - if (pLowerCaseValue != null) { - String pLowerCaseValueAsString = pLowerCaseValue.toString(); - valMap.put("pLowerCase", pLowerCaseValueAsString); - } - valMap.put("timestamp", getTimestamp()); return asciiEncode( valMap.keySet().stream() .map(key -> key + "=" + valMap.get(key)) @@ -207,25 +76,7 @@ public String toUrlQueryString() { public Map toMap() { Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Object eLowerCaseValue = geteLowerCase(); - if (eLowerCaseValue != null) { - valMap.put("eLowerCase", eLowerCaseValue); - } - Object EValue = getE(); - if (EValue != null) { - valMap.put("E", EValue); - } - Object sLowerCaseValue = getsLowerCase(); - if (sLowerCaseValue != null) { - valMap.put("sLowerCase", sLowerCaseValue); - } - Object pLowerCaseValue = getpLowerCase(); - if (pLowerCaseValue != null) { - valMap.put("pLowerCase", pLowerCaseValue); - } - valMap.put("timestamp", getTimestamp()); return valMap; } @@ -250,10 +101,6 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("e"); - openapiFields.add("E"); - openapiFields.add("s"); - openapiFields.add("p"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -288,31 +135,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti entry.getKey(), jsonElement.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("e") != null && !jsonObj.get("e").isJsonNull()) - && !jsonObj.get("e").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `e` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("e").toString())); - } - if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) - && !jsonObj.get("s").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `s` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("s").toString())); - } - if ((jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) - && !jsonObj.get("p").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `p` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("p").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -332,7 +154,7 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, IndexPriceStreamsResponse value) throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); elementAdapter.write(out, obj); } diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/IndexPriceStreamsResponseInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/IndexPriceStreamsResponseInner.java new file mode 100644 index 000000000..bc8ddf7aa --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/IndexPriceStreamsResponseInner.java @@ -0,0 +1,376 @@ +/* + * Binance Derivatives Trading Options WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Options WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_options.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** IndexPriceStreamsResponseInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class IndexPriceStreamsResponseInner extends BaseDTO { + public static final String SERIALIZED_NAME_E_LOWER_CASE = "e"; + + @SerializedName(SERIALIZED_NAME_E_LOWER_CASE) + @jakarta.annotation.Nullable + private String eLowerCase; + + public static final String SERIALIZED_NAME_E = "E"; + + @SerializedName(SERIALIZED_NAME_E) + @jakarta.annotation.Nullable + private Long E; + + public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; + + @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) + @jakarta.annotation.Nullable + private String sLowerCase; + + public static final String SERIALIZED_NAME_P_LOWER_CASE = "p"; + + @SerializedName(SERIALIZED_NAME_P_LOWER_CASE) + @jakarta.annotation.Nullable + private String pLowerCase; + + public IndexPriceStreamsResponseInner() {} + + public IndexPriceStreamsResponseInner eLowerCase( + @jakarta.annotation.Nullable String eLowerCase) { + this.eLowerCase = eLowerCase; + return this; + } + + /** + * Get eLowerCase + * + * @return eLowerCase + */ + @jakarta.annotation.Nullable + public String geteLowerCase() { + return eLowerCase; + } + + public void seteLowerCase(@jakarta.annotation.Nullable String eLowerCase) { + this.eLowerCase = eLowerCase; + } + + public IndexPriceStreamsResponseInner E(@jakarta.annotation.Nullable Long E) { + this.E = E; + return this; + } + + /** + * Get E + * + * @return E + */ + @jakarta.annotation.Nullable + public Long getE() { + return E; + } + + public void setE(@jakarta.annotation.Nullable Long E) { + this.E = E; + } + + public IndexPriceStreamsResponseInner sLowerCase( + @jakarta.annotation.Nullable String sLowerCase) { + this.sLowerCase = sLowerCase; + return this; + } + + /** + * Get sLowerCase + * + * @return sLowerCase + */ + @jakarta.annotation.Nullable + public String getsLowerCase() { + return sLowerCase; + } + + public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { + this.sLowerCase = sLowerCase; + } + + public IndexPriceStreamsResponseInner pLowerCase( + @jakarta.annotation.Nullable String pLowerCase) { + this.pLowerCase = pLowerCase; + return this; + } + + /** + * Get pLowerCase + * + * @return pLowerCase + */ + @jakarta.annotation.Nullable + public String getpLowerCase() { + return pLowerCase; + } + + public void setpLowerCase(@jakarta.annotation.Nullable String pLowerCase) { + this.pLowerCase = pLowerCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IndexPriceStreamsResponseInner indexPriceStreamsResponseInner = + (IndexPriceStreamsResponseInner) o; + return Objects.equals(this.eLowerCase, indexPriceStreamsResponseInner.eLowerCase) + && Objects.equals(this.E, indexPriceStreamsResponseInner.E) + && Objects.equals(this.sLowerCase, indexPriceStreamsResponseInner.sLowerCase) + && Objects.equals(this.pLowerCase, indexPriceStreamsResponseInner.pLowerCase); + } + + @Override + public int hashCode() { + return Objects.hash(eLowerCase, E, sLowerCase, pLowerCase); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IndexPriceStreamsResponseInner {\n"); + sb.append(" eLowerCase: ").append(toIndentedString(eLowerCase)).append("\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" pLowerCase: ").append(toIndentedString(pLowerCase)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String eLowerCaseValue = geteLowerCase(); + if (eLowerCaseValue != null) { + String eLowerCaseValueAsString = eLowerCaseValue.toString(); + valMap.put("eLowerCase", eLowerCaseValueAsString); + } + Long EValue = getE(); + if (EValue != null) { + String EValueAsString = EValue.toString(); + valMap.put("E", EValueAsString); + } + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); + } + String pLowerCaseValue = getpLowerCase(); + if (pLowerCaseValue != null) { + String pLowerCaseValueAsString = pLowerCaseValue.toString(); + valMap.put("pLowerCase", pLowerCaseValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object eLowerCaseValue = geteLowerCase(); + if (eLowerCaseValue != null) { + valMap.put("eLowerCase", eLowerCaseValue); + } + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + Object pLowerCaseValue = getpLowerCase(); + if (pLowerCaseValue != null) { + valMap.put("pLowerCase", pLowerCaseValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("e"); + openapiFields.add("E"); + openapiFields.add("s"); + openapiFields.add("p"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * IndexPriceStreamsResponseInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IndexPriceStreamsResponseInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in IndexPriceStreamsResponseInner is not" + + " found in the empty JSON string", + IndexPriceStreamsResponseInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IndexPriceStreamsResponseInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `IndexPriceStreamsResponseInner` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("e") != null && !jsonObj.get("e").isJsonNull()) + && !jsonObj.get("e").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `e` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("e").toString())); + } + if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) + && !jsonObj.get("s").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `s` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("s").toString())); + } + if ((jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) + && !jsonObj.get("p").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `p` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("p").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IndexPriceStreamsResponseInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IndexPriceStreamsResponseInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(IndexPriceStreamsResponseInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, IndexPriceStreamsResponseInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IndexPriceStreamsResponseInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of IndexPriceStreamsResponseInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of IndexPriceStreamsResponseInner + * @throws IOException if the JSON string is invalid with respect to + * IndexPriceStreamsResponseInner + */ + public static IndexPriceStreamsResponseInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IndexPriceStreamsResponseInner.class); + } + + /** + * Convert an instance of IndexPriceStreamsResponseInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/IndividualSymbolBookTickerStreamsRequest.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/IndividualSymbolBookTickerStreamsRequest.java new file mode 100644 index 000000000..6266164cf --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/IndividualSymbolBookTickerStreamsRequest.java @@ -0,0 +1,302 @@ +/* + * Binance Derivatives Trading Options WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Options WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_options.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** IndividualSymbolBookTickerStreamsRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class IndividualSymbolBookTickerStreamsRequest extends BaseDTO { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + @jakarta.annotation.Nullable + private Integer id; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nonnull + private String symbol; + + public IndividualSymbolBookTickerStreamsRequest() {} + + public IndividualSymbolBookTickerStreamsRequest id(@jakarta.annotation.Nullable Integer id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @jakarta.annotation.Nullable + public Integer getId() { + return id; + } + + public void setId(@jakarta.annotation.Nullable Integer id) { + this.id = id; + } + + public IndividualSymbolBookTickerStreamsRequest symbol( + @jakarta.annotation.Nonnull String symbol) { + this.symbol = symbol; + return this; + } + + /** + * Get symbol + * + * @return symbol + */ + @jakarta.annotation.Nonnull + @NotNull + public String getSymbol() { + return symbol; + } + + public void setSymbol(@jakarta.annotation.Nonnull String symbol) { + this.symbol = symbol; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IndividualSymbolBookTickerStreamsRequest individualSymbolBookTickerStreamsRequest = + (IndividualSymbolBookTickerStreamsRequest) o; + return Objects.equals(this.id, individualSymbolBookTickerStreamsRequest.id) + && Objects.equals(this.symbol, individualSymbolBookTickerStreamsRequest.symbol); + } + + @Override + public int hashCode() { + return Objects.hash(id, symbol); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IndividualSymbolBookTickerStreamsRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Integer idValue = getId(); + if (idValue != null) { + String idValueAsString = idValue.toString(); + valMap.put("id", idValueAsString); + } + String symbolValue = getSymbol(); + if (symbolValue != null) { + String symbolValueAsString = symbolValue.toString(); + valMap.put("symbol", symbolValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object idValue = getId(); + if (idValue != null) { + valMap.put("id", idValue); + } + Object symbolValue = getSymbol(); + if (symbolValue != null) { + valMap.put("symbol", symbolValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("symbol"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("symbol"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * IndividualSymbolBookTickerStreamsRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IndividualSymbolBookTickerStreamsRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " IndividualSymbolBookTickerStreamsRequest is not found in" + + " the empty JSON string", + IndividualSymbolBookTickerStreamsRequest.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IndividualSymbolBookTickerStreamsRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `IndividualSymbolBookTickerStreamsRequest` properties." + + " JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + IndividualSymbolBookTickerStreamsRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `symbol` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("symbol").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IndividualSymbolBookTickerStreamsRequest.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'IndividualSymbolBookTickerStreamsRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(IndividualSymbolBookTickerStreamsRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, IndividualSymbolBookTickerStreamsRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IndividualSymbolBookTickerStreamsRequest read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of IndividualSymbolBookTickerStreamsRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of IndividualSymbolBookTickerStreamsRequest + * @throws IOException if the JSON string is invalid with respect to + * IndividualSymbolBookTickerStreamsRequest + */ + public static IndividualSymbolBookTickerStreamsRequest fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, IndividualSymbolBookTickerStreamsRequest.class); + } + + /** + * Convert an instance of IndividualSymbolBookTickerStreamsRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdateBInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/IndividualSymbolBookTickerStreamsResponse.java similarity index 51% rename from clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdateBInner.java rename to clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/IndividualSymbolBookTickerStreamsResponse.java index e861b75b5..a67958bfc 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/AccountUpdateBInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/IndividualSymbolBookTickerStreamsResponse.java @@ -34,46 +34,40 @@ import java.util.stream.Collectors; import org.hibernate.validator.constraints.*; -/** AccountUpdateBInner */ +/** IndividualSymbolBookTickerStreamsResponse */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class AccountUpdateBInner extends BaseDTO { - public static final String SERIALIZED_NAME_B_LOWER_CASE = "b"; +public class IndividualSymbolBookTickerStreamsResponse extends BaseDTO { + public static final String SERIALIZED_NAME_E_LOWER_CASE = "e"; - @SerializedName(SERIALIZED_NAME_B_LOWER_CASE) + @SerializedName(SERIALIZED_NAME_E_LOWER_CASE) @jakarta.annotation.Nullable - private String bLowerCase; - - public static final String SERIALIZED_NAME_M_LOWER_CASE = "m"; - - @SerializedName(SERIALIZED_NAME_M_LOWER_CASE) - @jakarta.annotation.Nullable - private String mLowerCase; + private String eLowerCase; public static final String SERIALIZED_NAME_U_LOWER_CASE = "u"; @SerializedName(SERIALIZED_NAME_U_LOWER_CASE) @jakarta.annotation.Nullable - private String uLowerCase; + private Long uLowerCase; - public static final String SERIALIZED_NAME_U = "U"; + public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; - @SerializedName(SERIALIZED_NAME_U) + @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) @jakarta.annotation.Nullable - private Long U; + private String sLowerCase; - public static final String SERIALIZED_NAME_M = "M"; + public static final String SERIALIZED_NAME_B_LOWER_CASE = "b"; - @SerializedName(SERIALIZED_NAME_M) + @SerializedName(SERIALIZED_NAME_B_LOWER_CASE) @jakarta.annotation.Nullable - private String M; + private String bLowerCase; - public static final String SERIALIZED_NAME_I_LOWER_CASE = "i"; + public static final String SERIALIZED_NAME_B = "B"; - @SerializedName(SERIALIZED_NAME_I_LOWER_CASE) + @SerializedName(SERIALIZED_NAME_B) @jakarta.annotation.Nullable - private String iLowerCase; + private String B; public static final String SERIALIZED_NAME_A_LOWER_CASE = "a"; @@ -81,47 +75,48 @@ public class AccountUpdateBInner extends BaseDTO { @jakarta.annotation.Nullable private String aLowerCase; - public AccountUpdateBInner() {} + public static final String SERIALIZED_NAME_A = "A"; - public AccountUpdateBInner bLowerCase(@jakarta.annotation.Nullable String bLowerCase) { - this.bLowerCase = bLowerCase; - return this; - } + @SerializedName(SERIALIZED_NAME_A) + @jakarta.annotation.Nullable + private String A; - /** - * Get bLowerCase - * - * @return bLowerCase - */ + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) @jakarta.annotation.Nullable - public String getbLowerCase() { - return bLowerCase; - } + private Long T; - public void setbLowerCase(@jakarta.annotation.Nullable String bLowerCase) { - this.bLowerCase = bLowerCase; - } + public static final String SERIALIZED_NAME_E = "E"; + + @SerializedName(SERIALIZED_NAME_E) + @jakarta.annotation.Nullable + private Long E; + + public IndividualSymbolBookTickerStreamsResponse() {} - public AccountUpdateBInner mLowerCase(@jakarta.annotation.Nullable String mLowerCase) { - this.mLowerCase = mLowerCase; + public IndividualSymbolBookTickerStreamsResponse eLowerCase( + @jakarta.annotation.Nullable String eLowerCase) { + this.eLowerCase = eLowerCase; return this; } /** - * Get mLowerCase + * Get eLowerCase * - * @return mLowerCase + * @return eLowerCase */ @jakarta.annotation.Nullable - public String getmLowerCase() { - return mLowerCase; + public String geteLowerCase() { + return eLowerCase; } - public void setmLowerCase(@jakarta.annotation.Nullable String mLowerCase) { - this.mLowerCase = mLowerCase; + public void seteLowerCase(@jakarta.annotation.Nullable String eLowerCase) { + this.eLowerCase = eLowerCase; } - public AccountUpdateBInner uLowerCase(@jakarta.annotation.Nullable String uLowerCase) { + public IndividualSymbolBookTickerStreamsResponse uLowerCase( + @jakarta.annotation.Nullable Long uLowerCase) { this.uLowerCase = uLowerCase; return this; } @@ -132,72 +127,75 @@ public AccountUpdateBInner uLowerCase(@jakarta.annotation.Nullable String uLower * @return uLowerCase */ @jakarta.annotation.Nullable - public String getuLowerCase() { + public Long getuLowerCase() { return uLowerCase; } - public void setuLowerCase(@jakarta.annotation.Nullable String uLowerCase) { + public void setuLowerCase(@jakarta.annotation.Nullable Long uLowerCase) { this.uLowerCase = uLowerCase; } - public AccountUpdateBInner U(@jakarta.annotation.Nullable Long U) { - this.U = U; + public IndividualSymbolBookTickerStreamsResponse sLowerCase( + @jakarta.annotation.Nullable String sLowerCase) { + this.sLowerCase = sLowerCase; return this; } /** - * Get U + * Get sLowerCase * - * @return U + * @return sLowerCase */ @jakarta.annotation.Nullable - public Long getU() { - return U; + public String getsLowerCase() { + return sLowerCase; } - public void setU(@jakarta.annotation.Nullable Long U) { - this.U = U; + public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { + this.sLowerCase = sLowerCase; } - public AccountUpdateBInner M(@jakarta.annotation.Nullable String M) { - this.M = M; + public IndividualSymbolBookTickerStreamsResponse bLowerCase( + @jakarta.annotation.Nullable String bLowerCase) { + this.bLowerCase = bLowerCase; return this; } /** - * Get M + * Get bLowerCase * - * @return M + * @return bLowerCase */ @jakarta.annotation.Nullable - public String getM() { - return M; + public String getbLowerCase() { + return bLowerCase; } - public void setM(@jakarta.annotation.Nullable String M) { - this.M = M; + public void setbLowerCase(@jakarta.annotation.Nullable String bLowerCase) { + this.bLowerCase = bLowerCase; } - public AccountUpdateBInner iLowerCase(@jakarta.annotation.Nullable String iLowerCase) { - this.iLowerCase = iLowerCase; + public IndividualSymbolBookTickerStreamsResponse B(@jakarta.annotation.Nullable String B) { + this.B = B; return this; } /** - * Get iLowerCase + * Get B * - * @return iLowerCase + * @return B */ @jakarta.annotation.Nullable - public String getiLowerCase() { - return iLowerCase; + public String getB() { + return B; } - public void setiLowerCase(@jakarta.annotation.Nullable String iLowerCase) { - this.iLowerCase = iLowerCase; + public void setB(@jakarta.annotation.Nullable String B) { + this.B = B; } - public AccountUpdateBInner aLowerCase(@jakarta.annotation.Nullable String aLowerCase) { + public IndividualSymbolBookTickerStreamsResponse aLowerCase( + @jakarta.annotation.Nullable String aLowerCase) { this.aLowerCase = aLowerCase; return this; } @@ -216,6 +214,63 @@ public void setaLowerCase(@jakarta.annotation.Nullable String aLowerCase) { this.aLowerCase = aLowerCase; } + public IndividualSymbolBookTickerStreamsResponse A(@jakarta.annotation.Nullable String A) { + this.A = A; + return this; + } + + /** + * Get A + * + * @return A + */ + @jakarta.annotation.Nullable + public String getA() { + return A; + } + + public void setA(@jakarta.annotation.Nullable String A) { + this.A = A; + } + + public IndividualSymbolBookTickerStreamsResponse T(@jakarta.annotation.Nullable Long T) { + this.T = T; + return this; + } + + /** + * Get T + * + * @return T + */ + @jakarta.annotation.Nullable + public Long getT() { + return T; + } + + public void setT(@jakarta.annotation.Nullable Long T) { + this.T = T; + } + + public IndividualSymbolBookTickerStreamsResponse E(@jakarta.annotation.Nullable Long E) { + this.E = E; + return this; + } + + /** + * Get E + * + * @return E + */ + @jakarta.annotation.Nullable + public Long getE() { + return E; + } + + public void setE(@jakarta.annotation.Nullable Long E) { + this.E = E; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -224,32 +279,41 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - AccountUpdateBInner accountUpdateBInner = (AccountUpdateBInner) o; - return Objects.equals(this.bLowerCase, accountUpdateBInner.bLowerCase) - && Objects.equals(this.mLowerCase, accountUpdateBInner.mLowerCase) - && Objects.equals(this.uLowerCase, accountUpdateBInner.uLowerCase) - && Objects.equals(this.U, accountUpdateBInner.U) - && Objects.equals(this.M, accountUpdateBInner.M) - && Objects.equals(this.iLowerCase, accountUpdateBInner.iLowerCase) - && Objects.equals(this.aLowerCase, accountUpdateBInner.aLowerCase); + IndividualSymbolBookTickerStreamsResponse individualSymbolBookTickerStreamsResponse = + (IndividualSymbolBookTickerStreamsResponse) o; + return Objects.equals(this.eLowerCase, individualSymbolBookTickerStreamsResponse.eLowerCase) + && Objects.equals( + this.uLowerCase, individualSymbolBookTickerStreamsResponse.uLowerCase) + && Objects.equals( + this.sLowerCase, individualSymbolBookTickerStreamsResponse.sLowerCase) + && Objects.equals( + this.bLowerCase, individualSymbolBookTickerStreamsResponse.bLowerCase) + && Objects.equals(this.B, individualSymbolBookTickerStreamsResponse.B) + && Objects.equals( + this.aLowerCase, individualSymbolBookTickerStreamsResponse.aLowerCase) + && Objects.equals(this.A, individualSymbolBookTickerStreamsResponse.A) + && Objects.equals(this.T, individualSymbolBookTickerStreamsResponse.T) + && Objects.equals(this.E, individualSymbolBookTickerStreamsResponse.E); } @Override public int hashCode() { - return Objects.hash(bLowerCase, mLowerCase, uLowerCase, U, M, iLowerCase, aLowerCase); + return Objects.hash(eLowerCase, uLowerCase, sLowerCase, bLowerCase, B, aLowerCase, A, T, E); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class AccountUpdateBInner {\n"); - sb.append(" bLowerCase: ").append(toIndentedString(bLowerCase)).append("\n"); - sb.append(" mLowerCase: ").append(toIndentedString(mLowerCase)).append("\n"); + sb.append("class IndividualSymbolBookTickerStreamsResponse {\n"); + sb.append(" eLowerCase: ").append(toIndentedString(eLowerCase)).append("\n"); sb.append(" uLowerCase: ").append(toIndentedString(uLowerCase)).append("\n"); - sb.append(" U: ").append(toIndentedString(U)).append("\n"); - sb.append(" M: ").append(toIndentedString(M)).append("\n"); - sb.append(" iLowerCase: ").append(toIndentedString(iLowerCase)).append("\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" bLowerCase: ").append(toIndentedString(bLowerCase)).append("\n"); + sb.append(" B: ").append(toIndentedString(B)).append("\n"); sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" A: ").append(toIndentedString(A)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); sb.append("}"); return sb.toString(); } @@ -258,41 +322,51 @@ public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - String bLowerCaseValue = getbLowerCase(); - if (bLowerCaseValue != null) { - String bLowerCaseValueAsString = bLowerCaseValue.toString(); - valMap.put("bLowerCase", bLowerCaseValueAsString); + String eLowerCaseValue = geteLowerCase(); + if (eLowerCaseValue != null) { + String eLowerCaseValueAsString = eLowerCaseValue.toString(); + valMap.put("eLowerCase", eLowerCaseValueAsString); } - String mLowerCaseValue = getmLowerCase(); - if (mLowerCaseValue != null) { - String mLowerCaseValueAsString = mLowerCaseValue.toString(); - valMap.put("mLowerCase", mLowerCaseValueAsString); - } - String uLowerCaseValue = getuLowerCase(); + Long uLowerCaseValue = getuLowerCase(); if (uLowerCaseValue != null) { String uLowerCaseValueAsString = uLowerCaseValue.toString(); valMap.put("uLowerCase", uLowerCaseValueAsString); } - Long UValue = getU(); - if (UValue != null) { - String UValueAsString = UValue.toString(); - valMap.put("U", UValueAsString); + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); } - String MValue = getM(); - if (MValue != null) { - String MValueAsString = MValue.toString(); - valMap.put("M", MValueAsString); + String bLowerCaseValue = getbLowerCase(); + if (bLowerCaseValue != null) { + String bLowerCaseValueAsString = bLowerCaseValue.toString(); + valMap.put("bLowerCase", bLowerCaseValueAsString); } - String iLowerCaseValue = getiLowerCase(); - if (iLowerCaseValue != null) { - String iLowerCaseValueAsString = iLowerCaseValue.toString(); - valMap.put("iLowerCase", iLowerCaseValueAsString); + String BValue = getB(); + if (BValue != null) { + String BValueAsString = BValue.toString(); + valMap.put("B", BValueAsString); } String aLowerCaseValue = getaLowerCase(); if (aLowerCaseValue != null) { String aLowerCaseValueAsString = aLowerCaseValue.toString(); valMap.put("aLowerCase", aLowerCaseValueAsString); } + String AValue = getA(); + if (AValue != null) { + String AValueAsString = AValue.toString(); + valMap.put("A", AValueAsString); + } + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + Long EValue = getE(); + if (EValue != null) { + String EValueAsString = EValue.toString(); + valMap.put("E", EValueAsString); + } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -304,34 +378,42 @@ public String toUrlQueryString() { public Map toMap() { Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - Object bLowerCaseValue = getbLowerCase(); - if (bLowerCaseValue != null) { - valMap.put("bLowerCase", bLowerCaseValue); - } - Object mLowerCaseValue = getmLowerCase(); - if (mLowerCaseValue != null) { - valMap.put("mLowerCase", mLowerCaseValue); + Object eLowerCaseValue = geteLowerCase(); + if (eLowerCaseValue != null) { + valMap.put("eLowerCase", eLowerCaseValue); } Object uLowerCaseValue = getuLowerCase(); if (uLowerCaseValue != null) { valMap.put("uLowerCase", uLowerCaseValue); } - Object UValue = getU(); - if (UValue != null) { - valMap.put("U", UValue); + Object sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); } - Object MValue = getM(); - if (MValue != null) { - valMap.put("M", MValue); + Object bLowerCaseValue = getbLowerCase(); + if (bLowerCaseValue != null) { + valMap.put("bLowerCase", bLowerCaseValue); } - Object iLowerCaseValue = getiLowerCase(); - if (iLowerCaseValue != null) { - valMap.put("iLowerCase", iLowerCaseValue); + Object BValue = getB(); + if (BValue != null) { + valMap.put("B", BValue); } Object aLowerCaseValue = getaLowerCase(); if (aLowerCaseValue != null) { valMap.put("aLowerCase", aLowerCaseValue); } + Object AValue = getA(); + if (AValue != null) { + valMap.put("A", AValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } valMap.put("timestamp", getTimestamp()); return valMap; @@ -358,13 +440,15 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("b"); - openapiFields.add("m"); + openapiFields.add("e"); openapiFields.add("u"); - openapiFields.add("U"); - openapiFields.add("M"); - openapiFields.add("i"); + openapiFields.add("s"); + openapiFields.add("b"); + openapiFields.add("B"); openapiFields.add("a"); + openapiFields.add("A"); + openapiFields.add("T"); + openapiFields.add("E"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -374,71 +458,67 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AccountUpdateBInner + * @throws IOException if the JSON Element is invalid with respect to + * IndividualSymbolBookTickerStreamsResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!AccountUpdateBInner.openapiRequiredFields + if (!IndividualSymbolBookTickerStreamsResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in AccountUpdateBInner is not found in" - + " the empty JSON string", - AccountUpdateBInner.openapiRequiredFields.toString())); + "The required field(s) %s in" + + " IndividualSymbolBookTickerStreamsResponse is not found in" + + " the empty JSON string", + IndividualSymbolBookTickerStreamsResponse.openapiRequiredFields + .toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!AccountUpdateBInner.openapiFields.contains(entry.getKey())) { + if (!IndividualSymbolBookTickerStreamsResponse.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `AccountUpdateBInner` properties. JSON: %s", + + " `IndividualSymbolBookTickerStreamsResponse` properties." + + " JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("b") != null && !jsonObj.get("b").isJsonNull()) - && !jsonObj.get("b").isJsonPrimitive()) { + if ((jsonObj.get("e") != null && !jsonObj.get("e").isJsonNull()) + && !jsonObj.get("e").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `b` to be a primitive type in the JSON string but" + "Expected the field `e` to be a primitive type in the JSON string but" + " got `%s`", - jsonObj.get("b").toString())); + jsonObj.get("e").toString())); } - if ((jsonObj.get("m") != null && !jsonObj.get("m").isJsonNull()) - && !jsonObj.get("m").isJsonPrimitive()) { + if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) + && !jsonObj.get("s").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `m` to be a primitive type in the JSON string but" + "Expected the field `s` to be a primitive type in the JSON string but" + " got `%s`", - jsonObj.get("m").toString())); + jsonObj.get("s").toString())); } - if ((jsonObj.get("u") != null && !jsonObj.get("u").isJsonNull()) - && !jsonObj.get("u").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `u` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("u").toString())); - } - if ((jsonObj.get("M") != null && !jsonObj.get("M").isJsonNull()) - && !jsonObj.get("M").isJsonPrimitive()) { + if ((jsonObj.get("b") != null && !jsonObj.get("b").isJsonNull()) + && !jsonObj.get("b").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `M` to be a primitive type in the JSON string but" + "Expected the field `b` to be a primitive type in the JSON string but" + " got `%s`", - jsonObj.get("M").toString())); + jsonObj.get("b").toString())); } - if ((jsonObj.get("i") != null && !jsonObj.get("i").isJsonNull()) - && !jsonObj.get("i").isJsonPrimitive()) { + if ((jsonObj.get("B") != null && !jsonObj.get("B").isJsonNull()) + && !jsonObj.get("B").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `i` to be a primitive type in the JSON string but" + "Expected the field `B` to be a primitive type in the JSON string but" + " got `%s`", - jsonObj.get("i").toString())); + jsonObj.get("B").toString())); } if ((jsonObj.get("a") != null && !jsonObj.get("a").isJsonNull()) && !jsonObj.get("a").isJsonPrimitive()) { @@ -448,30 +528,43 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("a").toString())); } + if ((jsonObj.get("A") != null && !jsonObj.get("A").isJsonNull()) + && !jsonObj.get("A").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `A` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("A").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!AccountUpdateBInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AccountUpdateBInner' and its subtypes + if (!IndividualSymbolBookTickerStreamsResponse.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'IndividualSymbolBookTickerStreamsResponse' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AccountUpdateBInner.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(IndividualSymbolBookTickerStreamsResponse.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, AccountUpdateBInner value) + public void write( + JsonWriter out, IndividualSymbolBookTickerStreamsResponse value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public AccountUpdateBInner read(JsonReader in) throws IOException { + public IndividualSymbolBookTickerStreamsResponse read(JsonReader in) + throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -481,18 +574,20 @@ public AccountUpdateBInner read(JsonReader in) throws IOException { } /** - * Create an instance of AccountUpdateBInner given an JSON string + * Create an instance of IndividualSymbolBookTickerStreamsResponse given an JSON string * * @param jsonString JSON string - * @return An instance of AccountUpdateBInner - * @throws IOException if the JSON string is invalid with respect to AccountUpdateBInner + * @return An instance of IndividualSymbolBookTickerStreamsResponse + * @throws IOException if the JSON string is invalid with respect to + * IndividualSymbolBookTickerStreamsResponse */ - public static AccountUpdateBInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AccountUpdateBInner.class); + public static IndividualSymbolBookTickerStreamsResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, IndividualSymbolBookTickerStreamsResponse.class); } /** - * Convert an instance of AccountUpdateBInner to an JSON string + * Convert an instance of IndividualSymbolBookTickerStreamsResponse to an JSON string * * @return JSON string */ diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/KlineCandlestickStreamsRequest.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/KlineCandlestickStreamsRequest.java index 6ea8ea06d..857c14d16 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/KlineCandlestickStreamsRequest.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/KlineCandlestickStreamsRequest.java @@ -43,7 +43,7 @@ public class KlineCandlestickStreamsRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_ID) @jakarta.annotation.Nullable - private String id; + private Integer id; public static final String SERIALIZED_NAME_SYMBOL = "symbol"; @@ -59,7 +59,7 @@ public class KlineCandlestickStreamsRequest extends BaseDTO { public KlineCandlestickStreamsRequest() {} - public KlineCandlestickStreamsRequest id(@jakarta.annotation.Nullable String id) { + public KlineCandlestickStreamsRequest id(@jakarta.annotation.Nullable Integer id) { this.id = id; return this; } @@ -70,11 +70,11 @@ public KlineCandlestickStreamsRequest id(@jakarta.annotation.Nullable String id) * @return id */ @jakarta.annotation.Nullable - public String getId() { + public Integer getId() { return id; } - public void setId(@jakarta.annotation.Nullable String id) { + public void setId(@jakarta.annotation.Nullable Integer id) { this.id = id; } @@ -153,7 +153,7 @@ public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - String idValue = getId(); + Integer idValue = getId(); if (idValue != null) { String idValueAsString = idValue.toString(); valMap.put("id", idValueAsString); @@ -268,14 +268,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } if (!jsonObj.get("symbol").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/KlineCandlestickStreamsResponseK.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/KlineCandlestickStreamsResponseK.java index 357dd4843..7aabca498 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/KlineCandlestickStreamsResponseK.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/KlineCandlestickStreamsResponseK.java @@ -63,11 +63,11 @@ public class KlineCandlestickStreamsResponseK extends BaseDTO { @jakarta.annotation.Nullable private String iLowerCase; - public static final String SERIALIZED_NAME_F = "F"; + public static final String SERIALIZED_NAME_F_LOWER_CASE = "f"; - @SerializedName(SERIALIZED_NAME_F) + @SerializedName(SERIALIZED_NAME_F_LOWER_CASE) @jakarta.annotation.Nullable - private Long F; + private Long fLowerCase; public static final String SERIALIZED_NAME_L = "L"; @@ -216,23 +216,24 @@ public void setiLowerCase(@jakarta.annotation.Nullable String iLowerCase) { this.iLowerCase = iLowerCase; } - public KlineCandlestickStreamsResponseK F(@jakarta.annotation.Nullable Long F) { - this.F = F; + public KlineCandlestickStreamsResponseK fLowerCase( + @jakarta.annotation.Nullable Long fLowerCase) { + this.fLowerCase = fLowerCase; return this; } /** - * Get F + * Get fLowerCase * - * @return F + * @return fLowerCase */ @jakarta.annotation.Nullable - public Long getF() { - return F; + public Long getfLowerCase() { + return fLowerCase; } - public void setF(@jakarta.annotation.Nullable Long F) { - this.F = F; + public void setfLowerCase(@jakarta.annotation.Nullable Long fLowerCase) { + this.fLowerCase = fLowerCase; } public KlineCandlestickStreamsResponseK L(@jakarta.annotation.Nullable Long L) { @@ -466,7 +467,7 @@ public boolean equals(Object o) { && Objects.equals(this.T, klineCandlestickStreamsResponseK.T) && Objects.equals(this.sLowerCase, klineCandlestickStreamsResponseK.sLowerCase) && Objects.equals(this.iLowerCase, klineCandlestickStreamsResponseK.iLowerCase) - && Objects.equals(this.F, klineCandlestickStreamsResponseK.F) + && Objects.equals(this.fLowerCase, klineCandlestickStreamsResponseK.fLowerCase) && Objects.equals(this.L, klineCandlestickStreamsResponseK.L) && Objects.equals(this.oLowerCase, klineCandlestickStreamsResponseK.oLowerCase) && Objects.equals(this.cLowerCase, klineCandlestickStreamsResponseK.cLowerCase) @@ -487,7 +488,7 @@ public int hashCode() { T, sLowerCase, iLowerCase, - F, + fLowerCase, L, oLowerCase, cLowerCase, @@ -509,7 +510,7 @@ public String toString() { sb.append(" T: ").append(toIndentedString(T)).append("\n"); sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); sb.append(" iLowerCase: ").append(toIndentedString(iLowerCase)).append("\n"); - sb.append(" F: ").append(toIndentedString(F)).append("\n"); + sb.append(" fLowerCase: ").append(toIndentedString(fLowerCase)).append("\n"); sb.append(" L: ").append(toIndentedString(L)).append("\n"); sb.append(" oLowerCase: ").append(toIndentedString(oLowerCase)).append("\n"); sb.append(" cLowerCase: ").append(toIndentedString(cLowerCase)).append("\n"); @@ -549,10 +550,10 @@ public String toUrlQueryString() { String iLowerCaseValueAsString = iLowerCaseValue.toString(); valMap.put("iLowerCase", iLowerCaseValueAsString); } - Long FValue = getF(); - if (FValue != null) { - String FValueAsString = FValue.toString(); - valMap.put("F", FValueAsString); + Long fLowerCaseValue = getfLowerCase(); + if (fLowerCaseValue != null) { + String fLowerCaseValueAsString = fLowerCaseValue.toString(); + valMap.put("fLowerCase", fLowerCaseValueAsString); } Long LValue = getL(); if (LValue != null) { @@ -636,9 +637,9 @@ public Map toMap() { if (iLowerCaseValue != null) { valMap.put("iLowerCase", iLowerCaseValue); } - Object FValue = getF(); - if (FValue != null) { - valMap.put("F", FValue); + Object fLowerCaseValue = getfLowerCase(); + if (fLowerCaseValue != null) { + valMap.put("fLowerCase", fLowerCaseValue); } Object LValue = getL(); if (LValue != null) { @@ -714,7 +715,7 @@ private String toIndentedString(Object o) { openapiFields.add("T"); openapiFields.add("s"); openapiFields.add("i"); - openapiFields.add("F"); + openapiFields.add("f"); openapiFields.add("L"); openapiFields.add("o"); openapiFields.add("c"); diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Listenkeyexpired.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Listenkeyexpired.java new file mode 100644 index 000000000..4fdbd4866 --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Listenkeyexpired.java @@ -0,0 +1,285 @@ +/* + * Binance Derivatives Trading Options WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Options WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_options.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** Listenkeyexpired */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class Listenkeyexpired extends BaseDTO { + public static final String SERIALIZED_NAME_E = "E"; + + @SerializedName(SERIALIZED_NAME_E) + @jakarta.annotation.Nullable + private String E; + + public static final String SERIALIZED_NAME_LISTEN_KEY = "listenKey"; + + @SerializedName(SERIALIZED_NAME_LISTEN_KEY) + @jakarta.annotation.Nullable + private String listenKey; + + public Listenkeyexpired() {} + + public Listenkeyexpired E(@jakarta.annotation.Nullable String E) { + this.E = E; + return this; + } + + /** + * Get E + * + * @return E + */ + @jakarta.annotation.Nullable + public String getE() { + return E; + } + + public void setE(@jakarta.annotation.Nullable String E) { + this.E = E; + } + + public Listenkeyexpired listenKey(@jakarta.annotation.Nullable String listenKey) { + this.listenKey = listenKey; + return this; + } + + /** + * Get listenKey + * + * @return listenKey + */ + @jakarta.annotation.Nullable + public String getListenKey() { + return listenKey; + } + + public void setListenKey(@jakarta.annotation.Nullable String listenKey) { + this.listenKey = listenKey; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Listenkeyexpired listenkeyexpired = (Listenkeyexpired) o; + return Objects.equals(this.E, listenkeyexpired.E) + && Objects.equals(this.listenKey, listenkeyexpired.listenKey); + } + + @Override + public int hashCode() { + return Objects.hash(E, listenKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Listenkeyexpired {\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" listenKey: ").append(toIndentedString(listenKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String EValue = getE(); + if (EValue != null) { + String EValueAsString = EValue.toString(); + valMap.put("E", EValueAsString); + } + String listenKeyValue = getListenKey(); + if (listenKeyValue != null) { + String listenKeyValueAsString = listenKeyValue.toString(); + valMap.put("listenKey", listenKeyValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object listenKeyValue = getListenKey(); + if (listenKeyValue != null) { + valMap.put("listenKey", listenKeyValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("E"); + openapiFields.add("listenKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Listenkeyexpired + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Listenkeyexpired.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Listenkeyexpired is not found in the" + + " empty JSON string", + Listenkeyexpired.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Listenkeyexpired.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Listenkeyexpired` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("E") != null && !jsonObj.get("E").isJsonNull()) + && !jsonObj.get("E").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `E` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("E").toString())); + } + if ((jsonObj.get("listenKey") != null && !jsonObj.get("listenKey").isJsonNull()) + && !jsonObj.get("listenKey").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `listenKey` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("listenKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Listenkeyexpired.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Listenkeyexpired' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Listenkeyexpired.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Listenkeyexpired value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Listenkeyexpired read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Listenkeyexpired given an JSON string + * + * @param jsonString JSON string + * @return An instance of Listenkeyexpired + * @throws IOException if the JSON string is invalid with respect to Listenkeyexpired + */ + public static Listenkeyexpired fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Listenkeyexpired.class); + } + + /** + * Convert an instance of Listenkeyexpired to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/MarkPriceRequest.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/MarkPriceRequest.java index b5d3166cf..207fc30bb 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/MarkPriceRequest.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/MarkPriceRequest.java @@ -43,17 +43,17 @@ public class MarkPriceRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_ID) @jakarta.annotation.Nullable - private String id; + private Integer id; - public static final String SERIALIZED_NAME_UNDERLYING_ASSET = "underlyingAsset"; + public static final String SERIALIZED_NAME_UNDERLYING = "underlying"; - @SerializedName(SERIALIZED_NAME_UNDERLYING_ASSET) + @SerializedName(SERIALIZED_NAME_UNDERLYING) @jakarta.annotation.Nonnull - private String underlyingAsset; + private String underlying; public MarkPriceRequest() {} - public MarkPriceRequest id(@jakarta.annotation.Nullable String id) { + public MarkPriceRequest id(@jakarta.annotation.Nullable Integer id) { this.id = id; return this; } @@ -64,32 +64,32 @@ public MarkPriceRequest id(@jakarta.annotation.Nullable String id) { * @return id */ @jakarta.annotation.Nullable - public String getId() { + public Integer getId() { return id; } - public void setId(@jakarta.annotation.Nullable String id) { + public void setId(@jakarta.annotation.Nullable Integer id) { this.id = id; } - public MarkPriceRequest underlyingAsset(@jakarta.annotation.Nonnull String underlyingAsset) { - this.underlyingAsset = underlyingAsset; + public MarkPriceRequest underlying(@jakarta.annotation.Nonnull String underlying) { + this.underlying = underlying; return this; } /** - * Get underlyingAsset + * Get underlying * - * @return underlyingAsset + * @return underlying */ @jakarta.annotation.Nonnull @NotNull - public String getUnderlyingAsset() { - return underlyingAsset; + public String getUnderlying() { + return underlying; } - public void setUnderlyingAsset(@jakarta.annotation.Nonnull String underlyingAsset) { - this.underlyingAsset = underlyingAsset; + public void setUnderlying(@jakarta.annotation.Nonnull String underlying) { + this.underlying = underlying; } @Override @@ -102,12 +102,12 @@ public boolean equals(Object o) { } MarkPriceRequest markPriceRequest = (MarkPriceRequest) o; return Objects.equals(this.id, markPriceRequest.id) - && Objects.equals(this.underlyingAsset, markPriceRequest.underlyingAsset); + && Objects.equals(this.underlying, markPriceRequest.underlying); } @Override public int hashCode() { - return Objects.hash(id, underlyingAsset); + return Objects.hash(id, underlying); } @Override @@ -115,7 +115,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class MarkPriceRequest {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" underlyingAsset: ").append(toIndentedString(underlyingAsset)).append("\n"); + sb.append(" underlying: ").append(toIndentedString(underlying)).append("\n"); sb.append("}"); return sb.toString(); } @@ -124,15 +124,15 @@ public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - String idValue = getId(); + Integer idValue = getId(); if (idValue != null) { String idValueAsString = idValue.toString(); valMap.put("id", idValueAsString); } - String underlyingAssetValue = getUnderlyingAsset(); - if (underlyingAssetValue != null) { - String underlyingAssetValueAsString = underlyingAssetValue.toString(); - valMap.put("underlyingAsset", underlyingAssetValueAsString); + String underlyingValue = getUnderlying(); + if (underlyingValue != null) { + String underlyingValueAsString = underlyingValue.toString(); + valMap.put("underlying", underlyingValueAsString); } valMap.put("timestamp", getTimestamp()); @@ -149,9 +149,9 @@ public Map toMap() { if (idValue != null) { valMap.put("id", idValue); } - Object underlyingAssetValue = getUnderlyingAsset(); - if (underlyingAssetValue != null) { - valMap.put("underlyingAsset", underlyingAssetValue); + Object underlyingValue = getUnderlying(); + if (underlyingValue != null) { + valMap.put("underlying", underlyingValue); } valMap.put("timestamp", getTimestamp()); @@ -180,11 +180,11 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("id"); - openapiFields.add("underlyingAsset"); + openapiFields.add("underlying"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("underlyingAsset"); + openapiRequiredFields.add("underlying"); } /** @@ -227,20 +227,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { + if (!jsonObj.get("underlying").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("underlyingAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `underlyingAsset` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("underlyingAsset").toString())); + "Expected the field `underlying` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("underlying").toString())); } } diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/MarkPriceResponseInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/MarkPriceResponseInner.java index a82c61a39..54ef6a76d 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/MarkPriceResponseInner.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/MarkPriceResponseInner.java @@ -39,11 +39,17 @@ value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class MarkPriceResponseInner extends BaseDTO { - public static final String SERIALIZED_NAME_E_LOWER_CASE = "e"; + public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; - @SerializedName(SERIALIZED_NAME_E_LOWER_CASE) + @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) @jakarta.annotation.Nullable - private String eLowerCase; + private String sLowerCase; + + public static final String SERIALIZED_NAME_MP = "mp"; + + @SerializedName(SERIALIZED_NAME_MP) + @jakarta.annotation.Nullable + private String mp; public static final String SERIALIZED_NAME_E = "E"; @@ -51,37 +57,146 @@ public class MarkPriceResponseInner extends BaseDTO { @jakarta.annotation.Nullable private Long E; - public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; + public static final String SERIALIZED_NAME_E_LOWER_CASE = "e"; - @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) + @SerializedName(SERIALIZED_NAME_E_LOWER_CASE) @jakarta.annotation.Nullable - private String sLowerCase; + private String eLowerCase; - public static final String SERIALIZED_NAME_MP = "mp"; + public static final String SERIALIZED_NAME_I_LOWER_CASE = "i"; - @SerializedName(SERIALIZED_NAME_MP) + @SerializedName(SERIALIZED_NAME_I_LOWER_CASE) @jakarta.annotation.Nullable - private String mp; + private String iLowerCase; + + public static final String SERIALIZED_NAME_P = "P"; + + @SerializedName(SERIALIZED_NAME_P) + @jakarta.annotation.Nullable + private String P; + + public static final String SERIALIZED_NAME_BO = "bo"; + + @SerializedName(SERIALIZED_NAME_BO) + @jakarta.annotation.Nullable + private String bo; + + public static final String SERIALIZED_NAME_AO = "ao"; + + @SerializedName(SERIALIZED_NAME_AO) + @jakarta.annotation.Nullable + private String ao; + + public static final String SERIALIZED_NAME_BQ = "bq"; + + @SerializedName(SERIALIZED_NAME_BQ) + @jakarta.annotation.Nullable + private String bq; + + public static final String SERIALIZED_NAME_AQ = "aq"; + + @SerializedName(SERIALIZED_NAME_AQ) + @jakarta.annotation.Nullable + private String aq; + + public static final String SERIALIZED_NAME_B_LOWER_CASE = "b"; + + @SerializedName(SERIALIZED_NAME_B_LOWER_CASE) + @jakarta.annotation.Nullable + private String bLowerCase; + + public static final String SERIALIZED_NAME_A_LOWER_CASE = "a"; + + @SerializedName(SERIALIZED_NAME_A_LOWER_CASE) + @jakarta.annotation.Nullable + private String aLowerCase; + + public static final String SERIALIZED_NAME_HL = "hl"; + + @SerializedName(SERIALIZED_NAME_HL) + @jakarta.annotation.Nullable + private String hl; + + public static final String SERIALIZED_NAME_LL = "ll"; + + @SerializedName(SERIALIZED_NAME_LL) + @jakarta.annotation.Nullable + private String ll; + + public static final String SERIALIZED_NAME_VO = "vo"; + + @SerializedName(SERIALIZED_NAME_VO) + @jakarta.annotation.Nullable + private String vo; + + public static final String SERIALIZED_NAME_RF = "rf"; + + @SerializedName(SERIALIZED_NAME_RF) + @jakarta.annotation.Nullable + private String rf; + + public static final String SERIALIZED_NAME_D_LOWER_CASE = "d"; + + @SerializedName(SERIALIZED_NAME_D_LOWER_CASE) + @jakarta.annotation.Nullable + private String dLowerCase; + + public static final String SERIALIZED_NAME_T_LOWER_CASE = "t"; + + @SerializedName(SERIALIZED_NAME_T_LOWER_CASE) + @jakarta.annotation.Nullable + private String tLowerCase; + + public static final String SERIALIZED_NAME_G_LOWER_CASE = "g"; + + @SerializedName(SERIALIZED_NAME_G_LOWER_CASE) + @jakarta.annotation.Nullable + private String gLowerCase; + + public static final String SERIALIZED_NAME_V_LOWER_CASE = "v"; + + @SerializedName(SERIALIZED_NAME_V_LOWER_CASE) + @jakarta.annotation.Nullable + private String vLowerCase; public MarkPriceResponseInner() {} - public MarkPriceResponseInner eLowerCase(@jakarta.annotation.Nullable String eLowerCase) { - this.eLowerCase = eLowerCase; + public MarkPriceResponseInner sLowerCase(@jakarta.annotation.Nullable String sLowerCase) { + this.sLowerCase = sLowerCase; return this; } /** - * Get eLowerCase + * Get sLowerCase * - * @return eLowerCase + * @return sLowerCase */ @jakarta.annotation.Nullable - public String geteLowerCase() { - return eLowerCase; + public String getsLowerCase() { + return sLowerCase; } - public void seteLowerCase(@jakarta.annotation.Nullable String eLowerCase) { - this.eLowerCase = eLowerCase; + public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { + this.sLowerCase = sLowerCase; + } + + public MarkPriceResponseInner mp(@jakarta.annotation.Nullable String mp) { + this.mp = mp; + return this; + } + + /** + * Get mp + * + * @return mp + */ + @jakarta.annotation.Nullable + public String getMp() { + return mp; + } + + public void setMp(@jakarta.annotation.Nullable String mp) { + this.mp = mp; } public MarkPriceResponseInner E(@jakarta.annotation.Nullable Long E) { @@ -103,42 +218,327 @@ public void setE(@jakarta.annotation.Nullable Long E) { this.E = E; } - public MarkPriceResponseInner sLowerCase(@jakarta.annotation.Nullable String sLowerCase) { - this.sLowerCase = sLowerCase; + public MarkPriceResponseInner eLowerCase(@jakarta.annotation.Nullable String eLowerCase) { + this.eLowerCase = eLowerCase; return this; } /** - * Get sLowerCase + * Get eLowerCase * - * @return sLowerCase + * @return eLowerCase */ @jakarta.annotation.Nullable - public String getsLowerCase() { - return sLowerCase; + public String geteLowerCase() { + return eLowerCase; } - public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { - this.sLowerCase = sLowerCase; + public void seteLowerCase(@jakarta.annotation.Nullable String eLowerCase) { + this.eLowerCase = eLowerCase; } - public MarkPriceResponseInner mp(@jakarta.annotation.Nullable String mp) { - this.mp = mp; + public MarkPriceResponseInner iLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; return this; } /** - * Get mp + * Get iLowerCase * - * @return mp + * @return iLowerCase */ @jakarta.annotation.Nullable - public String getMp() { - return mp; + public String getiLowerCase() { + return iLowerCase; } - public void setMp(@jakarta.annotation.Nullable String mp) { - this.mp = mp; + public void setiLowerCase(@jakarta.annotation.Nullable String iLowerCase) { + this.iLowerCase = iLowerCase; + } + + public MarkPriceResponseInner P(@jakarta.annotation.Nullable String P) { + this.P = P; + return this; + } + + /** + * Get P + * + * @return P + */ + @jakarta.annotation.Nullable + public String getP() { + return P; + } + + public void setP(@jakarta.annotation.Nullable String P) { + this.P = P; + } + + public MarkPriceResponseInner bo(@jakarta.annotation.Nullable String bo) { + this.bo = bo; + return this; + } + + /** + * Get bo + * + * @return bo + */ + @jakarta.annotation.Nullable + public String getBo() { + return bo; + } + + public void setBo(@jakarta.annotation.Nullable String bo) { + this.bo = bo; + } + + public MarkPriceResponseInner ao(@jakarta.annotation.Nullable String ao) { + this.ao = ao; + return this; + } + + /** + * Get ao + * + * @return ao + */ + @jakarta.annotation.Nullable + public String getAo() { + return ao; + } + + public void setAo(@jakarta.annotation.Nullable String ao) { + this.ao = ao; + } + + public MarkPriceResponseInner bq(@jakarta.annotation.Nullable String bq) { + this.bq = bq; + return this; + } + + /** + * Get bq + * + * @return bq + */ + @jakarta.annotation.Nullable + public String getBq() { + return bq; + } + + public void setBq(@jakarta.annotation.Nullable String bq) { + this.bq = bq; + } + + public MarkPriceResponseInner aq(@jakarta.annotation.Nullable String aq) { + this.aq = aq; + return this; + } + + /** + * Get aq + * + * @return aq + */ + @jakarta.annotation.Nullable + public String getAq() { + return aq; + } + + public void setAq(@jakarta.annotation.Nullable String aq) { + this.aq = aq; + } + + public MarkPriceResponseInner bLowerCase(@jakarta.annotation.Nullable String bLowerCase) { + this.bLowerCase = bLowerCase; + return this; + } + + /** + * Get bLowerCase + * + * @return bLowerCase + */ + @jakarta.annotation.Nullable + public String getbLowerCase() { + return bLowerCase; + } + + public void setbLowerCase(@jakarta.annotation.Nullable String bLowerCase) { + this.bLowerCase = bLowerCase; + } + + public MarkPriceResponseInner aLowerCase(@jakarta.annotation.Nullable String aLowerCase) { + this.aLowerCase = aLowerCase; + return this; + } + + /** + * Get aLowerCase + * + * @return aLowerCase + */ + @jakarta.annotation.Nullable + public String getaLowerCase() { + return aLowerCase; + } + + public void setaLowerCase(@jakarta.annotation.Nullable String aLowerCase) { + this.aLowerCase = aLowerCase; + } + + public MarkPriceResponseInner hl(@jakarta.annotation.Nullable String hl) { + this.hl = hl; + return this; + } + + /** + * Get hl + * + * @return hl + */ + @jakarta.annotation.Nullable + public String getHl() { + return hl; + } + + public void setHl(@jakarta.annotation.Nullable String hl) { + this.hl = hl; + } + + public MarkPriceResponseInner ll(@jakarta.annotation.Nullable String ll) { + this.ll = ll; + return this; + } + + /** + * Get ll + * + * @return ll + */ + @jakarta.annotation.Nullable + public String getLl() { + return ll; + } + + public void setLl(@jakarta.annotation.Nullable String ll) { + this.ll = ll; + } + + public MarkPriceResponseInner vo(@jakarta.annotation.Nullable String vo) { + this.vo = vo; + return this; + } + + /** + * Get vo + * + * @return vo + */ + @jakarta.annotation.Nullable + public String getVo() { + return vo; + } + + public void setVo(@jakarta.annotation.Nullable String vo) { + this.vo = vo; + } + + public MarkPriceResponseInner rf(@jakarta.annotation.Nullable String rf) { + this.rf = rf; + return this; + } + + /** + * Get rf + * + * @return rf + */ + @jakarta.annotation.Nullable + public String getRf() { + return rf; + } + + public void setRf(@jakarta.annotation.Nullable String rf) { + this.rf = rf; + } + + public MarkPriceResponseInner dLowerCase(@jakarta.annotation.Nullable String dLowerCase) { + this.dLowerCase = dLowerCase; + return this; + } + + /** + * Get dLowerCase + * + * @return dLowerCase + */ + @jakarta.annotation.Nullable + public String getdLowerCase() { + return dLowerCase; + } + + public void setdLowerCase(@jakarta.annotation.Nullable String dLowerCase) { + this.dLowerCase = dLowerCase; + } + + public MarkPriceResponseInner tLowerCase(@jakarta.annotation.Nullable String tLowerCase) { + this.tLowerCase = tLowerCase; + return this; + } + + /** + * Get tLowerCase + * + * @return tLowerCase + */ + @jakarta.annotation.Nullable + public String gettLowerCase() { + return tLowerCase; + } + + public void settLowerCase(@jakarta.annotation.Nullable String tLowerCase) { + this.tLowerCase = tLowerCase; + } + + public MarkPriceResponseInner gLowerCase(@jakarta.annotation.Nullable String gLowerCase) { + this.gLowerCase = gLowerCase; + return this; + } + + /** + * Get gLowerCase + * + * @return gLowerCase + */ + @jakarta.annotation.Nullable + public String getgLowerCase() { + return gLowerCase; + } + + public void setgLowerCase(@jakarta.annotation.Nullable String gLowerCase) { + this.gLowerCase = gLowerCase; + } + + public MarkPriceResponseInner vLowerCase(@jakarta.annotation.Nullable String vLowerCase) { + this.vLowerCase = vLowerCase; + return this; + } + + /** + * Get vLowerCase + * + * @return vLowerCase + */ + @jakarta.annotation.Nullable + public String getvLowerCase() { + return vLowerCase; + } + + public void setvLowerCase(@jakarta.annotation.Nullable String vLowerCase) { + this.vLowerCase = vLowerCase; } @Override @@ -150,25 +550,77 @@ public boolean equals(Object o) { return false; } MarkPriceResponseInner markPriceResponseInner = (MarkPriceResponseInner) o; - return Objects.equals(this.eLowerCase, markPriceResponseInner.eLowerCase) + return Objects.equals(this.sLowerCase, markPriceResponseInner.sLowerCase) + && Objects.equals(this.mp, markPriceResponseInner.mp) && Objects.equals(this.E, markPriceResponseInner.E) - && Objects.equals(this.sLowerCase, markPriceResponseInner.sLowerCase) - && Objects.equals(this.mp, markPriceResponseInner.mp); + && Objects.equals(this.eLowerCase, markPriceResponseInner.eLowerCase) + && Objects.equals(this.iLowerCase, markPriceResponseInner.iLowerCase) + && Objects.equals(this.P, markPriceResponseInner.P) + && Objects.equals(this.bo, markPriceResponseInner.bo) + && Objects.equals(this.ao, markPriceResponseInner.ao) + && Objects.equals(this.bq, markPriceResponseInner.bq) + && Objects.equals(this.aq, markPriceResponseInner.aq) + && Objects.equals(this.bLowerCase, markPriceResponseInner.bLowerCase) + && Objects.equals(this.aLowerCase, markPriceResponseInner.aLowerCase) + && Objects.equals(this.hl, markPriceResponseInner.hl) + && Objects.equals(this.ll, markPriceResponseInner.ll) + && Objects.equals(this.vo, markPriceResponseInner.vo) + && Objects.equals(this.rf, markPriceResponseInner.rf) + && Objects.equals(this.dLowerCase, markPriceResponseInner.dLowerCase) + && Objects.equals(this.tLowerCase, markPriceResponseInner.tLowerCase) + && Objects.equals(this.gLowerCase, markPriceResponseInner.gLowerCase) + && Objects.equals(this.vLowerCase, markPriceResponseInner.vLowerCase); } @Override public int hashCode() { - return Objects.hash(eLowerCase, E, sLowerCase, mp); + return Objects.hash( + sLowerCase, + mp, + E, + eLowerCase, + iLowerCase, + P, + bo, + ao, + bq, + aq, + bLowerCase, + aLowerCase, + hl, + ll, + vo, + rf, + dLowerCase, + tLowerCase, + gLowerCase, + vLowerCase); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class MarkPriceResponseInner {\n"); - sb.append(" eLowerCase: ").append(toIndentedString(eLowerCase)).append("\n"); - sb.append(" E: ").append(toIndentedString(E)).append("\n"); sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); sb.append(" mp: ").append(toIndentedString(mp)).append("\n"); + sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" eLowerCase: ").append(toIndentedString(eLowerCase)).append("\n"); + sb.append(" iLowerCase: ").append(toIndentedString(iLowerCase)).append("\n"); + sb.append(" P: ").append(toIndentedString(P)).append("\n"); + sb.append(" bo: ").append(toIndentedString(bo)).append("\n"); + sb.append(" ao: ").append(toIndentedString(ao)).append("\n"); + sb.append(" bq: ").append(toIndentedString(bq)).append("\n"); + sb.append(" aq: ").append(toIndentedString(aq)).append("\n"); + sb.append(" bLowerCase: ").append(toIndentedString(bLowerCase)).append("\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" hl: ").append(toIndentedString(hl)).append("\n"); + sb.append(" ll: ").append(toIndentedString(ll)).append("\n"); + sb.append(" vo: ").append(toIndentedString(vo)).append("\n"); + sb.append(" rf: ").append(toIndentedString(rf)).append("\n"); + sb.append(" dLowerCase: ").append(toIndentedString(dLowerCase)).append("\n"); + sb.append(" tLowerCase: ").append(toIndentedString(tLowerCase)).append("\n"); + sb.append(" gLowerCase: ").append(toIndentedString(gLowerCase)).append("\n"); + sb.append(" vLowerCase: ").append(toIndentedString(vLowerCase)).append("\n"); sb.append("}"); return sb.toString(); } @@ -177,16 +629,6 @@ public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - String eLowerCaseValue = geteLowerCase(); - if (eLowerCaseValue != null) { - String eLowerCaseValueAsString = eLowerCaseValue.toString(); - valMap.put("eLowerCase", eLowerCaseValueAsString); - } - Long EValue = getE(); - if (EValue != null) { - String EValueAsString = EValue.toString(); - valMap.put("E", EValueAsString); - } String sLowerCaseValue = getsLowerCase(); if (sLowerCaseValue != null) { String sLowerCaseValueAsString = sLowerCaseValue.toString(); @@ -197,6 +639,96 @@ public String toUrlQueryString() { String mpValueAsString = mpValue.toString(); valMap.put("mp", mpValueAsString); } + Long EValue = getE(); + if (EValue != null) { + String EValueAsString = EValue.toString(); + valMap.put("E", EValueAsString); + } + String eLowerCaseValue = geteLowerCase(); + if (eLowerCaseValue != null) { + String eLowerCaseValueAsString = eLowerCaseValue.toString(); + valMap.put("eLowerCase", eLowerCaseValueAsString); + } + String iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + String iLowerCaseValueAsString = iLowerCaseValue.toString(); + valMap.put("iLowerCase", iLowerCaseValueAsString); + } + String PValue = getP(); + if (PValue != null) { + String PValueAsString = PValue.toString(); + valMap.put("P", PValueAsString); + } + String boValue = getBo(); + if (boValue != null) { + String boValueAsString = boValue.toString(); + valMap.put("bo", boValueAsString); + } + String aoValue = getAo(); + if (aoValue != null) { + String aoValueAsString = aoValue.toString(); + valMap.put("ao", aoValueAsString); + } + String bqValue = getBq(); + if (bqValue != null) { + String bqValueAsString = bqValue.toString(); + valMap.put("bq", bqValueAsString); + } + String aqValue = getAq(); + if (aqValue != null) { + String aqValueAsString = aqValue.toString(); + valMap.put("aq", aqValueAsString); + } + String bLowerCaseValue = getbLowerCase(); + if (bLowerCaseValue != null) { + String bLowerCaseValueAsString = bLowerCaseValue.toString(); + valMap.put("bLowerCase", bLowerCaseValueAsString); + } + String aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + String aLowerCaseValueAsString = aLowerCaseValue.toString(); + valMap.put("aLowerCase", aLowerCaseValueAsString); + } + String hlValue = getHl(); + if (hlValue != null) { + String hlValueAsString = hlValue.toString(); + valMap.put("hl", hlValueAsString); + } + String llValue = getLl(); + if (llValue != null) { + String llValueAsString = llValue.toString(); + valMap.put("ll", llValueAsString); + } + String voValue = getVo(); + if (voValue != null) { + String voValueAsString = voValue.toString(); + valMap.put("vo", voValueAsString); + } + String rfValue = getRf(); + if (rfValue != null) { + String rfValueAsString = rfValue.toString(); + valMap.put("rf", rfValueAsString); + } + String dLowerCaseValue = getdLowerCase(); + if (dLowerCaseValue != null) { + String dLowerCaseValueAsString = dLowerCaseValue.toString(); + valMap.put("dLowerCase", dLowerCaseValueAsString); + } + String tLowerCaseValue = gettLowerCase(); + if (tLowerCaseValue != null) { + String tLowerCaseValueAsString = tLowerCaseValue.toString(); + valMap.put("tLowerCase", tLowerCaseValueAsString); + } + String gLowerCaseValue = getgLowerCase(); + if (gLowerCaseValue != null) { + String gLowerCaseValueAsString = gLowerCaseValue.toString(); + valMap.put("gLowerCase", gLowerCaseValueAsString); + } + String vLowerCaseValue = getvLowerCase(); + if (vLowerCaseValue != null) { + String vLowerCaseValueAsString = vLowerCaseValue.toString(); + valMap.put("vLowerCase", vLowerCaseValueAsString); + } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -208,14 +740,6 @@ public String toUrlQueryString() { public Map toMap() { Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - Object eLowerCaseValue = geteLowerCase(); - if (eLowerCaseValue != null) { - valMap.put("eLowerCase", eLowerCaseValue); - } - Object EValue = getE(); - if (EValue != null) { - valMap.put("E", EValue); - } Object sLowerCaseValue = getsLowerCase(); if (sLowerCaseValue != null) { valMap.put("sLowerCase", sLowerCaseValue); @@ -224,6 +748,78 @@ public Map toMap() { if (mpValue != null) { valMap.put("mp", mpValue); } + Object EValue = getE(); + if (EValue != null) { + valMap.put("E", EValue); + } + Object eLowerCaseValue = geteLowerCase(); + if (eLowerCaseValue != null) { + valMap.put("eLowerCase", eLowerCaseValue); + } + Object iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + valMap.put("iLowerCase", iLowerCaseValue); + } + Object PValue = getP(); + if (PValue != null) { + valMap.put("P", PValue); + } + Object boValue = getBo(); + if (boValue != null) { + valMap.put("bo", boValue); + } + Object aoValue = getAo(); + if (aoValue != null) { + valMap.put("ao", aoValue); + } + Object bqValue = getBq(); + if (bqValue != null) { + valMap.put("bq", bqValue); + } + Object aqValue = getAq(); + if (aqValue != null) { + valMap.put("aq", aqValue); + } + Object bLowerCaseValue = getbLowerCase(); + if (bLowerCaseValue != null) { + valMap.put("bLowerCase", bLowerCaseValue); + } + Object aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + valMap.put("aLowerCase", aLowerCaseValue); + } + Object hlValue = getHl(); + if (hlValue != null) { + valMap.put("hl", hlValue); + } + Object llValue = getLl(); + if (llValue != null) { + valMap.put("ll", llValue); + } + Object voValue = getVo(); + if (voValue != null) { + valMap.put("vo", voValue); + } + Object rfValue = getRf(); + if (rfValue != null) { + valMap.put("rf", rfValue); + } + Object dLowerCaseValue = getdLowerCase(); + if (dLowerCaseValue != null) { + valMap.put("dLowerCase", dLowerCaseValue); + } + Object tLowerCaseValue = gettLowerCase(); + if (tLowerCaseValue != null) { + valMap.put("tLowerCase", tLowerCaseValue); + } + Object gLowerCaseValue = getgLowerCase(); + if (gLowerCaseValue != null) { + valMap.put("gLowerCase", gLowerCaseValue); + } + Object vLowerCaseValue = getvLowerCase(); + if (vLowerCaseValue != null) { + valMap.put("vLowerCase", vLowerCaseValue); + } valMap.put("timestamp", getTimestamp()); return valMap; @@ -250,10 +846,26 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("e"); - openapiFields.add("E"); openapiFields.add("s"); openapiFields.add("mp"); + openapiFields.add("E"); + openapiFields.add("e"); + openapiFields.add("i"); + openapiFields.add("P"); + openapiFields.add("bo"); + openapiFields.add("ao"); + openapiFields.add("bq"); + openapiFields.add("aq"); + openapiFields.add("b"); + openapiFields.add("a"); + openapiFields.add("hl"); + openapiFields.add("ll"); + openapiFields.add("vo"); + openapiFields.add("rf"); + openapiFields.add("d"); + openapiFields.add("t"); + openapiFields.add("g"); + openapiFields.add("v"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -289,14 +901,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("e") != null && !jsonObj.get("e").isJsonNull()) - && !jsonObj.get("e").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `e` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("e").toString())); - } if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) && !jsonObj.get("s").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -313,6 +917,142 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("mp").toString())); } + if ((jsonObj.get("e") != null && !jsonObj.get("e").isJsonNull()) + && !jsonObj.get("e").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `e` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("e").toString())); + } + if ((jsonObj.get("i") != null && !jsonObj.get("i").isJsonNull()) + && !jsonObj.get("i").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `i` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("i").toString())); + } + if ((jsonObj.get("P") != null && !jsonObj.get("P").isJsonNull()) + && !jsonObj.get("P").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `P` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("P").toString())); + } + if ((jsonObj.get("bo") != null && !jsonObj.get("bo").isJsonNull()) + && !jsonObj.get("bo").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bo` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("bo").toString())); + } + if ((jsonObj.get("ao") != null && !jsonObj.get("ao").isJsonNull()) + && !jsonObj.get("ao").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ao` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ao").toString())); + } + if ((jsonObj.get("bq") != null && !jsonObj.get("bq").isJsonNull()) + && !jsonObj.get("bq").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `bq` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("bq").toString())); + } + if ((jsonObj.get("aq") != null && !jsonObj.get("aq").isJsonNull()) + && !jsonObj.get("aq").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `aq` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("aq").toString())); + } + if ((jsonObj.get("b") != null && !jsonObj.get("b").isJsonNull()) + && !jsonObj.get("b").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `b` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("b").toString())); + } + if ((jsonObj.get("a") != null && !jsonObj.get("a").isJsonNull()) + && !jsonObj.get("a").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `a` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("a").toString())); + } + if ((jsonObj.get("hl") != null && !jsonObj.get("hl").isJsonNull()) + && !jsonObj.get("hl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `hl` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("hl").toString())); + } + if ((jsonObj.get("ll") != null && !jsonObj.get("ll").isJsonNull()) + && !jsonObj.get("ll").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ll` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ll").toString())); + } + if ((jsonObj.get("vo") != null && !jsonObj.get("vo").isJsonNull()) + && !jsonObj.get("vo").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `vo` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("vo").toString())); + } + if ((jsonObj.get("rf") != null && !jsonObj.get("rf").isJsonNull()) + && !jsonObj.get("rf").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rf` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("rf").toString())); + } + if ((jsonObj.get("d") != null && !jsonObj.get("d").isJsonNull()) + && !jsonObj.get("d").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `d` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("d").toString())); + } + if ((jsonObj.get("t") != null && !jsonObj.get("t").isJsonNull()) + && !jsonObj.get("t").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `t` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("t").toString())); + } + if ((jsonObj.get("g") != null && !jsonObj.get("g").isJsonNull()) + && !jsonObj.get("g").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `g` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("g").toString())); + } + if ((jsonObj.get("v") != null && !jsonObj.get("v").isJsonNull()) + && !jsonObj.get("v").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `v` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("v").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/NewSymbolInfoRequest.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/NewSymbolInfoRequest.java index c200efbe0..a5f623318 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/NewSymbolInfoRequest.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/NewSymbolInfoRequest.java @@ -43,11 +43,11 @@ public class NewSymbolInfoRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_ID) @jakarta.annotation.Nullable - private String id; + private Integer id; public NewSymbolInfoRequest() {} - public NewSymbolInfoRequest id(@jakarta.annotation.Nullable String id) { + public NewSymbolInfoRequest id(@jakarta.annotation.Nullable Integer id) { this.id = id; return this; } @@ -58,11 +58,11 @@ public NewSymbolInfoRequest id(@jakarta.annotation.Nullable String id) { * @return id */ @jakarta.annotation.Nullable - public String getId() { + public Integer getId() { return id; } - public void setId(@jakarta.annotation.Nullable String id) { + public void setId(@jakarta.annotation.Nullable Integer id) { this.id = id; } @@ -96,7 +96,7 @@ public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - String idValue = getId(); + Integer idValue = getId(); if (idValue != null) { String idValueAsString = idValue.toString(); valMap.put("id", idValueAsString); @@ -178,14 +178,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/NewSymbolInfoResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/NewSymbolInfoResponse.java index ada340396..536710e7d 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/NewSymbolInfoResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/NewSymbolInfoResponse.java @@ -51,35 +51,23 @@ public class NewSymbolInfoResponse extends BaseDTO { @jakarta.annotation.Nullable private Long E; - public static final String SERIALIZED_NAME_U_LOWER_CASE = "u"; - - @SerializedName(SERIALIZED_NAME_U_LOWER_CASE) - @jakarta.annotation.Nullable - private String uLowerCase; - - public static final String SERIALIZED_NAME_QA = "qa"; - - @SerializedName(SERIALIZED_NAME_QA) - @jakarta.annotation.Nullable - private String qa; - public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) @jakarta.annotation.Nullable private String sLowerCase; - public static final String SERIALIZED_NAME_UNIT = "unit"; + public static final String SERIALIZED_NAME_PS = "ps"; - @SerializedName(SERIALIZED_NAME_UNIT) + @SerializedName(SERIALIZED_NAME_PS) @jakarta.annotation.Nullable - private Long unit; + private String ps; - public static final String SERIALIZED_NAME_MQ = "mq"; + public static final String SERIALIZED_NAME_QA = "qa"; - @SerializedName(SERIALIZED_NAME_MQ) + @SerializedName(SERIALIZED_NAME_QA) @jakarta.annotation.Nullable - private String mq; + private String qa; public static final String SERIALIZED_NAME_D_LOWER_CASE = "d"; @@ -93,11 +81,29 @@ public class NewSymbolInfoResponse extends BaseDTO { @jakarta.annotation.Nullable private String sp; - public static final String SERIALIZED_NAME_ED = "ed"; + public static final String SERIALIZED_NAME_DT = "dt"; + + @SerializedName(SERIALIZED_NAME_DT) + @jakarta.annotation.Nullable + private Long dt; + + public static final String SERIALIZED_NAME_U_LOWER_CASE = "u"; + + @SerializedName(SERIALIZED_NAME_U_LOWER_CASE) + @jakarta.annotation.Nullable + private Long uLowerCase; + + public static final String SERIALIZED_NAME_OT = "ot"; + + @SerializedName(SERIALIZED_NAME_OT) + @jakarta.annotation.Nullable + private Long ot; + + public static final String SERIALIZED_NAME_CS = "cs"; - @SerializedName(SERIALIZED_NAME_ED) + @SerializedName(SERIALIZED_NAME_CS) @jakarta.annotation.Nullable - private Long ed; + private String cs; public NewSymbolInfoResponse() {} @@ -139,23 +145,42 @@ public void setE(@jakarta.annotation.Nullable Long E) { this.E = E; } - public NewSymbolInfoResponse uLowerCase(@jakarta.annotation.Nullable String uLowerCase) { - this.uLowerCase = uLowerCase; + public NewSymbolInfoResponse sLowerCase(@jakarta.annotation.Nullable String sLowerCase) { + this.sLowerCase = sLowerCase; return this; } /** - * Get uLowerCase + * Get sLowerCase * - * @return uLowerCase + * @return sLowerCase */ @jakarta.annotation.Nullable - public String getuLowerCase() { - return uLowerCase; + public String getsLowerCase() { + return sLowerCase; } - public void setuLowerCase(@jakarta.annotation.Nullable String uLowerCase) { - this.uLowerCase = uLowerCase; + public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { + this.sLowerCase = sLowerCase; + } + + public NewSymbolInfoResponse ps(@jakarta.annotation.Nullable String ps) { + this.ps = ps; + return this; + } + + /** + * Get ps + * + * @return ps + */ + @jakarta.annotation.Nullable + public String getPs() { + return ps; + } + + public void setPs(@jakarta.annotation.Nullable String ps) { + this.ps = ps; } public NewSymbolInfoResponse qa(@jakarta.annotation.Nullable String qa) { @@ -177,118 +202,118 @@ public void setQa(@jakarta.annotation.Nullable String qa) { this.qa = qa; } - public NewSymbolInfoResponse sLowerCase(@jakarta.annotation.Nullable String sLowerCase) { - this.sLowerCase = sLowerCase; + public NewSymbolInfoResponse dLowerCase(@jakarta.annotation.Nullable String dLowerCase) { + this.dLowerCase = dLowerCase; return this; } /** - * Get sLowerCase + * Get dLowerCase * - * @return sLowerCase + * @return dLowerCase */ @jakarta.annotation.Nullable - public String getsLowerCase() { - return sLowerCase; + public String getdLowerCase() { + return dLowerCase; } - public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { - this.sLowerCase = sLowerCase; + public void setdLowerCase(@jakarta.annotation.Nullable String dLowerCase) { + this.dLowerCase = dLowerCase; } - public NewSymbolInfoResponse unit(@jakarta.annotation.Nullable Long unit) { - this.unit = unit; + public NewSymbolInfoResponse sp(@jakarta.annotation.Nullable String sp) { + this.sp = sp; return this; } /** - * Get unit + * Get sp * - * @return unit + * @return sp */ @jakarta.annotation.Nullable - public Long getUnit() { - return unit; + public String getSp() { + return sp; } - public void setUnit(@jakarta.annotation.Nullable Long unit) { - this.unit = unit; + public void setSp(@jakarta.annotation.Nullable String sp) { + this.sp = sp; } - public NewSymbolInfoResponse mq(@jakarta.annotation.Nullable String mq) { - this.mq = mq; + public NewSymbolInfoResponse dt(@jakarta.annotation.Nullable Long dt) { + this.dt = dt; return this; } /** - * Get mq + * Get dt * - * @return mq + * @return dt */ @jakarta.annotation.Nullable - public String getMq() { - return mq; + public Long getDt() { + return dt; } - public void setMq(@jakarta.annotation.Nullable String mq) { - this.mq = mq; + public void setDt(@jakarta.annotation.Nullable Long dt) { + this.dt = dt; } - public NewSymbolInfoResponse dLowerCase(@jakarta.annotation.Nullable String dLowerCase) { - this.dLowerCase = dLowerCase; + public NewSymbolInfoResponse uLowerCase(@jakarta.annotation.Nullable Long uLowerCase) { + this.uLowerCase = uLowerCase; return this; } /** - * Get dLowerCase + * Get uLowerCase * - * @return dLowerCase + * @return uLowerCase */ @jakarta.annotation.Nullable - public String getdLowerCase() { - return dLowerCase; + public Long getuLowerCase() { + return uLowerCase; } - public void setdLowerCase(@jakarta.annotation.Nullable String dLowerCase) { - this.dLowerCase = dLowerCase; + public void setuLowerCase(@jakarta.annotation.Nullable Long uLowerCase) { + this.uLowerCase = uLowerCase; } - public NewSymbolInfoResponse sp(@jakarta.annotation.Nullable String sp) { - this.sp = sp; + public NewSymbolInfoResponse ot(@jakarta.annotation.Nullable Long ot) { + this.ot = ot; return this; } /** - * Get sp + * Get ot * - * @return sp + * @return ot */ @jakarta.annotation.Nullable - public String getSp() { - return sp; + public Long getOt() { + return ot; } - public void setSp(@jakarta.annotation.Nullable String sp) { - this.sp = sp; + public void setOt(@jakarta.annotation.Nullable Long ot) { + this.ot = ot; } - public NewSymbolInfoResponse ed(@jakarta.annotation.Nullable Long ed) { - this.ed = ed; + public NewSymbolInfoResponse cs(@jakarta.annotation.Nullable String cs) { + this.cs = cs; return this; } /** - * Get ed + * Get cs * - * @return ed + * @return cs */ @jakarta.annotation.Nullable - public Long getEd() { - return ed; + public String getCs() { + return cs; } - public void setEd(@jakarta.annotation.Nullable Long ed) { - this.ed = ed; + public void setCs(@jakarta.annotation.Nullable String cs) { + this.cs = cs; } @Override @@ -302,20 +327,21 @@ public boolean equals(Object o) { NewSymbolInfoResponse newSymbolInfoResponse = (NewSymbolInfoResponse) o; return Objects.equals(this.eLowerCase, newSymbolInfoResponse.eLowerCase) && Objects.equals(this.E, newSymbolInfoResponse.E) - && Objects.equals(this.uLowerCase, newSymbolInfoResponse.uLowerCase) - && Objects.equals(this.qa, newSymbolInfoResponse.qa) && Objects.equals(this.sLowerCase, newSymbolInfoResponse.sLowerCase) - && Objects.equals(this.unit, newSymbolInfoResponse.unit) - && Objects.equals(this.mq, newSymbolInfoResponse.mq) + && Objects.equals(this.ps, newSymbolInfoResponse.ps) + && Objects.equals(this.qa, newSymbolInfoResponse.qa) && Objects.equals(this.dLowerCase, newSymbolInfoResponse.dLowerCase) && Objects.equals(this.sp, newSymbolInfoResponse.sp) - && Objects.equals(this.ed, newSymbolInfoResponse.ed); + && Objects.equals(this.dt, newSymbolInfoResponse.dt) + && Objects.equals(this.uLowerCase, newSymbolInfoResponse.uLowerCase) + && Objects.equals(this.ot, newSymbolInfoResponse.ot) + && Objects.equals(this.cs, newSymbolInfoResponse.cs); } @Override public int hashCode() { return Objects.hash( - eLowerCase, E, uLowerCase, qa, sLowerCase, unit, mq, dLowerCase, sp, ed); + eLowerCase, E, sLowerCase, ps, qa, dLowerCase, sp, dt, uLowerCase, ot, cs); } @Override @@ -324,14 +350,15 @@ public String toString() { sb.append("class NewSymbolInfoResponse {\n"); sb.append(" eLowerCase: ").append(toIndentedString(eLowerCase)).append("\n"); sb.append(" E: ").append(toIndentedString(E)).append("\n"); - sb.append(" uLowerCase: ").append(toIndentedString(uLowerCase)).append("\n"); - sb.append(" qa: ").append(toIndentedString(qa)).append("\n"); sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); - sb.append(" unit: ").append(toIndentedString(unit)).append("\n"); - sb.append(" mq: ").append(toIndentedString(mq)).append("\n"); + sb.append(" ps: ").append(toIndentedString(ps)).append("\n"); + sb.append(" qa: ").append(toIndentedString(qa)).append("\n"); sb.append(" dLowerCase: ").append(toIndentedString(dLowerCase)).append("\n"); sb.append(" sp: ").append(toIndentedString(sp)).append("\n"); - sb.append(" ed: ").append(toIndentedString(ed)).append("\n"); + sb.append(" dt: ").append(toIndentedString(dt)).append("\n"); + sb.append(" uLowerCase: ").append(toIndentedString(uLowerCase)).append("\n"); + sb.append(" ot: ").append(toIndentedString(ot)).append("\n"); + sb.append(" cs: ").append(toIndentedString(cs)).append("\n"); sb.append("}"); return sb.toString(); } @@ -350,30 +377,20 @@ public String toUrlQueryString() { String EValueAsString = EValue.toString(); valMap.put("E", EValueAsString); } - String uLowerCaseValue = getuLowerCase(); - if (uLowerCaseValue != null) { - String uLowerCaseValueAsString = uLowerCaseValue.toString(); - valMap.put("uLowerCase", uLowerCaseValueAsString); - } - String qaValue = getQa(); - if (qaValue != null) { - String qaValueAsString = qaValue.toString(); - valMap.put("qa", qaValueAsString); - } String sLowerCaseValue = getsLowerCase(); if (sLowerCaseValue != null) { String sLowerCaseValueAsString = sLowerCaseValue.toString(); valMap.put("sLowerCase", sLowerCaseValueAsString); } - Long unitValue = getUnit(); - if (unitValue != null) { - String unitValueAsString = unitValue.toString(); - valMap.put("unit", unitValueAsString); + String psValue = getPs(); + if (psValue != null) { + String psValueAsString = psValue.toString(); + valMap.put("ps", psValueAsString); } - String mqValue = getMq(); - if (mqValue != null) { - String mqValueAsString = mqValue.toString(); - valMap.put("mq", mqValueAsString); + String qaValue = getQa(); + if (qaValue != null) { + String qaValueAsString = qaValue.toString(); + valMap.put("qa", qaValueAsString); } String dLowerCaseValue = getdLowerCase(); if (dLowerCaseValue != null) { @@ -385,10 +402,25 @@ public String toUrlQueryString() { String spValueAsString = spValue.toString(); valMap.put("sp", spValueAsString); } - Long edValue = getEd(); - if (edValue != null) { - String edValueAsString = edValue.toString(); - valMap.put("ed", edValueAsString); + Long dtValue = getDt(); + if (dtValue != null) { + String dtValueAsString = dtValue.toString(); + valMap.put("dt", dtValueAsString); + } + Long uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + String uLowerCaseValueAsString = uLowerCaseValue.toString(); + valMap.put("uLowerCase", uLowerCaseValueAsString); + } + Long otValue = getOt(); + if (otValue != null) { + String otValueAsString = otValue.toString(); + valMap.put("ot", otValueAsString); + } + String csValue = getCs(); + if (csValue != null) { + String csValueAsString = csValue.toString(); + valMap.put("cs", csValueAsString); } valMap.put("timestamp", getTimestamp()); @@ -409,25 +441,17 @@ public Map toMap() { if (EValue != null) { valMap.put("E", EValue); } - Object uLowerCaseValue = getuLowerCase(); - if (uLowerCaseValue != null) { - valMap.put("uLowerCase", uLowerCaseValue); - } - Object qaValue = getQa(); - if (qaValue != null) { - valMap.put("qa", qaValue); - } Object sLowerCaseValue = getsLowerCase(); if (sLowerCaseValue != null) { valMap.put("sLowerCase", sLowerCaseValue); } - Object unitValue = getUnit(); - if (unitValue != null) { - valMap.put("unit", unitValue); + Object psValue = getPs(); + if (psValue != null) { + valMap.put("ps", psValue); } - Object mqValue = getMq(); - if (mqValue != null) { - valMap.put("mq", mqValue); + Object qaValue = getQa(); + if (qaValue != null) { + valMap.put("qa", qaValue); } Object dLowerCaseValue = getdLowerCase(); if (dLowerCaseValue != null) { @@ -437,9 +461,21 @@ public Map toMap() { if (spValue != null) { valMap.put("sp", spValue); } - Object edValue = getEd(); - if (edValue != null) { - valMap.put("ed", edValue); + Object dtValue = getDt(); + if (dtValue != null) { + valMap.put("dt", dtValue); + } + Object uLowerCaseValue = getuLowerCase(); + if (uLowerCaseValue != null) { + valMap.put("uLowerCase", uLowerCaseValue); + } + Object otValue = getOt(); + if (otValue != null) { + valMap.put("ot", otValue); + } + Object csValue = getCs(); + if (csValue != null) { + valMap.put("cs", csValue); } valMap.put("timestamp", getTimestamp()); @@ -469,14 +505,15 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("e"); openapiFields.add("E"); - openapiFields.add("u"); - openapiFields.add("qa"); openapiFields.add("s"); - openapiFields.add("unit"); - openapiFields.add("mq"); + openapiFields.add("ps"); + openapiFields.add("qa"); openapiFields.add("d"); openapiFields.add("sp"); - openapiFields.add("ed"); + openapiFields.add("dt"); + openapiFields.add("u"); + openapiFields.add("ot"); + openapiFields.add("cs"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -520,22 +557,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("e").toString())); } - if ((jsonObj.get("u") != null && !jsonObj.get("u").isJsonNull()) - && !jsonObj.get("u").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `u` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("u").toString())); - } - if ((jsonObj.get("qa") != null && !jsonObj.get("qa").isJsonNull()) - && !jsonObj.get("qa").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `qa` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("qa").toString())); - } if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) && !jsonObj.get("s").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -544,13 +565,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("s").toString())); } - if ((jsonObj.get("mq") != null && !jsonObj.get("mq").isJsonNull()) - && !jsonObj.get("mq").isJsonPrimitive()) { + if ((jsonObj.get("ps") != null && !jsonObj.get("ps").isJsonNull()) + && !jsonObj.get("ps").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ps` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ps").toString())); + } + if ((jsonObj.get("qa") != null && !jsonObj.get("qa").isJsonNull()) + && !jsonObj.get("qa").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `mq` to be a primitive type in the JSON string but" + "Expected the field `qa` to be a primitive type in the JSON string but" + " got `%s`", - jsonObj.get("mq").toString())); + jsonObj.get("qa").toString())); } if ((jsonObj.get("d") != null && !jsonObj.get("d").isJsonNull()) && !jsonObj.get("d").isJsonPrimitive()) { @@ -568,6 +597,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("sp").toString())); } + if ((jsonObj.get("cs") != null && !jsonObj.get("cs").isJsonNull()) + && !jsonObj.get("cs").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cs` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("cs").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OpenInterestRequest.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OpenInterestRequest.java index 44ca7c627..31d3ad187 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OpenInterestRequest.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OpenInterestRequest.java @@ -43,13 +43,7 @@ public class OpenInterestRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_ID) @jakarta.annotation.Nullable - private String id; - - public static final String SERIALIZED_NAME_UNDERLYING_ASSET = "underlyingAsset"; - - @SerializedName(SERIALIZED_NAME_UNDERLYING_ASSET) - @jakarta.annotation.Nonnull - private String underlyingAsset; + private Integer id; public static final String SERIALIZED_NAME_EXPIRATION_DATE = "expirationDate"; @@ -59,7 +53,7 @@ public class OpenInterestRequest extends BaseDTO { public OpenInterestRequest() {} - public OpenInterestRequest id(@jakarta.annotation.Nullable String id) { + public OpenInterestRequest id(@jakarta.annotation.Nullable Integer id) { this.id = id; return this; } @@ -70,34 +64,14 @@ public OpenInterestRequest id(@jakarta.annotation.Nullable String id) { * @return id */ @jakarta.annotation.Nullable - public String getId() { + public Integer getId() { return id; } - public void setId(@jakarta.annotation.Nullable String id) { + public void setId(@jakarta.annotation.Nullable Integer id) { this.id = id; } - public OpenInterestRequest underlyingAsset(@jakarta.annotation.Nonnull String underlyingAsset) { - this.underlyingAsset = underlyingAsset; - return this; - } - - /** - * Get underlyingAsset - * - * @return underlyingAsset - */ - @jakarta.annotation.Nonnull - @NotNull - public String getUnderlyingAsset() { - return underlyingAsset; - } - - public void setUnderlyingAsset(@jakarta.annotation.Nonnull String underlyingAsset) { - this.underlyingAsset = underlyingAsset; - } - public OpenInterestRequest expirationDate(@jakarta.annotation.Nonnull String expirationDate) { this.expirationDate = expirationDate; return this; @@ -128,13 +102,12 @@ public boolean equals(Object o) { } OpenInterestRequest openInterestRequest = (OpenInterestRequest) o; return Objects.equals(this.id, openInterestRequest.id) - && Objects.equals(this.underlyingAsset, openInterestRequest.underlyingAsset) && Objects.equals(this.expirationDate, openInterestRequest.expirationDate); } @Override public int hashCode() { - return Objects.hash(id, underlyingAsset, expirationDate); + return Objects.hash(id, expirationDate); } @Override @@ -142,7 +115,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class OpenInterestRequest {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" underlyingAsset: ").append(toIndentedString(underlyingAsset)).append("\n"); sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); sb.append("}"); return sb.toString(); @@ -152,16 +124,11 @@ public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - String idValue = getId(); + Integer idValue = getId(); if (idValue != null) { String idValueAsString = idValue.toString(); valMap.put("id", idValueAsString); } - String underlyingAssetValue = getUnderlyingAsset(); - if (underlyingAssetValue != null) { - String underlyingAssetValueAsString = underlyingAssetValue.toString(); - valMap.put("underlyingAsset", underlyingAssetValueAsString); - } String expirationDateValue = getExpirationDate(); if (expirationDateValue != null) { String expirationDateValueAsString = expirationDateValue.toString(); @@ -182,10 +149,6 @@ public Map toMap() { if (idValue != null) { valMap.put("id", idValue); } - Object underlyingAssetValue = getUnderlyingAsset(); - if (underlyingAssetValue != null) { - valMap.put("underlyingAsset", underlyingAssetValue); - } Object expirationDateValue = getExpirationDate(); if (expirationDateValue != null) { valMap.put("expirationDate", expirationDateValue); @@ -217,12 +180,10 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("id"); - openapiFields.add("underlyingAsset"); openapiFields.add("expirationDate"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("underlyingAsset"); openapiRequiredFields.add("expirationDate"); } @@ -266,21 +227,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("underlyingAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `underlyingAsset` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("underlyingAsset").toString())); - } if (!jsonObj.get("expirationDate").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdate.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdate.java index e4ff9d812..a8f875faa 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdate.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdate.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.websocket.dtos.BaseDTO; import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; import com.google.gson.Gson; -import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; @@ -28,9 +27,7 @@ import jakarta.validation.constraints.*; import java.io.IOException; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; @@ -49,11 +46,17 @@ public class OrderTradeUpdate extends BaseDTO { @jakarta.annotation.Nullable private Long E; + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + public static final String SERIALIZED_NAME_O_LOWER_CASE = "o"; @SerializedName(SERIALIZED_NAME_O_LOWER_CASE) @jakarta.annotation.Nullable - private List<@Valid OrderTradeUpdateOInner> oLowerCase; + private OrderTradeUpdateO oLowerCase; public OrderTradeUpdate() {} @@ -76,17 +79,27 @@ public void setE(@jakarta.annotation.Nullable Long E) { this.E = E; } - public OrderTradeUpdate oLowerCase( - @jakarta.annotation.Nullable List<@Valid OrderTradeUpdateOInner> oLowerCase) { - this.oLowerCase = oLowerCase; + public OrderTradeUpdate T(@jakarta.annotation.Nullable Long T) { + this.T = T; return this; } - public OrderTradeUpdate addOLowerCaseItem(OrderTradeUpdateOInner oLowerCaseItem) { - if (this.oLowerCase == null) { - this.oLowerCase = new ArrayList<>(); - } - this.oLowerCase.add(oLowerCaseItem); + /** + * Get T + * + * @return T + */ + @jakarta.annotation.Nullable + public Long getT() { + return T; + } + + public void setT(@jakarta.annotation.Nullable Long T) { + this.T = T; + } + + public OrderTradeUpdate oLowerCase(@jakarta.annotation.Nullable OrderTradeUpdateO oLowerCase) { + this.oLowerCase = oLowerCase; return this; } @@ -97,12 +110,11 @@ public OrderTradeUpdate addOLowerCaseItem(OrderTradeUpdateOInner oLowerCaseItem) */ @jakarta.annotation.Nullable @Valid - public List<@Valid OrderTradeUpdateOInner> getoLowerCase() { + public OrderTradeUpdateO getoLowerCase() { return oLowerCase; } - public void setoLowerCase( - @jakarta.annotation.Nullable List<@Valid OrderTradeUpdateOInner> oLowerCase) { + public void setoLowerCase(@jakarta.annotation.Nullable OrderTradeUpdateO oLowerCase) { this.oLowerCase = oLowerCase; } @@ -116,12 +128,13 @@ public boolean equals(Object o) { } OrderTradeUpdate orderTradeUpdate = (OrderTradeUpdate) o; return Objects.equals(this.E, orderTradeUpdate.E) + && Objects.equals(this.T, orderTradeUpdate.T) && Objects.equals(this.oLowerCase, orderTradeUpdate.oLowerCase); } @Override public int hashCode() { - return Objects.hash(E, oLowerCase); + return Objects.hash(E, T, oLowerCase); } @Override @@ -129,6 +142,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class OrderTradeUpdate {\n"); sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); sb.append(" oLowerCase: ").append(toIndentedString(oLowerCase)).append("\n"); sb.append("}"); return sb.toString(); @@ -143,7 +157,12 @@ public String toUrlQueryString() { String EValueAsString = EValue.toString(); valMap.put("E", EValueAsString); } - List<@Valid OrderTradeUpdateOInner> oLowerCaseValue = getoLowerCase(); + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + OrderTradeUpdateO oLowerCaseValue = getoLowerCase(); if (oLowerCaseValue != null) { String oLowerCaseValueAsString = JSON.getGson().toJson(oLowerCaseValue); valMap.put("oLowerCase", oLowerCaseValueAsString); @@ -163,6 +182,10 @@ public Map toMap() { if (EValue != null) { valMap.put("E", EValue); } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } Object oLowerCaseValue = getoLowerCase(); if (oLowerCaseValue != null) { valMap.put("oLowerCase", oLowerCaseValue); @@ -194,6 +217,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("E"); + openapiFields.add("T"); openapiFields.add("o"); // a set of required properties/fields (JSON key names) @@ -230,24 +254,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `o` if (jsonObj.get("o") != null && !jsonObj.get("o").isJsonNull()) { - JsonArray jsonArrayoLowerCase = jsonObj.getAsJsonArray("o"); - if (jsonArrayoLowerCase != null) { - // ensure the json data is an array - if (!jsonObj.get("o").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `o` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("o").toString())); - } - - // validate the optional field `o` (array) - for (int i = 0; i < jsonArrayoLowerCase.size(); i++) { - OrderTradeUpdateOInner.validateJsonElement(jsonArrayoLowerCase.get(i)); - } - ; - } + OrderTradeUpdateO.validateJsonElement(jsonObj.get("o")); } } diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdateO.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdateO.java new file mode 100644 index 000000000..8c4c08303 --- /dev/null +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdateO.java @@ -0,0 +1,1259 @@ +/* + * Binance Derivatives Trading Options WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Options WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_options.websocket.stream.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** OrderTradeUpdateO */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class OrderTradeUpdateO extends BaseDTO { + public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; + + @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) + @jakarta.annotation.Nullable + private String sLowerCase; + + public static final String SERIALIZED_NAME_C_LOWER_CASE = "c"; + + @SerializedName(SERIALIZED_NAME_C_LOWER_CASE) + @jakarta.annotation.Nullable + private String cLowerCase; + + public static final String SERIALIZED_NAME_S = "S"; + + @SerializedName(SERIALIZED_NAME_S) + @jakarta.annotation.Nullable + private String S; + + public static final String SERIALIZED_NAME_O_LOWER_CASE = "o"; + + @SerializedName(SERIALIZED_NAME_O_LOWER_CASE) + @jakarta.annotation.Nullable + private String oLowerCase; + + public static final String SERIALIZED_NAME_F_LOWER_CASE = "f"; + + @SerializedName(SERIALIZED_NAME_F_LOWER_CASE) + @jakarta.annotation.Nullable + private String fLowerCase; + + public static final String SERIALIZED_NAME_Q_LOWER_CASE = "q"; + + @SerializedName(SERIALIZED_NAME_Q_LOWER_CASE) + @jakarta.annotation.Nullable + private String qLowerCase; + + public static final String SERIALIZED_NAME_P_LOWER_CASE = "p"; + + @SerializedName(SERIALIZED_NAME_P_LOWER_CASE) + @jakarta.annotation.Nullable + private String pLowerCase; + + public static final String SERIALIZED_NAME_AP = "ap"; + + @SerializedName(SERIALIZED_NAME_AP) + @jakarta.annotation.Nullable + private String ap; + + public static final String SERIALIZED_NAME_X_LOWER_CASE = "x"; + + @SerializedName(SERIALIZED_NAME_X_LOWER_CASE) + @jakarta.annotation.Nullable + private String xLowerCase; + + public static final String SERIALIZED_NAME_X = "X"; + + @SerializedName(SERIALIZED_NAME_X) + @jakarta.annotation.Nullable + private String X; + + public static final String SERIALIZED_NAME_I_LOWER_CASE = "i"; + + @SerializedName(SERIALIZED_NAME_I_LOWER_CASE) + @jakarta.annotation.Nullable + private Long iLowerCase; + + public static final String SERIALIZED_NAME_L_LOWER_CASE = "l"; + + @SerializedName(SERIALIZED_NAME_L_LOWER_CASE) + @jakarta.annotation.Nullable + private String lLowerCase; + + public static final String SERIALIZED_NAME_Z_LOWER_CASE = "z"; + + @SerializedName(SERIALIZED_NAME_Z_LOWER_CASE) + @jakarta.annotation.Nullable + private String zLowerCase; + + public static final String SERIALIZED_NAME_L = "L"; + + @SerializedName(SERIALIZED_NAME_L) + @jakarta.annotation.Nullable + private String L; + + public static final String SERIALIZED_NAME_N = "N"; + + @SerializedName(SERIALIZED_NAME_N) + @jakarta.annotation.Nullable + private String N; + + public static final String SERIALIZED_NAME_N_LOWER_CASE = "n"; + + @SerializedName(SERIALIZED_NAME_N_LOWER_CASE) + @jakarta.annotation.Nullable + private String nLowerCase; + + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + + public static final String SERIALIZED_NAME_T_LOWER_CASE = "t"; + + @SerializedName(SERIALIZED_NAME_T_LOWER_CASE) + @jakarta.annotation.Nullable + private Long tLowerCase; + + public static final String SERIALIZED_NAME_B_LOWER_CASE = "b"; + + @SerializedName(SERIALIZED_NAME_B_LOWER_CASE) + @jakarta.annotation.Nullable + private String bLowerCase; + + public static final String SERIALIZED_NAME_A_LOWER_CASE = "a"; + + @SerializedName(SERIALIZED_NAME_A_LOWER_CASE) + @jakarta.annotation.Nullable + private String aLowerCase; + + public static final String SERIALIZED_NAME_M_LOWER_CASE = "m"; + + @SerializedName(SERIALIZED_NAME_M_LOWER_CASE) + @jakarta.annotation.Nullable + private Boolean mLowerCase; + + public static final String SERIALIZED_NAME_R = "R"; + + @SerializedName(SERIALIZED_NAME_R) + @jakarta.annotation.Nullable + private Boolean R; + + public static final String SERIALIZED_NAME_OT = "ot"; + + @SerializedName(SERIALIZED_NAME_OT) + @jakarta.annotation.Nullable + private String ot; + + public static final String SERIALIZED_NAME_RP = "rp"; + + @SerializedName(SERIALIZED_NAME_RP) + @jakarta.annotation.Nullable + private String rp; + + public OrderTradeUpdateO() {} + + public OrderTradeUpdateO sLowerCase(@jakarta.annotation.Nullable String sLowerCase) { + this.sLowerCase = sLowerCase; + return this; + } + + /** + * Get sLowerCase + * + * @return sLowerCase + */ + @jakarta.annotation.Nullable + public String getsLowerCase() { + return sLowerCase; + } + + public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { + this.sLowerCase = sLowerCase; + } + + public OrderTradeUpdateO cLowerCase(@jakarta.annotation.Nullable String cLowerCase) { + this.cLowerCase = cLowerCase; + return this; + } + + /** + * Get cLowerCase + * + * @return cLowerCase + */ + @jakarta.annotation.Nullable + public String getcLowerCase() { + return cLowerCase; + } + + public void setcLowerCase(@jakarta.annotation.Nullable String cLowerCase) { + this.cLowerCase = cLowerCase; + } + + public OrderTradeUpdateO S(@jakarta.annotation.Nullable String S) { + this.S = S; + return this; + } + + /** + * Get S + * + * @return S + */ + @jakarta.annotation.Nullable + public String getS() { + return S; + } + + public void setS(@jakarta.annotation.Nullable String S) { + this.S = S; + } + + public OrderTradeUpdateO oLowerCase(@jakarta.annotation.Nullable String oLowerCase) { + this.oLowerCase = oLowerCase; + return this; + } + + /** + * Get oLowerCase + * + * @return oLowerCase + */ + @jakarta.annotation.Nullable + public String getoLowerCase() { + return oLowerCase; + } + + public void setoLowerCase(@jakarta.annotation.Nullable String oLowerCase) { + this.oLowerCase = oLowerCase; + } + + public OrderTradeUpdateO fLowerCase(@jakarta.annotation.Nullable String fLowerCase) { + this.fLowerCase = fLowerCase; + return this; + } + + /** + * Get fLowerCase + * + * @return fLowerCase + */ + @jakarta.annotation.Nullable + public String getfLowerCase() { + return fLowerCase; + } + + public void setfLowerCase(@jakarta.annotation.Nullable String fLowerCase) { + this.fLowerCase = fLowerCase; + } + + public OrderTradeUpdateO qLowerCase(@jakarta.annotation.Nullable String qLowerCase) { + this.qLowerCase = qLowerCase; + return this; + } + + /** + * Get qLowerCase + * + * @return qLowerCase + */ + @jakarta.annotation.Nullable + public String getqLowerCase() { + return qLowerCase; + } + + public void setqLowerCase(@jakarta.annotation.Nullable String qLowerCase) { + this.qLowerCase = qLowerCase; + } + + public OrderTradeUpdateO pLowerCase(@jakarta.annotation.Nullable String pLowerCase) { + this.pLowerCase = pLowerCase; + return this; + } + + /** + * Get pLowerCase + * + * @return pLowerCase + */ + @jakarta.annotation.Nullable + public String getpLowerCase() { + return pLowerCase; + } + + public void setpLowerCase(@jakarta.annotation.Nullable String pLowerCase) { + this.pLowerCase = pLowerCase; + } + + public OrderTradeUpdateO ap(@jakarta.annotation.Nullable String ap) { + this.ap = ap; + return this; + } + + /** + * Get ap + * + * @return ap + */ + @jakarta.annotation.Nullable + public String getAp() { + return ap; + } + + public void setAp(@jakarta.annotation.Nullable String ap) { + this.ap = ap; + } + + public OrderTradeUpdateO xLowerCase(@jakarta.annotation.Nullable String xLowerCase) { + this.xLowerCase = xLowerCase; + return this; + } + + /** + * Get xLowerCase + * + * @return xLowerCase + */ + @jakarta.annotation.Nullable + public String getxLowerCase() { + return xLowerCase; + } + + public void setxLowerCase(@jakarta.annotation.Nullable String xLowerCase) { + this.xLowerCase = xLowerCase; + } + + public OrderTradeUpdateO X(@jakarta.annotation.Nullable String X) { + this.X = X; + return this; + } + + /** + * Get X + * + * @return X + */ + @jakarta.annotation.Nullable + public String getX() { + return X; + } + + public void setX(@jakarta.annotation.Nullable String X) { + this.X = X; + } + + public OrderTradeUpdateO iLowerCase(@jakarta.annotation.Nullable Long iLowerCase) { + this.iLowerCase = iLowerCase; + return this; + } + + /** + * Get iLowerCase + * + * @return iLowerCase + */ + @jakarta.annotation.Nullable + public Long getiLowerCase() { + return iLowerCase; + } + + public void setiLowerCase(@jakarta.annotation.Nullable Long iLowerCase) { + this.iLowerCase = iLowerCase; + } + + public OrderTradeUpdateO lLowerCase(@jakarta.annotation.Nullable String lLowerCase) { + this.lLowerCase = lLowerCase; + return this; + } + + /** + * Get lLowerCase + * + * @return lLowerCase + */ + @jakarta.annotation.Nullable + public String getlLowerCase() { + return lLowerCase; + } + + public void setlLowerCase(@jakarta.annotation.Nullable String lLowerCase) { + this.lLowerCase = lLowerCase; + } + + public OrderTradeUpdateO zLowerCase(@jakarta.annotation.Nullable String zLowerCase) { + this.zLowerCase = zLowerCase; + return this; + } + + /** + * Get zLowerCase + * + * @return zLowerCase + */ + @jakarta.annotation.Nullable + public String getzLowerCase() { + return zLowerCase; + } + + public void setzLowerCase(@jakarta.annotation.Nullable String zLowerCase) { + this.zLowerCase = zLowerCase; + } + + public OrderTradeUpdateO L(@jakarta.annotation.Nullable String L) { + this.L = L; + return this; + } + + /** + * Get L + * + * @return L + */ + @jakarta.annotation.Nullable + public String getL() { + return L; + } + + public void setL(@jakarta.annotation.Nullable String L) { + this.L = L; + } + + public OrderTradeUpdateO N(@jakarta.annotation.Nullable String N) { + this.N = N; + return this; + } + + /** + * Get N + * + * @return N + */ + @jakarta.annotation.Nullable + public String getN() { + return N; + } + + public void setN(@jakarta.annotation.Nullable String N) { + this.N = N; + } + + public OrderTradeUpdateO nLowerCase(@jakarta.annotation.Nullable String nLowerCase) { + this.nLowerCase = nLowerCase; + return this; + } + + /** + * Get nLowerCase + * + * @return nLowerCase + */ + @jakarta.annotation.Nullable + public String getnLowerCase() { + return nLowerCase; + } + + public void setnLowerCase(@jakarta.annotation.Nullable String nLowerCase) { + this.nLowerCase = nLowerCase; + } + + public OrderTradeUpdateO T(@jakarta.annotation.Nullable Long T) { + this.T = T; + return this; + } + + /** + * Get T + * + * @return T + */ + @jakarta.annotation.Nullable + public Long getT() { + return T; + } + + public void setT(@jakarta.annotation.Nullable Long T) { + this.T = T; + } + + public OrderTradeUpdateO tLowerCase(@jakarta.annotation.Nullable Long tLowerCase) { + this.tLowerCase = tLowerCase; + return this; + } + + /** + * Get tLowerCase + * + * @return tLowerCase + */ + @jakarta.annotation.Nullable + public Long gettLowerCase() { + return tLowerCase; + } + + public void settLowerCase(@jakarta.annotation.Nullable Long tLowerCase) { + this.tLowerCase = tLowerCase; + } + + public OrderTradeUpdateO bLowerCase(@jakarta.annotation.Nullable String bLowerCase) { + this.bLowerCase = bLowerCase; + return this; + } + + /** + * Get bLowerCase + * + * @return bLowerCase + */ + @jakarta.annotation.Nullable + public String getbLowerCase() { + return bLowerCase; + } + + public void setbLowerCase(@jakarta.annotation.Nullable String bLowerCase) { + this.bLowerCase = bLowerCase; + } + + public OrderTradeUpdateO aLowerCase(@jakarta.annotation.Nullable String aLowerCase) { + this.aLowerCase = aLowerCase; + return this; + } + + /** + * Get aLowerCase + * + * @return aLowerCase + */ + @jakarta.annotation.Nullable + public String getaLowerCase() { + return aLowerCase; + } + + public void setaLowerCase(@jakarta.annotation.Nullable String aLowerCase) { + this.aLowerCase = aLowerCase; + } + + public OrderTradeUpdateO mLowerCase(@jakarta.annotation.Nullable Boolean mLowerCase) { + this.mLowerCase = mLowerCase; + return this; + } + + /** + * Get mLowerCase + * + * @return mLowerCase + */ + @jakarta.annotation.Nullable + public Boolean getmLowerCase() { + return mLowerCase; + } + + public void setmLowerCase(@jakarta.annotation.Nullable Boolean mLowerCase) { + this.mLowerCase = mLowerCase; + } + + public OrderTradeUpdateO R(@jakarta.annotation.Nullable Boolean R) { + this.R = R; + return this; + } + + /** + * Get R + * + * @return R + */ + @jakarta.annotation.Nullable + public Boolean getR() { + return R; + } + + public void setR(@jakarta.annotation.Nullable Boolean R) { + this.R = R; + } + + public OrderTradeUpdateO ot(@jakarta.annotation.Nullable String ot) { + this.ot = ot; + return this; + } + + /** + * Get ot + * + * @return ot + */ + @jakarta.annotation.Nullable + public String getOt() { + return ot; + } + + public void setOt(@jakarta.annotation.Nullable String ot) { + this.ot = ot; + } + + public OrderTradeUpdateO rp(@jakarta.annotation.Nullable String rp) { + this.rp = rp; + return this; + } + + /** + * Get rp + * + * @return rp + */ + @jakarta.annotation.Nullable + public String getRp() { + return rp; + } + + public void setRp(@jakarta.annotation.Nullable String rp) { + this.rp = rp; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderTradeUpdateO orderTradeUpdateO = (OrderTradeUpdateO) o; + return Objects.equals(this.sLowerCase, orderTradeUpdateO.sLowerCase) + && Objects.equals(this.cLowerCase, orderTradeUpdateO.cLowerCase) + && Objects.equals(this.S, orderTradeUpdateO.S) + && Objects.equals(this.oLowerCase, orderTradeUpdateO.oLowerCase) + && Objects.equals(this.fLowerCase, orderTradeUpdateO.fLowerCase) + && Objects.equals(this.qLowerCase, orderTradeUpdateO.qLowerCase) + && Objects.equals(this.pLowerCase, orderTradeUpdateO.pLowerCase) + && Objects.equals(this.ap, orderTradeUpdateO.ap) + && Objects.equals(this.xLowerCase, orderTradeUpdateO.xLowerCase) + && Objects.equals(this.X, orderTradeUpdateO.X) + && Objects.equals(this.iLowerCase, orderTradeUpdateO.iLowerCase) + && Objects.equals(this.lLowerCase, orderTradeUpdateO.lLowerCase) + && Objects.equals(this.zLowerCase, orderTradeUpdateO.zLowerCase) + && Objects.equals(this.L, orderTradeUpdateO.L) + && Objects.equals(this.N, orderTradeUpdateO.N) + && Objects.equals(this.nLowerCase, orderTradeUpdateO.nLowerCase) + && Objects.equals(this.T, orderTradeUpdateO.T) + && Objects.equals(this.tLowerCase, orderTradeUpdateO.tLowerCase) + && Objects.equals(this.bLowerCase, orderTradeUpdateO.bLowerCase) + && Objects.equals(this.aLowerCase, orderTradeUpdateO.aLowerCase) + && Objects.equals(this.mLowerCase, orderTradeUpdateO.mLowerCase) + && Objects.equals(this.R, orderTradeUpdateO.R) + && Objects.equals(this.ot, orderTradeUpdateO.ot) + && Objects.equals(this.rp, orderTradeUpdateO.rp); + } + + @Override + public int hashCode() { + return Objects.hash( + sLowerCase, + cLowerCase, + S, + oLowerCase, + fLowerCase, + qLowerCase, + pLowerCase, + ap, + xLowerCase, + X, + iLowerCase, + lLowerCase, + zLowerCase, + L, + N, + nLowerCase, + T, + tLowerCase, + bLowerCase, + aLowerCase, + mLowerCase, + R, + ot, + rp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderTradeUpdateO {\n"); + sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" cLowerCase: ").append(toIndentedString(cLowerCase)).append("\n"); + sb.append(" S: ").append(toIndentedString(S)).append("\n"); + sb.append(" oLowerCase: ").append(toIndentedString(oLowerCase)).append("\n"); + sb.append(" fLowerCase: ").append(toIndentedString(fLowerCase)).append("\n"); + sb.append(" qLowerCase: ").append(toIndentedString(qLowerCase)).append("\n"); + sb.append(" pLowerCase: ").append(toIndentedString(pLowerCase)).append("\n"); + sb.append(" ap: ").append(toIndentedString(ap)).append("\n"); + sb.append(" xLowerCase: ").append(toIndentedString(xLowerCase)).append("\n"); + sb.append(" X: ").append(toIndentedString(X)).append("\n"); + sb.append(" iLowerCase: ").append(toIndentedString(iLowerCase)).append("\n"); + sb.append(" lLowerCase: ").append(toIndentedString(lLowerCase)).append("\n"); + sb.append(" zLowerCase: ").append(toIndentedString(zLowerCase)).append("\n"); + sb.append(" L: ").append(toIndentedString(L)).append("\n"); + sb.append(" N: ").append(toIndentedString(N)).append("\n"); + sb.append(" nLowerCase: ").append(toIndentedString(nLowerCase)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); + sb.append(" tLowerCase: ").append(toIndentedString(tLowerCase)).append("\n"); + sb.append(" bLowerCase: ").append(toIndentedString(bLowerCase)).append("\n"); + sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); + sb.append(" mLowerCase: ").append(toIndentedString(mLowerCase)).append("\n"); + sb.append(" R: ").append(toIndentedString(R)).append("\n"); + sb.append(" ot: ").append(toIndentedString(ot)).append("\n"); + sb.append(" rp: ").append(toIndentedString(rp)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + String sLowerCaseValueAsString = sLowerCaseValue.toString(); + valMap.put("sLowerCase", sLowerCaseValueAsString); + } + String cLowerCaseValue = getcLowerCase(); + if (cLowerCaseValue != null) { + String cLowerCaseValueAsString = cLowerCaseValue.toString(); + valMap.put("cLowerCase", cLowerCaseValueAsString); + } + String SValue = getS(); + if (SValue != null) { + String SValueAsString = SValue.toString(); + valMap.put("S", SValueAsString); + } + String oLowerCaseValue = getoLowerCase(); + if (oLowerCaseValue != null) { + String oLowerCaseValueAsString = oLowerCaseValue.toString(); + valMap.put("oLowerCase", oLowerCaseValueAsString); + } + String fLowerCaseValue = getfLowerCase(); + if (fLowerCaseValue != null) { + String fLowerCaseValueAsString = fLowerCaseValue.toString(); + valMap.put("fLowerCase", fLowerCaseValueAsString); + } + String qLowerCaseValue = getqLowerCase(); + if (qLowerCaseValue != null) { + String qLowerCaseValueAsString = qLowerCaseValue.toString(); + valMap.put("qLowerCase", qLowerCaseValueAsString); + } + String pLowerCaseValue = getpLowerCase(); + if (pLowerCaseValue != null) { + String pLowerCaseValueAsString = pLowerCaseValue.toString(); + valMap.put("pLowerCase", pLowerCaseValueAsString); + } + String apValue = getAp(); + if (apValue != null) { + String apValueAsString = apValue.toString(); + valMap.put("ap", apValueAsString); + } + String xLowerCaseValue = getxLowerCase(); + if (xLowerCaseValue != null) { + String xLowerCaseValueAsString = xLowerCaseValue.toString(); + valMap.put("xLowerCase", xLowerCaseValueAsString); + } + String XValue = getX(); + if (XValue != null) { + String XValueAsString = XValue.toString(); + valMap.put("X", XValueAsString); + } + Long iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + String iLowerCaseValueAsString = iLowerCaseValue.toString(); + valMap.put("iLowerCase", iLowerCaseValueAsString); + } + String lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + String lLowerCaseValueAsString = lLowerCaseValue.toString(); + valMap.put("lLowerCase", lLowerCaseValueAsString); + } + String zLowerCaseValue = getzLowerCase(); + if (zLowerCaseValue != null) { + String zLowerCaseValueAsString = zLowerCaseValue.toString(); + valMap.put("zLowerCase", zLowerCaseValueAsString); + } + String LValue = getL(); + if (LValue != null) { + String LValueAsString = LValue.toString(); + valMap.put("L", LValueAsString); + } + String NValue = getN(); + if (NValue != null) { + String NValueAsString = NValue.toString(); + valMap.put("N", NValueAsString); + } + String nLowerCaseValue = getnLowerCase(); + if (nLowerCaseValue != null) { + String nLowerCaseValueAsString = nLowerCaseValue.toString(); + valMap.put("nLowerCase", nLowerCaseValueAsString); + } + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } + Long tLowerCaseValue = gettLowerCase(); + if (tLowerCaseValue != null) { + String tLowerCaseValueAsString = tLowerCaseValue.toString(); + valMap.put("tLowerCase", tLowerCaseValueAsString); + } + String bLowerCaseValue = getbLowerCase(); + if (bLowerCaseValue != null) { + String bLowerCaseValueAsString = bLowerCaseValue.toString(); + valMap.put("bLowerCase", bLowerCaseValueAsString); + } + String aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + String aLowerCaseValueAsString = aLowerCaseValue.toString(); + valMap.put("aLowerCase", aLowerCaseValueAsString); + } + Boolean mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + String mLowerCaseValueAsString = mLowerCaseValue.toString(); + valMap.put("mLowerCase", mLowerCaseValueAsString); + } + Boolean RValue = getR(); + if (RValue != null) { + String RValueAsString = RValue.toString(); + valMap.put("R", RValueAsString); + } + String otValue = getOt(); + if (otValue != null) { + String otValueAsString = otValue.toString(); + valMap.put("ot", otValueAsString); + } + String rpValue = getRp(); + if (rpValue != null) { + String rpValueAsString = rpValue.toString(); + valMap.put("rp", rpValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object sLowerCaseValue = getsLowerCase(); + if (sLowerCaseValue != null) { + valMap.put("sLowerCase", sLowerCaseValue); + } + Object cLowerCaseValue = getcLowerCase(); + if (cLowerCaseValue != null) { + valMap.put("cLowerCase", cLowerCaseValue); + } + Object SValue = getS(); + if (SValue != null) { + valMap.put("S", SValue); + } + Object oLowerCaseValue = getoLowerCase(); + if (oLowerCaseValue != null) { + valMap.put("oLowerCase", oLowerCaseValue); + } + Object fLowerCaseValue = getfLowerCase(); + if (fLowerCaseValue != null) { + valMap.put("fLowerCase", fLowerCaseValue); + } + Object qLowerCaseValue = getqLowerCase(); + if (qLowerCaseValue != null) { + valMap.put("qLowerCase", qLowerCaseValue); + } + Object pLowerCaseValue = getpLowerCase(); + if (pLowerCaseValue != null) { + valMap.put("pLowerCase", pLowerCaseValue); + } + Object apValue = getAp(); + if (apValue != null) { + valMap.put("ap", apValue); + } + Object xLowerCaseValue = getxLowerCase(); + if (xLowerCaseValue != null) { + valMap.put("xLowerCase", xLowerCaseValue); + } + Object XValue = getX(); + if (XValue != null) { + valMap.put("X", XValue); + } + Object iLowerCaseValue = getiLowerCase(); + if (iLowerCaseValue != null) { + valMap.put("iLowerCase", iLowerCaseValue); + } + Object lLowerCaseValue = getlLowerCase(); + if (lLowerCaseValue != null) { + valMap.put("lLowerCase", lLowerCaseValue); + } + Object zLowerCaseValue = getzLowerCase(); + if (zLowerCaseValue != null) { + valMap.put("zLowerCase", zLowerCaseValue); + } + Object LValue = getL(); + if (LValue != null) { + valMap.put("L", LValue); + } + Object NValue = getN(); + if (NValue != null) { + valMap.put("N", NValue); + } + Object nLowerCaseValue = getnLowerCase(); + if (nLowerCaseValue != null) { + valMap.put("nLowerCase", nLowerCaseValue); + } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } + Object tLowerCaseValue = gettLowerCase(); + if (tLowerCaseValue != null) { + valMap.put("tLowerCase", tLowerCaseValue); + } + Object bLowerCaseValue = getbLowerCase(); + if (bLowerCaseValue != null) { + valMap.put("bLowerCase", bLowerCaseValue); + } + Object aLowerCaseValue = getaLowerCase(); + if (aLowerCaseValue != null) { + valMap.put("aLowerCase", aLowerCaseValue); + } + Object mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + valMap.put("mLowerCase", mLowerCaseValue); + } + Object RValue = getR(); + if (RValue != null) { + valMap.put("R", RValue); + } + Object otValue = getOt(); + if (otValue != null) { + valMap.put("ot", otValue); + } + Object rpValue = getRp(); + if (rpValue != null) { + valMap.put("rp", rpValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("s"); + openapiFields.add("c"); + openapiFields.add("S"); + openapiFields.add("o"); + openapiFields.add("f"); + openapiFields.add("q"); + openapiFields.add("p"); + openapiFields.add("ap"); + openapiFields.add("x"); + openapiFields.add("X"); + openapiFields.add("i"); + openapiFields.add("l"); + openapiFields.add("z"); + openapiFields.add("L"); + openapiFields.add("N"); + openapiFields.add("n"); + openapiFields.add("T"); + openapiFields.add("t"); + openapiFields.add("b"); + openapiFields.add("a"); + openapiFields.add("m"); + openapiFields.add("R"); + openapiFields.add("ot"); + openapiFields.add("rp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OrderTradeUpdateO + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrderTradeUpdateO.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in OrderTradeUpdateO is not found in the" + + " empty JSON string", + OrderTradeUpdateO.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OrderTradeUpdateO.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `OrderTradeUpdateO` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) + && !jsonObj.get("s").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `s` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("s").toString())); + } + if ((jsonObj.get("c") != null && !jsonObj.get("c").isJsonNull()) + && !jsonObj.get("c").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `c` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("c").toString())); + } + if ((jsonObj.get("S") != null && !jsonObj.get("S").isJsonNull()) + && !jsonObj.get("S").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `S` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("S").toString())); + } + if ((jsonObj.get("o") != null && !jsonObj.get("o").isJsonNull()) + && !jsonObj.get("o").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `o` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("o").toString())); + } + if ((jsonObj.get("f") != null && !jsonObj.get("f").isJsonNull()) + && !jsonObj.get("f").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `f` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("f").toString())); + } + if ((jsonObj.get("q") != null && !jsonObj.get("q").isJsonNull()) + && !jsonObj.get("q").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `q` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("q").toString())); + } + if ((jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) + && !jsonObj.get("p").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `p` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("p").toString())); + } + if ((jsonObj.get("ap") != null && !jsonObj.get("ap").isJsonNull()) + && !jsonObj.get("ap").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ap` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ap").toString())); + } + if ((jsonObj.get("x") != null && !jsonObj.get("x").isJsonNull()) + && !jsonObj.get("x").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `x` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("x").toString())); + } + if ((jsonObj.get("X") != null && !jsonObj.get("X").isJsonNull()) + && !jsonObj.get("X").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `X` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("X").toString())); + } + if ((jsonObj.get("l") != null && !jsonObj.get("l").isJsonNull()) + && !jsonObj.get("l").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `l` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("l").toString())); + } + if ((jsonObj.get("z") != null && !jsonObj.get("z").isJsonNull()) + && !jsonObj.get("z").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `z` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("z").toString())); + } + if ((jsonObj.get("L") != null && !jsonObj.get("L").isJsonNull()) + && !jsonObj.get("L").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `L` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("L").toString())); + } + if ((jsonObj.get("N") != null && !jsonObj.get("N").isJsonNull()) + && !jsonObj.get("N").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `N` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("N").toString())); + } + if ((jsonObj.get("n") != null && !jsonObj.get("n").isJsonNull()) + && !jsonObj.get("n").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `n` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("n").toString())); + } + if ((jsonObj.get("b") != null && !jsonObj.get("b").isJsonNull()) + && !jsonObj.get("b").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `b` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("b").toString())); + } + if ((jsonObj.get("a") != null && !jsonObj.get("a").isJsonNull()) + && !jsonObj.get("a").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `a` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("a").toString())); + } + if ((jsonObj.get("ot") != null && !jsonObj.get("ot").isJsonNull()) + && !jsonObj.get("ot").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `ot` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("ot").toString())); + } + if ((jsonObj.get("rp") != null && !jsonObj.get("rp").isJsonNull()) + && !jsonObj.get("rp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rp` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("rp").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OrderTradeUpdateO.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrderTradeUpdateO' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(OrderTradeUpdateO.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, OrderTradeUpdateO value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OrderTradeUpdateO read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of OrderTradeUpdateO given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrderTradeUpdateO + * @throws IOException if the JSON string is invalid with respect to OrderTradeUpdateO + */ + public static OrderTradeUpdateO fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrderTradeUpdateO.class); + } + + /** + * Convert an instance of OrderTradeUpdateO to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdateOInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdateOInner.java deleted file mode 100644 index c97943ec7..000000000 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdateOInner.java +++ /dev/null @@ -1,962 +0,0 @@ -/* - * Binance Derivatives Trading Options WebSocket Market Streams - * OpenAPI Specification for the Binance Derivatives Trading Options WebSocket Market Streams - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_options.websocket.stream.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** OrderTradeUpdateOInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class OrderTradeUpdateOInner extends BaseDTO { - public static final String SERIALIZED_NAME_T = "T"; - - @SerializedName(SERIALIZED_NAME_T) - @jakarta.annotation.Nullable - private Long T; - - public static final String SERIALIZED_NAME_T_LOWER_CASE = "t"; - - @SerializedName(SERIALIZED_NAME_T_LOWER_CASE) - @jakarta.annotation.Nullable - private Long tLowerCase; - - public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; - - @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) - @jakarta.annotation.Nullable - private String sLowerCase; - - public static final String SERIALIZED_NAME_C_LOWER_CASE = "c"; - - @SerializedName(SERIALIZED_NAME_C_LOWER_CASE) - @jakarta.annotation.Nullable - private String cLowerCase; - - public static final String SERIALIZED_NAME_OID = "oid"; - - @SerializedName(SERIALIZED_NAME_OID) - @jakarta.annotation.Nullable - private String oid; - - public static final String SERIALIZED_NAME_P_LOWER_CASE = "p"; - - @SerializedName(SERIALIZED_NAME_P_LOWER_CASE) - @jakarta.annotation.Nullable - private String pLowerCase; - - public static final String SERIALIZED_NAME_Q_LOWER_CASE = "q"; - - @SerializedName(SERIALIZED_NAME_Q_LOWER_CASE) - @jakarta.annotation.Nullable - private String qLowerCase; - - public static final String SERIALIZED_NAME_STP = "stp"; - - @SerializedName(SERIALIZED_NAME_STP) - @jakarta.annotation.Nullable - private Long stp; - - public static final String SERIALIZED_NAME_R_LOWER_CASE = "r"; - - @SerializedName(SERIALIZED_NAME_R_LOWER_CASE) - @jakarta.annotation.Nullable - private Boolean rLowerCase; - - public static final String SERIALIZED_NAME_PO = "po"; - - @SerializedName(SERIALIZED_NAME_PO) - @jakarta.annotation.Nullable - private Boolean po; - - public static final String SERIALIZED_NAME_S = "S"; - - @SerializedName(SERIALIZED_NAME_S) - @jakarta.annotation.Nullable - private String S; - - public static final String SERIALIZED_NAME_E_LOWER_CASE = "e"; - - @SerializedName(SERIALIZED_NAME_E_LOWER_CASE) - @jakarta.annotation.Nullable - private String eLowerCase; - - public static final String SERIALIZED_NAME_EC = "ec"; - - @SerializedName(SERIALIZED_NAME_EC) - @jakarta.annotation.Nullable - private String ec; - - public static final String SERIALIZED_NAME_F_LOWER_CASE = "f"; - - @SerializedName(SERIALIZED_NAME_F_LOWER_CASE) - @jakarta.annotation.Nullable - private String fLowerCase; - - public static final String SERIALIZED_NAME_TIF = "tif"; - - @SerializedName(SERIALIZED_NAME_TIF) - @jakarta.annotation.Nullable - private String tif; - - public static final String SERIALIZED_NAME_OTY = "oty"; - - @SerializedName(SERIALIZED_NAME_OTY) - @jakarta.annotation.Nullable - private String oty; - - public static final String SERIALIZED_NAME_FI = "fi"; - - @SerializedName(SERIALIZED_NAME_FI) - @jakarta.annotation.Nullable - private List<@Valid OrderTradeUpdateOInnerFiInner> fi; - - public OrderTradeUpdateOInner() {} - - public OrderTradeUpdateOInner T(@jakarta.annotation.Nullable Long T) { - this.T = T; - return this; - } - - /** - * Get T - * - * @return T - */ - @jakarta.annotation.Nullable - public Long getT() { - return T; - } - - public void setT(@jakarta.annotation.Nullable Long T) { - this.T = T; - } - - public OrderTradeUpdateOInner tLowerCase(@jakarta.annotation.Nullable Long tLowerCase) { - this.tLowerCase = tLowerCase; - return this; - } - - /** - * Get tLowerCase - * - * @return tLowerCase - */ - @jakarta.annotation.Nullable - public Long gettLowerCase() { - return tLowerCase; - } - - public void settLowerCase(@jakarta.annotation.Nullable Long tLowerCase) { - this.tLowerCase = tLowerCase; - } - - public OrderTradeUpdateOInner sLowerCase(@jakarta.annotation.Nullable String sLowerCase) { - this.sLowerCase = sLowerCase; - return this; - } - - /** - * Get sLowerCase - * - * @return sLowerCase - */ - @jakarta.annotation.Nullable - public String getsLowerCase() { - return sLowerCase; - } - - public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { - this.sLowerCase = sLowerCase; - } - - public OrderTradeUpdateOInner cLowerCase(@jakarta.annotation.Nullable String cLowerCase) { - this.cLowerCase = cLowerCase; - return this; - } - - /** - * Get cLowerCase - * - * @return cLowerCase - */ - @jakarta.annotation.Nullable - public String getcLowerCase() { - return cLowerCase; - } - - public void setcLowerCase(@jakarta.annotation.Nullable String cLowerCase) { - this.cLowerCase = cLowerCase; - } - - public OrderTradeUpdateOInner oid(@jakarta.annotation.Nullable String oid) { - this.oid = oid; - return this; - } - - /** - * Get oid - * - * @return oid - */ - @jakarta.annotation.Nullable - public String getOid() { - return oid; - } - - public void setOid(@jakarta.annotation.Nullable String oid) { - this.oid = oid; - } - - public OrderTradeUpdateOInner pLowerCase(@jakarta.annotation.Nullable String pLowerCase) { - this.pLowerCase = pLowerCase; - return this; - } - - /** - * Get pLowerCase - * - * @return pLowerCase - */ - @jakarta.annotation.Nullable - public String getpLowerCase() { - return pLowerCase; - } - - public void setpLowerCase(@jakarta.annotation.Nullable String pLowerCase) { - this.pLowerCase = pLowerCase; - } - - public OrderTradeUpdateOInner qLowerCase(@jakarta.annotation.Nullable String qLowerCase) { - this.qLowerCase = qLowerCase; - return this; - } - - /** - * Get qLowerCase - * - * @return qLowerCase - */ - @jakarta.annotation.Nullable - public String getqLowerCase() { - return qLowerCase; - } - - public void setqLowerCase(@jakarta.annotation.Nullable String qLowerCase) { - this.qLowerCase = qLowerCase; - } - - public OrderTradeUpdateOInner stp(@jakarta.annotation.Nullable Long stp) { - this.stp = stp; - return this; - } - - /** - * Get stp - * - * @return stp - */ - @jakarta.annotation.Nullable - public Long getStp() { - return stp; - } - - public void setStp(@jakarta.annotation.Nullable Long stp) { - this.stp = stp; - } - - public OrderTradeUpdateOInner rLowerCase(@jakarta.annotation.Nullable Boolean rLowerCase) { - this.rLowerCase = rLowerCase; - return this; - } - - /** - * Get rLowerCase - * - * @return rLowerCase - */ - @jakarta.annotation.Nullable - public Boolean getrLowerCase() { - return rLowerCase; - } - - public void setrLowerCase(@jakarta.annotation.Nullable Boolean rLowerCase) { - this.rLowerCase = rLowerCase; - } - - public OrderTradeUpdateOInner po(@jakarta.annotation.Nullable Boolean po) { - this.po = po; - return this; - } - - /** - * Get po - * - * @return po - */ - @jakarta.annotation.Nullable - public Boolean getPo() { - return po; - } - - public void setPo(@jakarta.annotation.Nullable Boolean po) { - this.po = po; - } - - public OrderTradeUpdateOInner S(@jakarta.annotation.Nullable String S) { - this.S = S; - return this; - } - - /** - * Get S - * - * @return S - */ - @jakarta.annotation.Nullable - public String getS() { - return S; - } - - public void setS(@jakarta.annotation.Nullable String S) { - this.S = S; - } - - public OrderTradeUpdateOInner eLowerCase(@jakarta.annotation.Nullable String eLowerCase) { - this.eLowerCase = eLowerCase; - return this; - } - - /** - * Get eLowerCase - * - * @return eLowerCase - */ - @jakarta.annotation.Nullable - public String geteLowerCase() { - return eLowerCase; - } - - public void seteLowerCase(@jakarta.annotation.Nullable String eLowerCase) { - this.eLowerCase = eLowerCase; - } - - public OrderTradeUpdateOInner ec(@jakarta.annotation.Nullable String ec) { - this.ec = ec; - return this; - } - - /** - * Get ec - * - * @return ec - */ - @jakarta.annotation.Nullable - public String getEc() { - return ec; - } - - public void setEc(@jakarta.annotation.Nullable String ec) { - this.ec = ec; - } - - public OrderTradeUpdateOInner fLowerCase(@jakarta.annotation.Nullable String fLowerCase) { - this.fLowerCase = fLowerCase; - return this; - } - - /** - * Get fLowerCase - * - * @return fLowerCase - */ - @jakarta.annotation.Nullable - public String getfLowerCase() { - return fLowerCase; - } - - public void setfLowerCase(@jakarta.annotation.Nullable String fLowerCase) { - this.fLowerCase = fLowerCase; - } - - public OrderTradeUpdateOInner tif(@jakarta.annotation.Nullable String tif) { - this.tif = tif; - return this; - } - - /** - * Get tif - * - * @return tif - */ - @jakarta.annotation.Nullable - public String getTif() { - return tif; - } - - public void setTif(@jakarta.annotation.Nullable String tif) { - this.tif = tif; - } - - public OrderTradeUpdateOInner oty(@jakarta.annotation.Nullable String oty) { - this.oty = oty; - return this; - } - - /** - * Get oty - * - * @return oty - */ - @jakarta.annotation.Nullable - public String getOty() { - return oty; - } - - public void setOty(@jakarta.annotation.Nullable String oty) { - this.oty = oty; - } - - public OrderTradeUpdateOInner fi( - @jakarta.annotation.Nullable List<@Valid OrderTradeUpdateOInnerFiInner> fi) { - this.fi = fi; - return this; - } - - public OrderTradeUpdateOInner addFiItem(OrderTradeUpdateOInnerFiInner fiItem) { - if (this.fi == null) { - this.fi = new ArrayList<>(); - } - this.fi.add(fiItem); - return this; - } - - /** - * Get fi - * - * @return fi - */ - @jakarta.annotation.Nullable - @Valid - public List<@Valid OrderTradeUpdateOInnerFiInner> getFi() { - return fi; - } - - public void setFi(@jakarta.annotation.Nullable List<@Valid OrderTradeUpdateOInnerFiInner> fi) { - this.fi = fi; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OrderTradeUpdateOInner orderTradeUpdateOInner = (OrderTradeUpdateOInner) o; - return Objects.equals(this.T, orderTradeUpdateOInner.T) - && Objects.equals(this.tLowerCase, orderTradeUpdateOInner.tLowerCase) - && Objects.equals(this.sLowerCase, orderTradeUpdateOInner.sLowerCase) - && Objects.equals(this.cLowerCase, orderTradeUpdateOInner.cLowerCase) - && Objects.equals(this.oid, orderTradeUpdateOInner.oid) - && Objects.equals(this.pLowerCase, orderTradeUpdateOInner.pLowerCase) - && Objects.equals(this.qLowerCase, orderTradeUpdateOInner.qLowerCase) - && Objects.equals(this.stp, orderTradeUpdateOInner.stp) - && Objects.equals(this.rLowerCase, orderTradeUpdateOInner.rLowerCase) - && Objects.equals(this.po, orderTradeUpdateOInner.po) - && Objects.equals(this.S, orderTradeUpdateOInner.S) - && Objects.equals(this.eLowerCase, orderTradeUpdateOInner.eLowerCase) - && Objects.equals(this.ec, orderTradeUpdateOInner.ec) - && Objects.equals(this.fLowerCase, orderTradeUpdateOInner.fLowerCase) - && Objects.equals(this.tif, orderTradeUpdateOInner.tif) - && Objects.equals(this.oty, orderTradeUpdateOInner.oty) - && Objects.equals(this.fi, orderTradeUpdateOInner.fi); - } - - @Override - public int hashCode() { - return Objects.hash( - T, - tLowerCase, - sLowerCase, - cLowerCase, - oid, - pLowerCase, - qLowerCase, - stp, - rLowerCase, - po, - S, - eLowerCase, - ec, - fLowerCase, - tif, - oty, - fi); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OrderTradeUpdateOInner {\n"); - sb.append(" T: ").append(toIndentedString(T)).append("\n"); - sb.append(" tLowerCase: ").append(toIndentedString(tLowerCase)).append("\n"); - sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); - sb.append(" cLowerCase: ").append(toIndentedString(cLowerCase)).append("\n"); - sb.append(" oid: ").append(toIndentedString(oid)).append("\n"); - sb.append(" pLowerCase: ").append(toIndentedString(pLowerCase)).append("\n"); - sb.append(" qLowerCase: ").append(toIndentedString(qLowerCase)).append("\n"); - sb.append(" stp: ").append(toIndentedString(stp)).append("\n"); - sb.append(" rLowerCase: ").append(toIndentedString(rLowerCase)).append("\n"); - sb.append(" po: ").append(toIndentedString(po)).append("\n"); - sb.append(" S: ").append(toIndentedString(S)).append("\n"); - sb.append(" eLowerCase: ").append(toIndentedString(eLowerCase)).append("\n"); - sb.append(" ec: ").append(toIndentedString(ec)).append("\n"); - sb.append(" fLowerCase: ").append(toIndentedString(fLowerCase)).append("\n"); - sb.append(" tif: ").append(toIndentedString(tif)).append("\n"); - sb.append(" oty: ").append(toIndentedString(oty)).append("\n"); - sb.append(" fi: ").append(toIndentedString(fi)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Long TValue = getT(); - if (TValue != null) { - String TValueAsString = TValue.toString(); - valMap.put("T", TValueAsString); - } - Long tLowerCaseValue = gettLowerCase(); - if (tLowerCaseValue != null) { - String tLowerCaseValueAsString = tLowerCaseValue.toString(); - valMap.put("tLowerCase", tLowerCaseValueAsString); - } - String sLowerCaseValue = getsLowerCase(); - if (sLowerCaseValue != null) { - String sLowerCaseValueAsString = sLowerCaseValue.toString(); - valMap.put("sLowerCase", sLowerCaseValueAsString); - } - String cLowerCaseValue = getcLowerCase(); - if (cLowerCaseValue != null) { - String cLowerCaseValueAsString = cLowerCaseValue.toString(); - valMap.put("cLowerCase", cLowerCaseValueAsString); - } - String oidValue = getOid(); - if (oidValue != null) { - String oidValueAsString = oidValue.toString(); - valMap.put("oid", oidValueAsString); - } - String pLowerCaseValue = getpLowerCase(); - if (pLowerCaseValue != null) { - String pLowerCaseValueAsString = pLowerCaseValue.toString(); - valMap.put("pLowerCase", pLowerCaseValueAsString); - } - String qLowerCaseValue = getqLowerCase(); - if (qLowerCaseValue != null) { - String qLowerCaseValueAsString = qLowerCaseValue.toString(); - valMap.put("qLowerCase", qLowerCaseValueAsString); - } - Long stpValue = getStp(); - if (stpValue != null) { - String stpValueAsString = stpValue.toString(); - valMap.put("stp", stpValueAsString); - } - Boolean rLowerCaseValue = getrLowerCase(); - if (rLowerCaseValue != null) { - String rLowerCaseValueAsString = rLowerCaseValue.toString(); - valMap.put("rLowerCase", rLowerCaseValueAsString); - } - Boolean poValue = getPo(); - if (poValue != null) { - String poValueAsString = poValue.toString(); - valMap.put("po", poValueAsString); - } - String SValue = getS(); - if (SValue != null) { - String SValueAsString = SValue.toString(); - valMap.put("S", SValueAsString); - } - String eLowerCaseValue = geteLowerCase(); - if (eLowerCaseValue != null) { - String eLowerCaseValueAsString = eLowerCaseValue.toString(); - valMap.put("eLowerCase", eLowerCaseValueAsString); - } - String ecValue = getEc(); - if (ecValue != null) { - String ecValueAsString = ecValue.toString(); - valMap.put("ec", ecValueAsString); - } - String fLowerCaseValue = getfLowerCase(); - if (fLowerCaseValue != null) { - String fLowerCaseValueAsString = fLowerCaseValue.toString(); - valMap.put("fLowerCase", fLowerCaseValueAsString); - } - String tifValue = getTif(); - if (tifValue != null) { - String tifValueAsString = tifValue.toString(); - valMap.put("tif", tifValueAsString); - } - String otyValue = getOty(); - if (otyValue != null) { - String otyValueAsString = otyValue.toString(); - valMap.put("oty", otyValueAsString); - } - List<@Valid OrderTradeUpdateOInnerFiInner> fiValue = getFi(); - if (fiValue != null) { - String fiValueAsString = JSON.getGson().toJson(fiValue); - valMap.put("fi", fiValueAsString); - } - - valMap.put("timestamp", getTimestamp()); - return asciiEncode( - valMap.keySet().stream() - .map(key -> key + "=" + valMap.get(key)) - .collect(Collectors.joining("&"))); - } - - public Map toMap() { - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Object TValue = getT(); - if (TValue != null) { - valMap.put("T", TValue); - } - Object tLowerCaseValue = gettLowerCase(); - if (tLowerCaseValue != null) { - valMap.put("tLowerCase", tLowerCaseValue); - } - Object sLowerCaseValue = getsLowerCase(); - if (sLowerCaseValue != null) { - valMap.put("sLowerCase", sLowerCaseValue); - } - Object cLowerCaseValue = getcLowerCase(); - if (cLowerCaseValue != null) { - valMap.put("cLowerCase", cLowerCaseValue); - } - Object oidValue = getOid(); - if (oidValue != null) { - valMap.put("oid", oidValue); - } - Object pLowerCaseValue = getpLowerCase(); - if (pLowerCaseValue != null) { - valMap.put("pLowerCase", pLowerCaseValue); - } - Object qLowerCaseValue = getqLowerCase(); - if (qLowerCaseValue != null) { - valMap.put("qLowerCase", qLowerCaseValue); - } - Object stpValue = getStp(); - if (stpValue != null) { - valMap.put("stp", stpValue); - } - Object rLowerCaseValue = getrLowerCase(); - if (rLowerCaseValue != null) { - valMap.put("rLowerCase", rLowerCaseValue); - } - Object poValue = getPo(); - if (poValue != null) { - valMap.put("po", poValue); - } - Object SValue = getS(); - if (SValue != null) { - valMap.put("S", SValue); - } - Object eLowerCaseValue = geteLowerCase(); - if (eLowerCaseValue != null) { - valMap.put("eLowerCase", eLowerCaseValue); - } - Object ecValue = getEc(); - if (ecValue != null) { - valMap.put("ec", ecValue); - } - Object fLowerCaseValue = getfLowerCase(); - if (fLowerCaseValue != null) { - valMap.put("fLowerCase", fLowerCaseValue); - } - Object tifValue = getTif(); - if (tifValue != null) { - valMap.put("tif", tifValue); - } - Object otyValue = getOty(); - if (otyValue != null) { - valMap.put("oty", otyValue); - } - Object fiValue = getFi(); - if (fiValue != null) { - valMap.put("fi", fiValue); - } - - valMap.put("timestamp", getTimestamp()); - return valMap; - } - - public static String asciiEncode(String s) { - return new String(s.getBytes(), StandardCharsets.US_ASCII); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("T"); - openapiFields.add("t"); - openapiFields.add("s"); - openapiFields.add("c"); - openapiFields.add("oid"); - openapiFields.add("p"); - openapiFields.add("q"); - openapiFields.add("stp"); - openapiFields.add("r"); - openapiFields.add("po"); - openapiFields.add("S"); - openapiFields.add("e"); - openapiFields.add("ec"); - openapiFields.add("f"); - openapiFields.add("tif"); - openapiFields.add("oty"); - openapiFields.add("fi"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to OrderTradeUpdateOInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OrderTradeUpdateOInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in OrderTradeUpdateOInner is not found in" - + " the empty JSON string", - OrderTradeUpdateOInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderTradeUpdateOInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderTradeUpdateOInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) - && !jsonObj.get("s").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `s` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("s").toString())); - } - if ((jsonObj.get("c") != null && !jsonObj.get("c").isJsonNull()) - && !jsonObj.get("c").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `c` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("c").toString())); - } - if ((jsonObj.get("oid") != null && !jsonObj.get("oid").isJsonNull()) - && !jsonObj.get("oid").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `oid` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("oid").toString())); - } - if ((jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) - && !jsonObj.get("p").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `p` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("p").toString())); - } - if ((jsonObj.get("q") != null && !jsonObj.get("q").isJsonNull()) - && !jsonObj.get("q").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `q` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("q").toString())); - } - if ((jsonObj.get("S") != null && !jsonObj.get("S").isJsonNull()) - && !jsonObj.get("S").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `S` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("S").toString())); - } - if ((jsonObj.get("e") != null && !jsonObj.get("e").isJsonNull()) - && !jsonObj.get("e").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `e` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("e").toString())); - } - if ((jsonObj.get("ec") != null && !jsonObj.get("ec").isJsonNull()) - && !jsonObj.get("ec").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `ec` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("ec").toString())); - } - if ((jsonObj.get("f") != null && !jsonObj.get("f").isJsonNull()) - && !jsonObj.get("f").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `f` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("f").toString())); - } - if ((jsonObj.get("tif") != null && !jsonObj.get("tif").isJsonNull()) - && !jsonObj.get("tif").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `tif` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("tif").toString())); - } - if ((jsonObj.get("oty") != null && !jsonObj.get("oty").isJsonNull()) - && !jsonObj.get("oty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `oty` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("oty").toString())); - } - if (jsonObj.get("fi") != null && !jsonObj.get("fi").isJsonNull()) { - JsonArray jsonArrayfi = jsonObj.getAsJsonArray("fi"); - if (jsonArrayfi != null) { - // ensure the json data is an array - if (!jsonObj.get("fi").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `fi` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("fi").toString())); - } - - // validate the optional field `fi` (array) - for (int i = 0; i < jsonArrayfi.size(); i++) { - OrderTradeUpdateOInnerFiInner.validateJsonElement(jsonArrayfi.get(i)); - } - ; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OrderTradeUpdateOInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OrderTradeUpdateOInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(OrderTradeUpdateOInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, OrderTradeUpdateOInner value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public OrderTradeUpdateOInner read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of OrderTradeUpdateOInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of OrderTradeUpdateOInner - * @throws IOException if the JSON string is invalid with respect to OrderTradeUpdateOInner - */ - public static OrderTradeUpdateOInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OrderTradeUpdateOInner.class); - } - - /** - * Convert an instance of OrderTradeUpdateOInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdateOInnerFiInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdateOInnerFiInner.java deleted file mode 100644 index d2b676ea7..000000000 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/OrderTradeUpdateOInnerFiInner.java +++ /dev/null @@ -1,468 +0,0 @@ -/* - * Binance Derivatives Trading Options WebSocket Market Streams - * OpenAPI Specification for the Binance Derivatives Trading Options WebSocket Market Streams - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_options.websocket.stream.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** OrderTradeUpdateOInnerFiInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class OrderTradeUpdateOInnerFiInner extends BaseDTO { - public static final String SERIALIZED_NAME_T_LOWER_CASE = "t"; - - @SerializedName(SERIALIZED_NAME_T_LOWER_CASE) - @jakarta.annotation.Nullable - private String tLowerCase; - - public static final String SERIALIZED_NAME_P_LOWER_CASE = "p"; - - @SerializedName(SERIALIZED_NAME_P_LOWER_CASE) - @jakarta.annotation.Nullable - private String pLowerCase; - - public static final String SERIALIZED_NAME_Q_LOWER_CASE = "q"; - - @SerializedName(SERIALIZED_NAME_Q_LOWER_CASE) - @jakarta.annotation.Nullable - private String qLowerCase; - - public static final String SERIALIZED_NAME_T = "T"; - - @SerializedName(SERIALIZED_NAME_T) - @jakarta.annotation.Nullable - private Long T; - - public static final String SERIALIZED_NAME_M_LOWER_CASE = "m"; - - @SerializedName(SERIALIZED_NAME_M_LOWER_CASE) - @jakarta.annotation.Nullable - private String mLowerCase; - - public static final String SERIALIZED_NAME_F_LOWER_CASE = "f"; - - @SerializedName(SERIALIZED_NAME_F_LOWER_CASE) - @jakarta.annotation.Nullable - private String fLowerCase; - - public OrderTradeUpdateOInnerFiInner() {} - - public OrderTradeUpdateOInnerFiInner tLowerCase( - @jakarta.annotation.Nullable String tLowerCase) { - this.tLowerCase = tLowerCase; - return this; - } - - /** - * Get tLowerCase - * - * @return tLowerCase - */ - @jakarta.annotation.Nullable - public String gettLowerCase() { - return tLowerCase; - } - - public void settLowerCase(@jakarta.annotation.Nullable String tLowerCase) { - this.tLowerCase = tLowerCase; - } - - public OrderTradeUpdateOInnerFiInner pLowerCase( - @jakarta.annotation.Nullable String pLowerCase) { - this.pLowerCase = pLowerCase; - return this; - } - - /** - * Get pLowerCase - * - * @return pLowerCase - */ - @jakarta.annotation.Nullable - public String getpLowerCase() { - return pLowerCase; - } - - public void setpLowerCase(@jakarta.annotation.Nullable String pLowerCase) { - this.pLowerCase = pLowerCase; - } - - public OrderTradeUpdateOInnerFiInner qLowerCase( - @jakarta.annotation.Nullable String qLowerCase) { - this.qLowerCase = qLowerCase; - return this; - } - - /** - * Get qLowerCase - * - * @return qLowerCase - */ - @jakarta.annotation.Nullable - public String getqLowerCase() { - return qLowerCase; - } - - public void setqLowerCase(@jakarta.annotation.Nullable String qLowerCase) { - this.qLowerCase = qLowerCase; - } - - public OrderTradeUpdateOInnerFiInner T(@jakarta.annotation.Nullable Long T) { - this.T = T; - return this; - } - - /** - * Get T - * - * @return T - */ - @jakarta.annotation.Nullable - public Long getT() { - return T; - } - - public void setT(@jakarta.annotation.Nullable Long T) { - this.T = T; - } - - public OrderTradeUpdateOInnerFiInner mLowerCase( - @jakarta.annotation.Nullable String mLowerCase) { - this.mLowerCase = mLowerCase; - return this; - } - - /** - * Get mLowerCase - * - * @return mLowerCase - */ - @jakarta.annotation.Nullable - public String getmLowerCase() { - return mLowerCase; - } - - public void setmLowerCase(@jakarta.annotation.Nullable String mLowerCase) { - this.mLowerCase = mLowerCase; - } - - public OrderTradeUpdateOInnerFiInner fLowerCase( - @jakarta.annotation.Nullable String fLowerCase) { - this.fLowerCase = fLowerCase; - return this; - } - - /** - * Get fLowerCase - * - * @return fLowerCase - */ - @jakarta.annotation.Nullable - public String getfLowerCase() { - return fLowerCase; - } - - public void setfLowerCase(@jakarta.annotation.Nullable String fLowerCase) { - this.fLowerCase = fLowerCase; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OrderTradeUpdateOInnerFiInner orderTradeUpdateOInnerFiInner = - (OrderTradeUpdateOInnerFiInner) o; - return Objects.equals(this.tLowerCase, orderTradeUpdateOInnerFiInner.tLowerCase) - && Objects.equals(this.pLowerCase, orderTradeUpdateOInnerFiInner.pLowerCase) - && Objects.equals(this.qLowerCase, orderTradeUpdateOInnerFiInner.qLowerCase) - && Objects.equals(this.T, orderTradeUpdateOInnerFiInner.T) - && Objects.equals(this.mLowerCase, orderTradeUpdateOInnerFiInner.mLowerCase) - && Objects.equals(this.fLowerCase, orderTradeUpdateOInnerFiInner.fLowerCase); - } - - @Override - public int hashCode() { - return Objects.hash(tLowerCase, pLowerCase, qLowerCase, T, mLowerCase, fLowerCase); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OrderTradeUpdateOInnerFiInner {\n"); - sb.append(" tLowerCase: ").append(toIndentedString(tLowerCase)).append("\n"); - sb.append(" pLowerCase: ").append(toIndentedString(pLowerCase)).append("\n"); - sb.append(" qLowerCase: ").append(toIndentedString(qLowerCase)).append("\n"); - sb.append(" T: ").append(toIndentedString(T)).append("\n"); - sb.append(" mLowerCase: ").append(toIndentedString(mLowerCase)).append("\n"); - sb.append(" fLowerCase: ").append(toIndentedString(fLowerCase)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String tLowerCaseValue = gettLowerCase(); - if (tLowerCaseValue != null) { - String tLowerCaseValueAsString = tLowerCaseValue.toString(); - valMap.put("tLowerCase", tLowerCaseValueAsString); - } - String pLowerCaseValue = getpLowerCase(); - if (pLowerCaseValue != null) { - String pLowerCaseValueAsString = pLowerCaseValue.toString(); - valMap.put("pLowerCase", pLowerCaseValueAsString); - } - String qLowerCaseValue = getqLowerCase(); - if (qLowerCaseValue != null) { - String qLowerCaseValueAsString = qLowerCaseValue.toString(); - valMap.put("qLowerCase", qLowerCaseValueAsString); - } - Long TValue = getT(); - if (TValue != null) { - String TValueAsString = TValue.toString(); - valMap.put("T", TValueAsString); - } - String mLowerCaseValue = getmLowerCase(); - if (mLowerCaseValue != null) { - String mLowerCaseValueAsString = mLowerCaseValue.toString(); - valMap.put("mLowerCase", mLowerCaseValueAsString); - } - String fLowerCaseValue = getfLowerCase(); - if (fLowerCaseValue != null) { - String fLowerCaseValueAsString = fLowerCaseValue.toString(); - valMap.put("fLowerCase", fLowerCaseValueAsString); - } - - valMap.put("timestamp", getTimestamp()); - return asciiEncode( - valMap.keySet().stream() - .map(key -> key + "=" + valMap.get(key)) - .collect(Collectors.joining("&"))); - } - - public Map toMap() { - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Object tLowerCaseValue = gettLowerCase(); - if (tLowerCaseValue != null) { - valMap.put("tLowerCase", tLowerCaseValue); - } - Object pLowerCaseValue = getpLowerCase(); - if (pLowerCaseValue != null) { - valMap.put("pLowerCase", pLowerCaseValue); - } - Object qLowerCaseValue = getqLowerCase(); - if (qLowerCaseValue != null) { - valMap.put("qLowerCase", qLowerCaseValue); - } - Object TValue = getT(); - if (TValue != null) { - valMap.put("T", TValue); - } - Object mLowerCaseValue = getmLowerCase(); - if (mLowerCaseValue != null) { - valMap.put("mLowerCase", mLowerCaseValue); - } - Object fLowerCaseValue = getfLowerCase(); - if (fLowerCaseValue != null) { - valMap.put("fLowerCase", fLowerCaseValue); - } - - valMap.put("timestamp", getTimestamp()); - return valMap; - } - - public static String asciiEncode(String s) { - return new String(s.getBytes(), StandardCharsets.US_ASCII); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("t"); - openapiFields.add("p"); - openapiFields.add("q"); - openapiFields.add("T"); - openapiFields.add("m"); - openapiFields.add("f"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * OrderTradeUpdateOInnerFiInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!OrderTradeUpdateOInnerFiInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in OrderTradeUpdateOInnerFiInner is not" - + " found in the empty JSON string", - OrderTradeUpdateOInnerFiInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!OrderTradeUpdateOInnerFiInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `OrderTradeUpdateOInnerFiInner` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("t") != null && !jsonObj.get("t").isJsonNull()) - && !jsonObj.get("t").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `t` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("t").toString())); - } - if ((jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) - && !jsonObj.get("p").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `p` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("p").toString())); - } - if ((jsonObj.get("q") != null && !jsonObj.get("q").isJsonNull()) - && !jsonObj.get("q").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `q` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("q").toString())); - } - if ((jsonObj.get("m") != null && !jsonObj.get("m").isJsonNull()) - && !jsonObj.get("m").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `m` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("m").toString())); - } - if ((jsonObj.get("f") != null && !jsonObj.get("f").isJsonNull()) - && !jsonObj.get("f").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `f` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("f").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OrderTradeUpdateOInnerFiInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OrderTradeUpdateOInnerFiInner' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(OrderTradeUpdateOInnerFiInner.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, OrderTradeUpdateOInnerFiInner value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public OrderTradeUpdateOInnerFiInner read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of OrderTradeUpdateOInnerFiInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of OrderTradeUpdateOInnerFiInner - * @throws IOException if the JSON string is invalid with respect to - * OrderTradeUpdateOInnerFiInner - */ - public static OrderTradeUpdateOInnerFiInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OrderTradeUpdateOInnerFiInner.class); - } - - /** - * Convert an instance of OrderTradeUpdateOInnerFiInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/PartialBookDepthStreamsRequest.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/PartialBookDepthStreamsRequest.java index 5cb8cf522..9c204757c 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/PartialBookDepthStreamsRequest.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/PartialBookDepthStreamsRequest.java @@ -43,7 +43,7 @@ public class PartialBookDepthStreamsRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_ID) @jakarta.annotation.Nullable - private String id; + private Integer id; public static final String SERIALIZED_NAME_SYMBOL = "symbol"; @@ -51,11 +51,11 @@ public class PartialBookDepthStreamsRequest extends BaseDTO { @jakarta.annotation.Nonnull private String symbol; - public static final String SERIALIZED_NAME_LEVELS = "levels"; + public static final String SERIALIZED_NAME_LEVEL = "level"; - @SerializedName(SERIALIZED_NAME_LEVELS) + @SerializedName(SERIALIZED_NAME_LEVEL) @jakarta.annotation.Nonnull - private Long levels; + private String level; public static final String SERIALIZED_NAME_UPDATE_SPEED = "updateSpeed"; @@ -65,7 +65,7 @@ public class PartialBookDepthStreamsRequest extends BaseDTO { public PartialBookDepthStreamsRequest() {} - public PartialBookDepthStreamsRequest id(@jakarta.annotation.Nullable String id) { + public PartialBookDepthStreamsRequest id(@jakarta.annotation.Nullable Integer id) { this.id = id; return this; } @@ -76,11 +76,11 @@ public PartialBookDepthStreamsRequest id(@jakarta.annotation.Nullable String id) * @return id */ @jakarta.annotation.Nullable - public String getId() { + public Integer getId() { return id; } - public void setId(@jakarta.annotation.Nullable String id) { + public void setId(@jakarta.annotation.Nullable Integer id) { this.id = id; } @@ -104,24 +104,24 @@ public void setSymbol(@jakarta.annotation.Nonnull String symbol) { this.symbol = symbol; } - public PartialBookDepthStreamsRequest levels(@jakarta.annotation.Nonnull Long levels) { - this.levels = levels; + public PartialBookDepthStreamsRequest level(@jakarta.annotation.Nonnull String level) { + this.level = level; return this; } /** - * Get levels + * Get level * - * @return levels + * @return level */ @jakarta.annotation.Nonnull @NotNull - public Long getLevels() { - return levels; + public String getLevel() { + return level; } - public void setLevels(@jakarta.annotation.Nonnull Long levels) { - this.levels = levels; + public void setLevel(@jakarta.annotation.Nonnull String level) { + this.level = level; } public PartialBookDepthStreamsRequest updateSpeed( @@ -156,13 +156,13 @@ public boolean equals(Object o) { (PartialBookDepthStreamsRequest) o; return Objects.equals(this.id, partialBookDepthStreamsRequest.id) && Objects.equals(this.symbol, partialBookDepthStreamsRequest.symbol) - && Objects.equals(this.levels, partialBookDepthStreamsRequest.levels) + && Objects.equals(this.level, partialBookDepthStreamsRequest.level) && Objects.equals(this.updateSpeed, partialBookDepthStreamsRequest.updateSpeed); } @Override public int hashCode() { - return Objects.hash(id, symbol, levels, updateSpeed); + return Objects.hash(id, symbol, level, updateSpeed); } @Override @@ -171,7 +171,7 @@ public String toString() { sb.append("class PartialBookDepthStreamsRequest {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); - sb.append(" levels: ").append(toIndentedString(levels)).append("\n"); + sb.append(" level: ").append(toIndentedString(level)).append("\n"); sb.append(" updateSpeed: ").append(toIndentedString(updateSpeed)).append("\n"); sb.append("}"); return sb.toString(); @@ -181,7 +181,7 @@ public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - String idValue = getId(); + Integer idValue = getId(); if (idValue != null) { String idValueAsString = idValue.toString(); valMap.put("id", idValueAsString); @@ -191,10 +191,10 @@ public String toUrlQueryString() { String symbolValueAsString = symbolValue.toString(); valMap.put("symbol", symbolValueAsString); } - Long levelsValue = getLevels(); - if (levelsValue != null) { - String levelsValueAsString = levelsValue.toString(); - valMap.put("levels", levelsValueAsString); + String levelValue = getLevel(); + if (levelValue != null) { + String levelValueAsString = levelValue.toString(); + valMap.put("level", levelValueAsString); } String updateSpeedValue = getUpdateSpeed(); if (updateSpeedValue != null) { @@ -220,9 +220,9 @@ public Map toMap() { if (symbolValue != null) { valMap.put("symbol", symbolValue); } - Object levelsValue = getLevels(); - if (levelsValue != null) { - valMap.put("levels", levelsValue); + Object levelValue = getLevel(); + if (levelValue != null) { + valMap.put("level", levelValue); } Object updateSpeedValue = getUpdateSpeed(); if (updateSpeedValue != null) { @@ -256,13 +256,13 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("id"); openapiFields.add("symbol"); - openapiFields.add("levels"); + openapiFields.add("level"); openapiFields.add("updateSpeed"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("symbol"); - openapiRequiredFields.add("levels"); + openapiRequiredFields.add("level"); } /** @@ -306,14 +306,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } if (!jsonObj.get("symbol").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -321,6 +313,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("symbol").toString())); } + if (!jsonObj.get("level").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `level` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("level").toString())); + } if ((jsonObj.get("updateSpeed") != null && !jsonObj.get("updateSpeed").isJsonNull()) && !jsonObj.get("updateSpeed").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/PartialBookDepthStreamsResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/PartialBookDepthStreamsResponse.java index 760cfaffe..65874a06d 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/PartialBookDepthStreamsResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/PartialBookDepthStreamsResponse.java @@ -66,6 +66,12 @@ public class PartialBookDepthStreamsResponse extends BaseDTO { @jakarta.annotation.Nullable private String sLowerCase; + public static final String SERIALIZED_NAME_U = "U"; + + @SerializedName(SERIALIZED_NAME_U) + @jakarta.annotation.Nullable + private Long U; + public static final String SERIALIZED_NAME_U_LOWER_CASE = "u"; @SerializedName(SERIALIZED_NAME_U_LOWER_CASE) @@ -170,6 +176,25 @@ public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { this.sLowerCase = sLowerCase; } + public PartialBookDepthStreamsResponse U(@jakarta.annotation.Nullable Long U) { + this.U = U; + return this; + } + + /** + * Get U + * + * @return U + */ + @jakarta.annotation.Nullable + public Long getU() { + return U; + } + + public void setU(@jakarta.annotation.Nullable Long U) { + this.U = U; + } + public PartialBookDepthStreamsResponse uLowerCase( @jakarta.annotation.Nullable Long uLowerCase) { this.uLowerCase = uLowerCase; @@ -285,6 +310,7 @@ public boolean equals(Object o) { && Objects.equals(this.E, partialBookDepthStreamsResponse.E) && Objects.equals(this.T, partialBookDepthStreamsResponse.T) && Objects.equals(this.sLowerCase, partialBookDepthStreamsResponse.sLowerCase) + && Objects.equals(this.U, partialBookDepthStreamsResponse.U) && Objects.equals(this.uLowerCase, partialBookDepthStreamsResponse.uLowerCase) && Objects.equals(this.pu, partialBookDepthStreamsResponse.pu) && Objects.equals(this.bLowerCase, partialBookDepthStreamsResponse.bLowerCase) @@ -293,7 +319,8 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(eLowerCase, E, T, sLowerCase, uLowerCase, pu, bLowerCase, aLowerCase); + return Objects.hash( + eLowerCase, E, T, sLowerCase, U, uLowerCase, pu, bLowerCase, aLowerCase); } @Override @@ -304,6 +331,7 @@ public String toString() { sb.append(" E: ").append(toIndentedString(E)).append("\n"); sb.append(" T: ").append(toIndentedString(T)).append("\n"); sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" U: ").append(toIndentedString(U)).append("\n"); sb.append(" uLowerCase: ").append(toIndentedString(uLowerCase)).append("\n"); sb.append(" pu: ").append(toIndentedString(pu)).append("\n"); sb.append(" bLowerCase: ").append(toIndentedString(bLowerCase)).append("\n"); @@ -336,6 +364,11 @@ public String toUrlQueryString() { String sLowerCaseValueAsString = sLowerCaseValue.toString(); valMap.put("sLowerCase", sLowerCaseValueAsString); } + Long UValue = getU(); + if (UValue != null) { + String UValueAsString = UValue.toString(); + valMap.put("U", UValueAsString); + } Long uLowerCaseValue = getuLowerCase(); if (uLowerCaseValue != null) { String uLowerCaseValueAsString = uLowerCaseValue.toString(); @@ -383,6 +416,10 @@ public Map toMap() { if (sLowerCaseValue != null) { valMap.put("sLowerCase", sLowerCaseValue); } + Object UValue = getU(); + if (UValue != null) { + valMap.put("U", UValue); + } Object uLowerCaseValue = getuLowerCase(); if (uLowerCaseValue != null) { valMap.put("uLowerCase", uLowerCaseValue); @@ -429,6 +466,7 @@ private String toIndentedString(Object o) { openapiFields.add("E"); openapiFields.add("T"); openapiFields.add("s"); + openapiFields.add("U"); openapiFields.add("u"); openapiFields.add("pu"); openapiFields.add("b"); diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Ticker24HourByUnderlyingAssetAndExpirationDataRequest.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Ticker24HourByUnderlyingAssetAndExpirationDataRequest.java deleted file mode 100644 index 020c3d476..000000000 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Ticker24HourByUnderlyingAssetAndExpirationDataRequest.java +++ /dev/null @@ -1,372 +0,0 @@ -/* - * Binance Derivatives Trading Options WebSocket Market Streams - * OpenAPI Specification for the Binance Derivatives Trading Options WebSocket Market Streams - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_options.websocket.stream.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** Ticker24HourByUnderlyingAssetAndExpirationDataRequest */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class Ticker24HourByUnderlyingAssetAndExpirationDataRequest extends BaseDTO { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - @jakarta.annotation.Nullable - private String id; - - public static final String SERIALIZED_NAME_UNDERLYING_ASSET = "underlyingAsset"; - - @SerializedName(SERIALIZED_NAME_UNDERLYING_ASSET) - @jakarta.annotation.Nonnull - private String underlyingAsset; - - public static final String SERIALIZED_NAME_EXPIRATION_DATE = "expirationDate"; - - @SerializedName(SERIALIZED_NAME_EXPIRATION_DATE) - @jakarta.annotation.Nonnull - private String expirationDate; - - public Ticker24HourByUnderlyingAssetAndExpirationDataRequest() {} - - public Ticker24HourByUnderlyingAssetAndExpirationDataRequest id( - @jakarta.annotation.Nullable String id) { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id - */ - @jakarta.annotation.Nullable - public String getId() { - return id; - } - - public void setId(@jakarta.annotation.Nullable String id) { - this.id = id; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataRequest underlyingAsset( - @jakarta.annotation.Nonnull String underlyingAsset) { - this.underlyingAsset = underlyingAsset; - return this; - } - - /** - * Get underlyingAsset - * - * @return underlyingAsset - */ - @jakarta.annotation.Nonnull - @NotNull - public String getUnderlyingAsset() { - return underlyingAsset; - } - - public void setUnderlyingAsset(@jakarta.annotation.Nonnull String underlyingAsset) { - this.underlyingAsset = underlyingAsset; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataRequest expirationDate( - @jakarta.annotation.Nonnull String expirationDate) { - this.expirationDate = expirationDate; - return this; - } - - /** - * Get expirationDate - * - * @return expirationDate - */ - @jakarta.annotation.Nonnull - @NotNull - public String getExpirationDate() { - return expirationDate; - } - - public void setExpirationDate(@jakarta.annotation.Nonnull String expirationDate) { - this.expirationDate = expirationDate; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Ticker24HourByUnderlyingAssetAndExpirationDataRequest - ticker24HourByUnderlyingAssetAndExpirationDataRequest = - (Ticker24HourByUnderlyingAssetAndExpirationDataRequest) o; - return Objects.equals(this.id, ticker24HourByUnderlyingAssetAndExpirationDataRequest.id) - && Objects.equals( - this.underlyingAsset, - ticker24HourByUnderlyingAssetAndExpirationDataRequest.underlyingAsset) - && Objects.equals( - this.expirationDate, - ticker24HourByUnderlyingAssetAndExpirationDataRequest.expirationDate); - } - - @Override - public int hashCode() { - return Objects.hash(id, underlyingAsset, expirationDate); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Ticker24HourByUnderlyingAssetAndExpirationDataRequest {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" underlyingAsset: ").append(toIndentedString(underlyingAsset)).append("\n"); - sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String idValue = getId(); - if (idValue != null) { - String idValueAsString = idValue.toString(); - valMap.put("id", idValueAsString); - } - String underlyingAssetValue = getUnderlyingAsset(); - if (underlyingAssetValue != null) { - String underlyingAssetValueAsString = underlyingAssetValue.toString(); - valMap.put("underlyingAsset", underlyingAssetValueAsString); - } - String expirationDateValue = getExpirationDate(); - if (expirationDateValue != null) { - String expirationDateValueAsString = expirationDateValue.toString(); - valMap.put("expirationDate", expirationDateValueAsString); - } - - valMap.put("timestamp", getTimestamp()); - return asciiEncode( - valMap.keySet().stream() - .map(key -> key + "=" + valMap.get(key)) - .collect(Collectors.joining("&"))); - } - - public Map toMap() { - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Object idValue = getId(); - if (idValue != null) { - valMap.put("id", idValue); - } - Object underlyingAssetValue = getUnderlyingAsset(); - if (underlyingAssetValue != null) { - valMap.put("underlyingAsset", underlyingAssetValue); - } - Object expirationDateValue = getExpirationDate(); - if (expirationDateValue != null) { - valMap.put("expirationDate", expirationDateValue); - } - - valMap.put("timestamp", getTimestamp()); - return valMap; - } - - public static String asciiEncode(String s) { - return new String(s.getBytes(), StandardCharsets.US_ASCII); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("underlyingAsset"); - openapiFields.add("expirationDate"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("underlyingAsset"); - openapiRequiredFields.add("expirationDate"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * Ticker24HourByUnderlyingAssetAndExpirationDataRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Ticker24HourByUnderlyingAssetAndExpirationDataRequest.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " Ticker24HourByUnderlyingAssetAndExpirationDataRequest is" - + " not found in the empty JSON string", - Ticker24HourByUnderlyingAssetAndExpirationDataRequest - .openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Ticker24HourByUnderlyingAssetAndExpirationDataRequest.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Ticker24HourByUnderlyingAssetAndExpirationDataRequest`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : - Ticker24HourByUnderlyingAssetAndExpirationDataRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("underlyingAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `underlyingAsset` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("underlyingAsset").toString())); - } - if (!jsonObj.get("expirationDate").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `expirationDate` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("expirationDate").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Ticker24HourByUnderlyingAssetAndExpirationDataRequest.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'Ticker24HourByUnderlyingAssetAndExpirationDataRequest' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get( - Ticker24HourByUnderlyingAssetAndExpirationDataRequest.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, - Ticker24HourByUnderlyingAssetAndExpirationDataRequest value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Ticker24HourByUnderlyingAssetAndExpirationDataRequest read( - JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Ticker24HourByUnderlyingAssetAndExpirationDataRequest given an JSON - * string - * - * @param jsonString JSON string - * @return An instance of Ticker24HourByUnderlyingAssetAndExpirationDataRequest - * @throws IOException if the JSON string is invalid with respect to - * Ticker24HourByUnderlyingAssetAndExpirationDataRequest - */ - public static Ticker24HourByUnderlyingAssetAndExpirationDataRequest fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, Ticker24HourByUnderlyingAssetAndExpirationDataRequest.class); - } - - /** - * Convert an instance of Ticker24HourByUnderlyingAssetAndExpirationDataRequest to an JSON - * string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.java deleted file mode 100644 index 9016c0828..000000000 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.java +++ /dev/null @@ -1,1699 +0,0 @@ -/* - * Binance Derivatives Trading Options WebSocket Market Streams - * OpenAPI Specification for the Binance Derivatives Trading Options WebSocket Market Streams - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_options.websocket.stream.model; - -import com.binance.connector.client.common.websocket.dtos.BaseDTO; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.stream.Collectors; -import org.hibernate.validator.constraints.*; - -/** Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner extends BaseDTO { - public static final String SERIALIZED_NAME_E_LOWER_CASE = "e"; - - @SerializedName(SERIALIZED_NAME_E_LOWER_CASE) - @jakarta.annotation.Nullable - private String eLowerCase; - - public static final String SERIALIZED_NAME_E = "E"; - - @SerializedName(SERIALIZED_NAME_E) - @jakarta.annotation.Nullable - private Long E; - - public static final String SERIALIZED_NAME_T = "T"; - - @SerializedName(SERIALIZED_NAME_T) - @jakarta.annotation.Nullable - private Long T; - - public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; - - @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) - @jakarta.annotation.Nullable - private String sLowerCase; - - public static final String SERIALIZED_NAME_O_LOWER_CASE = "o"; - - @SerializedName(SERIALIZED_NAME_O_LOWER_CASE) - @jakarta.annotation.Nullable - private String oLowerCase; - - public static final String SERIALIZED_NAME_H_LOWER_CASE = "h"; - - @SerializedName(SERIALIZED_NAME_H_LOWER_CASE) - @jakarta.annotation.Nullable - private String hLowerCase; - - public static final String SERIALIZED_NAME_L_LOWER_CASE = "l"; - - @SerializedName(SERIALIZED_NAME_L_LOWER_CASE) - @jakarta.annotation.Nullable - private String lLowerCase; - - public static final String SERIALIZED_NAME_C_LOWER_CASE = "c"; - - @SerializedName(SERIALIZED_NAME_C_LOWER_CASE) - @jakarta.annotation.Nullable - private String cLowerCase; - - public static final String SERIALIZED_NAME_V = "V"; - - @SerializedName(SERIALIZED_NAME_V) - @jakarta.annotation.Nullable - private String V; - - public static final String SERIALIZED_NAME_A = "A"; - - @SerializedName(SERIALIZED_NAME_A) - @jakarta.annotation.Nullable - private String A; - - public static final String SERIALIZED_NAME_P = "P"; - - @SerializedName(SERIALIZED_NAME_P) - @jakarta.annotation.Nullable - private String P; - - public static final String SERIALIZED_NAME_P_LOWER_CASE = "p"; - - @SerializedName(SERIALIZED_NAME_P_LOWER_CASE) - @jakarta.annotation.Nullable - private String pLowerCase; - - public static final String SERIALIZED_NAME_Q = "Q"; - - @SerializedName(SERIALIZED_NAME_Q) - @jakarta.annotation.Nullable - private String Q; - - public static final String SERIALIZED_NAME_F = "F"; - - @SerializedName(SERIALIZED_NAME_F) - @jakarta.annotation.Nullable - private String F; - - public static final String SERIALIZED_NAME_L = "L"; - - @SerializedName(SERIALIZED_NAME_L) - @jakarta.annotation.Nullable - private String L; - - public static final String SERIALIZED_NAME_N_LOWER_CASE = "n"; - - @SerializedName(SERIALIZED_NAME_N_LOWER_CASE) - @jakarta.annotation.Nullable - private Long nLowerCase; - - public static final String SERIALIZED_NAME_BO = "bo"; - - @SerializedName(SERIALIZED_NAME_BO) - @jakarta.annotation.Nullable - private String bo; - - public static final String SERIALIZED_NAME_AO = "ao"; - - @SerializedName(SERIALIZED_NAME_AO) - @jakarta.annotation.Nullable - private String ao; - - public static final String SERIALIZED_NAME_BQ = "bq"; - - @SerializedName(SERIALIZED_NAME_BQ) - @jakarta.annotation.Nullable - private String bq; - - public static final String SERIALIZED_NAME_AQ = "aq"; - - @SerializedName(SERIALIZED_NAME_AQ) - @jakarta.annotation.Nullable - private String aq; - - public static final String SERIALIZED_NAME_B_LOWER_CASE = "b"; - - @SerializedName(SERIALIZED_NAME_B_LOWER_CASE) - @jakarta.annotation.Nullable - private String bLowerCase; - - public static final String SERIALIZED_NAME_A_LOWER_CASE = "a"; - - @SerializedName(SERIALIZED_NAME_A_LOWER_CASE) - @jakarta.annotation.Nullable - private String aLowerCase; - - public static final String SERIALIZED_NAME_D_LOWER_CASE = "d"; - - @SerializedName(SERIALIZED_NAME_D_LOWER_CASE) - @jakarta.annotation.Nullable - private String dLowerCase; - - public static final String SERIALIZED_NAME_T_LOWER_CASE = "t"; - - @SerializedName(SERIALIZED_NAME_T_LOWER_CASE) - @jakarta.annotation.Nullable - private String tLowerCase; - - public static final String SERIALIZED_NAME_G_LOWER_CASE = "g"; - - @SerializedName(SERIALIZED_NAME_G_LOWER_CASE) - @jakarta.annotation.Nullable - private String gLowerCase; - - public static final String SERIALIZED_NAME_V_LOWER_CASE = "v"; - - @SerializedName(SERIALIZED_NAME_V_LOWER_CASE) - @jakarta.annotation.Nullable - private String vLowerCase; - - public static final String SERIALIZED_NAME_VO = "vo"; - - @SerializedName(SERIALIZED_NAME_VO) - @jakarta.annotation.Nullable - private String vo; - - public static final String SERIALIZED_NAME_MP = "mp"; - - @SerializedName(SERIALIZED_NAME_MP) - @jakarta.annotation.Nullable - private String mp; - - public static final String SERIALIZED_NAME_HL = "hl"; - - @SerializedName(SERIALIZED_NAME_HL) - @jakarta.annotation.Nullable - private String hl; - - public static final String SERIALIZED_NAME_LL = "ll"; - - @SerializedName(SERIALIZED_NAME_LL) - @jakarta.annotation.Nullable - private String ll; - - public static final String SERIALIZED_NAME_EEP = "eep"; - - @SerializedName(SERIALIZED_NAME_EEP) - @jakarta.annotation.Nullable - private String eep; - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner() {} - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner eLowerCase( - @jakarta.annotation.Nullable String eLowerCase) { - this.eLowerCase = eLowerCase; - return this; - } - - /** - * Get eLowerCase - * - * @return eLowerCase - */ - @jakarta.annotation.Nullable - public String geteLowerCase() { - return eLowerCase; - } - - public void seteLowerCase(@jakarta.annotation.Nullable String eLowerCase) { - this.eLowerCase = eLowerCase; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner E( - @jakarta.annotation.Nullable Long E) { - this.E = E; - return this; - } - - /** - * Get E - * - * @return E - */ - @jakarta.annotation.Nullable - public Long getE() { - return E; - } - - public void setE(@jakarta.annotation.Nullable Long E) { - this.E = E; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner T( - @jakarta.annotation.Nullable Long T) { - this.T = T; - return this; - } - - /** - * Get T - * - * @return T - */ - @jakarta.annotation.Nullable - public Long getT() { - return T; - } - - public void setT(@jakarta.annotation.Nullable Long T) { - this.T = T; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner sLowerCase( - @jakarta.annotation.Nullable String sLowerCase) { - this.sLowerCase = sLowerCase; - return this; - } - - /** - * Get sLowerCase - * - * @return sLowerCase - */ - @jakarta.annotation.Nullable - public String getsLowerCase() { - return sLowerCase; - } - - public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { - this.sLowerCase = sLowerCase; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner oLowerCase( - @jakarta.annotation.Nullable String oLowerCase) { - this.oLowerCase = oLowerCase; - return this; - } - - /** - * Get oLowerCase - * - * @return oLowerCase - */ - @jakarta.annotation.Nullable - public String getoLowerCase() { - return oLowerCase; - } - - public void setoLowerCase(@jakarta.annotation.Nullable String oLowerCase) { - this.oLowerCase = oLowerCase; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner hLowerCase( - @jakarta.annotation.Nullable String hLowerCase) { - this.hLowerCase = hLowerCase; - return this; - } - - /** - * Get hLowerCase - * - * @return hLowerCase - */ - @jakarta.annotation.Nullable - public String gethLowerCase() { - return hLowerCase; - } - - public void sethLowerCase(@jakarta.annotation.Nullable String hLowerCase) { - this.hLowerCase = hLowerCase; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner lLowerCase( - @jakarta.annotation.Nullable String lLowerCase) { - this.lLowerCase = lLowerCase; - return this; - } - - /** - * Get lLowerCase - * - * @return lLowerCase - */ - @jakarta.annotation.Nullable - public String getlLowerCase() { - return lLowerCase; - } - - public void setlLowerCase(@jakarta.annotation.Nullable String lLowerCase) { - this.lLowerCase = lLowerCase; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner cLowerCase( - @jakarta.annotation.Nullable String cLowerCase) { - this.cLowerCase = cLowerCase; - return this; - } - - /** - * Get cLowerCase - * - * @return cLowerCase - */ - @jakarta.annotation.Nullable - public String getcLowerCase() { - return cLowerCase; - } - - public void setcLowerCase(@jakarta.annotation.Nullable String cLowerCase) { - this.cLowerCase = cLowerCase; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner V( - @jakarta.annotation.Nullable String V) { - this.V = V; - return this; - } - - /** - * Get V - * - * @return V - */ - @jakarta.annotation.Nullable - public String getV() { - return V; - } - - public void setV(@jakarta.annotation.Nullable String V) { - this.V = V; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner A( - @jakarta.annotation.Nullable String A) { - this.A = A; - return this; - } - - /** - * Get A - * - * @return A - */ - @jakarta.annotation.Nullable - public String getA() { - return A; - } - - public void setA(@jakarta.annotation.Nullable String A) { - this.A = A; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner P( - @jakarta.annotation.Nullable String P) { - this.P = P; - return this; - } - - /** - * Get P - * - * @return P - */ - @jakarta.annotation.Nullable - public String getP() { - return P; - } - - public void setP(@jakarta.annotation.Nullable String P) { - this.P = P; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner pLowerCase( - @jakarta.annotation.Nullable String pLowerCase) { - this.pLowerCase = pLowerCase; - return this; - } - - /** - * Get pLowerCase - * - * @return pLowerCase - */ - @jakarta.annotation.Nullable - public String getpLowerCase() { - return pLowerCase; - } - - public void setpLowerCase(@jakarta.annotation.Nullable String pLowerCase) { - this.pLowerCase = pLowerCase; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner Q( - @jakarta.annotation.Nullable String Q) { - this.Q = Q; - return this; - } - - /** - * Get Q - * - * @return Q - */ - @jakarta.annotation.Nullable - public String getQ() { - return Q; - } - - public void setQ(@jakarta.annotation.Nullable String Q) { - this.Q = Q; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner F( - @jakarta.annotation.Nullable String F) { - this.F = F; - return this; - } - - /** - * Get F - * - * @return F - */ - @jakarta.annotation.Nullable - public String getF() { - return F; - } - - public void setF(@jakarta.annotation.Nullable String F) { - this.F = F; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner L( - @jakarta.annotation.Nullable String L) { - this.L = L; - return this; - } - - /** - * Get L - * - * @return L - */ - @jakarta.annotation.Nullable - public String getL() { - return L; - } - - public void setL(@jakarta.annotation.Nullable String L) { - this.L = L; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner nLowerCase( - @jakarta.annotation.Nullable Long nLowerCase) { - this.nLowerCase = nLowerCase; - return this; - } - - /** - * Get nLowerCase - * - * @return nLowerCase - */ - @jakarta.annotation.Nullable - public Long getnLowerCase() { - return nLowerCase; - } - - public void setnLowerCase(@jakarta.annotation.Nullable Long nLowerCase) { - this.nLowerCase = nLowerCase; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner bo( - @jakarta.annotation.Nullable String bo) { - this.bo = bo; - return this; - } - - /** - * Get bo - * - * @return bo - */ - @jakarta.annotation.Nullable - public String getBo() { - return bo; - } - - public void setBo(@jakarta.annotation.Nullable String bo) { - this.bo = bo; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner ao( - @jakarta.annotation.Nullable String ao) { - this.ao = ao; - return this; - } - - /** - * Get ao - * - * @return ao - */ - @jakarta.annotation.Nullable - public String getAo() { - return ao; - } - - public void setAo(@jakarta.annotation.Nullable String ao) { - this.ao = ao; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner bq( - @jakarta.annotation.Nullable String bq) { - this.bq = bq; - return this; - } - - /** - * Get bq - * - * @return bq - */ - @jakarta.annotation.Nullable - public String getBq() { - return bq; - } - - public void setBq(@jakarta.annotation.Nullable String bq) { - this.bq = bq; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner aq( - @jakarta.annotation.Nullable String aq) { - this.aq = aq; - return this; - } - - /** - * Get aq - * - * @return aq - */ - @jakarta.annotation.Nullable - public String getAq() { - return aq; - } - - public void setAq(@jakarta.annotation.Nullable String aq) { - this.aq = aq; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner bLowerCase( - @jakarta.annotation.Nullable String bLowerCase) { - this.bLowerCase = bLowerCase; - return this; - } - - /** - * Get bLowerCase - * - * @return bLowerCase - */ - @jakarta.annotation.Nullable - public String getbLowerCase() { - return bLowerCase; - } - - public void setbLowerCase(@jakarta.annotation.Nullable String bLowerCase) { - this.bLowerCase = bLowerCase; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner aLowerCase( - @jakarta.annotation.Nullable String aLowerCase) { - this.aLowerCase = aLowerCase; - return this; - } - - /** - * Get aLowerCase - * - * @return aLowerCase - */ - @jakarta.annotation.Nullable - public String getaLowerCase() { - return aLowerCase; - } - - public void setaLowerCase(@jakarta.annotation.Nullable String aLowerCase) { - this.aLowerCase = aLowerCase; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner dLowerCase( - @jakarta.annotation.Nullable String dLowerCase) { - this.dLowerCase = dLowerCase; - return this; - } - - /** - * Get dLowerCase - * - * @return dLowerCase - */ - @jakarta.annotation.Nullable - public String getdLowerCase() { - return dLowerCase; - } - - public void setdLowerCase(@jakarta.annotation.Nullable String dLowerCase) { - this.dLowerCase = dLowerCase; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner tLowerCase( - @jakarta.annotation.Nullable String tLowerCase) { - this.tLowerCase = tLowerCase; - return this; - } - - /** - * Get tLowerCase - * - * @return tLowerCase - */ - @jakarta.annotation.Nullable - public String gettLowerCase() { - return tLowerCase; - } - - public void settLowerCase(@jakarta.annotation.Nullable String tLowerCase) { - this.tLowerCase = tLowerCase; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner gLowerCase( - @jakarta.annotation.Nullable String gLowerCase) { - this.gLowerCase = gLowerCase; - return this; - } - - /** - * Get gLowerCase - * - * @return gLowerCase - */ - @jakarta.annotation.Nullable - public String getgLowerCase() { - return gLowerCase; - } - - public void setgLowerCase(@jakarta.annotation.Nullable String gLowerCase) { - this.gLowerCase = gLowerCase; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner vLowerCase( - @jakarta.annotation.Nullable String vLowerCase) { - this.vLowerCase = vLowerCase; - return this; - } - - /** - * Get vLowerCase - * - * @return vLowerCase - */ - @jakarta.annotation.Nullable - public String getvLowerCase() { - return vLowerCase; - } - - public void setvLowerCase(@jakarta.annotation.Nullable String vLowerCase) { - this.vLowerCase = vLowerCase; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner vo( - @jakarta.annotation.Nullable String vo) { - this.vo = vo; - return this; - } - - /** - * Get vo - * - * @return vo - */ - @jakarta.annotation.Nullable - public String getVo() { - return vo; - } - - public void setVo(@jakarta.annotation.Nullable String vo) { - this.vo = vo; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner mp( - @jakarta.annotation.Nullable String mp) { - this.mp = mp; - return this; - } - - /** - * Get mp - * - * @return mp - */ - @jakarta.annotation.Nullable - public String getMp() { - return mp; - } - - public void setMp(@jakarta.annotation.Nullable String mp) { - this.mp = mp; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner hl( - @jakarta.annotation.Nullable String hl) { - this.hl = hl; - return this; - } - - /** - * Get hl - * - * @return hl - */ - @jakarta.annotation.Nullable - public String getHl() { - return hl; - } - - public void setHl(@jakarta.annotation.Nullable String hl) { - this.hl = hl; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner ll( - @jakarta.annotation.Nullable String ll) { - this.ll = ll; - return this; - } - - /** - * Get ll - * - * @return ll - */ - @jakarta.annotation.Nullable - public String getLl() { - return ll; - } - - public void setLl(@jakarta.annotation.Nullable String ll) { - this.ll = ll; - } - - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner eep( - @jakarta.annotation.Nullable String eep) { - this.eep = eep; - return this; - } - - /** - * Get eep - * - * @return eep - */ - @jakarta.annotation.Nullable - public String getEep() { - return eep; - } - - public void setEep(@jakarta.annotation.Nullable String eep) { - this.eep = eep; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner - ticker24HourByUnderlyingAssetAndExpirationDataResponseInner = - (Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner) o; - return Objects.equals( - this.eLowerCase, - ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.eLowerCase) - && Objects.equals( - this.E, ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.E) - && Objects.equals( - this.T, ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.T) - && Objects.equals( - this.sLowerCase, - ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.sLowerCase) - && Objects.equals( - this.oLowerCase, - ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.oLowerCase) - && Objects.equals( - this.hLowerCase, - ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.hLowerCase) - && Objects.equals( - this.lLowerCase, - ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.lLowerCase) - && Objects.equals( - this.cLowerCase, - ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.cLowerCase) - && Objects.equals( - this.V, ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.V) - && Objects.equals( - this.A, ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.A) - && Objects.equals( - this.P, ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.P) - && Objects.equals( - this.pLowerCase, - ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.pLowerCase) - && Objects.equals( - this.Q, ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.Q) - && Objects.equals( - this.F, ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.F) - && Objects.equals( - this.L, ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.L) - && Objects.equals( - this.nLowerCase, - ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.nLowerCase) - && Objects.equals( - this.bo, ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.bo) - && Objects.equals( - this.ao, ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.ao) - && Objects.equals( - this.bq, ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.bq) - && Objects.equals( - this.aq, ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.aq) - && Objects.equals( - this.bLowerCase, - ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.bLowerCase) - && Objects.equals( - this.aLowerCase, - ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.aLowerCase) - && Objects.equals( - this.dLowerCase, - ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.dLowerCase) - && Objects.equals( - this.tLowerCase, - ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.tLowerCase) - && Objects.equals( - this.gLowerCase, - ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.gLowerCase) - && Objects.equals( - this.vLowerCase, - ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.vLowerCase) - && Objects.equals( - this.vo, ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.vo) - && Objects.equals( - this.mp, ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.mp) - && Objects.equals( - this.hl, ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.hl) - && Objects.equals( - this.ll, ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.ll) - && Objects.equals( - this.eep, ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.eep); - } - - @Override - public int hashCode() { - return Objects.hash( - eLowerCase, - E, - T, - sLowerCase, - oLowerCase, - hLowerCase, - lLowerCase, - cLowerCase, - V, - A, - P, - pLowerCase, - Q, - F, - L, - nLowerCase, - bo, - ao, - bq, - aq, - bLowerCase, - aLowerCase, - dLowerCase, - tLowerCase, - gLowerCase, - vLowerCase, - vo, - mp, - hl, - ll, - eep); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner {\n"); - sb.append(" eLowerCase: ").append(toIndentedString(eLowerCase)).append("\n"); - sb.append(" E: ").append(toIndentedString(E)).append("\n"); - sb.append(" T: ").append(toIndentedString(T)).append("\n"); - sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); - sb.append(" oLowerCase: ").append(toIndentedString(oLowerCase)).append("\n"); - sb.append(" hLowerCase: ").append(toIndentedString(hLowerCase)).append("\n"); - sb.append(" lLowerCase: ").append(toIndentedString(lLowerCase)).append("\n"); - sb.append(" cLowerCase: ").append(toIndentedString(cLowerCase)).append("\n"); - sb.append(" V: ").append(toIndentedString(V)).append("\n"); - sb.append(" A: ").append(toIndentedString(A)).append("\n"); - sb.append(" P: ").append(toIndentedString(P)).append("\n"); - sb.append(" pLowerCase: ").append(toIndentedString(pLowerCase)).append("\n"); - sb.append(" Q: ").append(toIndentedString(Q)).append("\n"); - sb.append(" F: ").append(toIndentedString(F)).append("\n"); - sb.append(" L: ").append(toIndentedString(L)).append("\n"); - sb.append(" nLowerCase: ").append(toIndentedString(nLowerCase)).append("\n"); - sb.append(" bo: ").append(toIndentedString(bo)).append("\n"); - sb.append(" ao: ").append(toIndentedString(ao)).append("\n"); - sb.append(" bq: ").append(toIndentedString(bq)).append("\n"); - sb.append(" aq: ").append(toIndentedString(aq)).append("\n"); - sb.append(" bLowerCase: ").append(toIndentedString(bLowerCase)).append("\n"); - sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); - sb.append(" dLowerCase: ").append(toIndentedString(dLowerCase)).append("\n"); - sb.append(" tLowerCase: ").append(toIndentedString(tLowerCase)).append("\n"); - sb.append(" gLowerCase: ").append(toIndentedString(gLowerCase)).append("\n"); - sb.append(" vLowerCase: ").append(toIndentedString(vLowerCase)).append("\n"); - sb.append(" vo: ").append(toIndentedString(vo)).append("\n"); - sb.append(" mp: ").append(toIndentedString(mp)).append("\n"); - sb.append(" hl: ").append(toIndentedString(hl)).append("\n"); - sb.append(" ll: ").append(toIndentedString(ll)).append("\n"); - sb.append(" eep: ").append(toIndentedString(eep)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - String eLowerCaseValue = geteLowerCase(); - if (eLowerCaseValue != null) { - String eLowerCaseValueAsString = eLowerCaseValue.toString(); - valMap.put("eLowerCase", eLowerCaseValueAsString); - } - Long EValue = getE(); - if (EValue != null) { - String EValueAsString = EValue.toString(); - valMap.put("E", EValueAsString); - } - Long TValue = getT(); - if (TValue != null) { - String TValueAsString = TValue.toString(); - valMap.put("T", TValueAsString); - } - String sLowerCaseValue = getsLowerCase(); - if (sLowerCaseValue != null) { - String sLowerCaseValueAsString = sLowerCaseValue.toString(); - valMap.put("sLowerCase", sLowerCaseValueAsString); - } - String oLowerCaseValue = getoLowerCase(); - if (oLowerCaseValue != null) { - String oLowerCaseValueAsString = oLowerCaseValue.toString(); - valMap.put("oLowerCase", oLowerCaseValueAsString); - } - String hLowerCaseValue = gethLowerCase(); - if (hLowerCaseValue != null) { - String hLowerCaseValueAsString = hLowerCaseValue.toString(); - valMap.put("hLowerCase", hLowerCaseValueAsString); - } - String lLowerCaseValue = getlLowerCase(); - if (lLowerCaseValue != null) { - String lLowerCaseValueAsString = lLowerCaseValue.toString(); - valMap.put("lLowerCase", lLowerCaseValueAsString); - } - String cLowerCaseValue = getcLowerCase(); - if (cLowerCaseValue != null) { - String cLowerCaseValueAsString = cLowerCaseValue.toString(); - valMap.put("cLowerCase", cLowerCaseValueAsString); - } - String VValue = getV(); - if (VValue != null) { - String VValueAsString = VValue.toString(); - valMap.put("V", VValueAsString); - } - String AValue = getA(); - if (AValue != null) { - String AValueAsString = AValue.toString(); - valMap.put("A", AValueAsString); - } - String PValue = getP(); - if (PValue != null) { - String PValueAsString = PValue.toString(); - valMap.put("P", PValueAsString); - } - String pLowerCaseValue = getpLowerCase(); - if (pLowerCaseValue != null) { - String pLowerCaseValueAsString = pLowerCaseValue.toString(); - valMap.put("pLowerCase", pLowerCaseValueAsString); - } - String QValue = getQ(); - if (QValue != null) { - String QValueAsString = QValue.toString(); - valMap.put("Q", QValueAsString); - } - String FValue = getF(); - if (FValue != null) { - String FValueAsString = FValue.toString(); - valMap.put("F", FValueAsString); - } - String LValue = getL(); - if (LValue != null) { - String LValueAsString = LValue.toString(); - valMap.put("L", LValueAsString); - } - Long nLowerCaseValue = getnLowerCase(); - if (nLowerCaseValue != null) { - String nLowerCaseValueAsString = nLowerCaseValue.toString(); - valMap.put("nLowerCase", nLowerCaseValueAsString); - } - String boValue = getBo(); - if (boValue != null) { - String boValueAsString = boValue.toString(); - valMap.put("bo", boValueAsString); - } - String aoValue = getAo(); - if (aoValue != null) { - String aoValueAsString = aoValue.toString(); - valMap.put("ao", aoValueAsString); - } - String bqValue = getBq(); - if (bqValue != null) { - String bqValueAsString = bqValue.toString(); - valMap.put("bq", bqValueAsString); - } - String aqValue = getAq(); - if (aqValue != null) { - String aqValueAsString = aqValue.toString(); - valMap.put("aq", aqValueAsString); - } - String bLowerCaseValue = getbLowerCase(); - if (bLowerCaseValue != null) { - String bLowerCaseValueAsString = bLowerCaseValue.toString(); - valMap.put("bLowerCase", bLowerCaseValueAsString); - } - String aLowerCaseValue = getaLowerCase(); - if (aLowerCaseValue != null) { - String aLowerCaseValueAsString = aLowerCaseValue.toString(); - valMap.put("aLowerCase", aLowerCaseValueAsString); - } - String dLowerCaseValue = getdLowerCase(); - if (dLowerCaseValue != null) { - String dLowerCaseValueAsString = dLowerCaseValue.toString(); - valMap.put("dLowerCase", dLowerCaseValueAsString); - } - String tLowerCaseValue = gettLowerCase(); - if (tLowerCaseValue != null) { - String tLowerCaseValueAsString = tLowerCaseValue.toString(); - valMap.put("tLowerCase", tLowerCaseValueAsString); - } - String gLowerCaseValue = getgLowerCase(); - if (gLowerCaseValue != null) { - String gLowerCaseValueAsString = gLowerCaseValue.toString(); - valMap.put("gLowerCase", gLowerCaseValueAsString); - } - String vLowerCaseValue = getvLowerCase(); - if (vLowerCaseValue != null) { - String vLowerCaseValueAsString = vLowerCaseValue.toString(); - valMap.put("vLowerCase", vLowerCaseValueAsString); - } - String voValue = getVo(); - if (voValue != null) { - String voValueAsString = voValue.toString(); - valMap.put("vo", voValueAsString); - } - String mpValue = getMp(); - if (mpValue != null) { - String mpValueAsString = mpValue.toString(); - valMap.put("mp", mpValueAsString); - } - String hlValue = getHl(); - if (hlValue != null) { - String hlValueAsString = hlValue.toString(); - valMap.put("hl", hlValueAsString); - } - String llValue = getLl(); - if (llValue != null) { - String llValueAsString = llValue.toString(); - valMap.put("ll", llValueAsString); - } - String eepValue = getEep(); - if (eepValue != null) { - String eepValueAsString = eepValue.toString(); - valMap.put("eep", eepValueAsString); - } - - valMap.put("timestamp", getTimestamp()); - return asciiEncode( - valMap.keySet().stream() - .map(key -> key + "=" + valMap.get(key)) - .collect(Collectors.joining("&"))); - } - - public Map toMap() { - Map valMap = new TreeMap(); - valMap.put("apiKey", getApiKey()); - Object eLowerCaseValue = geteLowerCase(); - if (eLowerCaseValue != null) { - valMap.put("eLowerCase", eLowerCaseValue); - } - Object EValue = getE(); - if (EValue != null) { - valMap.put("E", EValue); - } - Object TValue = getT(); - if (TValue != null) { - valMap.put("T", TValue); - } - Object sLowerCaseValue = getsLowerCase(); - if (sLowerCaseValue != null) { - valMap.put("sLowerCase", sLowerCaseValue); - } - Object oLowerCaseValue = getoLowerCase(); - if (oLowerCaseValue != null) { - valMap.put("oLowerCase", oLowerCaseValue); - } - Object hLowerCaseValue = gethLowerCase(); - if (hLowerCaseValue != null) { - valMap.put("hLowerCase", hLowerCaseValue); - } - Object lLowerCaseValue = getlLowerCase(); - if (lLowerCaseValue != null) { - valMap.put("lLowerCase", lLowerCaseValue); - } - Object cLowerCaseValue = getcLowerCase(); - if (cLowerCaseValue != null) { - valMap.put("cLowerCase", cLowerCaseValue); - } - Object VValue = getV(); - if (VValue != null) { - valMap.put("V", VValue); - } - Object AValue = getA(); - if (AValue != null) { - valMap.put("A", AValue); - } - Object PValue = getP(); - if (PValue != null) { - valMap.put("P", PValue); - } - Object pLowerCaseValue = getpLowerCase(); - if (pLowerCaseValue != null) { - valMap.put("pLowerCase", pLowerCaseValue); - } - Object QValue = getQ(); - if (QValue != null) { - valMap.put("Q", QValue); - } - Object FValue = getF(); - if (FValue != null) { - valMap.put("F", FValue); - } - Object LValue = getL(); - if (LValue != null) { - valMap.put("L", LValue); - } - Object nLowerCaseValue = getnLowerCase(); - if (nLowerCaseValue != null) { - valMap.put("nLowerCase", nLowerCaseValue); - } - Object boValue = getBo(); - if (boValue != null) { - valMap.put("bo", boValue); - } - Object aoValue = getAo(); - if (aoValue != null) { - valMap.put("ao", aoValue); - } - Object bqValue = getBq(); - if (bqValue != null) { - valMap.put("bq", bqValue); - } - Object aqValue = getAq(); - if (aqValue != null) { - valMap.put("aq", aqValue); - } - Object bLowerCaseValue = getbLowerCase(); - if (bLowerCaseValue != null) { - valMap.put("bLowerCase", bLowerCaseValue); - } - Object aLowerCaseValue = getaLowerCase(); - if (aLowerCaseValue != null) { - valMap.put("aLowerCase", aLowerCaseValue); - } - Object dLowerCaseValue = getdLowerCase(); - if (dLowerCaseValue != null) { - valMap.put("dLowerCase", dLowerCaseValue); - } - Object tLowerCaseValue = gettLowerCase(); - if (tLowerCaseValue != null) { - valMap.put("tLowerCase", tLowerCaseValue); - } - Object gLowerCaseValue = getgLowerCase(); - if (gLowerCaseValue != null) { - valMap.put("gLowerCase", gLowerCaseValue); - } - Object vLowerCaseValue = getvLowerCase(); - if (vLowerCaseValue != null) { - valMap.put("vLowerCase", vLowerCaseValue); - } - Object voValue = getVo(); - if (voValue != null) { - valMap.put("vo", voValue); - } - Object mpValue = getMp(); - if (mpValue != null) { - valMap.put("mp", mpValue); - } - Object hlValue = getHl(); - if (hlValue != null) { - valMap.put("hl", hlValue); - } - Object llValue = getLl(); - if (llValue != null) { - valMap.put("ll", llValue); - } - Object eepValue = getEep(); - if (eepValue != null) { - valMap.put("eep", eepValue); - } - - valMap.put("timestamp", getTimestamp()); - return valMap; - } - - public static String asciiEncode(String s) { - return new String(s.getBytes(), StandardCharsets.US_ASCII); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("e"); - openapiFields.add("E"); - openapiFields.add("T"); - openapiFields.add("s"); - openapiFields.add("o"); - openapiFields.add("h"); - openapiFields.add("l"); - openapiFields.add("c"); - openapiFields.add("V"); - openapiFields.add("A"); - openapiFields.add("P"); - openapiFields.add("p"); - openapiFields.add("Q"); - openapiFields.add("F"); - openapiFields.add("L"); - openapiFields.add("n"); - openapiFields.add("bo"); - openapiFields.add("ao"); - openapiFields.add("bq"); - openapiFields.add("aq"); - openapiFields.add("b"); - openapiFields.add("a"); - openapiFields.add("d"); - openapiFields.add("t"); - openapiFields.add("g"); - openapiFields.add("v"); - openapiFields.add("vo"); - openapiFields.add("mp"); - openapiFields.add("hl"); - openapiFields.add("ll"); - openapiFields.add("eep"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner" - + " is not found in the empty JSON string", - Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner - .openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("e") != null && !jsonObj.get("e").isJsonNull()) - && !jsonObj.get("e").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `e` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("e").toString())); - } - if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) - && !jsonObj.get("s").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `s` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("s").toString())); - } - if ((jsonObj.get("o") != null && !jsonObj.get("o").isJsonNull()) - && !jsonObj.get("o").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `o` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("o").toString())); - } - if ((jsonObj.get("h") != null && !jsonObj.get("h").isJsonNull()) - && !jsonObj.get("h").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `h` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("h").toString())); - } - if ((jsonObj.get("l") != null && !jsonObj.get("l").isJsonNull()) - && !jsonObj.get("l").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `l` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("l").toString())); - } - if ((jsonObj.get("c") != null && !jsonObj.get("c").isJsonNull()) - && !jsonObj.get("c").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `c` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("c").toString())); - } - if ((jsonObj.get("V") != null && !jsonObj.get("V").isJsonNull()) - && !jsonObj.get("V").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `V` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("V").toString())); - } - if ((jsonObj.get("A") != null && !jsonObj.get("A").isJsonNull()) - && !jsonObj.get("A").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `A` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("A").toString())); - } - if ((jsonObj.get("P") != null && !jsonObj.get("P").isJsonNull()) - && !jsonObj.get("P").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `P` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("P").toString())); - } - if ((jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) - && !jsonObj.get("p").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `p` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("p").toString())); - } - if ((jsonObj.get("Q") != null && !jsonObj.get("Q").isJsonNull()) - && !jsonObj.get("Q").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `Q` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("Q").toString())); - } - if ((jsonObj.get("F") != null && !jsonObj.get("F").isJsonNull()) - && !jsonObj.get("F").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `F` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("F").toString())); - } - if ((jsonObj.get("L") != null && !jsonObj.get("L").isJsonNull()) - && !jsonObj.get("L").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `L` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("L").toString())); - } - if ((jsonObj.get("bo") != null && !jsonObj.get("bo").isJsonNull()) - && !jsonObj.get("bo").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `bo` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("bo").toString())); - } - if ((jsonObj.get("ao") != null && !jsonObj.get("ao").isJsonNull()) - && !jsonObj.get("ao").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `ao` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("ao").toString())); - } - if ((jsonObj.get("bq") != null && !jsonObj.get("bq").isJsonNull()) - && !jsonObj.get("bq").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `bq` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("bq").toString())); - } - if ((jsonObj.get("aq") != null && !jsonObj.get("aq").isJsonNull()) - && !jsonObj.get("aq").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `aq` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("aq").toString())); - } - if ((jsonObj.get("b") != null && !jsonObj.get("b").isJsonNull()) - && !jsonObj.get("b").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `b` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("b").toString())); - } - if ((jsonObj.get("a") != null && !jsonObj.get("a").isJsonNull()) - && !jsonObj.get("a").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `a` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("a").toString())); - } - if ((jsonObj.get("d") != null && !jsonObj.get("d").isJsonNull()) - && !jsonObj.get("d").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `d` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("d").toString())); - } - if ((jsonObj.get("t") != null && !jsonObj.get("t").isJsonNull()) - && !jsonObj.get("t").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `t` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("t").toString())); - } - if ((jsonObj.get("g") != null && !jsonObj.get("g").isJsonNull()) - && !jsonObj.get("g").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `g` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("g").toString())); - } - if ((jsonObj.get("v") != null && !jsonObj.get("v").isJsonNull()) - && !jsonObj.get("v").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `v` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("v").toString())); - } - if ((jsonObj.get("vo") != null && !jsonObj.get("vo").isJsonNull()) - && !jsonObj.get("vo").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `vo` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("vo").toString())); - } - if ((jsonObj.get("mp") != null && !jsonObj.get("mp").isJsonNull()) - && !jsonObj.get("mp").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `mp` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("mp").toString())); - } - if ((jsonObj.get("hl") != null && !jsonObj.get("hl").isJsonNull()) - && !jsonObj.get("hl").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `hl` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("hl").toString())); - } - if ((jsonObj.get("ll") != null && !jsonObj.get("ll").isJsonNull()) - && !jsonObj.get("ll").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `ll` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("ll").toString())); - } - if ((jsonObj.get("eep") != null && !jsonObj.get("eep").isJsonNull()) - && !jsonObj.get("eep").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `eep` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("eep").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter - thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get( - Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner - .class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, - Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner read( - JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner given an - * JSON string - * - * @param jsonString JSON string - * @return An instance of Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner - * @throws IOException if the JSON string is invalid with respect to - * Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner - */ - public static Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner fromJson( - String jsonString) throws IOException { - return JSON.getGson() - .fromJson( - jsonString, - Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner.class); - } - - /** - * Convert an instance of Ticker24HourByUnderlyingAssetAndExpirationDataResponseInner to an JSON - * string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Ticker24HourRequest.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Ticker24HourRequest.java index b4cdca126..8b7e75cb4 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Ticker24HourRequest.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Ticker24HourRequest.java @@ -43,7 +43,7 @@ public class Ticker24HourRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_ID) @jakarta.annotation.Nullable - private String id; + private Integer id; public static final String SERIALIZED_NAME_SYMBOL = "symbol"; @@ -53,7 +53,7 @@ public class Ticker24HourRequest extends BaseDTO { public Ticker24HourRequest() {} - public Ticker24HourRequest id(@jakarta.annotation.Nullable String id) { + public Ticker24HourRequest id(@jakarta.annotation.Nullable Integer id) { this.id = id; return this; } @@ -64,11 +64,11 @@ public Ticker24HourRequest id(@jakarta.annotation.Nullable String id) { * @return id */ @jakarta.annotation.Nullable - public String getId() { + public Integer getId() { return id; } - public void setId(@jakarta.annotation.Nullable String id) { + public void setId(@jakarta.annotation.Nullable Integer id) { this.id = id; } @@ -124,7 +124,7 @@ public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - String idValue = getId(); + Integer idValue = getId(); if (idValue != null) { String idValueAsString = idValue.toString(); valMap.put("id", idValueAsString); @@ -227,14 +227,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } if (!jsonObj.get("symbol").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Ticker24HourResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Ticker24HourResponse.java index 66c7cc289..c1a25d76c 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Ticker24HourResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/Ticker24HourResponse.java @@ -51,35 +51,29 @@ public class Ticker24HourResponse extends BaseDTO { @jakarta.annotation.Nullable private Long E; - public static final String SERIALIZED_NAME_T = "T"; - - @SerializedName(SERIALIZED_NAME_T) - @jakarta.annotation.Nullable - private Long T; - public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) @jakarta.annotation.Nullable private String sLowerCase; - public static final String SERIALIZED_NAME_O_LOWER_CASE = "o"; + public static final String SERIALIZED_NAME_P_LOWER_CASE = "p"; - @SerializedName(SERIALIZED_NAME_O_LOWER_CASE) + @SerializedName(SERIALIZED_NAME_P_LOWER_CASE) @jakarta.annotation.Nullable - private String oLowerCase; + private String pLowerCase; - public static final String SERIALIZED_NAME_H_LOWER_CASE = "h"; + public static final String SERIALIZED_NAME_P = "P"; - @SerializedName(SERIALIZED_NAME_H_LOWER_CASE) + @SerializedName(SERIALIZED_NAME_P) @jakarta.annotation.Nullable - private String hLowerCase; + private String P; - public static final String SERIALIZED_NAME_L_LOWER_CASE = "l"; + public static final String SERIALIZED_NAME_W_LOWER_CASE = "w"; - @SerializedName(SERIALIZED_NAME_L_LOWER_CASE) + @SerializedName(SERIALIZED_NAME_W_LOWER_CASE) @jakarta.annotation.Nullable - private String lLowerCase; + private String wLowerCase; public static final String SERIALIZED_NAME_C_LOWER_CASE = "c"; @@ -87,107 +81,29 @@ public class Ticker24HourResponse extends BaseDTO { @jakarta.annotation.Nullable private String cLowerCase; - public static final String SERIALIZED_NAME_V = "V"; - - @SerializedName(SERIALIZED_NAME_V) - @jakarta.annotation.Nullable - private String V; - - public static final String SERIALIZED_NAME_A = "A"; - - @SerializedName(SERIALIZED_NAME_A) - @jakarta.annotation.Nullable - private String A; - - public static final String SERIALIZED_NAME_P = "P"; - - @SerializedName(SERIALIZED_NAME_P) - @jakarta.annotation.Nullable - private String P; - - public static final String SERIALIZED_NAME_P_LOWER_CASE = "p"; - - @SerializedName(SERIALIZED_NAME_P_LOWER_CASE) - @jakarta.annotation.Nullable - private String pLowerCase; - public static final String SERIALIZED_NAME_Q = "Q"; @SerializedName(SERIALIZED_NAME_Q) @jakarta.annotation.Nullable private String Q; - public static final String SERIALIZED_NAME_F = "F"; - - @SerializedName(SERIALIZED_NAME_F) - @jakarta.annotation.Nullable - private String F; - - public static final String SERIALIZED_NAME_L = "L"; - - @SerializedName(SERIALIZED_NAME_L) - @jakarta.annotation.Nullable - private String L; - - public static final String SERIALIZED_NAME_N_LOWER_CASE = "n"; - - @SerializedName(SERIALIZED_NAME_N_LOWER_CASE) - @jakarta.annotation.Nullable - private Long nLowerCase; - - public static final String SERIALIZED_NAME_BO = "bo"; - - @SerializedName(SERIALIZED_NAME_BO) - @jakarta.annotation.Nullable - private String bo; - - public static final String SERIALIZED_NAME_AO = "ao"; - - @SerializedName(SERIALIZED_NAME_AO) - @jakarta.annotation.Nullable - private String ao; - - public static final String SERIALIZED_NAME_BQ = "bq"; - - @SerializedName(SERIALIZED_NAME_BQ) - @jakarta.annotation.Nullable - private String bq; - - public static final String SERIALIZED_NAME_AQ = "aq"; - - @SerializedName(SERIALIZED_NAME_AQ) - @jakarta.annotation.Nullable - private String aq; - - public static final String SERIALIZED_NAME_B_LOWER_CASE = "b"; - - @SerializedName(SERIALIZED_NAME_B_LOWER_CASE) - @jakarta.annotation.Nullable - private String bLowerCase; - - public static final String SERIALIZED_NAME_A_LOWER_CASE = "a"; - - @SerializedName(SERIALIZED_NAME_A_LOWER_CASE) - @jakarta.annotation.Nullable - private String aLowerCase; - - public static final String SERIALIZED_NAME_D_LOWER_CASE = "d"; + public static final String SERIALIZED_NAME_O_LOWER_CASE = "o"; - @SerializedName(SERIALIZED_NAME_D_LOWER_CASE) + @SerializedName(SERIALIZED_NAME_O_LOWER_CASE) @jakarta.annotation.Nullable - private String dLowerCase; + private String oLowerCase; - public static final String SERIALIZED_NAME_T_LOWER_CASE = "t"; + public static final String SERIALIZED_NAME_H_LOWER_CASE = "h"; - @SerializedName(SERIALIZED_NAME_T_LOWER_CASE) + @SerializedName(SERIALIZED_NAME_H_LOWER_CASE) @jakarta.annotation.Nullable - private String tLowerCase; + private String hLowerCase; - public static final String SERIALIZED_NAME_G_LOWER_CASE = "g"; + public static final String SERIALIZED_NAME_L_LOWER_CASE = "l"; - @SerializedName(SERIALIZED_NAME_G_LOWER_CASE) + @SerializedName(SERIALIZED_NAME_L_LOWER_CASE) @jakarta.annotation.Nullable - private String gLowerCase; + private String lLowerCase; public static final String SERIALIZED_NAME_V_LOWER_CASE = "v"; @@ -195,35 +111,41 @@ public class Ticker24HourResponse extends BaseDTO { @jakarta.annotation.Nullable private String vLowerCase; - public static final String SERIALIZED_NAME_VO = "vo"; + public static final String SERIALIZED_NAME_Q_LOWER_CASE = "q"; + + @SerializedName(SERIALIZED_NAME_Q_LOWER_CASE) + @jakarta.annotation.Nullable + private String qLowerCase; + + public static final String SERIALIZED_NAME_O = "O"; - @SerializedName(SERIALIZED_NAME_VO) + @SerializedName(SERIALIZED_NAME_O) @jakarta.annotation.Nullable - private String vo; + private Long O; - public static final String SERIALIZED_NAME_MP = "mp"; + public static final String SERIALIZED_NAME_C = "C"; - @SerializedName(SERIALIZED_NAME_MP) + @SerializedName(SERIALIZED_NAME_C) @jakarta.annotation.Nullable - private String mp; + private Long C; - public static final String SERIALIZED_NAME_HL = "hl"; + public static final String SERIALIZED_NAME_F = "F"; - @SerializedName(SERIALIZED_NAME_HL) + @SerializedName(SERIALIZED_NAME_F) @jakarta.annotation.Nullable - private String hl; + private Long F; - public static final String SERIALIZED_NAME_LL = "ll"; + public static final String SERIALIZED_NAME_L = "L"; - @SerializedName(SERIALIZED_NAME_LL) + @SerializedName(SERIALIZED_NAME_L) @jakarta.annotation.Nullable - private String ll; + private Long L; - public static final String SERIALIZED_NAME_EEP = "eep"; + public static final String SERIALIZED_NAME_N_LOWER_CASE = "n"; - @SerializedName(SERIALIZED_NAME_EEP) + @SerializedName(SERIALIZED_NAME_N_LOWER_CASE) @jakarta.annotation.Nullable - private String eep; + private Long nLowerCase; public Ticker24HourResponse() {} @@ -265,25 +187,6 @@ public void setE(@jakarta.annotation.Nullable Long E) { this.E = E; } - public Ticker24HourResponse T(@jakarta.annotation.Nullable Long T) { - this.T = T; - return this; - } - - /** - * Get T - * - * @return T - */ - @jakarta.annotation.Nullable - public Long getT() { - return T; - } - - public void setT(@jakarta.annotation.Nullable Long T) { - this.T = T; - } - public Ticker24HourResponse sLowerCase(@jakarta.annotation.Nullable String sLowerCase) { this.sLowerCase = sLowerCase; return this; @@ -303,61 +206,61 @@ public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { this.sLowerCase = sLowerCase; } - public Ticker24HourResponse oLowerCase(@jakarta.annotation.Nullable String oLowerCase) { - this.oLowerCase = oLowerCase; + public Ticker24HourResponse pLowerCase(@jakarta.annotation.Nullable String pLowerCase) { + this.pLowerCase = pLowerCase; return this; } /** - * Get oLowerCase + * Get pLowerCase * - * @return oLowerCase + * @return pLowerCase */ @jakarta.annotation.Nullable - public String getoLowerCase() { - return oLowerCase; + public String getpLowerCase() { + return pLowerCase; } - public void setoLowerCase(@jakarta.annotation.Nullable String oLowerCase) { - this.oLowerCase = oLowerCase; + public void setpLowerCase(@jakarta.annotation.Nullable String pLowerCase) { + this.pLowerCase = pLowerCase; } - public Ticker24HourResponse hLowerCase(@jakarta.annotation.Nullable String hLowerCase) { - this.hLowerCase = hLowerCase; + public Ticker24HourResponse P(@jakarta.annotation.Nullable String P) { + this.P = P; return this; } /** - * Get hLowerCase + * Get P * - * @return hLowerCase + * @return P */ @jakarta.annotation.Nullable - public String gethLowerCase() { - return hLowerCase; + public String getP() { + return P; } - public void sethLowerCase(@jakarta.annotation.Nullable String hLowerCase) { - this.hLowerCase = hLowerCase; + public void setP(@jakarta.annotation.Nullable String P) { + this.P = P; } - public Ticker24HourResponse lLowerCase(@jakarta.annotation.Nullable String lLowerCase) { - this.lLowerCase = lLowerCase; + public Ticker24HourResponse wLowerCase(@jakarta.annotation.Nullable String wLowerCase) { + this.wLowerCase = wLowerCase; return this; } /** - * Get lLowerCase + * Get wLowerCase * - * @return lLowerCase + * @return wLowerCase */ @jakarta.annotation.Nullable - public String getlLowerCase() { - return lLowerCase; + public String getwLowerCase() { + return wLowerCase; } - public void setlLowerCase(@jakarta.annotation.Nullable String lLowerCase) { - this.lLowerCase = lLowerCase; + public void setwLowerCase(@jakarta.annotation.Nullable String wLowerCase) { + this.wLowerCase = wLowerCase; } public Ticker24HourResponse cLowerCase(@jakarta.annotation.Nullable String cLowerCase) { @@ -379,441 +282,213 @@ public void setcLowerCase(@jakarta.annotation.Nullable String cLowerCase) { this.cLowerCase = cLowerCase; } - public Ticker24HourResponse V(@jakarta.annotation.Nullable String V) { - this.V = V; - return this; - } - - /** - * Get V - * - * @return V - */ - @jakarta.annotation.Nullable - public String getV() { - return V; - } - - public void setV(@jakarta.annotation.Nullable String V) { - this.V = V; - } - - public Ticker24HourResponse A(@jakarta.annotation.Nullable String A) { - this.A = A; + public Ticker24HourResponse Q(@jakarta.annotation.Nullable String Q) { + this.Q = Q; return this; } /** - * Get A + * Get Q * - * @return A + * @return Q */ @jakarta.annotation.Nullable - public String getA() { - return A; + public String getQ() { + return Q; } - public void setA(@jakarta.annotation.Nullable String A) { - this.A = A; + public void setQ(@jakarta.annotation.Nullable String Q) { + this.Q = Q; } - public Ticker24HourResponse P(@jakarta.annotation.Nullable String P) { - this.P = P; + public Ticker24HourResponse oLowerCase(@jakarta.annotation.Nullable String oLowerCase) { + this.oLowerCase = oLowerCase; return this; } /** - * Get P + * Get oLowerCase * - * @return P + * @return oLowerCase */ @jakarta.annotation.Nullable - public String getP() { - return P; + public String getoLowerCase() { + return oLowerCase; } - public void setP(@jakarta.annotation.Nullable String P) { - this.P = P; + public void setoLowerCase(@jakarta.annotation.Nullable String oLowerCase) { + this.oLowerCase = oLowerCase; } - public Ticker24HourResponse pLowerCase(@jakarta.annotation.Nullable String pLowerCase) { - this.pLowerCase = pLowerCase; + public Ticker24HourResponse hLowerCase(@jakarta.annotation.Nullable String hLowerCase) { + this.hLowerCase = hLowerCase; return this; } /** - * Get pLowerCase + * Get hLowerCase * - * @return pLowerCase + * @return hLowerCase */ @jakarta.annotation.Nullable - public String getpLowerCase() { - return pLowerCase; + public String gethLowerCase() { + return hLowerCase; } - public void setpLowerCase(@jakarta.annotation.Nullable String pLowerCase) { - this.pLowerCase = pLowerCase; + public void sethLowerCase(@jakarta.annotation.Nullable String hLowerCase) { + this.hLowerCase = hLowerCase; } - public Ticker24HourResponse Q(@jakarta.annotation.Nullable String Q) { - this.Q = Q; + public Ticker24HourResponse lLowerCase(@jakarta.annotation.Nullable String lLowerCase) { + this.lLowerCase = lLowerCase; return this; } /** - * Get Q + * Get lLowerCase * - * @return Q + * @return lLowerCase */ @jakarta.annotation.Nullable - public String getQ() { - return Q; + public String getlLowerCase() { + return lLowerCase; } - public void setQ(@jakarta.annotation.Nullable String Q) { - this.Q = Q; + public void setlLowerCase(@jakarta.annotation.Nullable String lLowerCase) { + this.lLowerCase = lLowerCase; } - public Ticker24HourResponse F(@jakarta.annotation.Nullable String F) { - this.F = F; + public Ticker24HourResponse vLowerCase(@jakarta.annotation.Nullable String vLowerCase) { + this.vLowerCase = vLowerCase; return this; } /** - * Get F + * Get vLowerCase * - * @return F + * @return vLowerCase */ @jakarta.annotation.Nullable - public String getF() { - return F; + public String getvLowerCase() { + return vLowerCase; } - public void setF(@jakarta.annotation.Nullable String F) { - this.F = F; + public void setvLowerCase(@jakarta.annotation.Nullable String vLowerCase) { + this.vLowerCase = vLowerCase; } - public Ticker24HourResponse L(@jakarta.annotation.Nullable String L) { - this.L = L; + public Ticker24HourResponse qLowerCase(@jakarta.annotation.Nullable String qLowerCase) { + this.qLowerCase = qLowerCase; return this; } /** - * Get L + * Get qLowerCase * - * @return L + * @return qLowerCase */ @jakarta.annotation.Nullable - public String getL() { - return L; + public String getqLowerCase() { + return qLowerCase; } - public void setL(@jakarta.annotation.Nullable String L) { - this.L = L; + public void setqLowerCase(@jakarta.annotation.Nullable String qLowerCase) { + this.qLowerCase = qLowerCase; } - public Ticker24HourResponse nLowerCase(@jakarta.annotation.Nullable Long nLowerCase) { - this.nLowerCase = nLowerCase; + public Ticker24HourResponse O(@jakarta.annotation.Nullable Long O) { + this.O = O; return this; } /** - * Get nLowerCase + * Get O * - * @return nLowerCase + * @return O */ @jakarta.annotation.Nullable - public Long getnLowerCase() { - return nLowerCase; + public Long getO() { + return O; } - public void setnLowerCase(@jakarta.annotation.Nullable Long nLowerCase) { - this.nLowerCase = nLowerCase; + public void setO(@jakarta.annotation.Nullable Long O) { + this.O = O; } - public Ticker24HourResponse bo(@jakarta.annotation.Nullable String bo) { - this.bo = bo; + public Ticker24HourResponse C(@jakarta.annotation.Nullable Long C) { + this.C = C; return this; } /** - * Get bo + * Get C * - * @return bo + * @return C */ @jakarta.annotation.Nullable - public String getBo() { - return bo; + public Long getC() { + return C; } - public void setBo(@jakarta.annotation.Nullable String bo) { - this.bo = bo; + public void setC(@jakarta.annotation.Nullable Long C) { + this.C = C; } - public Ticker24HourResponse ao(@jakarta.annotation.Nullable String ao) { - this.ao = ao; + public Ticker24HourResponse F(@jakarta.annotation.Nullable Long F) { + this.F = F; return this; } /** - * Get ao + * Get F * - * @return ao + * @return F */ @jakarta.annotation.Nullable - public String getAo() { - return ao; + public Long getF() { + return F; } - public void setAo(@jakarta.annotation.Nullable String ao) { - this.ao = ao; + public void setF(@jakarta.annotation.Nullable Long F) { + this.F = F; } - public Ticker24HourResponse bq(@jakarta.annotation.Nullable String bq) { - this.bq = bq; + public Ticker24HourResponse L(@jakarta.annotation.Nullable Long L) { + this.L = L; return this; } /** - * Get bq + * Get L * - * @return bq + * @return L */ @jakarta.annotation.Nullable - public String getBq() { - return bq; + public Long getL() { + return L; } - public void setBq(@jakarta.annotation.Nullable String bq) { - this.bq = bq; + public void setL(@jakarta.annotation.Nullable Long L) { + this.L = L; } - public Ticker24HourResponse aq(@jakarta.annotation.Nullable String aq) { - this.aq = aq; + public Ticker24HourResponse nLowerCase(@jakarta.annotation.Nullable Long nLowerCase) { + this.nLowerCase = nLowerCase; return this; } /** - * Get aq + * Get nLowerCase * - * @return aq + * @return nLowerCase */ @jakarta.annotation.Nullable - public String getAq() { - return aq; - } - - public void setAq(@jakarta.annotation.Nullable String aq) { - this.aq = aq; + public Long getnLowerCase() { + return nLowerCase; } - public Ticker24HourResponse bLowerCase(@jakarta.annotation.Nullable String bLowerCase) { - this.bLowerCase = bLowerCase; - return this; - } - - /** - * Get bLowerCase - * - * @return bLowerCase - */ - @jakarta.annotation.Nullable - public String getbLowerCase() { - return bLowerCase; - } - - public void setbLowerCase(@jakarta.annotation.Nullable String bLowerCase) { - this.bLowerCase = bLowerCase; - } - - public Ticker24HourResponse aLowerCase(@jakarta.annotation.Nullable String aLowerCase) { - this.aLowerCase = aLowerCase; - return this; - } - - /** - * Get aLowerCase - * - * @return aLowerCase - */ - @jakarta.annotation.Nullable - public String getaLowerCase() { - return aLowerCase; - } - - public void setaLowerCase(@jakarta.annotation.Nullable String aLowerCase) { - this.aLowerCase = aLowerCase; - } - - public Ticker24HourResponse dLowerCase(@jakarta.annotation.Nullable String dLowerCase) { - this.dLowerCase = dLowerCase; - return this; - } - - /** - * Get dLowerCase - * - * @return dLowerCase - */ - @jakarta.annotation.Nullable - public String getdLowerCase() { - return dLowerCase; - } - - public void setdLowerCase(@jakarta.annotation.Nullable String dLowerCase) { - this.dLowerCase = dLowerCase; - } - - public Ticker24HourResponse tLowerCase(@jakarta.annotation.Nullable String tLowerCase) { - this.tLowerCase = tLowerCase; - return this; - } - - /** - * Get tLowerCase - * - * @return tLowerCase - */ - @jakarta.annotation.Nullable - public String gettLowerCase() { - return tLowerCase; - } - - public void settLowerCase(@jakarta.annotation.Nullable String tLowerCase) { - this.tLowerCase = tLowerCase; - } - - public Ticker24HourResponse gLowerCase(@jakarta.annotation.Nullable String gLowerCase) { - this.gLowerCase = gLowerCase; - return this; - } - - /** - * Get gLowerCase - * - * @return gLowerCase - */ - @jakarta.annotation.Nullable - public String getgLowerCase() { - return gLowerCase; - } - - public void setgLowerCase(@jakarta.annotation.Nullable String gLowerCase) { - this.gLowerCase = gLowerCase; - } - - public Ticker24HourResponse vLowerCase(@jakarta.annotation.Nullable String vLowerCase) { - this.vLowerCase = vLowerCase; - return this; - } - - /** - * Get vLowerCase - * - * @return vLowerCase - */ - @jakarta.annotation.Nullable - public String getvLowerCase() { - return vLowerCase; - } - - public void setvLowerCase(@jakarta.annotation.Nullable String vLowerCase) { - this.vLowerCase = vLowerCase; - } - - public Ticker24HourResponse vo(@jakarta.annotation.Nullable String vo) { - this.vo = vo; - return this; - } - - /** - * Get vo - * - * @return vo - */ - @jakarta.annotation.Nullable - public String getVo() { - return vo; - } - - public void setVo(@jakarta.annotation.Nullable String vo) { - this.vo = vo; - } - - public Ticker24HourResponse mp(@jakarta.annotation.Nullable String mp) { - this.mp = mp; - return this; - } - - /** - * Get mp - * - * @return mp - */ - @jakarta.annotation.Nullable - public String getMp() { - return mp; - } - - public void setMp(@jakarta.annotation.Nullable String mp) { - this.mp = mp; - } - - public Ticker24HourResponse hl(@jakarta.annotation.Nullable String hl) { - this.hl = hl; - return this; - } - - /** - * Get hl - * - * @return hl - */ - @jakarta.annotation.Nullable - public String getHl() { - return hl; - } - - public void setHl(@jakarta.annotation.Nullable String hl) { - this.hl = hl; - } - - public Ticker24HourResponse ll(@jakarta.annotation.Nullable String ll) { - this.ll = ll; - return this; - } - - /** - * Get ll - * - * @return ll - */ - @jakarta.annotation.Nullable - public String getLl() { - return ll; - } - - public void setLl(@jakarta.annotation.Nullable String ll) { - this.ll = ll; - } - - public Ticker24HourResponse eep(@jakarta.annotation.Nullable String eep) { - this.eep = eep; - return this; - } - - /** - * Get eep - * - * @return eep - */ - @jakarta.annotation.Nullable - public String getEep() { - return eep; - } - - public void setEep(@jakarta.annotation.Nullable String eep) { - this.eep = eep; + public void setnLowerCase(@jakarta.annotation.Nullable Long nLowerCase) { + this.nLowerCase = nLowerCase; } @Override @@ -827,35 +502,22 @@ public boolean equals(Object o) { Ticker24HourResponse ticker24HourResponse = (Ticker24HourResponse) o; return Objects.equals(this.eLowerCase, ticker24HourResponse.eLowerCase) && Objects.equals(this.E, ticker24HourResponse.E) - && Objects.equals(this.T, ticker24HourResponse.T) && Objects.equals(this.sLowerCase, ticker24HourResponse.sLowerCase) + && Objects.equals(this.pLowerCase, ticker24HourResponse.pLowerCase) + && Objects.equals(this.P, ticker24HourResponse.P) + && Objects.equals(this.wLowerCase, ticker24HourResponse.wLowerCase) + && Objects.equals(this.cLowerCase, ticker24HourResponse.cLowerCase) + && Objects.equals(this.Q, ticker24HourResponse.Q) && Objects.equals(this.oLowerCase, ticker24HourResponse.oLowerCase) && Objects.equals(this.hLowerCase, ticker24HourResponse.hLowerCase) && Objects.equals(this.lLowerCase, ticker24HourResponse.lLowerCase) - && Objects.equals(this.cLowerCase, ticker24HourResponse.cLowerCase) - && Objects.equals(this.V, ticker24HourResponse.V) - && Objects.equals(this.A, ticker24HourResponse.A) - && Objects.equals(this.P, ticker24HourResponse.P) - && Objects.equals(this.pLowerCase, ticker24HourResponse.pLowerCase) - && Objects.equals(this.Q, ticker24HourResponse.Q) + && Objects.equals(this.vLowerCase, ticker24HourResponse.vLowerCase) + && Objects.equals(this.qLowerCase, ticker24HourResponse.qLowerCase) + && Objects.equals(this.O, ticker24HourResponse.O) + && Objects.equals(this.C, ticker24HourResponse.C) && Objects.equals(this.F, ticker24HourResponse.F) && Objects.equals(this.L, ticker24HourResponse.L) - && Objects.equals(this.nLowerCase, ticker24HourResponse.nLowerCase) - && Objects.equals(this.bo, ticker24HourResponse.bo) - && Objects.equals(this.ao, ticker24HourResponse.ao) - && Objects.equals(this.bq, ticker24HourResponse.bq) - && Objects.equals(this.aq, ticker24HourResponse.aq) - && Objects.equals(this.bLowerCase, ticker24HourResponse.bLowerCase) - && Objects.equals(this.aLowerCase, ticker24HourResponse.aLowerCase) - && Objects.equals(this.dLowerCase, ticker24HourResponse.dLowerCase) - && Objects.equals(this.tLowerCase, ticker24HourResponse.tLowerCase) - && Objects.equals(this.gLowerCase, ticker24HourResponse.gLowerCase) - && Objects.equals(this.vLowerCase, ticker24HourResponse.vLowerCase) - && Objects.equals(this.vo, ticker24HourResponse.vo) - && Objects.equals(this.mp, ticker24HourResponse.mp) - && Objects.equals(this.hl, ticker24HourResponse.hl) - && Objects.equals(this.ll, ticker24HourResponse.ll) - && Objects.equals(this.eep, ticker24HourResponse.eep); + && Objects.equals(this.nLowerCase, ticker24HourResponse.nLowerCase); } @Override @@ -863,35 +525,22 @@ public int hashCode() { return Objects.hash( eLowerCase, E, - T, sLowerCase, + pLowerCase, + P, + wLowerCase, + cLowerCase, + Q, oLowerCase, hLowerCase, lLowerCase, - cLowerCase, - V, - A, - P, - pLowerCase, - Q, + vLowerCase, + qLowerCase, + O, + C, F, L, - nLowerCase, - bo, - ao, - bq, - aq, - bLowerCase, - aLowerCase, - dLowerCase, - tLowerCase, - gLowerCase, - vLowerCase, - vo, - mp, - hl, - ll, - eep); + nLowerCase); } @Override @@ -900,35 +549,22 @@ public String toString() { sb.append("class Ticker24HourResponse {\n"); sb.append(" eLowerCase: ").append(toIndentedString(eLowerCase)).append("\n"); sb.append(" E: ").append(toIndentedString(E)).append("\n"); - sb.append(" T: ").append(toIndentedString(T)).append("\n"); sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); + sb.append(" pLowerCase: ").append(toIndentedString(pLowerCase)).append("\n"); + sb.append(" P: ").append(toIndentedString(P)).append("\n"); + sb.append(" wLowerCase: ").append(toIndentedString(wLowerCase)).append("\n"); + sb.append(" cLowerCase: ").append(toIndentedString(cLowerCase)).append("\n"); + sb.append(" Q: ").append(toIndentedString(Q)).append("\n"); sb.append(" oLowerCase: ").append(toIndentedString(oLowerCase)).append("\n"); sb.append(" hLowerCase: ").append(toIndentedString(hLowerCase)).append("\n"); sb.append(" lLowerCase: ").append(toIndentedString(lLowerCase)).append("\n"); - sb.append(" cLowerCase: ").append(toIndentedString(cLowerCase)).append("\n"); - sb.append(" V: ").append(toIndentedString(V)).append("\n"); - sb.append(" A: ").append(toIndentedString(A)).append("\n"); - sb.append(" P: ").append(toIndentedString(P)).append("\n"); - sb.append(" pLowerCase: ").append(toIndentedString(pLowerCase)).append("\n"); - sb.append(" Q: ").append(toIndentedString(Q)).append("\n"); + sb.append(" vLowerCase: ").append(toIndentedString(vLowerCase)).append("\n"); + sb.append(" qLowerCase: ").append(toIndentedString(qLowerCase)).append("\n"); + sb.append(" O: ").append(toIndentedString(O)).append("\n"); + sb.append(" C: ").append(toIndentedString(C)).append("\n"); sb.append(" F: ").append(toIndentedString(F)).append("\n"); sb.append(" L: ").append(toIndentedString(L)).append("\n"); sb.append(" nLowerCase: ").append(toIndentedString(nLowerCase)).append("\n"); - sb.append(" bo: ").append(toIndentedString(bo)).append("\n"); - sb.append(" ao: ").append(toIndentedString(ao)).append("\n"); - sb.append(" bq: ").append(toIndentedString(bq)).append("\n"); - sb.append(" aq: ").append(toIndentedString(aq)).append("\n"); - sb.append(" bLowerCase: ").append(toIndentedString(bLowerCase)).append("\n"); - sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); - sb.append(" dLowerCase: ").append(toIndentedString(dLowerCase)).append("\n"); - sb.append(" tLowerCase: ").append(toIndentedString(tLowerCase)).append("\n"); - sb.append(" gLowerCase: ").append(toIndentedString(gLowerCase)).append("\n"); - sb.append(" vLowerCase: ").append(toIndentedString(vLowerCase)).append("\n"); - sb.append(" vo: ").append(toIndentedString(vo)).append("\n"); - sb.append(" mp: ").append(toIndentedString(mp)).append("\n"); - sb.append(" hl: ").append(toIndentedString(hl)).append("\n"); - sb.append(" ll: ").append(toIndentedString(ll)).append("\n"); - sb.append(" eep: ").append(toIndentedString(eep)).append("\n"); sb.append("}"); return sb.toString(); } @@ -947,16 +583,36 @@ public String toUrlQueryString() { String EValueAsString = EValue.toString(); valMap.put("E", EValueAsString); } - Long TValue = getT(); - if (TValue != null) { - String TValueAsString = TValue.toString(); - valMap.put("T", TValueAsString); - } String sLowerCaseValue = getsLowerCase(); if (sLowerCaseValue != null) { String sLowerCaseValueAsString = sLowerCaseValue.toString(); valMap.put("sLowerCase", sLowerCaseValueAsString); } + String pLowerCaseValue = getpLowerCase(); + if (pLowerCaseValue != null) { + String pLowerCaseValueAsString = pLowerCaseValue.toString(); + valMap.put("pLowerCase", pLowerCaseValueAsString); + } + String PValue = getP(); + if (PValue != null) { + String PValueAsString = PValue.toString(); + valMap.put("P", PValueAsString); + } + String wLowerCaseValue = getwLowerCase(); + if (wLowerCaseValue != null) { + String wLowerCaseValueAsString = wLowerCaseValue.toString(); + valMap.put("wLowerCase", wLowerCaseValueAsString); + } + String cLowerCaseValue = getcLowerCase(); + if (cLowerCaseValue != null) { + String cLowerCaseValueAsString = cLowerCaseValue.toString(); + valMap.put("cLowerCase", cLowerCaseValueAsString); + } + String QValue = getQ(); + if (QValue != null) { + String QValueAsString = QValue.toString(); + valMap.put("Q", QValueAsString); + } String oLowerCaseValue = getoLowerCase(); if (oLowerCaseValue != null) { String oLowerCaseValueAsString = oLowerCaseValue.toString(); @@ -972,42 +628,32 @@ public String toUrlQueryString() { String lLowerCaseValueAsString = lLowerCaseValue.toString(); valMap.put("lLowerCase", lLowerCaseValueAsString); } - String cLowerCaseValue = getcLowerCase(); - if (cLowerCaseValue != null) { - String cLowerCaseValueAsString = cLowerCaseValue.toString(); - valMap.put("cLowerCase", cLowerCaseValueAsString); - } - String VValue = getV(); - if (VValue != null) { - String VValueAsString = VValue.toString(); - valMap.put("V", VValueAsString); - } - String AValue = getA(); - if (AValue != null) { - String AValueAsString = AValue.toString(); - valMap.put("A", AValueAsString); + String vLowerCaseValue = getvLowerCase(); + if (vLowerCaseValue != null) { + String vLowerCaseValueAsString = vLowerCaseValue.toString(); + valMap.put("vLowerCase", vLowerCaseValueAsString); } - String PValue = getP(); - if (PValue != null) { - String PValueAsString = PValue.toString(); - valMap.put("P", PValueAsString); + String qLowerCaseValue = getqLowerCase(); + if (qLowerCaseValue != null) { + String qLowerCaseValueAsString = qLowerCaseValue.toString(); + valMap.put("qLowerCase", qLowerCaseValueAsString); } - String pLowerCaseValue = getpLowerCase(); - if (pLowerCaseValue != null) { - String pLowerCaseValueAsString = pLowerCaseValue.toString(); - valMap.put("pLowerCase", pLowerCaseValueAsString); + Long OValue = getO(); + if (OValue != null) { + String OValueAsString = OValue.toString(); + valMap.put("O", OValueAsString); } - String QValue = getQ(); - if (QValue != null) { - String QValueAsString = QValue.toString(); - valMap.put("Q", QValueAsString); + Long CValue = getC(); + if (CValue != null) { + String CValueAsString = CValue.toString(); + valMap.put("C", CValueAsString); } - String FValue = getF(); + Long FValue = getF(); if (FValue != null) { String FValueAsString = FValue.toString(); valMap.put("F", FValueAsString); } - String LValue = getL(); + Long LValue = getL(); if (LValue != null) { String LValueAsString = LValue.toString(); valMap.put("L", LValueAsString); @@ -1017,81 +663,6 @@ public String toUrlQueryString() { String nLowerCaseValueAsString = nLowerCaseValue.toString(); valMap.put("nLowerCase", nLowerCaseValueAsString); } - String boValue = getBo(); - if (boValue != null) { - String boValueAsString = boValue.toString(); - valMap.put("bo", boValueAsString); - } - String aoValue = getAo(); - if (aoValue != null) { - String aoValueAsString = aoValue.toString(); - valMap.put("ao", aoValueAsString); - } - String bqValue = getBq(); - if (bqValue != null) { - String bqValueAsString = bqValue.toString(); - valMap.put("bq", bqValueAsString); - } - String aqValue = getAq(); - if (aqValue != null) { - String aqValueAsString = aqValue.toString(); - valMap.put("aq", aqValueAsString); - } - String bLowerCaseValue = getbLowerCase(); - if (bLowerCaseValue != null) { - String bLowerCaseValueAsString = bLowerCaseValue.toString(); - valMap.put("bLowerCase", bLowerCaseValueAsString); - } - String aLowerCaseValue = getaLowerCase(); - if (aLowerCaseValue != null) { - String aLowerCaseValueAsString = aLowerCaseValue.toString(); - valMap.put("aLowerCase", aLowerCaseValueAsString); - } - String dLowerCaseValue = getdLowerCase(); - if (dLowerCaseValue != null) { - String dLowerCaseValueAsString = dLowerCaseValue.toString(); - valMap.put("dLowerCase", dLowerCaseValueAsString); - } - String tLowerCaseValue = gettLowerCase(); - if (tLowerCaseValue != null) { - String tLowerCaseValueAsString = tLowerCaseValue.toString(); - valMap.put("tLowerCase", tLowerCaseValueAsString); - } - String gLowerCaseValue = getgLowerCase(); - if (gLowerCaseValue != null) { - String gLowerCaseValueAsString = gLowerCaseValue.toString(); - valMap.put("gLowerCase", gLowerCaseValueAsString); - } - String vLowerCaseValue = getvLowerCase(); - if (vLowerCaseValue != null) { - String vLowerCaseValueAsString = vLowerCaseValue.toString(); - valMap.put("vLowerCase", vLowerCaseValueAsString); - } - String voValue = getVo(); - if (voValue != null) { - String voValueAsString = voValue.toString(); - valMap.put("vo", voValueAsString); - } - String mpValue = getMp(); - if (mpValue != null) { - String mpValueAsString = mpValue.toString(); - valMap.put("mp", mpValueAsString); - } - String hlValue = getHl(); - if (hlValue != null) { - String hlValueAsString = hlValue.toString(); - valMap.put("hl", hlValueAsString); - } - String llValue = getLl(); - if (llValue != null) { - String llValueAsString = llValue.toString(); - valMap.put("ll", llValueAsString); - } - String eepValue = getEep(); - if (eepValue != null) { - String eepValueAsString = eepValue.toString(); - valMap.put("eep", eepValueAsString); - } valMap.put("timestamp", getTimestamp()); return asciiEncode( @@ -1111,14 +682,30 @@ public Map toMap() { if (EValue != null) { valMap.put("E", EValue); } - Object TValue = getT(); - if (TValue != null) { - valMap.put("T", TValue); - } Object sLowerCaseValue = getsLowerCase(); if (sLowerCaseValue != null) { valMap.put("sLowerCase", sLowerCaseValue); } + Object pLowerCaseValue = getpLowerCase(); + if (pLowerCaseValue != null) { + valMap.put("pLowerCase", pLowerCaseValue); + } + Object PValue = getP(); + if (PValue != null) { + valMap.put("P", PValue); + } + Object wLowerCaseValue = getwLowerCase(); + if (wLowerCaseValue != null) { + valMap.put("wLowerCase", wLowerCaseValue); + } + Object cLowerCaseValue = getcLowerCase(); + if (cLowerCaseValue != null) { + valMap.put("cLowerCase", cLowerCaseValue); + } + Object QValue = getQ(); + if (QValue != null) { + valMap.put("Q", QValue); + } Object oLowerCaseValue = getoLowerCase(); if (oLowerCaseValue != null) { valMap.put("oLowerCase", oLowerCaseValue); @@ -1131,29 +718,21 @@ public Map toMap() { if (lLowerCaseValue != null) { valMap.put("lLowerCase", lLowerCaseValue); } - Object cLowerCaseValue = getcLowerCase(); - if (cLowerCaseValue != null) { - valMap.put("cLowerCase", cLowerCaseValue); - } - Object VValue = getV(); - if (VValue != null) { - valMap.put("V", VValue); - } - Object AValue = getA(); - if (AValue != null) { - valMap.put("A", AValue); + Object vLowerCaseValue = getvLowerCase(); + if (vLowerCaseValue != null) { + valMap.put("vLowerCase", vLowerCaseValue); } - Object PValue = getP(); - if (PValue != null) { - valMap.put("P", PValue); + Object qLowerCaseValue = getqLowerCase(); + if (qLowerCaseValue != null) { + valMap.put("qLowerCase", qLowerCaseValue); } - Object pLowerCaseValue = getpLowerCase(); - if (pLowerCaseValue != null) { - valMap.put("pLowerCase", pLowerCaseValue); + Object OValue = getO(); + if (OValue != null) { + valMap.put("O", OValue); } - Object QValue = getQ(); - if (QValue != null) { - valMap.put("Q", QValue); + Object CValue = getC(); + if (CValue != null) { + valMap.put("C", CValue); } Object FValue = getF(); if (FValue != null) { @@ -1167,66 +746,6 @@ public Map toMap() { if (nLowerCaseValue != null) { valMap.put("nLowerCase", nLowerCaseValue); } - Object boValue = getBo(); - if (boValue != null) { - valMap.put("bo", boValue); - } - Object aoValue = getAo(); - if (aoValue != null) { - valMap.put("ao", aoValue); - } - Object bqValue = getBq(); - if (bqValue != null) { - valMap.put("bq", bqValue); - } - Object aqValue = getAq(); - if (aqValue != null) { - valMap.put("aq", aqValue); - } - Object bLowerCaseValue = getbLowerCase(); - if (bLowerCaseValue != null) { - valMap.put("bLowerCase", bLowerCaseValue); - } - Object aLowerCaseValue = getaLowerCase(); - if (aLowerCaseValue != null) { - valMap.put("aLowerCase", aLowerCaseValue); - } - Object dLowerCaseValue = getdLowerCase(); - if (dLowerCaseValue != null) { - valMap.put("dLowerCase", dLowerCaseValue); - } - Object tLowerCaseValue = gettLowerCase(); - if (tLowerCaseValue != null) { - valMap.put("tLowerCase", tLowerCaseValue); - } - Object gLowerCaseValue = getgLowerCase(); - if (gLowerCaseValue != null) { - valMap.put("gLowerCase", gLowerCaseValue); - } - Object vLowerCaseValue = getvLowerCase(); - if (vLowerCaseValue != null) { - valMap.put("vLowerCase", vLowerCaseValue); - } - Object voValue = getVo(); - if (voValue != null) { - valMap.put("vo", voValue); - } - Object mpValue = getMp(); - if (mpValue != null) { - valMap.put("mp", mpValue); - } - Object hlValue = getHl(); - if (hlValue != null) { - valMap.put("hl", hlValue); - } - Object llValue = getLl(); - if (llValue != null) { - valMap.put("ll", llValue); - } - Object eepValue = getEep(); - if (eepValue != null) { - valMap.put("eep", eepValue); - } valMap.put("timestamp", getTimestamp()); return valMap; @@ -1255,35 +774,22 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("e"); openapiFields.add("E"); - openapiFields.add("T"); openapiFields.add("s"); + openapiFields.add("p"); + openapiFields.add("P"); + openapiFields.add("w"); + openapiFields.add("c"); + openapiFields.add("Q"); openapiFields.add("o"); openapiFields.add("h"); openapiFields.add("l"); - openapiFields.add("c"); - openapiFields.add("V"); - openapiFields.add("A"); - openapiFields.add("P"); - openapiFields.add("p"); - openapiFields.add("Q"); + openapiFields.add("v"); + openapiFields.add("q"); + openapiFields.add("O"); + openapiFields.add("C"); openapiFields.add("F"); openapiFields.add("L"); openapiFields.add("n"); - openapiFields.add("bo"); - openapiFields.add("ao"); - openapiFields.add("bq"); - openapiFields.add("aq"); - openapiFields.add("b"); - openapiFields.add("a"); - openapiFields.add("d"); - openapiFields.add("t"); - openapiFields.add("g"); - openapiFields.add("v"); - openapiFields.add("vo"); - openapiFields.add("mp"); - openapiFields.add("hl"); - openapiFields.add("ll"); - openapiFields.add("eep"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -1335,29 +841,29 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("s").toString())); } - if ((jsonObj.get("o") != null && !jsonObj.get("o").isJsonNull()) - && !jsonObj.get("o").isJsonPrimitive()) { + if ((jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) + && !jsonObj.get("p").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `o` to be a primitive type in the JSON string but" + "Expected the field `p` to be a primitive type in the JSON string but" + " got `%s`", - jsonObj.get("o").toString())); + jsonObj.get("p").toString())); } - if ((jsonObj.get("h") != null && !jsonObj.get("h").isJsonNull()) - && !jsonObj.get("h").isJsonPrimitive()) { + if ((jsonObj.get("P") != null && !jsonObj.get("P").isJsonNull()) + && !jsonObj.get("P").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `h` to be a primitive type in the JSON string but" + "Expected the field `P` to be a primitive type in the JSON string but" + " got `%s`", - jsonObj.get("h").toString())); + jsonObj.get("P").toString())); } - if ((jsonObj.get("l") != null && !jsonObj.get("l").isJsonNull()) - && !jsonObj.get("l").isJsonPrimitive()) { + if ((jsonObj.get("w") != null && !jsonObj.get("w").isJsonNull()) + && !jsonObj.get("w").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `l` to be a primitive type in the JSON string but" + "Expected the field `w` to be a primitive type in the JSON string but" + " got `%s`", - jsonObj.get("l").toString())); + jsonObj.get("w").toString())); } if ((jsonObj.get("c") != null && !jsonObj.get("c").isJsonNull()) && !jsonObj.get("c").isJsonPrimitive()) { @@ -1367,38 +873,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("c").toString())); } - if ((jsonObj.get("V") != null && !jsonObj.get("V").isJsonNull()) - && !jsonObj.get("V").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `V` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("V").toString())); - } - if ((jsonObj.get("A") != null && !jsonObj.get("A").isJsonNull()) - && !jsonObj.get("A").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `A` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("A").toString())); - } - if ((jsonObj.get("P") != null && !jsonObj.get("P").isJsonNull()) - && !jsonObj.get("P").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `P` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("P").toString())); - } - if ((jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) - && !jsonObj.get("p").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `p` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("p").toString())); - } if ((jsonObj.get("Q") != null && !jsonObj.get("Q").isJsonNull()) && !jsonObj.get("Q").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -1407,93 +881,29 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("Q").toString())); } - if ((jsonObj.get("F") != null && !jsonObj.get("F").isJsonNull()) - && !jsonObj.get("F").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `F` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("F").toString())); - } - if ((jsonObj.get("L") != null && !jsonObj.get("L").isJsonNull()) - && !jsonObj.get("L").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `L` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("L").toString())); - } - if ((jsonObj.get("bo") != null && !jsonObj.get("bo").isJsonNull()) - && !jsonObj.get("bo").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `bo` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("bo").toString())); - } - if ((jsonObj.get("ao") != null && !jsonObj.get("ao").isJsonNull()) - && !jsonObj.get("ao").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `ao` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("ao").toString())); - } - if ((jsonObj.get("bq") != null && !jsonObj.get("bq").isJsonNull()) - && !jsonObj.get("bq").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `bq` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("bq").toString())); - } - if ((jsonObj.get("aq") != null && !jsonObj.get("aq").isJsonNull()) - && !jsonObj.get("aq").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `aq` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("aq").toString())); - } - if ((jsonObj.get("b") != null && !jsonObj.get("b").isJsonNull()) - && !jsonObj.get("b").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `b` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("b").toString())); - } - if ((jsonObj.get("a") != null && !jsonObj.get("a").isJsonNull()) - && !jsonObj.get("a").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `a` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("a").toString())); - } - if ((jsonObj.get("d") != null && !jsonObj.get("d").isJsonNull()) - && !jsonObj.get("d").isJsonPrimitive()) { + if ((jsonObj.get("o") != null && !jsonObj.get("o").isJsonNull()) + && !jsonObj.get("o").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `d` to be a primitive type in the JSON string but" + "Expected the field `o` to be a primitive type in the JSON string but" + " got `%s`", - jsonObj.get("d").toString())); + jsonObj.get("o").toString())); } - if ((jsonObj.get("t") != null && !jsonObj.get("t").isJsonNull()) - && !jsonObj.get("t").isJsonPrimitive()) { + if ((jsonObj.get("h") != null && !jsonObj.get("h").isJsonNull()) + && !jsonObj.get("h").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `t` to be a primitive type in the JSON string but" + "Expected the field `h` to be a primitive type in the JSON string but" + " got `%s`", - jsonObj.get("t").toString())); + jsonObj.get("h").toString())); } - if ((jsonObj.get("g") != null && !jsonObj.get("g").isJsonNull()) - && !jsonObj.get("g").isJsonPrimitive()) { + if ((jsonObj.get("l") != null && !jsonObj.get("l").isJsonNull()) + && !jsonObj.get("l").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `g` to be a primitive type in the JSON string but" + "Expected the field `l` to be a primitive type in the JSON string but" + " got `%s`", - jsonObj.get("g").toString())); + jsonObj.get("l").toString())); } if ((jsonObj.get("v") != null && !jsonObj.get("v").isJsonNull()) && !jsonObj.get("v").isJsonPrimitive()) { @@ -1503,45 +913,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("v").toString())); } - if ((jsonObj.get("vo") != null && !jsonObj.get("vo").isJsonNull()) - && !jsonObj.get("vo").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `vo` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("vo").toString())); - } - if ((jsonObj.get("mp") != null && !jsonObj.get("mp").isJsonNull()) - && !jsonObj.get("mp").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `mp` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("mp").toString())); - } - if ((jsonObj.get("hl") != null && !jsonObj.get("hl").isJsonNull()) - && !jsonObj.get("hl").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `hl` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("hl").toString())); - } - if ((jsonObj.get("ll") != null && !jsonObj.get("ll").isJsonNull()) - && !jsonObj.get("ll").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `ll` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("ll").toString())); - } - if ((jsonObj.get("eep") != null && !jsonObj.get("eep").isJsonNull()) - && !jsonObj.get("eep").isJsonPrimitive()) { + if ((jsonObj.get("q") != null && !jsonObj.get("q").isJsonNull()) + && !jsonObj.get("q").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `eep` to be a primitive type in the JSON string but" + "Expected the field `q` to be a primitive type in the JSON string but" + " got `%s`", - jsonObj.get("eep").toString())); + jsonObj.get("q").toString())); } } diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/TradeStreamsRequest.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/TradeStreamsRequest.java index 0fb60b25b..7c699e8d0 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/TradeStreamsRequest.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/TradeStreamsRequest.java @@ -43,7 +43,7 @@ public class TradeStreamsRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_ID) @jakarta.annotation.Nullable - private String id; + private Integer id; public static final String SERIALIZED_NAME_SYMBOL = "symbol"; @@ -53,7 +53,7 @@ public class TradeStreamsRequest extends BaseDTO { public TradeStreamsRequest() {} - public TradeStreamsRequest id(@jakarta.annotation.Nullable String id) { + public TradeStreamsRequest id(@jakarta.annotation.Nullable Integer id) { this.id = id; return this; } @@ -64,11 +64,11 @@ public TradeStreamsRequest id(@jakarta.annotation.Nullable String id) { * @return id */ @jakarta.annotation.Nullable - public String getId() { + public Integer getId() { return id; } - public void setId(@jakarta.annotation.Nullable String id) { + public void setId(@jakarta.annotation.Nullable Integer id) { this.id = id; } @@ -124,7 +124,7 @@ public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); Map valMap = new TreeMap(); valMap.put("apiKey", getApiKey()); - String idValue = getId(); + Integer idValue = getId(); if (idValue != null) { String idValueAsString = idValue.toString(); valMap.put("id", idValueAsString); @@ -227,14 +227,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } if (!jsonObj.get("symbol").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/TradeStreamsResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/TradeStreamsResponse.java index 7c7576b91..49e74d35f 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/TradeStreamsResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/TradeStreamsResponse.java @@ -51,6 +51,12 @@ public class TradeStreamsResponse extends BaseDTO { @jakarta.annotation.Nullable private Long E; + public static final String SERIALIZED_NAME_T = "T"; + + @SerializedName(SERIALIZED_NAME_T) + @jakarta.annotation.Nullable + private Long T; + public static final String SERIALIZED_NAME_S_LOWER_CASE = "s"; @SerializedName(SERIALIZED_NAME_S_LOWER_CASE) @@ -61,7 +67,7 @@ public class TradeStreamsResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_T_LOWER_CASE) @jakarta.annotation.Nullable - private String tLowerCase; + private Long tLowerCase; public static final String SERIALIZED_NAME_P_LOWER_CASE = "p"; @@ -75,23 +81,11 @@ public class TradeStreamsResponse extends BaseDTO { @jakarta.annotation.Nullable private String qLowerCase; - public static final String SERIALIZED_NAME_B_LOWER_CASE = "b"; - - @SerializedName(SERIALIZED_NAME_B_LOWER_CASE) - @jakarta.annotation.Nullable - private Long bLowerCase; - - public static final String SERIALIZED_NAME_A_LOWER_CASE = "a"; - - @SerializedName(SERIALIZED_NAME_A_LOWER_CASE) - @jakarta.annotation.Nullable - private Long aLowerCase; - - public static final String SERIALIZED_NAME_T = "T"; + public static final String SERIALIZED_NAME_X = "X"; - @SerializedName(SERIALIZED_NAME_T) + @SerializedName(SERIALIZED_NAME_X) @jakarta.annotation.Nullable - private Long T; + private String X; public static final String SERIALIZED_NAME_S = "S"; @@ -99,11 +93,11 @@ public class TradeStreamsResponse extends BaseDTO { @jakarta.annotation.Nullable private String S; - public static final String SERIALIZED_NAME_X = "X"; + public static final String SERIALIZED_NAME_M_LOWER_CASE = "m"; - @SerializedName(SERIALIZED_NAME_X) + @SerializedName(SERIALIZED_NAME_M_LOWER_CASE) @jakarta.annotation.Nullable - private String X; + private Boolean mLowerCase; public TradeStreamsResponse() {} @@ -145,6 +139,25 @@ public void setE(@jakarta.annotation.Nullable Long E) { this.E = E; } + public TradeStreamsResponse T(@jakarta.annotation.Nullable Long T) { + this.T = T; + return this; + } + + /** + * Get T + * + * @return T + */ + @jakarta.annotation.Nullable + public Long getT() { + return T; + } + + public void setT(@jakarta.annotation.Nullable Long T) { + this.T = T; + } + public TradeStreamsResponse sLowerCase(@jakarta.annotation.Nullable String sLowerCase) { this.sLowerCase = sLowerCase; return this; @@ -164,7 +177,7 @@ public void setsLowerCase(@jakarta.annotation.Nullable String sLowerCase) { this.sLowerCase = sLowerCase; } - public TradeStreamsResponse tLowerCase(@jakarta.annotation.Nullable String tLowerCase) { + public TradeStreamsResponse tLowerCase(@jakarta.annotation.Nullable Long tLowerCase) { this.tLowerCase = tLowerCase; return this; } @@ -175,11 +188,11 @@ public TradeStreamsResponse tLowerCase(@jakarta.annotation.Nullable String tLowe * @return tLowerCase */ @jakarta.annotation.Nullable - public String gettLowerCase() { + public Long gettLowerCase() { return tLowerCase; } - public void settLowerCase(@jakarta.annotation.Nullable String tLowerCase) { + public void settLowerCase(@jakarta.annotation.Nullable Long tLowerCase) { this.tLowerCase = tLowerCase; } @@ -221,61 +234,23 @@ public void setqLowerCase(@jakarta.annotation.Nullable String qLowerCase) { this.qLowerCase = qLowerCase; } - public TradeStreamsResponse bLowerCase(@jakarta.annotation.Nullable Long bLowerCase) { - this.bLowerCase = bLowerCase; - return this; - } - - /** - * Get bLowerCase - * - * @return bLowerCase - */ - @jakarta.annotation.Nullable - public Long getbLowerCase() { - return bLowerCase; - } - - public void setbLowerCase(@jakarta.annotation.Nullable Long bLowerCase) { - this.bLowerCase = bLowerCase; - } - - public TradeStreamsResponse aLowerCase(@jakarta.annotation.Nullable Long aLowerCase) { - this.aLowerCase = aLowerCase; - return this; - } - - /** - * Get aLowerCase - * - * @return aLowerCase - */ - @jakarta.annotation.Nullable - public Long getaLowerCase() { - return aLowerCase; - } - - public void setaLowerCase(@jakarta.annotation.Nullable Long aLowerCase) { - this.aLowerCase = aLowerCase; - } - - public TradeStreamsResponse T(@jakarta.annotation.Nullable Long T) { - this.T = T; + public TradeStreamsResponse X(@jakarta.annotation.Nullable String X) { + this.X = X; return this; } /** - * Get T + * Get X * - * @return T + * @return X */ @jakarta.annotation.Nullable - public Long getT() { - return T; + public String getX() { + return X; } - public void setT(@jakarta.annotation.Nullable Long T) { - this.T = T; + public void setX(@jakarta.annotation.Nullable String X) { + this.X = X; } public TradeStreamsResponse S(@jakarta.annotation.Nullable String S) { @@ -297,23 +272,23 @@ public void setS(@jakarta.annotation.Nullable String S) { this.S = S; } - public TradeStreamsResponse X(@jakarta.annotation.Nullable String X) { - this.X = X; + public TradeStreamsResponse mLowerCase(@jakarta.annotation.Nullable Boolean mLowerCase) { + this.mLowerCase = mLowerCase; return this; } /** - * Get X + * Get mLowerCase * - * @return X + * @return mLowerCase */ @jakarta.annotation.Nullable - public String getX() { - return X; + public Boolean getmLowerCase() { + return mLowerCase; } - public void setX(@jakarta.annotation.Nullable String X) { - this.X = X; + public void setmLowerCase(@jakarta.annotation.Nullable Boolean mLowerCase) { + this.mLowerCase = mLowerCase; } @Override @@ -327,31 +302,20 @@ public boolean equals(Object o) { TradeStreamsResponse tradeStreamsResponse = (TradeStreamsResponse) o; return Objects.equals(this.eLowerCase, tradeStreamsResponse.eLowerCase) && Objects.equals(this.E, tradeStreamsResponse.E) + && Objects.equals(this.T, tradeStreamsResponse.T) && Objects.equals(this.sLowerCase, tradeStreamsResponse.sLowerCase) && Objects.equals(this.tLowerCase, tradeStreamsResponse.tLowerCase) && Objects.equals(this.pLowerCase, tradeStreamsResponse.pLowerCase) && Objects.equals(this.qLowerCase, tradeStreamsResponse.qLowerCase) - && Objects.equals(this.bLowerCase, tradeStreamsResponse.bLowerCase) - && Objects.equals(this.aLowerCase, tradeStreamsResponse.aLowerCase) - && Objects.equals(this.T, tradeStreamsResponse.T) + && Objects.equals(this.X, tradeStreamsResponse.X) && Objects.equals(this.S, tradeStreamsResponse.S) - && Objects.equals(this.X, tradeStreamsResponse.X); + && Objects.equals(this.mLowerCase, tradeStreamsResponse.mLowerCase); } @Override public int hashCode() { return Objects.hash( - eLowerCase, - E, - sLowerCase, - tLowerCase, - pLowerCase, - qLowerCase, - bLowerCase, - aLowerCase, - T, - S, - X); + eLowerCase, E, T, sLowerCase, tLowerCase, pLowerCase, qLowerCase, X, S, mLowerCase); } @Override @@ -360,15 +324,14 @@ public String toString() { sb.append("class TradeStreamsResponse {\n"); sb.append(" eLowerCase: ").append(toIndentedString(eLowerCase)).append("\n"); sb.append(" E: ").append(toIndentedString(E)).append("\n"); + sb.append(" T: ").append(toIndentedString(T)).append("\n"); sb.append(" sLowerCase: ").append(toIndentedString(sLowerCase)).append("\n"); sb.append(" tLowerCase: ").append(toIndentedString(tLowerCase)).append("\n"); sb.append(" pLowerCase: ").append(toIndentedString(pLowerCase)).append("\n"); sb.append(" qLowerCase: ").append(toIndentedString(qLowerCase)).append("\n"); - sb.append(" bLowerCase: ").append(toIndentedString(bLowerCase)).append("\n"); - sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); - sb.append(" T: ").append(toIndentedString(T)).append("\n"); - sb.append(" S: ").append(toIndentedString(S)).append("\n"); sb.append(" X: ").append(toIndentedString(X)).append("\n"); + sb.append(" S: ").append(toIndentedString(S)).append("\n"); + sb.append(" mLowerCase: ").append(toIndentedString(mLowerCase)).append("\n"); sb.append("}"); return sb.toString(); } @@ -387,12 +350,17 @@ public String toUrlQueryString() { String EValueAsString = EValue.toString(); valMap.put("E", EValueAsString); } + Long TValue = getT(); + if (TValue != null) { + String TValueAsString = TValue.toString(); + valMap.put("T", TValueAsString); + } String sLowerCaseValue = getsLowerCase(); if (sLowerCaseValue != null) { String sLowerCaseValueAsString = sLowerCaseValue.toString(); valMap.put("sLowerCase", sLowerCaseValueAsString); } - String tLowerCaseValue = gettLowerCase(); + Long tLowerCaseValue = gettLowerCase(); if (tLowerCaseValue != null) { String tLowerCaseValueAsString = tLowerCaseValue.toString(); valMap.put("tLowerCase", tLowerCaseValueAsString); @@ -407,30 +375,20 @@ public String toUrlQueryString() { String qLowerCaseValueAsString = qLowerCaseValue.toString(); valMap.put("qLowerCase", qLowerCaseValueAsString); } - Long bLowerCaseValue = getbLowerCase(); - if (bLowerCaseValue != null) { - String bLowerCaseValueAsString = bLowerCaseValue.toString(); - valMap.put("bLowerCase", bLowerCaseValueAsString); - } - Long aLowerCaseValue = getaLowerCase(); - if (aLowerCaseValue != null) { - String aLowerCaseValueAsString = aLowerCaseValue.toString(); - valMap.put("aLowerCase", aLowerCaseValueAsString); - } - Long TValue = getT(); - if (TValue != null) { - String TValueAsString = TValue.toString(); - valMap.put("T", TValueAsString); + String XValue = getX(); + if (XValue != null) { + String XValueAsString = XValue.toString(); + valMap.put("X", XValueAsString); } String SValue = getS(); if (SValue != null) { String SValueAsString = SValue.toString(); valMap.put("S", SValueAsString); } - String XValue = getX(); - if (XValue != null) { - String XValueAsString = XValue.toString(); - valMap.put("X", XValueAsString); + Boolean mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + String mLowerCaseValueAsString = mLowerCaseValue.toString(); + valMap.put("mLowerCase", mLowerCaseValueAsString); } valMap.put("timestamp", getTimestamp()); @@ -451,6 +409,10 @@ public Map toMap() { if (EValue != null) { valMap.put("E", EValue); } + Object TValue = getT(); + if (TValue != null) { + valMap.put("T", TValue); + } Object sLowerCaseValue = getsLowerCase(); if (sLowerCaseValue != null) { valMap.put("sLowerCase", sLowerCaseValue); @@ -467,25 +429,17 @@ public Map toMap() { if (qLowerCaseValue != null) { valMap.put("qLowerCase", qLowerCaseValue); } - Object bLowerCaseValue = getbLowerCase(); - if (bLowerCaseValue != null) { - valMap.put("bLowerCase", bLowerCaseValue); - } - Object aLowerCaseValue = getaLowerCase(); - if (aLowerCaseValue != null) { - valMap.put("aLowerCase", aLowerCaseValue); - } - Object TValue = getT(); - if (TValue != null) { - valMap.put("T", TValue); + Object XValue = getX(); + if (XValue != null) { + valMap.put("X", XValue); } Object SValue = getS(); if (SValue != null) { valMap.put("S", SValue); } - Object XValue = getX(); - if (XValue != null) { - valMap.put("X", XValue); + Object mLowerCaseValue = getmLowerCase(); + if (mLowerCaseValue != null) { + valMap.put("mLowerCase", mLowerCaseValue); } valMap.put("timestamp", getTimestamp()); @@ -515,15 +469,14 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("e"); openapiFields.add("E"); + openapiFields.add("T"); openapiFields.add("s"); openapiFields.add("t"); openapiFields.add("p"); openapiFields.add("q"); - openapiFields.add("b"); - openapiFields.add("a"); - openapiFields.add("T"); - openapiFields.add("S"); openapiFields.add("X"); + openapiFields.add("S"); + openapiFields.add("m"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -575,14 +528,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("s").toString())); } - if ((jsonObj.get("t") != null && !jsonObj.get("t").isJsonNull()) - && !jsonObj.get("t").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `t` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("t").toString())); - } if ((jsonObj.get("p") != null && !jsonObj.get("p").isJsonNull()) && !jsonObj.get("p").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -599,14 +544,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("q").toString())); } - if ((jsonObj.get("S") != null && !jsonObj.get("S").isJsonNull()) - && !jsonObj.get("S").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `S` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("S").toString())); - } if ((jsonObj.get("X") != null && !jsonObj.get("X").isJsonNull()) && !jsonObj.get("X").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -615,6 +552,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("X").toString())); } + if ((jsonObj.get("S") != null && !jsonObj.get("S").isJsonNull()) + && !jsonObj.get("S").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `S` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("S").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/UserDataStreamEventsResponse.java b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/UserDataStreamEventsResponse.java index 2ac1198e1..67b5a9847 100644 --- a/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/UserDataStreamEventsResponse.java +++ b/clients/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/model/UserDataStreamEventsResponse.java @@ -47,12 +47,16 @@ public TypeAdapter create(Gson gson, TypeToken type) { // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterAccountUpdate = - gson.getDelegateAdapter(this, TypeToken.get(AccountUpdate.class)); + final TypeAdapter adapterBalancePositionUpdate = + gson.getDelegateAdapter(this, TypeToken.get(BalancePositionUpdate.class)); + final TypeAdapter adapterGreekUpdate = + gson.getDelegateAdapter(this, TypeToken.get(GreekUpdate.class)); final TypeAdapter adapterOrderTradeUpdate = gson.getDelegateAdapter(this, TypeToken.get(OrderTradeUpdate.class)); final TypeAdapter adapterRiskLevelChange = gson.getDelegateAdapter(this, TypeToken.get(RiskLevelChange.class)); + final TypeAdapter adapterListenkeyexpired = + gson.getDelegateAdapter(this, TypeToken.get(Listenkeyexpired.class)); return (TypeAdapter) new TypeAdapter() { @@ -64,11 +68,19 @@ public void write(JsonWriter out, UserDataStreamEventsResponse value) return; } - // check if the actual instance is of the type `AccountUpdate` - if (value.getActualInstance() instanceof AccountUpdate) { + // check if the actual instance is of the type `BalancePositionUpdate` + if (value.getActualInstance() instanceof BalancePositionUpdate) { JsonElement element = - adapterAccountUpdate.toJsonTree( - (AccountUpdate) value.getActualInstance()); + adapterBalancePositionUpdate.toJsonTree( + (BalancePositionUpdate) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `GreekUpdate` + if (value.getActualInstance() instanceof GreekUpdate) { + JsonElement element = + adapterGreekUpdate.toJsonTree( + (GreekUpdate) value.getActualInstance()); elementAdapter.write(out, element); return; } @@ -88,9 +100,18 @@ public void write(JsonWriter out, UserDataStreamEventsResponse value) elementAdapter.write(out, element); return; } + // check if the actual instance is of the type `Listenkeyexpired` + if (value.getActualInstance() instanceof Listenkeyexpired) { + JsonElement element = + adapterListenkeyexpired.toJsonTree( + (Listenkeyexpired) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } throw new IOException( "Failed to serialize as the type doesn't match oneOf schemas:" - + " AccountUpdate, OrderTradeUpdate, RiskLevelChange"); + + " BalancePositionUpdate, GreekUpdate, Listenkeyexpired," + + " OrderTradeUpdate, RiskLevelChange"); } @Override @@ -112,9 +133,15 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { } else { // look up the discriminator value in the field `e` switch (jsonObject.get("e").getAsString()) { - case "ACCOUNT_UPDATE": + case "BALANCE_POSITION_UPDATE": deserialized = - adapterAccountUpdate.fromJsonTree(jsonObject); + adapterBalancePositionUpdate.fromJsonTree( + jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "GREEK_UPDATE": + deserialized = adapterGreekUpdate.fromJsonTree(jsonObject); newUserDataStreamEventsResponse.setActualInstance( deserialized); return newUserDataStreamEventsResponse; @@ -130,9 +157,27 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { newUserDataStreamEventsResponse.setActualInstance( deserialized); return newUserDataStreamEventsResponse; - case "accountUpdate": + case "listenKeyExpired": + deserialized = + adapterListenkeyexpired.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "balancePositionUpdate": + deserialized = + adapterBalancePositionUpdate.fromJsonTree( + jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "greekUpdate": + deserialized = adapterGreekUpdate.fromJsonTree(jsonObject); + newUserDataStreamEventsResponse.setActualInstance( + deserialized); + return newUserDataStreamEventsResponse; + case "listenkeyexpired": deserialized = - adapterAccountUpdate.fromJsonTree(jsonObject); + adapterListenkeyexpired.fromJsonTree(jsonObject); newUserDataStreamEventsResponse.setActualInstance( deserialized); return newUserDataStreamEventsResponse; @@ -156,11 +201,14 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { String.format( "Failed to lookup discriminator value `%s`" + " for UserDataStreamEventsResponse." - + " Possible values: ACCOUNT_UPDATE" - + " ORDER_TRADE_UPDATE" - + " RISK_LEVEL_CHANGE accountUpdate" - + " orderTradeUpdate riskLevelChange." - + " Falling back to String.", + + " Possible values:" + + " BALANCE_POSITION_UPDATE" + + " GREEK_UPDATE ORDER_TRADE_UPDATE" + + " RISK_LEVEL_CHANGE listenKeyExpired" + + " balancePositionUpdate greekUpdate" + + " listenkeyexpired orderTradeUpdate" + + " riskLevelChange. Falling back to" + + " String.", jsonObject.get("e").getAsString())); } } @@ -169,23 +217,43 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; - // deserialize AccountUpdate + // deserialize BalancePositionUpdate try { // validate the JSON object to see if any exception is thrown - AccountUpdate.validateJsonElement(jsonElement); - actualAdapter = adapterAccountUpdate; + BalancePositionUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterBalancePositionUpdate; match++; - log.log(Level.FINER, "Input data matches schema 'AccountUpdate'"); + log.log( + Level.FINER, + "Input data matches schema 'BalancePositionUpdate'"); } catch (Exception e) { // deserialization failed, continue errorMessages.add( String.format( - "Deserialization for AccountUpdate failed with" - + " `%s`.", + "Deserialization for BalancePositionUpdate failed" + + " with `%s`.", e.getMessage())); log.log( Level.FINER, - "Input data does not match schema 'AccountUpdate'", + "Input data does not match schema 'BalancePositionUpdate'", + e); + } + // deserialize GreekUpdate + try { + // validate the JSON object to see if any exception is thrown + GreekUpdate.validateJsonElement(jsonElement); + actualAdapter = adapterGreekUpdate; + match++; + log.log(Level.FINER, "Input data matches schema 'GreekUpdate'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for GreekUpdate failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'GreekUpdate'", e); } // deserialize OrderTradeUpdate @@ -228,6 +296,27 @@ public UserDataStreamEventsResponse read(JsonReader in) throws IOException { "Input data does not match schema 'RiskLevelChange'", e); } + // deserialize Listenkeyexpired + try { + // validate the JSON object to see if any exception is thrown + Listenkeyexpired.validateJsonElement(jsonElement); + actualAdapter = adapterListenkeyexpired; + match++; + log.log( + Level.FINER, + "Input data matches schema 'Listenkeyexpired'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for Listenkeyexpired failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'Listenkeyexpired'", + e); + } if (match == 1) { UserDataStreamEventsResponse ret = @@ -261,9 +350,11 @@ public UserDataStreamEventsResponse(Object o) { } static { - schemas.put("AccountUpdate", AccountUpdate.class); + schemas.put("BalancePositionUpdate", BalancePositionUpdate.class); + schemas.put("GreekUpdate", GreekUpdate.class); schemas.put("OrderTradeUpdate", OrderTradeUpdate.class); schemas.put("RiskLevelChange", RiskLevelChange.class); + schemas.put("Listenkeyexpired", Listenkeyexpired.class); } @Override @@ -273,13 +364,19 @@ public Map> getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: AccountUpdate, OrderTradeUpdate, RiskLevelChange + * against the oneOf child schemas: BalancePositionUpdate, GreekUpdate, Listenkeyexpired, + * OrderTradeUpdate, RiskLevelChange * *

It could be an instance of the 'oneOf' schemas. */ @Override public void setActualInstance(Object instance) { - if (instance instanceof AccountUpdate) { + if (instance instanceof BalancePositionUpdate) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GreekUpdate) { super.setActualInstance(instance); return; } @@ -294,15 +391,22 @@ public void setActualInstance(Object instance) { return; } + if (instance instanceof Listenkeyexpired) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( - "Invalid instance type. Must be AccountUpdate, OrderTradeUpdate, RiskLevelChange"); + "Invalid instance type. Must be BalancePositionUpdate, GreekUpdate," + + " Listenkeyexpired, OrderTradeUpdate, RiskLevelChange"); } /** - * Get the actual instance, which can be the following: AccountUpdate, OrderTradeUpdate, - * RiskLevelChange + * Get the actual instance, which can be the following: BalancePositionUpdate, GreekUpdate, + * Listenkeyexpired, OrderTradeUpdate, RiskLevelChange * - * @return The actual instance (AccountUpdate, OrderTradeUpdate, RiskLevelChange) + * @return The actual instance (BalancePositionUpdate, GreekUpdate, Listenkeyexpired, + * OrderTradeUpdate, RiskLevelChange) */ @SuppressWarnings("unchecked") @Override @@ -311,14 +415,25 @@ public Object getActualInstance() { } /** - * Get the actual instance of `AccountUpdate`. If the actual instance is not `AccountUpdate`, - * the ClassCastException will be thrown. + * Get the actual instance of `BalancePositionUpdate`. If the actual instance is not + * `BalancePositionUpdate`, the ClassCastException will be thrown. + * + * @return The actual instance of `BalancePositionUpdate` + * @throws ClassCastException if the instance is not `BalancePositionUpdate` + */ + public BalancePositionUpdate getBalancePositionUpdate() throws ClassCastException { + return (BalancePositionUpdate) super.getActualInstance(); + } + + /** + * Get the actual instance of `GreekUpdate`. If the actual instance is not `GreekUpdate`, the + * ClassCastException will be thrown. * - * @return The actual instance of `AccountUpdate` - * @throws ClassCastException if the instance is not `AccountUpdate` + * @return The actual instance of `GreekUpdate` + * @throws ClassCastException if the instance is not `GreekUpdate` */ - public AccountUpdate getAccountUpdate() throws ClassCastException { - return (AccountUpdate) super.getActualInstance(); + public GreekUpdate getGreekUpdate() throws ClassCastException { + return (GreekUpdate) super.getActualInstance(); } /** @@ -343,6 +458,17 @@ public RiskLevelChange getRiskLevelChange() throws ClassCastException { return (RiskLevelChange) super.getActualInstance(); } + /** + * Get the actual instance of `Listenkeyexpired`. If the actual instance is not + * `Listenkeyexpired`, the ClassCastException will be thrown. + * + * @return The actual instance of `Listenkeyexpired` + * @throws ClassCastException if the instance is not `Listenkeyexpired` + */ + public Listenkeyexpired getListenkeyexpired() throws ClassCastException { + return (Listenkeyexpired) super.getActualInstance(); + } + /** * Validates the JSON Element and throws an exception if issues found * @@ -354,14 +480,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate oneOf schemas one by one int validCount = 0; ArrayList errorMessages = new ArrayList<>(); - // validate the json string with AccountUpdate + // validate the json string with BalancePositionUpdate try { - AccountUpdate.validateJsonElement(jsonElement); + BalancePositionUpdate.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { errorMessages.add( String.format( - "Deserialization for AccountUpdate failed with `%s`.", e.getMessage())); + "Deserialization for BalancePositionUpdate failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with GreekUpdate + try { + GreekUpdate.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for GreekUpdate failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with OrderTradeUpdate @@ -386,13 +523,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti e.getMessage())); // continue to the next one } + // validate the json string with Listenkeyexpired + try { + Listenkeyexpired.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for Listenkeyexpired failed with `%s`.", + e.getMessage())); + // continue to the next one + } if (validCount != 1) { throw new IOException( String.format( "The JSON string is invalid for UserDataStreamEventsResponse with oneOf" - + " schemas: AccountUpdate, OrderTradeUpdate, RiskLevelChange. %d" - + " class(es) match the result, expected 1. Detailed failure" - + " message for oneOf schemas: %s. JSON: %s", + + " schemas: BalancePositionUpdate, GreekUpdate, Listenkeyexpired," + + " OrderTradeUpdate, RiskLevelChange. %d class(es) match the" + + " result, expected 1. Detailed failure message for oneOf schemas:" + + " %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); } } diff --git a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApiTest.java b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApiTest.java index cb8a495d3..5f57892ec 100644 --- a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApiTest.java +++ b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/AccountApiTest.java @@ -24,9 +24,6 @@ import com.binance.connector.client.common.sign.HmacSignatureGenerator; import com.binance.connector.client.common.sign.SignatureGenerator; import com.binance.connector.client.derivatives_trading_options.rest.model.AccountFundingFlowResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.GetDownloadIdForOptionTransactionHistoryResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.GetOptionTransactionHistoryDownloadLinkByIdResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.OptionAccountInformationResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OptionMarginAccountInformationResponse; import jakarta.validation.constraints.*; import okhttp3.Call; @@ -107,116 +104,12 @@ public void accountFundingFlowTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); + assertEquals("currency=&recordId=1&startTime=1623319461670&endTime=1641782889000&limit=100&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "currency=&recordId=1&startTime=1623319461670&endTime=1641782889000&limit=100&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "f0086e9f3895b2783af30133a64c5d01c9b045c0032c9eea19078ecf24771e9d", - actualRequest.url().queryParameter("signature")); + "f0086e9f3895b2783af30133a64c5d01c9b045c0032c9eea19078ecf24771e9d", actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/bill", actualRequest.url().encodedPath()); } - /** - * Get Download Id For Option Transaction History (USER_DATA) - * - *

Get download id for option transaction history * Request Limitation is 5 times per month, - * shared by > front end download page and rest api * The time between `startTime` - * and `endTime` can not be longer than 1 year Weight: 5 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getDownloadIdForOptionTransactionHistoryTest() - throws ApiException, CryptoException { - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; - Long recvWindow = 5000L; - ApiResponse response = - api.getDownloadIdForOptionTransactionHistory(startTime, endTime, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "startTime=1623319461670&endTime=1641782889000&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "812caedbe8f349196a4532c2050ff706ed2569fed185039c7b60a78cd84bc718", - actualRequest.url().queryParameter("signature")); - assertEquals("/eapi/v1/income/asyn", actualRequest.url().encodedPath()); - } - - /** - * Get Option Transaction History Download Link by Id (USER_DATA) - * - *

Get option transaction history download Link by Id * Download link expiration: 24h Weight: - * 5 - * - * @throws ApiException if the Api call fails - */ - @Test - public void getOptionTransactionHistoryDownloadLinkByIdTest() - throws ApiException, CryptoException { - String downloadId = "1"; - Long recvWindow = 5000L; - ApiResponse response = - api.getOptionTransactionHistoryDownloadLinkById(downloadId, recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals( - "downloadId=1&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); - assertEquals( - "4947fe463a17e3ec0b50fc22b21afc2aafddf3da892fa0c8dfd1b9c50af87349", - actualRequest.url().queryParameter("signature")); - assertEquals("/eapi/v1/income/asyn/id", actualRequest.url().encodedPath()); - } - - /** - * Option Account Information(TRADE) - * - *

Get current account information. Weight: 3 - * - * @throws ApiException if the Api call fails - */ - @Test - public void optionAccountInformationTest() throws ApiException, CryptoException { - Long recvWindow = 5000L; - ApiResponse response = - api.optionAccountInformation(recvWindow); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); - Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals("recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); - assertEquals( - "2cdd1e484bce80021437bee6b762e6a276b1954c3a0c011a16f6f2f6a47aba75", - actualRequest.url().queryParameter("signature")); - assertEquals("/eapi/v1/account", actualRequest.url().encodedPath()); - } - /** * Option Margin Account Information (USER_DATA) * diff --git a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApiTest.java b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApiTest.java index febad351a..daf347ef2 100644 --- a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApiTest.java +++ b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketDataApiTest.java @@ -26,15 +26,13 @@ import com.binance.connector.client.derivatives_trading_options.rest.model.CheckServerTimeResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.ExchangeInformationResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.HistoricalExerciseRecordsResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.IndexPriceTickerResponse; +import com.binance.connector.client.derivatives_trading_options.rest.model.IndexPriceResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.KlineCandlestickDataResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.OldTradesLookupResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OpenInterestResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OptionMarkPriceResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.OrderBookResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.RecentBlockTradesListResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.RecentTradesListResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.SymbolPriceTickerResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.Ticker24hrPriceChangeStatisticsResponse; import jakarta.validation.constraints.*; import okhttp3.Call; @@ -105,7 +103,8 @@ public void checkServerTimeTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals(null, actualRequest.url().queryParameter("signature")); + assertEquals( + null, actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/time", actualRequest.url().encodedPath()); } @@ -127,7 +126,8 @@ public void exchangeInformationTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals(null, actualRequest.url().queryParameter("signature")); + assertEquals( + null, actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/exchangeInfo", actualRequest.url().encodedPath()); } @@ -155,27 +155,23 @@ public void historicalExerciseRecordsTest() throws ApiException, CryptoException Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals(null, actualRequest.url().queryParameter("signature")); + assertEquals( + null, + actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/exerciseHistory", actualRequest.url().encodedPath()); } /** - * Kline/Candlestick Data + * Index Price * - *

Kline/candlestick bars for an option symbol. Klines are uniquely identified by their open - * time. * If startTime and endTime are not sent, the most recent klines are returned. Weight: 1 + *

Get spot index price for option underlying. Weight: 1 * * @throws ApiException if the Api call fails */ @Test - public void klineCandlestickDataTest() throws ApiException, CryptoException { - String symbol = ""; - String interval = ""; - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; - Long limit = 100L; - ApiResponse response = - api.klineCandlestickData(symbol, interval, startTime, endTime, limit); + public void indexPriceTest() throws ApiException, CryptoException { + String underlying = ""; + ApiResponse response = api.indexPrice(underlying); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -185,22 +181,26 @@ public void klineCandlestickDataTest() throws ApiException, CryptoException { Request actualRequest = captorValue.request(); assertEquals(null, actualRequest.url().queryParameter("signature")); - assertEquals("/eapi/v1/klines", actualRequest.url().encodedPath()); + assertEquals("/eapi/v1/index", actualRequest.url().encodedPath()); } /** - * Old Trades Lookup (MARKET_DATA) + * Kline/Candlestick Data * - *

Get older market historical trades. Weight: 20 + *

Kline/candlestick bars for an option symbol. Klines are uniquely identified by their open + * time. * If startTime and endTime are not sent, the most recent klines are returned. Weight: 1 * * @throws ApiException if the Api call fails */ @Test - public void oldTradesLookupTest() throws ApiException, CryptoException { + public void klineCandlestickDataTest() throws ApiException, CryptoException { String symbol = ""; - Long fromId = 1L; + String interval = ""; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; Long limit = 100L; - ApiResponse response = api.oldTradesLookup(symbol, fromId, limit); + ApiResponse response = + api.klineCandlestickData(symbol, interval, startTime, endTime, limit); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -209,8 +209,10 @@ public void oldTradesLookupTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals(null, actualRequest.url().queryParameter("signature")); - assertEquals("/eapi/v1/historicalTrades", actualRequest.url().encodedPath()); + assertEquals( + null, + actualRequest.url().queryParameter("signature")); + assertEquals("/eapi/v1/klines", actualRequest.url().encodedPath()); } /** @@ -256,7 +258,8 @@ public void optionMarkPriceTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals(null, actualRequest.url().queryParameter("signature")); + assertEquals( + null, actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/mark", actualRequest.url().encodedPath()); } @@ -264,7 +267,7 @@ public void optionMarkPriceTest() throws ApiException, CryptoException { * Order Book * *

Check orderbook depth on specific symbol Weight: limit | weight ------------ | - * ------------ 5, 10, 20, 50 | 2 100 | 5 500 | 10 1000 | 20 + * ------------ 5, 10, 20, 50 | 1 100 | 5 500 | 10 1000 | 20 * * @throws ApiException if the Api call fails */ @@ -306,7 +309,9 @@ public void recentBlockTradesListTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals(null, actualRequest.url().queryParameter("signature")); + assertEquals( + null, + actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/blockTrades", actualRequest.url().encodedPath()); } @@ -330,33 +335,11 @@ public void recentTradesListTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals(null, actualRequest.url().queryParameter("signature")); + assertEquals( + null, actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/trades", actualRequest.url().encodedPath()); } - /** - * Symbol Price Ticker - * - *

Get spot index price for option underlying. Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void symbolPriceTickerTest() throws ApiException, CryptoException { - String underlying = ""; - ApiResponse response = api.indexPriceTicker(underlying); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals(null, actualRequest.url().queryParameter("signature")); - assertEquals("/eapi/v1/index", actualRequest.url().encodedPath()); - } - /** * Test Connectivity * @@ -374,7 +357,8 @@ public void testConnectivityTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals(null, actualRequest.url().queryParameter("signature")); + assertEquals( + null, actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/ping", actualRequest.url().encodedPath()); } @@ -398,7 +382,9 @@ public void ticker24hrPriceChangeStatisticsTest() throws ApiException, CryptoExc Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals(null, actualRequest.url().queryParameter("signature")); + assertEquals( + null, + actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/ticker", actualRequest.url().encodedPath()); } } diff --git a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApiTest.java b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApiTest.java index c2addc373..acc72339a 100644 --- a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApiTest.java +++ b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerBlockTradeApiTest.java @@ -33,8 +33,6 @@ import com.binance.connector.client.derivatives_trading_options.rest.model.NewBlockTradeOrderResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.QueryBlockTradeDetailsResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.QueryBlockTradeOrderResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.Side; -import jakarta.validation.constraints.*; import okhttp3.Call; import okhttp3.Request; import org.bouncycastle.crypto.CryptoException; @@ -43,7 +41,7 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mockito; -/** API tests for MarketMakerBlockTradeApi */ +/** API tests for BlockTradeApi */ public class MarketMakerBlockTradeApiTest { private MarketMakerBlockTradeApi api; @@ -96,7 +94,6 @@ public void initApiClient() throws ApiException { public void acceptBlockTradeOrderTest() throws ApiException, CryptoException { AcceptBlockTradeOrderRequest acceptBlockTradeOrderRequest = new AcceptBlockTradeOrderRequest(); - acceptBlockTradeOrderRequest.blockOrderMatchingKey(""); ApiResponse response = @@ -141,13 +138,10 @@ public void accountBlockTradeListTest() throws ApiException, CryptoException { ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); - Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals( - "endTime=1641782889000&startTime=1623319461670&underlying=&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); + assertEquals("endTime=1641782889000&startTime=1623319461670&underlying=&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( "933e8ed3a3cfc481c957b452740b714628caeb1ad91262ed96e251eff4b8bd3f", actualRequest.url().queryParameter("signature")); @@ -176,9 +170,7 @@ public void cancelBlockTradeOrderTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals( - "blockOrderMatchingKey=&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); + assertEquals("blockOrderMatchingKey=&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( "ae708c39578286d9f327c8abc95624dc3cc9d4999587112e264986264a52088a", actualRequest.url().queryParameter("signature")); @@ -196,7 +188,6 @@ public void cancelBlockTradeOrderTest() throws ApiException, CryptoException { public void extendBlockTradeOrderTest() throws ApiException, CryptoException { ExtendBlockTradeOrderRequest extendBlockTradeOrderRequest = new ExtendBlockTradeOrderRequest(); - extendBlockTradeOrderRequest.blockOrderMatchingKey(""); ApiResponse response = @@ -229,7 +220,6 @@ public void extendBlockTradeOrderTest() throws ApiException, CryptoException { @Test public void newBlockTradeOrderTest() throws ApiException, CryptoException { NewBlockTradeOrderRequest newBlockTradeOrderRequest = new NewBlockTradeOrderRequest(); - newBlockTradeOrderRequest.liquidity(""); newBlockTradeOrderRequest.legs(new Legs()); @@ -246,12 +236,9 @@ public void newBlockTradeOrderTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); + assertEquals("timestamp=1736393892000legs=%5B%5D&liquidity=", signInputCaptor.getValue()); assertEquals( - "timestamp=1736393892000legs=%5B%5D&liquidity=", - signInputCaptor.getValue()); - assertEquals( - "bfcdb97917945619131835baab3105074db01c428177e5af5122331605bf3cb8", - actualRequest.url().queryParameter("signature")); + "bfcdb97917945619131835baab3105074db01c428177e5af5122331605bf3cb8", actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/block/order/create", actualRequest.url().encodedPath()); } @@ -280,9 +267,7 @@ public void queryBlockTradeDetailsTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals( - "blockOrderMatchingKey=&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); + assertEquals("blockOrderMatchingKey=&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( "ae708c39578286d9f327c8abc95624dc3cc9d4999587112e264986264a52088a", actualRequest.url().queryParameter("signature")); @@ -317,9 +302,7 @@ public void queryBlockTradeOrderTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals( - "blockOrderMatchingKey=&endTime=1641782889000&startTime=1623319461670&underlying=&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); + assertEquals("blockOrderMatchingKey=&endTime=1641782889000&startTime=1623319461670&underlying=&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( "12052ae669c254b370aeed981dae5ab6e617de9427448d3232d92d0506899440", actualRequest.url().queryParameter("signature")); diff --git a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApiTest.java b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApiTest.java index 942731443..ce3f44622 100644 --- a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApiTest.java +++ b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/MarketMakerEndpointsApiTest.java @@ -27,7 +27,6 @@ import com.binance.connector.client.derivatives_trading_options.rest.model.AutoCancelAllOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.GetAutoCancelAllOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.GetMarketMakerProtectionConfigResponse; -import com.binance.connector.client.derivatives_trading_options.rest.model.OptionMarginAccountInformationResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.ResetMarketMakerProtectionConfigRequest; import com.binance.connector.client.derivatives_trading_options.rest.model.ResetMarketMakerProtectionConfigResponse; import com.binance.connector.client.derivatives_trading_options.rest.model.SetAutoCancelAllOpenOrdersRequest; @@ -100,7 +99,6 @@ public void initApiClient() throws ApiException { public void autoCancelAllOpenOrdersTest() throws ApiException, CryptoException { AutoCancelAllOpenOrdersRequest autoCancelAllOpenOrdersRequest = new AutoCancelAllOpenOrdersRequest(); - autoCancelAllOpenOrdersRequest.underlyings(""); ApiResponse response = @@ -151,8 +149,7 @@ public void getAutoCancelAllOpenOrdersTest() throws ApiException, CryptoExceptio Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals( - "underlying=&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); + assertEquals("underlying=&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( "b86106356cee58da83b1db58af2ff785ff31edb20e817cebe1782f91df7ddc12", actualRequest.url().queryParameter("signature")); @@ -183,8 +180,7 @@ public void getMarketMakerProtectionConfigTest() throws ApiException, CryptoExce Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals( - "underlying=&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); + assertEquals("underlying=&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( "b86106356cee58da83b1db58af2ff785ff31edb20e817cebe1782f91df7ddc12", actualRequest.url().queryParameter("signature")); @@ -216,7 +212,8 @@ public void resetMarketMakerProtectionConfigTest() throws ApiException, CryptoEx Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals("timestamp=1736393892000", signInputCaptor.getValue()); + assertEquals( + "timestamp=1736393892000", signInputCaptor.getValue()); assertEquals( "53668e00dc92eb93de0b253c301e9fc0c20042b13db384a0ad94b38688a5a84c", actualRequest.url().queryParameter("signature")); @@ -248,7 +245,6 @@ public void resetMarketMakerProtectionConfigTest() throws ApiException, CryptoEx public void setAutoCancelAllOpenOrdersTest() throws ApiException, CryptoException { SetAutoCancelAllOpenOrdersRequest setAutoCancelAllOpenOrdersRequest = new SetAutoCancelAllOpenOrdersRequest(); - setAutoCancelAllOpenOrdersRequest.underlying(""); setAutoCancelAllOpenOrdersRequest.countdownTime(0L); @@ -265,8 +261,7 @@ public void setAutoCancelAllOpenOrdersTest() throws ApiException, CryptoExceptio Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals( - "timestamp=1736393892000countdownTime=0&underlying=", signInputCaptor.getValue()); + assertEquals("timestamp=1736393892000countdownTime=0&underlying=", signInputCaptor.getValue()); assertEquals( "3ea20362d32987f98f76e76f49289f7848b16910aefdb250e574f5dd050aad4a", actualRequest.url().queryParameter("signature")); diff --git a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApiTest.java b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApiTest.java index 66fe355d6..f9eacec8d 100644 --- a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApiTest.java +++ b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/TradeApiTest.java @@ -121,12 +121,9 @@ public void accountTradeListTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); + assertEquals("symbol=&fromId=1&startTime=1623319461670&endTime=1641782889000&limit=100&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "symbol=&fromId=1&startTime=1623319461670&endTime=1641782889000&limit=100&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "e6c675628031b06a2cee642f08dd8c2ef4f300380d1b62eeeb68aa3dd76194f1", - actualRequest.url().queryParameter("signature")); + "e6c675628031b06a2cee642f08dd8c2ef4f300380d1b62eeeb68aa3dd76194f1", actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/userTrades", actualRequest.url().encodedPath()); } @@ -165,7 +162,7 @@ public void cancelAllOptionOrdersByUnderlyingTest() throws ApiException, CryptoE /** * Cancel all Option orders on specific symbol (TRADE) * - *

Cancel all active order on a symbol. Weight: 1 + *

Cancel all active order on a symbol. Weight: 5 * * @throws ApiException if the Api call fails */ @@ -186,11 +183,14 @@ public void cancelAllOptionOrdersOnSpecificSymbolTest() throws ApiException, Cry Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals("symbol=&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); + assertEquals( + "symbol=&recvWindow=5000×tamp=1736393892000", + signInputCaptor.getValue()); assertEquals( "db1a455af0a2e82b4ec79595d994eb2e7f6b8a93c91a67a2aa59e2b2eae4bc68", actualRequest.url().queryParameter("signature")); - assertEquals("/eapi/v1/allOpenOrders", actualRequest.url().encodedPath()); + assertEquals( + "/eapi/v1/allOpenOrders", actualRequest.url().encodedPath()); } /** @@ -254,12 +254,9 @@ public void cancelOptionOrderTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); + assertEquals("symbol=&orderId=1&clientOrderId=1&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "symbol=&orderId=1&clientOrderId=1&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "22bb4aab5007bdfe2006035e30f7f5fe51b409e0fd3e500e4d31970b67154176", - actualRequest.url().queryParameter("signature")); + "22bb4aab5007bdfe2006035e30f7f5fe51b409e0fd3e500e4d31970b67154176", actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/order", actualRequest.url().encodedPath()); } @@ -273,11 +270,10 @@ public void cancelOptionOrderTest() throws ApiException, CryptoException { @Test public void newOrderTest() throws ApiException, CryptoException { NewOrderRequest newOrderRequest = new NewOrderRequest(); - newOrderRequest.symbol(""); newOrderRequest.side(Side.BUY); newOrderRequest.type(Type.LIMIT); - newOrderRequest.quantity(1d); + newOrderRequest.quantity(1.0d); ApiResponse response = api.newOrder(newOrderRequest); @@ -291,12 +287,8 @@ public void newOrderTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals( - "timestamp=1736393892000symbol=&side=BUY&quantity=1&type=LIMIT", - signInputCaptor.getValue()); - assertEquals( - "bd7c3ca01fc9cf18bcbcb549be33525c3f9d56758986c3b229f2a0784fdf9232", - actualRequest.url().queryParameter("signature")); + assertEquals("timestamp=1736393892000symbol=&side=BUY&quantity=1&type=LIMIT", signInputCaptor.getValue()); + assertEquals("bd7c3ca01fc9cf18bcbcb549be33525c3f9d56758986c3b229f2a0784fdf9232", actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/order", actualRequest.url().encodedPath()); } @@ -342,7 +334,6 @@ public void optionPositionInformationTest() throws ApiException, CryptoException @Test public void placeMultipleOrdersTest() throws ApiException, CryptoException { PlaceMultipleOrdersRequest placeMultipleOrdersRequest = new PlaceMultipleOrdersRequest(); - placeMultipleOrdersRequest.orders(new Orders()); ApiResponse response = @@ -360,8 +351,7 @@ public void placeMultipleOrdersTest() throws ApiException, CryptoException { assertEquals("timestamp=1736393892000orders=%5B%5D", signInputCaptor.getValue()); assertEquals( - "f273926c44bae2debb7be2afff1b241effae47359ba75471bfd81910d65528e2", - actualRequest.url().queryParameter("signature")); + "f273926c44bae2debb7be2afff1b241effae47359ba75471bfd81910d65528e2", actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/batchOrders", actualRequest.url().encodedPath()); } @@ -381,8 +371,7 @@ public void queryCurrentOpenOptionOrdersTest() throws ApiException, CryptoExcept Long endTime = 1641782889000L; Long recvWindow = 5000L; ApiResponse response = - api.queryCurrentOpenOptionOrders( - symbol, orderId, startTime, endTime, recvWindow); + api.queryCurrentOpenOptionOrders(symbol, orderId, startTime, endTime, recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -394,9 +383,7 @@ public void queryCurrentOpenOptionOrdersTest() throws ApiException, CryptoExcept Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals( - "symbol=&orderId=1&startTime=1623319461670&endTime=1641782889000&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); + assertEquals("symbol=&orderId=1&startTime=1623319461670&endTime=1641782889000&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( "51e9f45d125dacba55909402a133899dd5f0956cd707d8d24ff372c34f5a8155", actualRequest.url().queryParameter("signature")); @@ -432,9 +419,7 @@ public void queryOptionOrderHistoryTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals( - "symbol=&orderId=1&startTime=1623319461670&endTime=1641782889000&limit=100&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); + assertEquals("symbol=&orderId=1&startTime=1623319461670&endTime=1641782889000&limit=100&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( "dc0808314025fc813dcde0328cd6754c982d28888760fc74b17e072087eb4895", actualRequest.url().queryParameter("signature")); @@ -470,12 +455,9 @@ public void querySingleOrderTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); + assertEquals("symbol=&orderId=1&clientOrderId=1&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "symbol=&orderId=1&clientOrderId=1&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "22bb4aab5007bdfe2006035e30f7f5fe51b409e0fd3e500e4d31970b67154176", - actualRequest.url().queryParameter("signature")); + "22bb4aab5007bdfe2006035e30f7f5fe51b409e0fd3e500e4d31970b67154176", actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/order", actualRequest.url().encodedPath()); } @@ -506,12 +488,9 @@ public void userExerciseRecordTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); + assertEquals("symbol=&startTime=1623319461670&endTime=1641782889000&limit=100&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "symbol=&startTime=1623319461670&endTime=1641782889000&limit=100&recvWindow=5000×tamp=1736393892000", - signInputCaptor.getValue()); - assertEquals( - "3d9795ecfdb1326d191e1c4777f0f21d3abe1b7efbde9431ba818a057bd1dd7f", - actualRequest.url().queryParameter("signature")); + "3d9795ecfdb1326d191e1c4777f0f21d3abe1b7efbde9431ba818a057bd1dd7f", actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/exerciseRecord", actualRequest.url().encodedPath()); } } diff --git a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApiTest.java b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApiTest.java index d0fddaa20..65928b4b1 100644 --- a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApiTest.java +++ b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/rest/api/UserDataStreamsApiTest.java @@ -92,7 +92,8 @@ public void closeUserDataStreamTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals(null, actualRequest.url().queryParameter("signature")); + assertEquals( + null, actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/listenKey", actualRequest.url().encodedPath()); } @@ -114,7 +115,9 @@ public void keepaliveUserDataStreamTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals(null, actualRequest.url().queryParameter("signature")); + assertEquals( + null, + actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/listenKey", actualRequest.url().encodedPath()); } @@ -138,7 +141,8 @@ public void startUserDataStreamTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals(null, actualRequest.url().queryParameter("signature")); + assertEquals( + null, actualRequest.url().queryParameter("signature")); assertEquals("/eapi/v1/listenKey", actualRequest.url().encodedPath()); } } diff --git a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/WebsocketMarketStreamsApiTest.java b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/MarketApiTest.java similarity index 53% rename from clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/WebsocketMarketStreamsApiTest.java rename to clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/MarketApiTest.java index fe4b3c11c..3446d5ada 100644 --- a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/WebsocketMarketStreamsApiTest.java +++ b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/MarketApiTest.java @@ -15,7 +15,6 @@ import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionWrapper; - import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO; import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; @@ -29,14 +28,7 @@ import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.NewSymbolInfoResponse; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.OpenInterestRequest; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.OpenInterestResponse; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.PartialBookDepthStreamsRequest; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.PartialBookDepthStreamsResponse; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourByUnderlyingAssetAndExpirationDataRequest; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourByUnderlyingAssetAndExpirationDataResponse; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourRequest; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourResponse; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.TradeStreamsRequest; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.TradeStreamsResponse; +import jakarta.validation.constraints.*; import java.io.File; import java.io.IOException; import java.net.URISyntaxException; @@ -45,7 +37,6 @@ import java.nio.file.Paths; import java.util.Set; import java.util.concurrent.CompletableFuture; - import org.eclipse.jetty.websocket.api.RemoteEndpoint; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.client.WebSocketClient; @@ -55,16 +46,16 @@ import org.mockito.Mockito; import org.skyscreamer.jsonassert.JSONAssert; -/** API tests for WebsocketMarketStreamsApi */ -public class WebsocketMarketStreamsApiTest { +/** API tests for MarketApi */ +public class MarketApiTest { - private WebsocketMarketStreamsApi api; + private MarketApi api; private StreamConnectionWrapper connectionSpy; private Session sessionMock; @BeforeEach public void initApiClient() throws Exception { - URL resource = WebsocketMarketStreamsApi.class.getResource("/test-ed25519-prv-key.pem"); + URL resource = MarketApi.class.getResource("/test-ed25519-prv-key.pem"); SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); signatureConfiguration.setApiKey("apiKey"); File file = new File(resource.toURI()); @@ -89,10 +80,11 @@ public void initApiClient() throws Exception { StreamConnectionWrapper connectionWrapper = new StreamConnectionWrapper(clientConfiguration, webSocketClient); connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); connectionSpy.connect(); - WebsocketMarketStreamsApi accountApi = new WebsocketMarketStreamsApi(connectionSpy); - api = Mockito.spy(accountApi); + MarketApi apiClient = new MarketApi(connectionSpy); + api = Mockito.spy(apiClient); Mockito.doReturn("eaf3292c-64b6-4c04-ad4f-4ca2608b42b4").when(api).getRequestID(); } @@ -107,8 +99,6 @@ public void initApiClient() throws Exception { public void indexPriceStreamsTest() throws ApiException, URISyntaxException, IOException { IndexPriceStreamsRequest indexPriceStreamsRequest = new IndexPriceStreamsRequest(); - indexPriceStreamsRequest.symbol("btcusdt"); - StreamBlockingQueueWrapper response = api.indexPriceStreams(indexPriceStreamsRequest); ArgumentCaptor, IndexPriceStreamsResponse>> @@ -124,8 +114,8 @@ public void indexPriceStreamsTest() throws ApiException, URISyntaxException, IOE String sentPayload = sendArgumentCaptor.getValue(); URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/symbol@index-test.json"); + MarketApiTest.class.getResource("/expected/stream/MarketApi/index@arr-test.json"); + String expectedJson = Files.readString(Paths.get(resource.toURI())); JSONAssert.assertEquals(expectedJson, sentPayload, true); } @@ -142,7 +132,6 @@ public void indexPriceStreamsTest() throws ApiException, URISyntaxException, IOE public void klineCandlestickStreamsTest() throws ApiException, URISyntaxException, IOException { KlineCandlestickStreamsRequest klineCandlestickStreamsRequest = new KlineCandlestickStreamsRequest(); - klineCandlestickStreamsRequest.symbol("btcusdt"); klineCandlestickStreamsRequest.interval("1m"); @@ -161,8 +150,9 @@ public void klineCandlestickStreamsTest() throws ApiException, URISyntaxExceptio String sentPayload = sendArgumentCaptor.getValue(); URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/symbol@kline_interval-test.json"); + MarketApiTest.class.getResource( + "/expected/stream/MarketApi/symbol@kline_interval-test.json"); + String expectedJson = Files.readString(Paths.get(resource.toURI())); JSONAssert.assertEquals(expectedJson, sentPayload, true); } @@ -171,7 +161,7 @@ public void klineCandlestickStreamsTest() throws ApiException, URISyntaxExceptio * Mark Price * *

The mark price for all option symbols on specific underlying asset. - * E.g.[ETH@markPrice](wss://nbstream.binance.com/eoptions/stream?streams=ETH@markPrice) + * E.g.[btcusdt@optionMarkPrice](wss://fstream.binance.com/market/stream?streams=btcusdt@optionMarkPrice) * Update Speed: 1000ms * * @throws ApiException if the Api call fails @@ -179,8 +169,7 @@ public void klineCandlestickStreamsTest() throws ApiException, URISyntaxExceptio @Test public void markPriceTest() throws ApiException, URISyntaxException, IOException { MarkPriceRequest markPriceRequest = new MarkPriceRequest(); - - markPriceRequest.underlyingAsset("ETH"); + markPriceRequest.underlying("example_value"); StreamBlockingQueueWrapper response = api.markPrice(markPriceRequest); ArgumentCaptor, MarkPriceResponse>> callArgumentCaptor = @@ -196,8 +185,9 @@ public void markPriceTest() throws ApiException, URISyntaxException, IOException String sentPayload = sendArgumentCaptor.getValue(); URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/underlyingAsset@markPrice-test.json"); + MarketApiTest.class.getResource( + "/expected/stream/MarketApi/underlying@optionMarkPrice-test.json"); + String expectedJson = Files.readString(Paths.get(resource.toURI())); JSONAssert.assertEquals(expectedJson, sentPayload, true); } @@ -228,8 +218,9 @@ public void newSymbolInfoTest() throws ApiException, URISyntaxException, IOExcep String sentPayload = sendArgumentCaptor.getValue(); URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/option_pair-test.json"); + MarketApiTest.class.getResource( + "/expected/stream/MarketApi/optionSymbol-test.json"); + String expectedJson = Files.readString(Paths.get(resource.toURI())); JSONAssert.assertEquals(expectedJson, sentPayload, true); } @@ -238,7 +229,7 @@ public void newSymbolInfoTest() throws ApiException, URISyntaxException, IOExcep * Open Interest * *

Option open interest for specific underlying asset on specific expiration date. - * E.g.[ETH@openInterest@221125](wss://nbstream.binance.com/eoptions/stream?streams=ETH@openInterest@221125) + * E.g.[ethusdt@openInterest@221125](wss://fstream.binance.com/market/stream?streams=ethusdt@openInterest@221125) * Update Speed: 60s * * @throws ApiException if the Api call fails @@ -246,8 +237,6 @@ public void newSymbolInfoTest() throws ApiException, URISyntaxException, IOExcep @Test public void openInterestTest() throws ApiException, URISyntaxException, IOException { OpenInterestRequest openInterestRequest = new OpenInterestRequest(); - - openInterestRequest.underlyingAsset("ETH"); openInterestRequest.expirationDate("220930"); StreamBlockingQueueWrapper response = @@ -265,162 +254,9 @@ public void openInterestTest() throws ApiException, URISyntaxException, IOExcept String sentPayload = sendArgumentCaptor.getValue(); URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/underlyingAsset@openInterest@expirationDate-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * Partial Book Depth Streams - * - *

Top **<levels\\>** bids and asks, Valid levels are **<levels\\>** are 10, 20, - * 50, 100. Update Speed: 100ms or 1000ms, 500ms(default when update speed isn't used) - * - * @throws ApiException if the Api call fails - */ - @Test - public void partialBookDepthStreamsTest() throws ApiException, URISyntaxException, IOException { - PartialBookDepthStreamsRequest partialBookDepthStreamsRequest = - new PartialBookDepthStreamsRequest(); - - partialBookDepthStreamsRequest.symbol("btcusdt"); - partialBookDepthStreamsRequest.levels(10L); - partialBookDepthStreamsRequest.updateSpeed("100ms"); - - StreamBlockingQueueWrapper response = - api.partialBookDepthStreams(partialBookDepthStreamsRequest); - ArgumentCaptor, PartialBookDepthStreamsResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, PartialBookDepthStreamsResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/symbol@depthlevelsupdateSpeed-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * 24-hour TICKER - * - *

24hr ticker info for all symbols. Only symbols whose ticker info changed will be sent. - * Update Speed: 1000ms - * - * @throws ApiException if the Api call fails - */ - @Test - public void ticker24HourTest() throws ApiException, URISyntaxException, IOException { - Ticker24HourRequest ticker24HourRequest = new Ticker24HourRequest(); - - ticker24HourRequest.symbol("btcusdt"); - - StreamBlockingQueueWrapper response = - api.ticker24Hour(ticker24HourRequest); - ArgumentCaptor, Ticker24HourResponse>> callArgumentCaptor = - ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, Ticker24HourResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/symbol@ticker-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * 24-hour TICKER by underlying asset and expiration data - * - *

24hr ticker info by underlying asset and expiration date. - * E.g.[ETH@ticker@220930](wss://nbstream.binance.com/eoptions/stream?streams=ETH@ticker@220930) - * Update Speed: 1000ms - * - * @throws ApiException if the Api call fails - */ - @Test - public void ticker24HourByUnderlyingAssetAndExpirationDataTest() - throws ApiException, URISyntaxException, IOException { - Ticker24HourByUnderlyingAssetAndExpirationDataRequest - ticker24HourByUnderlyingAssetAndExpirationDataRequest = - new Ticker24HourByUnderlyingAssetAndExpirationDataRequest(); + MarketApiTest.class.getResource( + "/expected/stream/MarketApi/underlying@optionOpenInterest@expirationDate-test.json"); - ticker24HourByUnderlyingAssetAndExpirationDataRequest.underlyingAsset("ETH"); - ticker24HourByUnderlyingAssetAndExpirationDataRequest.expirationDate("220930"); - - StreamBlockingQueueWrapper - response = - api.ticker24HourByUnderlyingAssetAndExpirationData( - ticker24HourByUnderlyingAssetAndExpirationDataRequest); - ArgumentCaptor< - RequestWrapperDTO< - Set, - Ticker24HourByUnderlyingAssetAndExpirationDataResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, Ticker24HourByUnderlyingAssetAndExpirationDataResponse> - requestWrapperDTO = callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/underlyingAsset@ticker@expirationDate-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * Trade Streams - * - *

The Trade Streams push raw trade information for specific symbol or underlying asset. - * E.g.[ETH@trade](wss://nbstream.binance.com/eoptions/stream?streams=ETH@trade) Update - * Speed: 50ms - * - * @throws ApiException if the Api call fails - */ - @Test - public void tradeStreamsTest() throws ApiException, URISyntaxException, IOException { - TradeStreamsRequest tradeStreamsRequest = new TradeStreamsRequest(); - - tradeStreamsRequest.symbol("btcusdt"); - - StreamBlockingQueueWrapper response = - api.tradeStreams(tradeStreamsRequest); - ArgumentCaptor, TradeStreamsResponse>> callArgumentCaptor = - ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, TradeStreamsResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/symbol@trade-test.json"); String expectedJson = Files.readString(Paths.get(resource.toURI())); JSONAssert.assertEquals(expectedJson, sentPayload, true); } diff --git a/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/PublicApiTest.java b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/PublicApiTest.java new file mode 100644 index 000000000..b3193c2e5 --- /dev/null +++ b/clients/derivatives-trading-options/src/test/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/api/PublicApiTest.java @@ -0,0 +1,271 @@ +/* + * Binance Derivatives Trading Options WebSocket Market Streams + * OpenAPI Specification for the Binance Derivatives Trading Options WebSocket Market Streams + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_options.websocket.stream.api; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionWrapper; +import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; +import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO; +import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.DiffBookDepthStreamsRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.DiffBookDepthStreamsResponse; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.IndividualSymbolBookTickerStreamsRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.IndividualSymbolBookTickerStreamsResponse; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.PartialBookDepthStreamsRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.PartialBookDepthStreamsResponse; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourResponse; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.TradeStreamsRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.TradeStreamsResponse; +import jakarta.validation.constraints.*; +import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Set; +import java.util.concurrent.CompletableFuture; +import org.eclipse.jetty.websocket.api.RemoteEndpoint; +import org.eclipse.jetty.websocket.api.Session; +import org.eclipse.jetty.websocket.client.WebSocketClient; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import org.skyscreamer.jsonassert.JSONAssert; + +/** API tests for PublicApi */ +public class PublicApiTest { + + private PublicApi api; + private StreamConnectionWrapper connectionSpy; + private Session sessionMock; + + @BeforeEach + public void initApiClient() throws Exception { + URL resource = PublicApi.class.getResource("/test-ed25519-prv-key.pem"); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + File file = new File(resource.toURI()); + signatureConfiguration.setPrivateKey(file.getAbsolutePath()); + WebSocketClientConfiguration clientConfiguration = new WebSocketClientConfiguration(); + // @TODO: run tests for LOGON as well + clientConfiguration.setAutoLogon(false); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + clientConfiguration.setUrl("wss://localhost:8080"); + + WebSocketClient webSocketClient = Mockito.mock(WebSocketClient.class); + CompletableFuture sessionCompletableFuture = new CompletableFuture<>(); + Mockito.doReturn(sessionCompletableFuture) + .when(webSocketClient) + .connect(Mockito.any(), Mockito.any(), Mockito.any()); + sessionMock = Mockito.mock(Session.class); + + RemoteEndpoint remoteEndpointMock = Mockito.mock(RemoteEndpoint.class); + Mockito.doReturn(remoteEndpointMock).when(sessionMock).getRemote(); + + sessionCompletableFuture.complete(sessionMock); + StreamConnectionWrapper connectionWrapper = + new StreamConnectionWrapper(clientConfiguration, webSocketClient); + connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); + Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); + connectionSpy.connect(); + PublicApi apiClient = new PublicApi(connectionSpy); + api = Mockito.spy(apiClient); + Mockito.doReturn("eaf3292c-64b6-4c04-ad4f-4ca2608b42b4").when(api).getRequestID(); + } + + /** + * Diff Book Depth Streams + * + *

Bids and asks, pushed every 500 milliseconds, 100 milliseconds (if existing) Update Speed: + * 100ms or 500ms + * + * @throws ApiException if the Api call fails + */ + @Test + public void diffBookDepthStreamsTest() throws ApiException, URISyntaxException, IOException { + DiffBookDepthStreamsRequest diffBookDepthStreamsRequest = new DiffBookDepthStreamsRequest(); + diffBookDepthStreamsRequest.symbol("btcusdt"); + diffBookDepthStreamsRequest.updateSpeed("100ms"); + + StreamBlockingQueueWrapper response = + api.diffBookDepthStreams(diffBookDepthStreamsRequest); + ArgumentCaptor, DiffBookDepthStreamsResponse>> + callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); + Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); + ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); + RemoteEndpoint remote = sessionMock.getRemote(); + Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); + RequestWrapperDTO, DiffBookDepthStreamsResponse> requestWrapperDTO = + callArgumentCaptor.getValue(); + Set params = requestWrapperDTO.getParams(); + // TODO: test validations + String sentPayload = sendArgumentCaptor.getValue(); + + URL resource = + PublicApiTest.class.getResource( + "/expected/stream/PublicApi/symbol@depth@updateSpeed-test.json"); + + String expectedJson = Files.readString(Paths.get(resource.toURI())); + JSONAssert.assertEquals(expectedJson, sentPayload, true); + } + + /** + * Individual Symbol Book Ticker Streams + * + *

Pushes any update to the best bid or ask's price or quantity in real-time for a + * specified symbol. Update Speed: Real-Time + * + * @throws ApiException if the Api call fails + */ + @Test + public void individualSymbolBookTickerStreamsTest() + throws ApiException, URISyntaxException, IOException { + IndividualSymbolBookTickerStreamsRequest individualSymbolBookTickerStreamsRequest = + new IndividualSymbolBookTickerStreamsRequest(); + individualSymbolBookTickerStreamsRequest.symbol("btcusdt"); + + StreamBlockingQueueWrapper response = + api.individualSymbolBookTickerStreams(individualSymbolBookTickerStreamsRequest); + ArgumentCaptor, IndividualSymbolBookTickerStreamsResponse>> + callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); + Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); + ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); + RemoteEndpoint remote = sessionMock.getRemote(); + Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); + RequestWrapperDTO, IndividualSymbolBookTickerStreamsResponse> + requestWrapperDTO = callArgumentCaptor.getValue(); + Set params = requestWrapperDTO.getParams(); + // TODO: test validations + String sentPayload = sendArgumentCaptor.getValue(); + + URL resource = + PublicApiTest.class.getResource( + "/expected/stream/PublicApi/symbol@bookTicker-test.json"); + + String expectedJson = Files.readString(Paths.get(resource.toURI())); + JSONAssert.assertEquals(expectedJson, sentPayload, true); + } + + /** + * Partial Book Depth Streams + * + *

Top **<levels\\>** bids and asks, Valid levels are **<levels\\>** are 5, 10, + * 20. Update Speed: 100ms 或 500ms + * + * @throws ApiException if the Api call fails + */ + @Test + public void partialBookDepthStreamsTest() throws ApiException, URISyntaxException, IOException { + PartialBookDepthStreamsRequest partialBookDepthStreamsRequest = + new PartialBookDepthStreamsRequest(); + partialBookDepthStreamsRequest.symbol("btcusdt"); + partialBookDepthStreamsRequest.level("example_value"); + + StreamBlockingQueueWrapper response = + api.partialBookDepthStreams(partialBookDepthStreamsRequest); + ArgumentCaptor, PartialBookDepthStreamsResponse>> + callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); + Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); + ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); + RemoteEndpoint remote = sessionMock.getRemote(); + Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); + RequestWrapperDTO, PartialBookDepthStreamsResponse> requestWrapperDTO = + callArgumentCaptor.getValue(); + Set params = requestWrapperDTO.getParams(); + // TODO: test validations + String sentPayload = sendArgumentCaptor.getValue(); + + URL resource = + PublicApiTest.class.getResource( + "/expected/stream/PublicApi/symbol@depthlevel@updateSpeed-test.json"); + + String expectedJson = Files.readString(Paths.get(resource.toURI())); + JSONAssert.assertEquals(expectedJson, sentPayload, true); + } + + /** + * 24-hour TICKER + * + *

24hr ticker info for all symbols. Only symbols whose ticker info changed will be sent. + * Update Speed: 1000ms + * + * @throws ApiException if the Api call fails + */ + @Test + public void ticker24HourTest() throws ApiException, URISyntaxException, IOException { + Ticker24HourRequest ticker24HourRequest = new Ticker24HourRequest(); + ticker24HourRequest.symbol("btcusdt"); + + StreamBlockingQueueWrapper response = + api.ticker24Hour(ticker24HourRequest); + ArgumentCaptor, Ticker24HourResponse>> callArgumentCaptor = + ArgumentCaptor.forClass(RequestWrapperDTO.class); + Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); + ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); + RemoteEndpoint remote = sessionMock.getRemote(); + Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); + RequestWrapperDTO, Ticker24HourResponse> requestWrapperDTO = + callArgumentCaptor.getValue(); + Set params = requestWrapperDTO.getParams(); + // TODO: test validations + String sentPayload = sendArgumentCaptor.getValue(); + + URL resource = + PublicApiTest.class.getResource( + "/expected/stream/PublicApi/symbol@optionTicker-test.json"); + + String expectedJson = Files.readString(Paths.get(resource.toURI())); + JSONAssert.assertEquals(expectedJson, sentPayload, true); + } + + /** + * Trade Streams + * + *

The Trade Streams push raw trade information for specific symbol or underlying asset. + * E.g.[btcusdt@optionTrade](wss://fstream.binance.com/public/stream?streams=btcusdt@optionTrade) + * Update Speed: 50ms + * + * @throws ApiException if the Api call fails + */ + @Test + public void tradeStreamsTest() throws ApiException, URISyntaxException, IOException { + TradeStreamsRequest tradeStreamsRequest = new TradeStreamsRequest(); + tradeStreamsRequest.symbol("btcusdt"); + + StreamBlockingQueueWrapper response = + api.tradeStreams(tradeStreamsRequest); + ArgumentCaptor, TradeStreamsResponse>> callArgumentCaptor = + ArgumentCaptor.forClass(RequestWrapperDTO.class); + Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); + ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); + RemoteEndpoint remote = sessionMock.getRemote(); + Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); + RequestWrapperDTO, TradeStreamsResponse> requestWrapperDTO = + callArgumentCaptor.getValue(); + Set params = requestWrapperDTO.getParams(); + // TODO: test validations + String sentPayload = sendArgumentCaptor.getValue(); + + URL resource = + PublicApiTest.class.getResource( + "/expected/stream/PublicApi/symbol@optionTrade-test.json"); + + String expectedJson = Files.readString(Paths.get(resource.toURI())); + JSONAssert.assertEquals(expectedJson, sentPayload, true); + } +} diff --git a/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/option_pair-test.json b/clients/derivatives-trading-options/src/test/resources/expected/stream/MarketApi/index@arr-test.json similarity index 84% rename from clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/option_pair-test.json rename to clients/derivatives-trading-options/src/test/resources/expected/stream/MarketApi/index@arr-test.json index 6d1a7dcc9..1d837adce 100644 --- a/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/option_pair-test.json +++ b/clients/derivatives-trading-options/src/test/resources/expected/stream/MarketApi/index@arr-test.json @@ -1,7 +1,7 @@ { "id": "eaf3292c-64b6-4c04-ad4f-4ca2608b42b4", "params": [ - "option_pair" + "!index@arr" ], "method": "SUBSCRIBE" } diff --git a/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/symbol@trade-test.json b/clients/derivatives-trading-options/src/test/resources/expected/stream/MarketApi/optionSymbol-test.json similarity index 82% rename from clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/symbol@trade-test.json rename to clients/derivatives-trading-options/src/test/resources/expected/stream/MarketApi/optionSymbol-test.json index bbec5aca7..1465fda05 100644 --- a/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/symbol@trade-test.json +++ b/clients/derivatives-trading-options/src/test/resources/expected/stream/MarketApi/optionSymbol-test.json @@ -1,7 +1,7 @@ { "id": "eaf3292c-64b6-4c04-ad4f-4ca2608b42b4", "params": [ - "btcusdt@trade" + "!optionSymbol" ], "method": "SUBSCRIBE" } diff --git a/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/symbol@kline_interval-test.json b/clients/derivatives-trading-options/src/test/resources/expected/stream/MarketApi/symbol@kline_interval-test.json similarity index 100% rename from clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/symbol@kline_interval-test.json rename to clients/derivatives-trading-options/src/test/resources/expected/stream/MarketApi/symbol@kline_interval-test.json diff --git a/clients/derivatives-trading-options/src/test/resources/expected/stream/MarketApi/underlying@optionMarkPrice-test.json b/clients/derivatives-trading-options/src/test/resources/expected/stream/MarketApi/underlying@optionMarkPrice-test.json new file mode 100644 index 000000000..89cc9fe5c --- /dev/null +++ b/clients/derivatives-trading-options/src/test/resources/expected/stream/MarketApi/underlying@optionMarkPrice-test.json @@ -0,0 +1,7 @@ +{ + "id": "eaf3292c-64b6-4c04-ad4f-4ca2608b42b4", + "params": [ + "example_value@optionMarkPrice" + ], + "method": "SUBSCRIBE" +} diff --git a/clients/derivatives-trading-options/src/test/resources/expected/stream/MarketApi/underlying@optionOpenInterest@expirationDate-test.json b/clients/derivatives-trading-options/src/test/resources/expected/stream/MarketApi/underlying@optionOpenInterest@expirationDate-test.json new file mode 100644 index 000000000..ab8a93017 --- /dev/null +++ b/clients/derivatives-trading-options/src/test/resources/expected/stream/MarketApi/underlying@optionOpenInterest@expirationDate-test.json @@ -0,0 +1,7 @@ +{ + "id": "eaf3292c-64b6-4c04-ad4f-4ca2608b42b4", + "params": [ + "underlying@optionOpenInterest@220930" + ], + "method": "SUBSCRIBE" +} diff --git a/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/symbol@index-test.json b/clients/derivatives-trading-options/src/test/resources/expected/stream/PublicApi/symbol@bookTicker-test.json similarity index 79% rename from clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/symbol@index-test.json rename to clients/derivatives-trading-options/src/test/resources/expected/stream/PublicApi/symbol@bookTicker-test.json index a4078540b..aaaa1a11d 100644 --- a/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/symbol@index-test.json +++ b/clients/derivatives-trading-options/src/test/resources/expected/stream/PublicApi/symbol@bookTicker-test.json @@ -1,7 +1,7 @@ { "id": "eaf3292c-64b6-4c04-ad4f-4ca2608b42b4", "params": [ - "btcusdt@index" + "btcusdt@bookTicker" ], "method": "SUBSCRIBE" } diff --git a/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/symbol@ticker-test.json b/clients/derivatives-trading-options/src/test/resources/expected/stream/PublicApi/symbol@depth@updateSpeed-test.json similarity index 78% rename from clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/symbol@ticker-test.json rename to clients/derivatives-trading-options/src/test/resources/expected/stream/PublicApi/symbol@depth@updateSpeed-test.json index b65aab349..2b0a72466 100644 --- a/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/symbol@ticker-test.json +++ b/clients/derivatives-trading-options/src/test/resources/expected/stream/PublicApi/symbol@depth@updateSpeed-test.json @@ -1,7 +1,7 @@ { "id": "eaf3292c-64b6-4c04-ad4f-4ca2608b42b4", "params": [ - "btcusdt@ticker" + "btcusdt@depth@100ms" ], "method": "SUBSCRIBE" } diff --git a/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/symbol@depthlevelsupdateSpeed-test.json b/clients/derivatives-trading-options/src/test/resources/expected/stream/PublicApi/symbol@depthlevel@updateSpeed-test.json similarity index 74% rename from clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/symbol@depthlevelsupdateSpeed-test.json rename to clients/derivatives-trading-options/src/test/resources/expected/stream/PublicApi/symbol@depthlevel@updateSpeed-test.json index 22321c9fc..bc5ba4517 100644 --- a/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/symbol@depthlevelsupdateSpeed-test.json +++ b/clients/derivatives-trading-options/src/test/resources/expected/stream/PublicApi/symbol@depthlevel@updateSpeed-test.json @@ -1,7 +1,7 @@ { "id": "eaf3292c-64b6-4c04-ad4f-4ca2608b42b4", "params": [ - "btcusdt@depth10@100ms" + "btcusdt@depthexample_value" ], "method": "SUBSCRIBE" } diff --git a/clients/derivatives-trading-options/src/test/resources/expected/stream/PublicApi/symbol@optionTicker-test.json b/clients/derivatives-trading-options/src/test/resources/expected/stream/PublicApi/symbol@optionTicker-test.json new file mode 100644 index 000000000..33fd15ba6 --- /dev/null +++ b/clients/derivatives-trading-options/src/test/resources/expected/stream/PublicApi/symbol@optionTicker-test.json @@ -0,0 +1,7 @@ +{ + "id": "eaf3292c-64b6-4c04-ad4f-4ca2608b42b4", + "params": [ + "btcusdt@optionTicker" + ], + "method": "SUBSCRIBE" +} diff --git a/clients/derivatives-trading-options/src/test/resources/expected/stream/PublicApi/symbol@optionTrade-test.json b/clients/derivatives-trading-options/src/test/resources/expected/stream/PublicApi/symbol@optionTrade-test.json new file mode 100644 index 000000000..da1f8eac3 --- /dev/null +++ b/clients/derivatives-trading-options/src/test/resources/expected/stream/PublicApi/symbol@optionTrade-test.json @@ -0,0 +1,7 @@ +{ + "id": "eaf3292c-64b6-4c04-ad4f-4ca2608b42b4", + "params": [ + "btcusdt@optionTrade" + ], + "method": "SUBSCRIBE" +} diff --git a/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/underlyingAsset@markPrice-test.json b/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/underlyingAsset@markPrice-test.json deleted file mode 100644 index 7c43d0237..000000000 --- a/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/underlyingAsset@markPrice-test.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "id": "eaf3292c-64b6-4c04-ad4f-4ca2608b42b4", - "params": [ - "ETH@markPrice" - ], - "method": "SUBSCRIBE" -} diff --git a/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/underlyingAsset@openInterest@expirationDate-test.json b/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/underlyingAsset@openInterest@expirationDate-test.json deleted file mode 100644 index 09db30d50..000000000 --- a/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/underlyingAsset@openInterest@expirationDate-test.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "id": "eaf3292c-64b6-4c04-ad4f-4ca2608b42b4", - "params": [ - "ETH@openInterest@220930" - ], - "method": "SUBSCRIBE" -} diff --git a/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/underlyingAsset@ticker@expirationDate-test.json b/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/underlyingAsset@ticker@expirationDate-test.json deleted file mode 100644 index e8464f47c..000000000 --- a/clients/derivatives-trading-options/src/test/resources/expected/stream/WebsocketMarketStreamsApi/underlyingAsset@ticker@expirationDate-test.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "id": "eaf3292c-64b6-4c04-ad4f-4ca2608b42b4", - "params": [ - "ETH@ticker@220930" - ], - "method": "SUBSCRIBE" -} diff --git a/examples/derivatives-trading-options/pom.xml b/examples/derivatives-trading-options/pom.xml index e03ecc642..c2515c537 100644 --- a/examples/derivatives-trading-options/pom.xml +++ b/examples/derivatives-trading-options/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-options - 5.0.0 + 6.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/GetDownloadIdForOptionTransactionHistoryExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/GetDownloadIdForOptionTransactionHistoryExample.java deleted file mode 100644 index 719309c41..000000000 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/GetDownloadIdForOptionTransactionHistoryExample.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_options.rest.account; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.derivatives_trading_options.rest.DerivativesTradingOptionsRestApiUtil; -import com.binance.connector.client.derivatives_trading_options.rest.api.DerivativesTradingOptionsRestApi; -import com.binance.connector.client.derivatives_trading_options.rest.model.GetDownloadIdForOptionTransactionHistoryResponse; - -/** API examples for AccountApi */ -public class GetDownloadIdForOptionTransactionHistoryExample { - private DerivativesTradingOptionsRestApi api; - - public DerivativesTradingOptionsRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - DerivativesTradingOptionsRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new DerivativesTradingOptionsRestApi(clientConfiguration); - } - return api; - } - - /** - * Get Download Id For Option Transaction History (USER_DATA) - * - *

Get download id for option transaction history * Request Limitation is 5 times per month, - * shared by > front end download page and rest api * The time between `startTime` - * and `endTime` can not be longer than 1 year Weight: 5 - * - * @throws ApiException if the Api call fails - */ - public void getDownloadIdForOptionTransactionHistoryExample() throws ApiException { - Long startTime = 1623319461670L; - Long endTime = 1641782889000L; - Long recvWindow = 5000L; - ApiResponse response = - getApi().getDownloadIdForOptionTransactionHistory(startTime, endTime, recvWindow); - System.out.println(response.getData()); - } -} diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/GetOptionTransactionHistoryDownloadLinkByIdExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/GetOptionTransactionHistoryDownloadLinkByIdExample.java deleted file mode 100644 index c2e54894a..000000000 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/GetOptionTransactionHistoryDownloadLinkByIdExample.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_options.rest.account; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.derivatives_trading_options.rest.DerivativesTradingOptionsRestApiUtil; -import com.binance.connector.client.derivatives_trading_options.rest.api.DerivativesTradingOptionsRestApi; -import com.binance.connector.client.derivatives_trading_options.rest.model.GetOptionTransactionHistoryDownloadLinkByIdResponse; - -/** API examples for AccountApi */ -public class GetOptionTransactionHistoryDownloadLinkByIdExample { - private DerivativesTradingOptionsRestApi api; - - public DerivativesTradingOptionsRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - DerivativesTradingOptionsRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new DerivativesTradingOptionsRestApi(clientConfiguration); - } - return api; - } - - /** - * Get Option Transaction History Download Link by Id (USER_DATA) - * - *

Get option transaction history download Link by Id * Download link expiration: 24h Weight: - * 5 - * - * @throws ApiException if the Api call fails - */ - public void getOptionTransactionHistoryDownloadLinkByIdExample() throws ApiException { - String downloadId = "1"; - Long recvWindow = 5000L; - ApiResponse response = - getApi().getOptionTransactionHistoryDownloadLinkById(downloadId, recvWindow); - System.out.println(response.getData()); - } -} diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/IndexPriceTickerExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/IndexPriceExample.java similarity index 89% rename from examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/IndexPriceTickerExample.java rename to examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/IndexPriceExample.java index 1d3a9fabd..902a25460 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/IndexPriceTickerExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/IndexPriceExample.java @@ -18,10 +18,10 @@ import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.derivatives_trading_options.rest.DerivativesTradingOptionsRestApiUtil; import com.binance.connector.client.derivatives_trading_options.rest.api.DerivativesTradingOptionsRestApi; -import com.binance.connector.client.derivatives_trading_options.rest.model.IndexPriceTickerResponse; +import com.binance.connector.client.derivatives_trading_options.rest.model.IndexPriceResponse; /** API examples for MarketDataApi */ -public class IndexPriceTickerExample { +public class IndexPriceExample { private DerivativesTradingOptionsRestApi api; public DerivativesTradingOptionsRestApi getApi() { @@ -38,15 +38,15 @@ public DerivativesTradingOptionsRestApi getApi() { } /** - * Index Price Ticker + * Index Price * *

Get spot index price for option underlying. Weight: 1 * * @throws ApiException if the Api call fails */ - public void indexPriceTickerExample() throws ApiException { + public void indexPriceExample() throws ApiException { String underlying = ""; - ApiResponse response = getApi().indexPriceTicker(underlying); + ApiResponse response = getApi().indexPrice(underlying); System.out.println(response.getData()); } } diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/OldTradesLookupExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/OldTradesLookupExample.java deleted file mode 100644 index 368605a27..000000000 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/OldTradesLookupExample.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_options.rest.marketdata; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.derivatives_trading_options.rest.DerivativesTradingOptionsRestApiUtil; -import com.binance.connector.client.derivatives_trading_options.rest.api.DerivativesTradingOptionsRestApi; -import com.binance.connector.client.derivatives_trading_options.rest.model.OldTradesLookupResponse; - -/** API examples for MarketDataApi */ -public class OldTradesLookupExample { - private DerivativesTradingOptionsRestApi api; - - public DerivativesTradingOptionsRestApi getApi() { - if (api == null) { - ClientConfiguration clientConfiguration = - DerivativesTradingOptionsRestApiUtil.getClientConfiguration(); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new DerivativesTradingOptionsRestApi(clientConfiguration); - } - return api; - } - - /** - * Old Trades Lookup (MARKET_DATA) - * - *

Get older market historical trades. Weight: 20 - * - * @throws ApiException if the Api call fails - */ - public void oldTradesLookupExample() throws ApiException { - String symbol = ""; - Long fromId = 1L; - Long limit = 100L; - ApiResponse response = - getApi().oldTradesLookup(symbol, fromId, limit); - System.out.println(response.getData()); - } -} diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/OrderBookExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/OrderBookExample.java index 2eed6fa1b..0909df34d 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/OrderBookExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/marketdata/OrderBookExample.java @@ -41,7 +41,7 @@ public DerivativesTradingOptionsRestApi getApi() { * Order Book * *

Check orderbook depth on specific symbol Weight: limit | weight ------------ | - * ------------ 5, 10, 20, 50 | 2 100 | 5 500 | 10 1000 | 20 + * ------------ 5, 10, 20, 50 | 1 100 | 5 500 | 10 1000 | 20 * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelMultipleOptionOrdersExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelMultipleOptionOrdersExample.java index ec8f8b60c..31a72dfbc 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelMultipleOptionOrdersExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/CancelMultipleOptionOrdersExample.java @@ -43,8 +43,7 @@ public DerivativesTradingOptionsRestApi getApi() { * Cancel Multiple Option Orders (TRADE) * *

Cancel multiple orders. * At least one instance of `orderId` and - * `clientOrderId` must be sent. * Max 10 orders can be deleted in one request Weight: - * 1 + * `clientOrderId` must be sent. Weight: 1 * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/OptionAccountInformationExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/UserCommissionExample.java similarity index 82% rename from examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/OptionAccountInformationExample.java rename to examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/UserCommissionExample.java index b3813cde4..ba4c9c105 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/account/OptionAccountInformationExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/rest/trade/UserCommissionExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.derivatives_trading_options.rest.account; +package com.binance.connector.client.derivatives_trading_options.rest.trade; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -18,10 +18,10 @@ import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.derivatives_trading_options.rest.DerivativesTradingOptionsRestApiUtil; import com.binance.connector.client.derivatives_trading_options.rest.api.DerivativesTradingOptionsRestApi; -import com.binance.connector.client.derivatives_trading_options.rest.model.OptionAccountInformationResponse; +import com.binance.connector.client.derivatives_trading_options.rest.model.UserCommissionResponse; -/** API examples for AccountApi */ -public class OptionAccountInformationExample { +/** API examples for TradeApi */ +public class UserCommissionExample { private DerivativesTradingOptionsRestApi api; public DerivativesTradingOptionsRestApi getApi() { @@ -38,16 +38,15 @@ public DerivativesTradingOptionsRestApi getApi() { } /** - * Option Account Information(TRADE) + * User Commission (USER_DATA) * - *

Get current account information. Weight: 3 + *

Get account commission. Weight: 5 * * @throws ApiException if the Api call fails */ - public void optionAccountInformationExample() throws ApiException { + public void userCommissionExample() throws ApiException { Long recvWindow = 5000L; - ApiResponse response = - getApi().optionAccountInformation(recvWindow); + ApiResponse response = getApi().userCommission(recvWindow); System.out.println(response.getData()); } } diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/IndexPriceStreamsExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/IndexPriceStreamsExample.java similarity index 94% rename from examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/IndexPriceStreamsExample.java rename to examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/IndexPriceStreamsExample.java index 7e56232e9..201132a2d 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/IndexPriceStreamsExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/IndexPriceStreamsExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.derivatives_trading_options.websocket.stream.websocketmarketstreams; +package com.binance.connector.client.derivatives_trading_options.websocket.stream.market; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; @@ -20,7 +20,7 @@ import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.IndexPriceStreamsRequest; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.IndexPriceStreamsResponse; -/** API examples for WebsocketMarketStreamsApi */ +/** API examples for MarketApi */ public class IndexPriceStreamsExample { private DerivativesTradingOptionsWebSocketStreams api; @@ -42,7 +42,6 @@ public DerivativesTradingOptionsWebSocketStreams getApi() { */ public void indexPriceStreamsExample() throws ApiException, InterruptedException { IndexPriceStreamsRequest indexPriceStreamsRequest = new IndexPriceStreamsRequest(); - indexPriceStreamsRequest.symbol("btcusdt"); StreamBlockingQueueWrapper response = getApi().indexPriceStreams(indexPriceStreamsRequest); while (true) { diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/KlineCandlestickStreamsExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/KlineCandlestickStreamsExample.java similarity index 96% rename from examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/KlineCandlestickStreamsExample.java rename to examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/KlineCandlestickStreamsExample.java index 5f0243592..0fb9f38a3 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/KlineCandlestickStreamsExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/KlineCandlestickStreamsExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.derivatives_trading_options.websocket.stream.websocketmarketstreams; +package com.binance.connector.client.derivatives_trading_options.websocket.stream.market; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; @@ -20,7 +20,7 @@ import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.KlineCandlestickStreamsRequest; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.KlineCandlestickStreamsResponse; -/** API examples for WebsocketMarketStreamsApi */ +/** API examples for MarketApi */ public class KlineCandlestickStreamsExample { private DerivativesTradingOptionsWebSocketStreams api; diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/MarkPriceExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/MarkPriceExample.java similarity index 90% rename from examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/MarkPriceExample.java rename to examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/MarkPriceExample.java index 6abb71ad0..546182ffa 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/MarkPriceExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/MarkPriceExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.derivatives_trading_options.websocket.stream.websocketmarketstreams; +package com.binance.connector.client.derivatives_trading_options.websocket.stream.market; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; @@ -20,7 +20,7 @@ import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.MarkPriceRequest; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.MarkPriceResponse; -/** API examples for WebsocketMarketStreamsApi */ +/** API examples for MarketApi */ public class MarkPriceExample { private DerivativesTradingOptionsWebSocketStreams api; @@ -37,14 +37,14 @@ public DerivativesTradingOptionsWebSocketStreams getApi() { * Mark Price * *

The mark price for all option symbols on specific underlying asset. - * E.g.[ETH@markPrice](wss://nbstream.binance.com/eoptions/stream?streams=ETH@markPrice) + * E.g.[btcusdt@optionMarkPrice](wss://fstream.binance.com/market/stream?streams=btcusdt@optionMarkPrice) * Update Speed: 1000ms * * @throws ApiException if the Api call fails */ public void markPriceExample() throws ApiException, InterruptedException { MarkPriceRequest markPriceRequest = new MarkPriceRequest(); - markPriceRequest.underlyingAsset("ETH"); + markPriceRequest.underlying("btcusdt"); StreamBlockingQueueWrapper response = getApi().markPrice(markPriceRequest); while (true) { diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/NewSymbolInfoExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/NewSymbolInfoExample.java similarity index 96% rename from examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/NewSymbolInfoExample.java rename to examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/NewSymbolInfoExample.java index f93248d1a..3892eebe6 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/NewSymbolInfoExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/NewSymbolInfoExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.derivatives_trading_options.websocket.stream.websocketmarketstreams; +package com.binance.connector.client.derivatives_trading_options.websocket.stream.market; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; @@ -20,7 +20,7 @@ import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.NewSymbolInfoRequest; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.NewSymbolInfoResponse; -/** API examples for WebsocketMarketStreamsApi */ +/** API examples for MarketApi */ public class NewSymbolInfoExample { private DerivativesTradingOptionsWebSocketStreams api; diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/OpenInterestExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/OpenInterestExample.java similarity index 90% rename from examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/OpenInterestExample.java rename to examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/OpenInterestExample.java index f83affd51..aa6859381 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/OpenInterestExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/market/OpenInterestExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.derivatives_trading_options.websocket.stream.websocketmarketstreams; +package com.binance.connector.client.derivatives_trading_options.websocket.stream.market; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; @@ -20,7 +20,7 @@ import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.OpenInterestRequest; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.OpenInterestResponse; -/** API examples for WebsocketMarketStreamsApi */ +/** API examples for MarketApi */ public class OpenInterestExample { private DerivativesTradingOptionsWebSocketStreams api; @@ -37,14 +37,13 @@ public DerivativesTradingOptionsWebSocketStreams getApi() { * Open Interest * *

Option open interest for specific underlying asset on specific expiration date. - * E.g.[ETH@openInterest@221125](wss://nbstream.binance.com/eoptions/stream?streams=ETH@openInterest@221125) + * E.g.[ethusdt@openInterest@221125](wss://fstream.binance.com/market/stream?streams=ethusdt@openInterest@221125) * Update Speed: 60s * * @throws ApiException if the Api call fails */ public void openInterestExample() throws ApiException, InterruptedException { OpenInterestRequest openInterestRequest = new OpenInterestRequest(); - openInterestRequest.underlyingAsset("ETH"); openInterestRequest.expirationDate("220930"); StreamBlockingQueueWrapper response = getApi().openInterest(openInterestRequest); diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/DiffBookDepthStreamsExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/DiffBookDepthStreamsExample.java new file mode 100644 index 000000000..1eb177fd3 --- /dev/null +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/DiffBookDepthStreamsExample.java @@ -0,0 +1,53 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_options.websocket.stream.publicpkg; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; +import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.DerivativesTradingOptionsWebSocketStreamsUtil; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.DerivativesTradingOptionsWebSocketStreams; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.DiffBookDepthStreamsRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.DiffBookDepthStreamsResponse; + +/** API examples for PublicApi */ +public class DiffBookDepthStreamsExample { + private DerivativesTradingOptionsWebSocketStreams api; + + public DerivativesTradingOptionsWebSocketStreams getApi() { + if (api == null) { + WebSocketClientConfiguration clientConfiguration = + DerivativesTradingOptionsWebSocketStreamsUtil.getClientConfiguration(); + api = new DerivativesTradingOptionsWebSocketStreams(clientConfiguration); + } + return api; + } + + /** + * Diff Book Depth Streams + * + *

Bids and asks, pushed every 500 milliseconds, 100 milliseconds (if existing) Update Speed: + * 100ms or 500ms + * + * @throws ApiException if the Api call fails + */ + public void diffBookDepthStreamsExample() throws ApiException, InterruptedException { + DiffBookDepthStreamsRequest diffBookDepthStreamsRequest = new DiffBookDepthStreamsRequest(); + diffBookDepthStreamsRequest.symbol("btcusdt"); + StreamBlockingQueueWrapper response = + getApi().diffBookDepthStreams(diffBookDepthStreamsRequest); + while (true) { + System.out.println(response.take()); + } + } +} diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/Ticker24HourByUnderlyingAssetAndExpirationDataExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/IndividualSymbolBookTickerStreamsExample.java similarity index 58% rename from examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/Ticker24HourByUnderlyingAssetAndExpirationDataExample.java rename to examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/IndividualSymbolBookTickerStreamsExample.java index 7299d2c30..c2bb459dd 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/Ticker24HourByUnderlyingAssetAndExpirationDataExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/IndividualSymbolBookTickerStreamsExample.java @@ -10,18 +10,18 @@ * Do not edit the class manually. */ -package com.binance.connector.client.derivatives_trading_options.websocket.stream.websocketmarketstreams; +package com.binance.connector.client.derivatives_trading_options.websocket.stream.publicpkg; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; import com.binance.connector.client.derivatives_trading_options.websocket.stream.DerivativesTradingOptionsWebSocketStreamsUtil; import com.binance.connector.client.derivatives_trading_options.websocket.stream.api.DerivativesTradingOptionsWebSocketStreams; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourByUnderlyingAssetAndExpirationDataRequest; -import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourByUnderlyingAssetAndExpirationDataResponse; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.IndividualSymbolBookTickerStreamsRequest; +import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.IndividualSymbolBookTickerStreamsResponse; -/** API examples for WebsocketMarketStreamsApi */ -public class Ticker24HourByUnderlyingAssetAndExpirationDataExample { +/** API examples for PublicApi */ +public class IndividualSymbolBookTickerStreamsExample { private DerivativesTradingOptionsWebSocketStreams api; public DerivativesTradingOptionsWebSocketStreams getApi() { @@ -34,25 +34,21 @@ public DerivativesTradingOptionsWebSocketStreams getApi() { } /** - * 24-hour TICKER by underlying asset and expiration data + * Individual Symbol Book Ticker Streams * - *

24hr ticker info by underlying asset and expiration date. - * E.g.[ETH@ticker@220930](wss://nbstream.binance.com/eoptions/stream?streams=ETH@ticker@220930) - * Update Speed: 1000ms + *

Pushes any update to the best bid or ask's price or quantity in real-time for a + * specified symbol. Update Speed: Real-Time * * @throws ApiException if the Api call fails */ - public void ticker24HourByUnderlyingAssetAndExpirationDataExample() + public void individualSymbolBookTickerStreamsExample() throws ApiException, InterruptedException { - Ticker24HourByUnderlyingAssetAndExpirationDataRequest - ticker24HourByUnderlyingAssetAndExpirationDataRequest = - new Ticker24HourByUnderlyingAssetAndExpirationDataRequest(); - ticker24HourByUnderlyingAssetAndExpirationDataRequest.underlyingAsset("ETH"); - ticker24HourByUnderlyingAssetAndExpirationDataRequest.expirationDate("220930"); - StreamBlockingQueueWrapper - response = - getApi().ticker24HourByUnderlyingAssetAndExpirationData( - ticker24HourByUnderlyingAssetAndExpirationDataRequest); + IndividualSymbolBookTickerStreamsRequest individualSymbolBookTickerStreamsRequest = + new IndividualSymbolBookTickerStreamsRequest(); + individualSymbolBookTickerStreamsRequest.symbol("btcusdt"); + StreamBlockingQueueWrapper response = + getApi().individualSymbolBookTickerStreams( + individualSymbolBookTickerStreamsRequest); while (true) { System.out.println(response.take()); } diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/PartialBookDepthStreamsExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/PartialBookDepthStreamsExample.java similarity index 90% rename from examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/PartialBookDepthStreamsExample.java rename to examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/PartialBookDepthStreamsExample.java index c3a6c134d..325865f99 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/PartialBookDepthStreamsExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/PartialBookDepthStreamsExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.derivatives_trading_options.websocket.stream.websocketmarketstreams; +package com.binance.connector.client.derivatives_trading_options.websocket.stream.publicpkg; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; @@ -20,7 +20,7 @@ import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.PartialBookDepthStreamsRequest; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.PartialBookDepthStreamsResponse; -/** API examples for WebsocketMarketStreamsApi */ +/** API examples for PublicApi */ public class PartialBookDepthStreamsExample { private DerivativesTradingOptionsWebSocketStreams api; @@ -36,8 +36,8 @@ public DerivativesTradingOptionsWebSocketStreams getApi() { /** * Partial Book Depth Streams * - *

Top **<levels\\>** bids and asks, Valid levels are **<levels\\>** are 10, 20, - * 50, 100. Update Speed: 100ms or 1000ms, 500ms(default when update speed isn't used) + *

Top **<levels\\>** bids and asks, Valid levels are **<levels\\>** are 5, 10, + * 20. Update Speed: 100ms or 500ms * * @throws ApiException if the Api call fails */ @@ -45,7 +45,7 @@ public void partialBookDepthStreamsExample() throws ApiException, InterruptedExc PartialBookDepthStreamsRequest partialBookDepthStreamsRequest = new PartialBookDepthStreamsRequest(); partialBookDepthStreamsRequest.symbol("btcusdt"); - partialBookDepthStreamsRequest.levels(10L); + partialBookDepthStreamsRequest.level("example_value"); StreamBlockingQueueWrapper response = getApi().partialBookDepthStreams(partialBookDepthStreamsRequest); while (true) { diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/Ticker24HourExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/Ticker24HourExample.java similarity index 96% rename from examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/Ticker24HourExample.java rename to examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/Ticker24HourExample.java index 590c5e048..90d87b3fa 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/Ticker24HourExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/Ticker24HourExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.derivatives_trading_options.websocket.stream.websocketmarketstreams; +package com.binance.connector.client.derivatives_trading_options.websocket.stream.publicpkg; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; @@ -20,7 +20,7 @@ import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourRequest; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.Ticker24HourResponse; -/** API examples for WebsocketMarketStreamsApi */ +/** API examples for PublicApi */ public class Ticker24HourExample { private DerivativesTradingOptionsWebSocketStreams api; diff --git a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/TradeStreamsExample.java b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/TradeStreamsExample.java similarity index 92% rename from examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/TradeStreamsExample.java rename to examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/TradeStreamsExample.java index fda0aec95..8d8843e33 100644 --- a/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/websocketmarketstreams/TradeStreamsExample.java +++ b/examples/derivatives-trading-options/src/main/java/com/binance/connector/client/derivatives_trading_options/websocket/stream/publicpkg/TradeStreamsExample.java @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -package com.binance.connector.client.derivatives_trading_options.websocket.stream.websocketmarketstreams; +package com.binance.connector.client.derivatives_trading_options.websocket.stream.publicpkg; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; @@ -20,7 +20,7 @@ import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.TradeStreamsRequest; import com.binance.connector.client.derivatives_trading_options.websocket.stream.model.TradeStreamsResponse; -/** API examples for WebsocketMarketStreamsApi */ +/** API examples for PublicApi */ public class TradeStreamsExample { private DerivativesTradingOptionsWebSocketStreams api; @@ -37,8 +37,8 @@ public DerivativesTradingOptionsWebSocketStreams getApi() { * Trade Streams * *

The Trade Streams push raw trade information for specific symbol or underlying asset. - * E.g.[ETH@trade](wss://nbstream.binance.com/eoptions/stream?streams=ETH@trade) Update - * Speed: 50ms + * E.g.[btcusdt@optionTrade](wss://fstream.binance.com/public/stream?streams=btcusdt@optionTrade) + * Update Speed: 50ms * * @throws ApiException if the Api call fails */